/* Dayplo / Quiet Mono — Dayflow, 하루의 흐름.
   기존 컴포넌트의 동작은 유지하고 색상·밀도·내비게이션을 한곳에서 정의한다. */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #232325;
  --muted: #74747c;
  --line: #e8e8ec;
  --fill: #f3f3f5;
  --fill-strong: #dedee3;
  --primary: #262628;
  --primary-soft: #f0f0f2;
  --on-primary: #ffffff;
  --danger: #bd453f;
  --danger-soft: #fbeeed;
  --warn: #8b6832;
  --warn-soft: #f7f2e9;
  --ok: #557461;
  --ok-soft: #edf4ef;
  --new-bg: #f7f7f9;
  --bar: #ffffff;
  --radius: 12px;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171719;
    --card: #1f1f22;
    --text: #ededf0;
    --muted: #a1a1aa;
    --line: #333338;
    --fill: #28282d;
    --fill-strong: #45454c;
    --primary: #ededf0;
    --primary-soft: #2b2b30;
    --on-primary: #1c1c1e;
    --danger: #f08e87;
    --danger-soft: #3c292a;
    --warn: #d6b77d;
    --warn-soft: #342f25;
    --ok: #9ebea6;
    --ok-soft: #27332d;
    --new-bg: #232329;
    --bar: #171719;
  }
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.btn.primary, .fab, .chips button.active, .month-grid .month.on, .daybtn.today {
  color: var(--on-primary);
}
.check::after { border-color: var(--on-primary); }
.cal-grid .day.selected .num { color: var(--on-primary) !important; }
.cal-grid .day.selected.sun .num, .cal-grid .day.selected.holiday .num { background: var(--primary); }
.btn { border-radius: 9px; font-weight: 500; }
.btn.small { border-radius: 7px; }
.logo { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.auth h1 { font-weight: 650; letter-spacing: -1px; }
.auth form input { border: 1px solid var(--line); }

header.top {
  position: static;
  flex-direction: column;
  padding: calc(24px + env(safe-area-inset-top)) 22px 12px;
  border-bottom: none;
}
.head-row { align-items: center; gap: 10px; }
.daynav-row .head-text { flex: 1; }
header.top .team, header.top .daynav-row .team { font-size: 30px; font-weight: 650; letter-spacing: -1.2px; }
header.top .user { font-size: 12px; font-weight: 400; margin-top: 7px; line-height: 1.5; }
.day-controls { display: flex; align-items: center; gap: 2px; flex: none; }
.daybtn { width: 36px; height: 40px; background: none; border-radius: 8px; font-size: 26px; }
.daybtn.today { height: 32px; padding: 0 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 400; font-size: 12px; }
.week-strip { display: none; }
main#content { padding: 0 22px calc(128px + env(safe-area-inset-bottom)); }
.day-hint { margin: 12px 0; }

h2.section { margin: 22px 0 7px; font-size: 12px; font-weight: 600; color: var(--text); gap: 7px; }
h2.section .count { padding: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 400; }
h2.section .sub { font-size: 11px; font-weight: 400; }
h2.section.done-head { color: var(--muted); font-weight: 400; }
ul.tasks { background: none; border-radius: 0; box-shadow: none; }
li.task { gap: 11px; padding: 14px 0; }
li.task:not(:last-child)::after { left: 35px; background: var(--line); }
li.task.urgent { box-shadow: none; }
li.task.new { border-radius: 8px; }
.title { font-size: 15px; font-weight: 400; line-height: 1.5; letter-spacing: -0.25px; }
.meta { font-size: 11px; gap: 4px 8px; margin-top: 4px; }
.check { width: 22px; height: 22px; margin-top: 1px; border-width: 1.25px; }
.check::before { content: ''; position: absolute; inset: -9px -5px; }
.check::after { left: 6px; top: 3px; width: 6px; height: 10px; border-width: 0 2px 2px 0; }
.chip { background: none; padding: 0; font-size: 11px; font-weight: 400; border-radius: 0; }
.chip.urgent, .chip.important, .chip.due.overdue, .chip.due.today, .chip.due.soon, .chip.private { background: none; }
.chip.due.today, .chip.due.soon { color: var(--muted); }
.chip.urgent, .chip.due.overdue { color: var(--danger); }
li.task.event { padding: 12px 0; }
li.task.event .title { font-size: 14px; }
li.task.event .when { width: 62px; font-size: 11px; }
li.task.event .when b { font-size: 12px; font-weight: 500; }
li.task.event .src { background: none; font-weight: 400; }
.agenda-section ul.tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 7px 0 4px; }
.agenda-section li.task.event { flex-direction: column; gap: 4px; padding: 0 0 0 10px; border-left: 2px solid var(--fill-strong); min-width: 0; }
.agenda-section li.task.event::after { display: none; }
.agenda-section li.task.event .when { width: auto; flex-direction: row; gap: 6px; padding-top: 0; }
.agenda-section li.task.event .when b { font-size: 11px; color: var(--muted); font-weight: 400; }
.agenda-section li.task.event .body { width: 100%; }
.agenda-section li.task.event .title { font-size: 13px; }
.empty { background: none; padding: 26px 4px; font-size: 14px; }
.empty.slim { padding: 15px 0; }
.done-list .title { font-size: 14px; }
.done-list li.task { padding: 10px 0; }

nav.tabs { background: var(--bar); padding-top: 4px; }
nav.tabs button { min-height: 56px; padding: 7px 3px; font-size: 11px; gap: 4px; }
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs .dot { background: var(--primary); color: var(--on-primary); font-size: 10px; font-weight: 500; }
.fab { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 2px 8px #0000000d; font-size: 29px; bottom: calc(82px + env(safe-area-inset-bottom)); }
.card { border: 1px solid var(--line); padding: 18px; margin: 16px 0; }
.card h3 { font-size: 16px; font-weight: 600; }
details.guide.advanced { border: 1px solid var(--line); }
.tip-card { background: var(--fill); font-size: 13px; }
.cal-grid { background: none; border-radius: 0; padding-left: 0; padding-right: 0; }
.cal-nav .cal-title { font-weight: 600; }
.cal-legend { font-size: 11px; }
.cal-grid .day .hol { font-size: 10px; }
.panel h3 { font-weight: 600; }
.choice { border-radius: 10px; }
.choice b { font-weight: 500; }

@media (max-width: 380px) {
  header.top { padding-left: 18px; padding-right: 18px; }
  header.top .team, header.top .daynav-row .team { font-size: 27px; }
  main#content { padding-left: 18px; padding-right: 18px; }
  .head-row { gap: 2px; }
  header.top .user { font-size: 11px; }
  .daybtn { width: 32px; }
  .daybtn.today { padding-left: 6px; padding-right: 6px; }
}

@media (min-width: 900px) {
  #app.has-side { display: flex; max-width: 1180px; margin: 0 auto; }
  .side {
    position: sticky; top: 0; z-index: 5;
    height: auto; min-height: 78px; padding: 18px 38px;
    flex-direction: row; align-items: center; gap: 22px;
    border-right: 0; border-bottom: 1px solid var(--line); background: var(--bar);
  }
  .brand { flex: none; font-size: 23px; font-weight: 650; letter-spacing: -0.9px; padding: 0; }
  .side-nav { flex-direction: row; align-items: center; gap: 3px; padding: 3px; border-radius: 9px; background: var(--fill); margin: 0 auto; }
  .side-nav button { width: auto; padding: 7px 15px; border-radius: 7px; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--muted); }
  .side-nav button svg { display: none; }
  .side-nav button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px #0000000b; }
  .side-nav .dot { margin-left: 1px; padding: 0; min-width: 0; color: var(--muted); background: none; font-weight: 400; }
  .side .new-btn { flex: none; margin: 0; width: auto; padding: 9px 14px; font-size: 12px; }
  .side-foot { padding: 0; margin: 0; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .main-col { width: 100%; max-width: 1000px; margin: 0 auto; }
  header.top { padding: 38px 42px 6px; }
  header.top .team, header.top .daynav-row .team { font-size: 32px; }
  header.top .user { font-size: 13px; margin-top: 8px; }
  main#content { width: 100%; max-width: none; padding: 0 42px 70px; }
  #app[data-view=settings] .main-col, #app[data-view=admin] .main-col { max-width: 850px; }
  .week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding: 22px 0 19px; margin-bottom: 5px; }
  .week-strip button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px; font-size: 11px; color: var(--muted); cursor: pointer; }
  .week-strip b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: var(--text); font-weight: 500; }
  .week-strip button[aria-pressed=true] b { background: var(--primary); color: var(--on-primary); }
  .week-strip button:hover b { outline: 1px solid var(--line); }
  .task-groups { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 48px; align-items: start; }
  .task-groups .today-group { grid-column: 1; grid-row: 1; }
  .task-groups .routine-group { grid-column: 2; grid-row: 1 / span 2; }
  .task-groups .next-group { grid-column: 1; }
  .task-groups:not(:has(.routine-group)), .task-groups:not(:has(.today-group)):not(:has(.next-group)) { display: block; }
  h2.section { margin-top: 26px; font-size: 13px; }
  li.task { padding: 16px 0; }
  .title { font-size: 15px; }
  #toast { left: 50%; }
  .day-hint { margin-left: 0; }
  .cal-grid { padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
