:root {
  color-scheme: light;
  --frame: #f3f5f8;
  --surface: #fff;
  --wash: #f7f8fa;
  --accent: #283d55;
  --accent-soft: #eaf0f6;
  --ink: #192635;
  --muted: #526171;
  --border: #e2e7ee;
  --field: #adb9c7;
  --danger: #92362d;
  --danger-bg: #faeeeb;
  --warning: #74541c;
  --warning-bg: #f7f0e2;
  --positive: #275e4e;
  --positive-bg: #e9f3ee;
  --radius: 12px;
  --small-radius: 7px;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--frame);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button[disabled] { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid #526e8e; outline-offset: 3px; }
[hidden] { display: none !important; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 221px minmax(0, 1fr); grid-template-rows: 53px 1fr; }
.sidebar { grid-row: 1 / -1; display: flex; flex-direction: column; height: 100dvh; position: sticky; top: 0; padding: 26px 14px 19px; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 36px; text-decoration: none; max-width: max-content; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.045em; line-height: 1.35; }
.brand small { font-size: .8125rem; margin-top: 2px; color: var(--muted); }
.brand-mark { height: 36px; width: 36px; display: flex; align-items: end; justify-content: center; gap: 2px; border: 1.5px solid var(--accent); border-radius: 8px; padding-bottom: 9px; }
.brand-mark i { width: 3px; height: 9px; background: var(--accent); transform: skew(-18deg); }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 19px; }
.nav { display: grid; gap: 4px; }
.nav a { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--small-radius); text-decoration: none; font-size: .9375rem; font-weight: 550; color: var(--muted); white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: #e7ebf1; }
.nav a[aria-current="page"] { font-weight: 700; }
.nav svg, .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { margin: auto 8px 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; }
.local-dot { width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; flex: 0 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 29px 0 23px; color: var(--muted); gap: 14px; }
.breadcrumb, .top-date { font-size: .8125rem; }
.breadcrumb span { margin: 0 6px; color: #6a7a8c; }
.sheet { min-width: 0; margin: 0 9px 9px 0; padding: 29px clamp(22px, 3vw, 41px) 38px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.page-inner { max-width: 1470px; margin-inline: auto; }
.title-row, .panel-head, .section-head, .inline-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-row { margin-bottom: 22px; align-items: flex-end; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 2.5vw, 1.875rem); line-height: 1.25; letter-spacing: -.055em; }
h2 { font-size: 1.125rem; line-height: 1.35; letter-spacing: -.035em; }
h3 { font-size: 1rem; line-height: 1.45; letter-spacing: -.02em; }
.subtitle { margin-top: 6px; color: var(--muted); font-size: .9375rem; }
.muted, .metadata { color: var(--muted); }
.metadata { font-size: .8125rem; margin-top: 3px; }
.button { border: 1px solid transparent; border-radius: var(--small-radius); display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 7px 13px; font-size: .875rem; line-height: 1.35; font-weight: 650; text-decoration: none; white-space: nowrap; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: #1e3045; }
.secondary { background: var(--surface); border-color: var(--field); color: var(--ink); }
.secondary:hover, .quiet:hover, .icon-button:hover { background: var(--wash); }
.quiet { background: transparent; color: var(--accent); min-height: 38px; padding-inline: 8px; }
.icon-button { display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--small-radius); width: 36px; height: 36px; color: var(--ink); font-size: 1.2rem; flex: 0 0 auto; }
.metric-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 19px; border: 1px solid var(--border); border-radius: var(--radius); }
.metric { min-width: 0; padding: 13px 17px 12px; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric dt { font-size: .875rem; color: var(--muted); }
.metric dd { margin: 1px 0 0; font-size: 1.55rem; line-height: 1.2; font-weight: 680; letter-spacing: -.045em; }
.metric dd small { font-size: .8125rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.metric .metric-note { font-size: .8125rem; margin-top: 4px; color: var(--muted); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .58fr); gap: 17px; align-items: start; }
.column { min-width: 0; display: grid; gap: 17px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; }
.panel-head { min-height: 35px; margin-bottom: 8px; }
.panel .inline-actions { justify-content: flex-start; flex-wrap: wrap; }
.rows { list-style: none; padding: 0; margin: 0; }
.account-row, .log-row, .content-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 13px; min-height: 60px; padding: 8px 0; border-top: 1px solid var(--border); }
.rows > :first-child { border-top: 1px solid var(--border); }
.row-text { min-width: 0; overflow-wrap: anywhere; }
.row-title { font-weight: 700; font-size: .9375rem; display: block; color: var(--ink); line-height: 1.35; }
.row-title:hover:is(a) { color: #385c81; }
.row-title.as-button { padding: 0; text-align: left; background: none; border: 0; }
.row-title.as-button:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 23px; border-radius: 5px; padding: 1px 7px; color: var(--muted); background: var(--wash); font-size: .8125rem; font-weight: 650; text-align: center; }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.positive { color: var(--positive); background: var(--positive-bg); }
.badge.accent { color: var(--accent); background: var(--accent-soft); }
.account-scope { margin-top: 7px; padding: 6px 0 0; color: var(--muted); font-size: .8125rem; }
.day-switch { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 3px; }
.day-button { display: grid; justify-items: center; gap: 2px; background: transparent; color: var(--muted); min-height: 61px; border: 0; padding: 6px 2px; border-bottom: 2px solid transparent; font-size: .875rem; }
.day-button[aria-pressed=true] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 750; background: #f1f4f8; }
.day-button strong { font-size: .9375rem; }
.day-date { font-size: .8125rem; }
.tasks { margin-block: 4px 2px; }
.task { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 9px; align-items: start; min-height: 44px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .9375rem; cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task input { width: 16px; height: 16px; margin: 4px 0 0; accent-color: var(--accent); }
.task-text { overflow-wrap: anywhere; }
.task input:checked + span .task-text { color: var(--muted); text-decoration: line-through; }
.task-hint { display: block; color: var(--muted); font-size: .8125rem; }
.task-count { white-space: nowrap; font-size: .8125rem; color: var(--muted); }
.empty { padding: 12px; background: var(--wash); border: 1px dashed var(--border); border-radius: var(--small-radius); color: var(--muted); font-size: .875rem; }
.nudge { border-left: 2px solid #8297af; padding: 10px 12px; background: var(--wash); color: var(--muted); margin: 0 0 16px; font-size: .875rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-note { font-size: .875rem; color: var(--muted); margin: 1px 0 8px; }
.list-panel { margin-top: 16px; }
.toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 10px; }
.toolbar-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-fields input { width: clamp(168px, 28vw, 290px); }
label.field { display: grid; gap: 4px; font-size: .875rem; font-weight: 650; min-width: 0; }
input:not([type=checkbox]):not([type=file]), select, textarea, .report-text { min-width: 0; height: 42px; background: #fff; color: var(--ink); border: 1px solid var(--field); border-radius: var(--small-radius); padding: 7px 9px; font-size: .9375rem; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='m5 7 4 4 4-4' fill='none' stroke='%23526171' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; }
textarea { min-height: 84px; height: auto; resize: vertical; }
input::placeholder, textarea::placeholder { color: #687585; }
.week-control { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.week-label { font-size: .9375rem; font-weight: 680; min-width: 120px; text-align: center; }
.task-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.report-text { display: block; width: 100%; height: auto; min-height: 290px; margin: 10px 0; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-label { font-size: .875rem; font-weight: 680; margin-top: 11px; }
.details { list-style: none; padding: 0; margin: 6px 0; }
.details li { font-size: .9375rem; display: grid; grid-template-columns: minmax(104px,auto) minmax(0,1fr); gap: 10px; border-bottom: 1px solid var(--border); padding: 6px 0; overflow-wrap: anywhere; }
.details li > :first-child { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.full { grid-column: 1 / -1; }
.help { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; gap: 10px; flex: 0 0 auto; }
.dialog-head { border-bottom: 1px solid var(--border); }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--border); }
dialog { padding: 0; color: var(--ink); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); width: min(640px, calc(100% - 24px)); max-height: min(92dvh, 850px); }
dialog::backdrop { background: #26354665; }
dialog form { display: flex; flex-direction: column; max-height: inherit; }
.dialog-body { min-height: 0; overflow: auto; padding: 15px 18px; }
.toast { position: fixed; z-index: 5; padding: 11px 14px; inset: auto 17px 17px auto; max-width: calc(100% - 34px); border-radius: var(--small-radius); background: var(--accent); color: #fff; font-size: .9375rem; }
.inline-error { color: var(--danger); font-size: .875rem; }
.storage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
@media (max-width: 1080px) {
  .layout { grid-template-columns: 179px minmax(0,1fr); }
  .sheet { padding-inline: 21px; }
  .grid { grid-template-columns: minmax(0,1fr) minmax(278px,.72fr); gap: 12px; }
  .panel { padding-inline: 13px; }
  .metric { padding-inline: 12px; }
}
@media (max-width: 870px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; padding: 8px 13px; gap: 14px; align-items: center; }
  .brand { margin: 0; flex: 0 0 auto; }
  .nav { display: flex; min-width: 0; overflow-x: auto; }
  .sidebar-foot, .breadcrumb { display: none; }
  .topbar { justify-content: flex-end; min-height: 24px; padding: 0 16px 3px; }
  .sheet { margin: 0 7px 7px; padding: 21px 16px 26px; }
}
@media (max-width: 680px) {
  .sidebar { display: grid; gap: 5px; padding: 8px 12px 3px; }
  .brand-mark { width: 31px; height: 31px; padding-bottom: 6px; }
  .brand { gap: 7px; }
  .brand > span:last-child { display: flex; align-items: baseline; gap: 6px; }
  .nav { gap: 1px; }
  .nav a { padding-inline: 8px; }
  .nav svg { display: none; }
  .topbar { min-height: 21px; }
  .sheet { margin: 0; border-radius: 12px 12px 0 0; padding: 16px 13px 24px; }
  .title-row { margin-bottom: 15px; align-items: center; gap: 7px; }
  .title-row .button { padding-inline: 9px; }
  .grid, .task-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .grid { display: flex; flex-direction: column; }
  .column { width: 100%; gap: 12px; }
  .column, .grid { display: contents; }
  .dashboard-panels { display: flex; flex-direction: column; gap: 12px; }
  .dashboard-panels .schedule-panel { order: 1; }
  .dashboard-panels .logs-panel { order: 2; }
  .dashboard-panels .report-panel { order: 3; }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 13px; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .metric { padding: 8px 10px; }
  .metric .metric-note { margin-top: 2px; }
  .account-row, .log-row, .content-row { gap: 6px; }
  .row-title { font-size: .875rem; }
  .account-row .button, .content-row .button, .log-row .button { min-height: 44px; padding-inline: 5px; }
  .badge { font-size: .75rem; padding-inline: 5px; }
  .toolbar-fields { width: 100%; }
  .toolbar-fields input { flex: 1; min-width: 120px !important; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .nudge { align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .nav a, .day-button { transition: background-color .13s; }
}
