/* Luis's private app (/admin). Loaded after style.css. Everything is scoped under .app so the public site is untouched.
   Brand colors and fonts are his own: charcoal, Mexican green, red, white, Barlow Condensed and Manrope. */

/* ---------- Light and dark ---------- */
html.app {
  color-scheme: light;
  --c-bg: #f3f4f1;
  --c-surface: #ffffff;
  --c-raised: #e9ebe6;
  --c-text: #1c1d21;
  --c-soft: rgba(28, 29, 33, .66);
  --c-line: rgba(28, 29, 33, .12);
  --c-edge: rgba(28, 29, 33, .32);
  --c-accent: #c8102e;
  --c-fill: #c8102e;
  --c-red: #c8101a;
  --c-red-edge: rgba(200, 16, 26, .45);
  --c-bar: rgba(255, 255, 255, .94);
  --c-scrim: rgba(28, 29, 33, .38);
  --c-nextup: #1c1d21;
  --c-nextup-edge: transparent;
  --tabh: 61px;
  /* old site variables, so any style.css rule the panes still use reads right in both modes */
  --soft: var(--c-soft);
  --line: var(--c-line);
  --tint: var(--c-raised);
}
@media (prefers-color-scheme: dark) {
  html.app:not([data-theme="light"]) {
    color-scheme: dark;
    --c-bg: #1c1d21;
    --c-surface: #26272c;
    --c-raised: #2f3036;
    --c-text: #f2f2ef;
    --c-soft: rgba(242, 242, 239, .66);
    --c-line: rgba(255, 255, 255, .12);
    --c-edge: rgba(255, 255, 255, .3);
    --c-accent: #3cc47c;
    --c-fill: #06874a;
    --c-red: #ff6368;
    --c-red-edge: rgba(255, 99, 104, .5);
    --c-bar: rgba(38, 39, 44, .94);
    --c-scrim: rgba(0, 0, 0, .55);
    --c-nextup: #2f3036;
    --c-nextup-edge: rgba(255, 255, 255, .14);
  }
}
html.app[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #1c1d21;
  --c-surface: #26272c;
  --c-raised: #2f3036;
  --c-text: #f2f2ef;
  --c-soft: rgba(242, 242, 239, .66);
  --c-line: rgba(255, 255, 255, .12);
  --c-edge: rgba(255, 255, 255, .3);
  --c-accent: #3cc47c;
  --c-fill: #06874a;
  --c-red: #ff6368;
  --c-red-edge: rgba(255, 99, 104, .5);
  --c-bar: rgba(38, 39, 44, .94);
  --c-scrim: rgba(0, 0, 0, .55);
  --c-nextup: #2f3036;
  --c-nextup-edge: rgba(255, 255, 255, .14);
}

/* ---------- Base ---------- */
.app, .app body { background: var(--c-bg); }
.app body { color: var(--c-text); margin: 0; }
.app main { background: transparent; }
.app :focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.app .skip { background: var(--c-surface); color: var(--c-text); }
.app h1, .app h2, .app h3 { color: var(--c-text); text-transform: none; }
.app .step { border-top: 1px solid var(--c-line); padding: 24px 0; }
.app .step:first-child { border-top: 0; padding-top: 8px; }
.app .step h2 { font: 700 26px/1.1 var(--display); letter-spacing: 0; margin: 0 0 6px; display: block; }
.app .step .hint, .app .hint { color: var(--c-soft); font-size: 15px; line-height: 1.5; margin: 0 0 16px; }
.app .status { color: var(--c-soft); font-size: 15px; margin: 4px 0 0; }
.app .muted { color: var(--c-soft); }
.app .error { color: var(--c-red); font-weight: 700; }
.app .uploading { color: var(--c-soft); font-weight: 600; }
.app a { color: inherit; }
/* The editor panes already have the section name in the top bar, so their first heading stays out of the way. */
.app #editor-panes .step > h2:first-child, .app #pane-block .step:first-child > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar and column ---------- */
.app .app-top {
  position: sticky; top: 0; z-index: 20;
  background: var(--c-bg);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--c-line);
}
.app .app-top-in {
  max-width: 620px; margin: 0 auto; height: 56px; padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.app .app-top img { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.app .app-top h1 { font: 700 28px/1 var(--display); letter-spacing: 0; margin: 0; }
.app .app-col {
  max-width: 620px; margin: 0 auto;
  padding: 8px 20px calc(var(--tabh) + env(safe-area-inset-bottom) + 28px);
}
.app body.has-pub .app-col {
  padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 190px);
}
@media (max-width: 420px) {
  .app .app-top-in, .app .app-col { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Sign in ---------- */
.app #login { min-height: 100vh; min-height: 100svh; max-width: 360px; margin: 0 auto; padding: 24px 20px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.app .login-logo { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 16px; }
.app #login h1 { font: 700 36px/1 var(--display); margin: 0 0 20px; }
.app #login .field { text-align: left; }

/* ---------- Forms ---------- */
.app .field span { color: var(--c-text); font-weight: 700; font-size: 15px; }
.app .field span em { color: var(--c-soft); }
.app .field input, .app .field select, .app .field textarea, .app .sel, .app .hours-row select {
  background: var(--c-surface); color: var(--c-text);
  border: 1.5px solid var(--c-edge); border-radius: 12px;
}
.app .field input:focus, .app .field select:focus, .app .field textarea:focus, .app .sel:focus, .app .hours-row select:focus {
  border-color: var(--c-accent); outline: 2px solid var(--c-accent); outline-offset: 1px; box-shadow: none;
}
.app .field input[type=date], .app .field input[type=time] {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; display: block;
  width: 100%; min-width: 0; max-width: 100%; text-align: left;
}
.app .field input::-webkit-date-and-time-value { text-align: left; }
.app input::placeholder, .app textarea::placeholder { color: var(--c-soft); opacity: 1; }
.app select:disabled, .app input:disabled { opacity: .5; }
.app input[type=checkbox] { accent-color: var(--c-fill); }
.app .toggle { color: var(--c-text); }
.app .toggle input { accent-color: var(--c-fill); }
.app .two { gap: 12px; }

/* ---------- Buttons ---------- */
.app .button { border-radius: 12px; min-height: 52px; font-size: 16px; font-weight: 700; }
.app .button.primary { background: var(--c-fill); color: #fff; }
.app .button.primary:hover { background: var(--c-fill); filter: brightness(1.08); }
.app .button.ghost { background: transparent; color: var(--c-text); box-shadow: inset 0 0 0 1.5px var(--c-edge); }
.app .button.ghost:hover { background: var(--c-raised); color: var(--c-text); }
.app .button[disabled], .app .card .row button[disabled] { opacity: .45; }
.app .cancel-link { color: var(--c-soft); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; font-size: 14px; }
.app .mini, .app .card .row button, .app .bk .links a, .app .bk .links button {
  min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1.5px solid var(--c-edge); background: var(--c-surface); color: var(--c-text);
  font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center;
}
.app .mini { color: var(--c-accent); border-color: var(--c-accent); }
.app .card .row .danger, .app .mini.danger, .app .bk .links button.cancel {
  color: var(--c-red); border-color: var(--c-red-edge);
}
.app .card .row + .field { margin-top: 16px; }

/* ---------- Cards, pills, photos ---------- */
.app .card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px; box-shadow: none; padding: 16px; }
.app .card h3 { font: 700 22px/1.15 var(--display); letter-spacing: 0; margin: 0 0 10px; }
.app .pill { background: var(--c-raised); color: var(--c-text); }
.app .pill.on { background: var(--c-fill); color: #fff; }
.app .thumb { background: var(--c-raised); border-radius: 10px; }

/* ---------- Next up (the one bold thing) ---------- */
.app .nextup {
  background: var(--c-nextup); color: #f2f2ef; margin: 12px 0 0;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--c-nextup-edge);
}
.app .papel-strip { height: 26px; background: url('/media/papel-picado.svg') repeat-x 0 0; background-size: auto 26px; }
.app .nextup-body { padding: 14px 20px 22px; }
.app .nu-time { font: 800 68px/1 var(--display); letter-spacing: 0; color: #fff; }
.app .nu-day { font: 700 24px/1.2 var(--display); color: #f2f2ef; margin-top: 4px; }
.app .nu-who { margin-top: 6px; color: rgba(242, 242, 239, .8); font-size: 16px; }
.app .nu-who b { color: #fff; display: block; font-size: 18px; }
.app .svc { display: block; }
.app .nu-btns { display: flex; gap: 10px; margin-top: 18px; }
.app .nu-btn {
  flex: 1 1 0; min-height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; text-decoration: none; color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55);
}
.app .nu-btn.call { background: #06874a; box-shadow: none; }
.app .nextup :focus-visible { outline-color: #fff; }
.app .nu-none { font: 700 34px/1.1 var(--display); color: #fff; padding-top: 6px; }
.app .nu-sub { margin: 6px 0 0; color: rgba(242, 242, 239, .8); }
.app .nu-sub a { color: #fff; text-underline-offset: 3px; }

/* ---------- Schedule ---------- */
.app .nudge {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 14px 0 0; padding: 6px 8px 6px 16px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 12px; font-weight: 700;
}
.app .nudge button, .app .nudge .mini { white-space: nowrap; flex-shrink: 0; }
.app #pane-schedule .step { border-top: 0; padding: 22px 0 4px; }
.app .day-head { font: 700 20px/1.2 var(--display); letter-spacing: 0; color: var(--c-soft); margin: 18px 0 0; }
.app .day-head:first-child { margin-top: 6px; }
.app .bk { display: block; padding: 14px 0; border-bottom: 1px solid var(--c-line); }
.app .bk b { display: inline; }
.app .bk .line { color: var(--c-text); }
.app .bk .who .muted { font-size: 14px; }
.app .bk .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.app .bk.cut { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: start; }
.app .bk .t { font: 700 26px/1.15 var(--display); letter-spacing: 0; color: var(--c-text); }
.app .week-box { margin: 20px 0 0; border-top: 1px solid var(--c-line); }
.app .week-box summary {
  list-style: none; min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; cursor: pointer; border-radius: 8px;
}
.app .week-box summary::-webkit-details-marker { display: none; }
.app .week-box summary::after {
  content: ''; width: 9px; height: 9px; border-right: 2px solid var(--c-soft); border-bottom: 2px solid var(--c-soft);
  transform: rotate(45deg); margin: -4px 4px 0 0;
}
.app .week-box[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.app .day-row { border-bottom: 1px solid var(--c-line); }
.app .day-row .muted { color: var(--c-soft); }
.app .hours-row { border-bottom: 1px solid var(--c-line); }
.app .hours-row label { color: var(--c-text); }

/* ---------- Bottom bar ---------- */
.app .tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--c-bar); border-top: 1px solid var(--c-line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}
.app .tabs-row { list-style: none; margin: 0 auto; padding: 0; max-width: 620px; display: flex; align-items: stretch; }
.app .tabs-row li { flex: 1 1 0; min-width: 0; }
.app .tab {
  width: 100%; min-height: calc(var(--tabh) - 1px); padding: 8px 2px 6px; background: none; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--c-soft); font-size: 12px; font-weight: 700; letter-spacing: .01em;
}
.app .tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.app .tab[aria-current="page"] { color: var(--c-accent); }
.app .tab:active { color: var(--c-text); }

.app .backdrop { position: fixed; inset: 0; z-index: 40; background: var(--c-scrim); }
.app .more-list {
  max-width: 620px; margin: 0 auto; padding: 10px 12px 8px; border-bottom: 1px solid var(--c-line);
  max-height: calc(100vh - var(--tabh) - env(safe-area-inset-bottom) - 24px); overflow-y: auto; overscroll-behavior: contain;
}
@supports (height: 100dvh) {
  .app .more-list { max-height: calc(100dvh - var(--tabh) - env(safe-area-inset-bottom) - 24px); }
}
.app .more-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.app .more-item, .app .look-label {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 6px 12px; min-height: 48px;
  background: none; border: 0; border-radius: 12px; text-align: left; color: var(--c-text); text-decoration: none;
}
.app .more-item svg, .app .look-label svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.app .more-item b, .app .look-label b { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; }
.app .more-item .note, .app .look-label .note { display: block; font-size: 13px; line-height: 1.3; color: var(--c-soft); }
.app .more-item:active { background: var(--c-raised); }
.app .more-item[aria-current="page"] { background: var(--c-raised); color: var(--c-accent); }
.app .more-item[aria-current="page"] .note { color: var(--c-soft); }
.app .look-row { padding: 4px 0 6px; }
.app .seg { display: flex; gap: 2px; margin: 0 12px; padding: 3px; background: var(--c-raised); border-radius: 12px; }
.app .seg button {
  flex: 1 1 0; min-height: 44px; border: 0; border-radius: 10px; background: transparent;
  color: var(--c-text); font-size: 15px; font-weight: 700;
}
.app .seg button[aria-pressed="true"] { background: var(--c-fill); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .app .more-list:not([hidden]) { animation: more-up .12s ease-out; }
  @keyframes more-up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- Save bar for the editing sections ---------- */
.app .publish-bar {
  position: fixed; left: 0; right: 0; z-index: 30;
  bottom: calc(var(--tabh) + env(safe-area-inset-bottom));
  margin: 0; padding: 10px 0 6px; text-align: center;
  background: var(--c-bar); border-top: 1px solid var(--c-line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
}
.app .publish-in { max-width: 620px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 420px) { .app .publish-in { padding: 0 16px; } }
.app .publish-bar .status { margin: 0 0 8px; font-size: 14px; line-height: 1.35; }
.app .publish-bar .two { margin-top: 0; }
.app .publish-bar .button { min-height: 48px; }
.app .publish-bar .cancel-link { min-height: 40px; }

/* ---------- Toast ---------- */
.app #flash.flash {
  top: calc(12px + env(safe-area-inset-top)); z-index: 60;
  background: var(--c-fill); color: #fff; border: 0; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .28); font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .app * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
