/* 셸: 모바일은 위에 탭 줄, 데스크톱은 왼쪽 사이드바. 탭이 늘어나도 같은 목록에서 이어져요. */
.app { min-height: 100vh; }
.side {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "brand dday acct" "nav nav nav";
  align-items: center; gap: 6px 10px;
  padding: 10px 16px 0; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brandrow { grid-area: brand; display: flex; align-items: center; gap: 8px; min-width: 0; }
.brandrow .brand { flex: 1; }
.sidebtn, .sideopen { display: none; }
.brand { grid-area: auto; display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brand .mark { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-h); color: var(--on-accent); font-size: 21px; }
.brand .bt { display: grid; min-width: 0; line-height: 1.25; }
.brand .bt b { font-size: 15px; }
.brand .bt small { color: var(--muted); font-size: 12px; }

.dday { grid-area: dday; display: flex; align-items: baseline; gap: 8px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.dday strong { font-family: var(--f-mono); font-size: 16px; font-weight: 500; color: var(--accent-h); font-variant-numeric: tabular-nums; }
.dday .dl { display: none; }

.acct { grid-area: acct; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; text-align: left; }
.acct .av { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-h); color: var(--on-accent); font-size: 13px; font-weight: 700; }
.acct .at { display: grid; min-width: 0; line-height: 1.3; }
.acct .at b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .at small { display: none; color: var(--muted); font-size: 12px; }
.acct .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.acct .dot.synced { background: var(--ok); }
.acct .dot.error { background: var(--bad); }
.acct.in .at { display: none; }

.nav { grid-area: nav; display: flex; gap: 2px; overflow-x: auto; margin-inline: -16px; padding: 0 16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.nav::-webkit-scrollbar { display: none; }
.ni { flex: none; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; scroll-snap-align: start; }
.ni .nn { font-family: var(--f-mono); font-size: 12px; min-width: 1ch; }
.ni .ng { display: none; }
.ni .nt { display: grid; line-height: 1.3; }
.ni .nt small { display: none; font-weight: 400; font-size: 12px; color: var(--muted); }
.ni .tg { display: none; }
.ni[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.ni.soon:not([aria-current="page"]) { opacity: .75; }
.nsep { flex: none; width: 1px; margin: 8px 6px; background: var(--line); }

.main { width: 100%; min-width: 0; max-width: 960px; margin-inline: auto; padding: 20px 16px 72px; outline: 0; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 272px minmax(0, 1fr); }
  .side {
    height: 100vh; overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--line);
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "brand" "dday" "nav" "acct"; align-content: stretch; gap: 14px; padding: 22px 14px 16px;
  }
  .dday { padding: 10px 12px; border-radius: 12px; justify-content: space-between; font-size: 13px; }
  .dday .dl { display: inline; }
  .dday strong { font-size: 22px; }
  .nav { flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 0; overflow: visible; align-content: start; }
  .ni { gap: 10px; min-height: 48px; padding: 6px 10px; }
  .ni .nn { order: 3; margin-left: auto; opacity: .7; }
  .ni .ng { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; font-family: var(--f-kana); font-size: 19px; font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
  .ni .nt small { display: block; }
  .ni .tg { display: inline-block; order: 2; padding: 0 7px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: 11px; font-weight: 400; line-height: 18px; }
  .ni .nt { flex: 1; min-width: 0; }
  .nsep { width: auto; height: 1px; margin: 8px 4px; }
  .acct { width: 100%; justify-content: flex-start; padding: 8px 10px; border-radius: 12px; }
  .acct.in .at { display: grid; }
  .acct .at small { display: block; }
  .main { padding: 34px 36px 80px; }
  .sidebtn { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
  .sidebtn:hover { color: var(--fg); border-color: var(--muted); }
  /* 왼쪽 메뉴 접기: 메뉴를 숨기고 본문이 화면 전체를 써요. 펼치는 버튼은 왼쪽 위에 떠 있어요. */
  html[data-side="min"] .app { grid-template-columns: minmax(0, 1fr); }
  html[data-side="min"] .side { display: none; }
  html[data-side="min"] .main { max-width: none; padding-left: 68px; }
  .sideopen { position: fixed; top: 14px; left: 14px; z-index: 40; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--fg); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
  html[data-side="min"] .sideopen { display: grid; }
}

/* 탭 머리글 */
.mod-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mod-glyph { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-size: 30px; }
.mod-head h1 { margin: 0; font-size: 22px; line-height: 1.25; text-wrap: balance; }
.mod-head .eyebrow { margin: 0; }
.eyebrow { margin: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.page-h { margin: 0 0 14px; font-size: 22px; line-height: 1.25; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }

/* 홈 */
.home { display: grid; gap: 22px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.hero .big { font-family: var(--f-mono); font-weight: 500; font-size: clamp(56px, 15vw, 84px); line-height: 1; letter-spacing: -.02em; color: var(--accent-h); font-variant-numeric: tabular-nums; }
.hero .when { margin: 8px 0 0; color: var(--muted); }
.hero .side2 { display: grid; gap: 12px; align-content: space-between; min-width: 0; }
.hero .stats { display: flex; gap: 20px; }
.hero .stats b { display: block; font-family: var(--f-mono); font-size: 26px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hero .stats span { font-size: 12px; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark i { flex: 1; min-height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--accent-h) 28%, var(--surface2)); }
.spark i:last-child { background: var(--accent-h); }
@media (max-width: 640px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mcard { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "glyph head" "glyph desc" "stat stat"; gap: 2px 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; }
.mcard:hover { border-color: var(--accent); }
.mcard .mg { grid-area: glyph; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-size: 32px; }
.mcard .mh { grid-area: head; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mcard .mh .mono { font-size: 12px; color: var(--muted); }
.mcard .mh b { font-size: 17px; }
.mcard .md { grid-area: desc; font-size: 13px; color: var(--muted); line-height: 1.45; }
.mcard .ms { grid-area: stat; margin-top: 12px; display: grid; gap: 6px; font-size: 13px; }
.mcard.soon { background: transparent; border-style: dashed; }
.mcard.soon .mg { background: var(--surface2); color: var(--muted); }
.mcard .tag { margin-left: auto; background: var(--surface2); color: var(--muted); }

/* 준비 중 탭 */
.ph { display: grid; gap: 14px; }
.plan { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 4px; border: 1.5px solid var(--muted); border-radius: 4px; }

/* 설정 */
.set { display: grid; gap: 14px; }
.set .card > h2 { margin-bottom: 4px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.srow:first-of-type { border-top: 0; }
.srow .st { display: grid; min-width: 0; line-height: 1.4; }
.srow .st small { color: var(--muted); font-size: 12px; }
.confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: var(--on-accent); }
.statline { display: flex; align-items: center; gap: 8px; }
.statline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.statline .dot.synced { background: var(--ok); }
.statline .dot.error { background: var(--bad); }

/* 폼 (로그인 시트, 설정) */
.fld { display: grid; gap: 6px; }
.fld > label { font-size: 13px; font-weight: 500; color: var(--muted); }
.inp { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface2); }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--surface2); }
.msg.err { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.msg.good { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); }
.linkbtn { border: 0; background: none; padding: 4px 0; color: var(--accent); text-decoration: underline; font-size: 13px; text-align: left; }
.form { display: grid; gap: 14px; }

.toasts { position: fixed; inset-inline: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast { pointer-events: auto; max-width: min(92vw, 440px); padding: 10px 16px; border-radius: 12px; background: var(--fg); color: var(--bg); font-size: 14px; }
