/* The portal wears the app's Light and Dark, by the computer's own setting. Values are the app's (app/src/theme/themes.ts). */
:root {
  --ground: #F2F4F9; --card: #FFFFFF; --card2: #E6EAF3; --ink: #0A1330; --ink2: #5C6887; --line: #E1E5EE;
  --accent: #051650; --on-accent: #FFFFFF; --accent-text: #2B50C8; --soft: #E3E9F8; --green: #1F8A5B; --bad: #C6382C;
  --shadow: 0 1px 2px rgba(10, 19, 48, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0B0F1C; --card: #171C2D; --card2: #232A42; --ink: #EEF1F8; --ink2: #A4ADC6; --line: #262D43;
    --accent: #2F55D4; --on-accent: #FFFFFF; --accent-text: #8BA6FF; --soft: #1D2850; --green: #3CCB8C; --bad: #FF8A80;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: Poppins, system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Signed out */
.door { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.door-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 28px; padding: 36px 28px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.door-card img { width: 72px; height: 72px; border-radius: 18px; }
.door-card h1 { font-size: 26px; font-weight: 600; margin-top: 4px; }
.door-card .sub { color: var(--ink2); margin-bottom: 10px; }
.btn { width: 100%; height: 52px; border-radius: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--card2); }
.btn.main { background: var(--accent); color: var(--on-accent); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.or { width: 100%; display: flex; align-items: center; gap: 12px; color: var(--ink2); font-size: 13px; margin: 6px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { width: 100%; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--ground); padding: 0 16px; text-align: center; }
.field.code { font-size: 22px; font-weight: 600; letter-spacing: 6px; }
.note { color: var(--ink2); font-size: 13px; }
.note.bad { color: var(--bad); }
.link { color: var(--accent-text); font-weight: 500; font-size: 13px; }

/* Signed in */
.top { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.tabs { display: flex; gap: 4px; background: var(--card); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.tab { height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 500; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.tab[aria-selected="true"] { background: var(--soft); color: var(--accent-text); font-weight: 600; }
.who { justify-self: end; display: flex; align-items: center; gap: 14px; color: var(--ink2); font-size: 14px; }
.who b { color: var(--ink); font-weight: 500; }
main { max-width: 600px; margin: 0 auto; padding: 28px 24px 80px; display: flex; flex-direction: column; gap: 14px; }
main.wide { max-width: 1160px; }
.head { text-align: center; margin-bottom: 6px; }
.head h1 { font-size: 26px; font-weight: 600; }
.head p { color: var(--ink2); }
.nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.round { width: 44px; height: 44px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.round[disabled] { opacity: 0.35; cursor: default; }
.card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.tile { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; flex: none; }
.row .name { font-weight: 600; }
.row .when { color: var(--ink2); font-size: 13px; }
.row .grow { flex: 1; min-width: 0; }
.row .len { color: var(--ink2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.block.now { color: #FFFFFF; }
.block.now .when, .block.now .len { color: rgba(255, 255, 255, 0.86); }
.block.now .tile { background: rgba(255, 255, 255, 0.2) !important; }
.block.done { opacity: 0.55; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); margin-left: 8px; vertical-align: 2px; }
.sub-tasks { padding: 0 16px 12px 74px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sub-tasks div { display: flex; align-items: center; gap: 8px; }
.free { border: 1.5px dashed var(--line); border-radius: 22px; padding: 12px; text-align: center; color: var(--ink2); font-size: 13px; }
.empty { text-align: center; padding: 44px 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h2 { font-size: 18px; font-weight: 600; }
.empty p { color: var(--ink2); max-width: 360px; }
.sect { text-align: center; color: var(--ink2); font-size: 13px; font-weight: 500; margin-top: 10px; }
.check { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; }
.check.on { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.struck { color: var(--ink2); text-decoration: line-through; }
.dots { display: flex; gap: 6px; }
.dot { width: 26px; height: 26px; border-radius: 999px; background: var(--card2); color: var(--ink2); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.dot.on { color: #FFFFFF; }
.foot { text-align: center; color: var(--ink2); font-size: 13px; margin-top: 18px; }

/* The week */
.week { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .dayname { text-align: center; font-size: 13px; color: var(--ink2); font-weight: 500; padding-bottom: 6px; }
.week .dayname b { display: block; font-size: 18px; color: var(--ink); font-weight: 600; }
.week .dayname.today b { color: var(--accent-text); }
.hours, .col { position: relative; }
.hours span { position: absolute; right: 4px; transform: translateY(-50%); font-size: 11px; color: var(--ink2); }
.col { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.col .hr { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); opacity: 0.6; }
.col .wb { position: absolute; left: 4px; right: 4px; border-radius: 10px; color: #FFFFFF; padding: 4px 8px; font-size: 12px; font-weight: 600; overflow: hidden; line-height: 1.25; }
.col .wb small { display: block; font-weight: 400; opacity: 0.86; font-size: 11px; }
.col .nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; }
.col .none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink2); font-size: 12px; text-align: center; padding: 8px; }

@media (max-width: 820px) {
  .top-in { grid-template-columns: 1fr auto; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .week { grid-template-columns: 36px repeat(7, 132px); overflow-x: auto; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tab, .btn, .round { transition: background-color 0.15s ease, opacity 0.15s ease; }
}
@media (max-width: 560px) {
  .top-in { padding: 12px 16px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 0 6px; }
  .tab svg { display: none; }
  main { padding: 22px 16px 64px; }
}
