/* 오늘할일 웹 — 무지 디자인 토큰(폰 앱 DS.swift에서 옮김) · 데스크탑 3칸 레이아웃 */
:root {
  --gold: #F2B01E;
  --ink: #3D2600;
  --bg: #FFFFFF;
  --side-bg: #F7F6F4;          /* 종이 느낌 사이드바 */
  --text: #1A1A1A;
  --secondary: #6B6B6B;
  --tertiary: #9B9B9B;
  --fill: rgba(0,0,0,0.05);
  --hairline: rgba(0,0,0,0.09);
  --radius-card: 14px;
  --radius-cta: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--secondary); }
.small { font-size: 13px; }
button { font-family: inherit; }

/* ── 로그인 ── */
.signin { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.signin-card { max-width: 340px; text-align: center; }
.signin-card .mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: var(--ink);
  font-size: 30px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.signin-card h1 { font-size: 28px; font-weight: 600; margin-bottom: 10px; }
.signin-card p { font-size: 15px; line-height: 1.5; margin-bottom: 22px; }
.hint { color: var(--tertiary); font-size: 13px; margin-top: 14px; min-height: 18px; }
.gold-btn {
  background: var(--gold); color: var(--ink); border: none; border-radius: var(--radius-cta);
  font-size: 16px; font-weight: 600; padding: 13px 22px; cursor: pointer; width: 100%;
}
.gold-btn:active { opacity: .85; }
.ghost-link { background: none; border: none; color: var(--secondary); font-size: 14px; cursor: pointer; margin-top: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ── 3칸 레이아웃 ── */
#app { display: flex; height: 100vh; }

/* 사이드바 */
.sidebar {
  width: 220px; flex: none; background: var(--side-bg); border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; padding: 18px 10px 14px;
}
.side-brand { font-size: 15px; font-weight: 600; padding: 4px 10px 16px; display: flex; align-items: center; gap: 8px; }
.side-mark {
  width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.scopes { display: flex; flex-direction: column; gap: 2px; }
.scope-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text); text-align: left;
}
.scope-item:hover { background: var(--fill); }
.scope-item.active { background: rgba(242,176,30,.16); font-weight: 600; }
.scope-item .ico { width: 18px; text-align: center; color: var(--secondary); font-size: 13px; }
.scope-item.active .ico { color: var(--gold); }
.scope-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-item .cnt { font-size: 12px; color: var(--tertiary); font-variant-numeric: tabular-nums; }
.scope-sep { height: 1px; background: var(--hairline); margin: 8px 10px; }
.side-add {
  background: none; border: none; color: var(--secondary); font-size: 13px; cursor: pointer;
  text-align: left; padding: 8px 10px; border-radius: 9px; margin-top: 2px;
}
.side-add:hover { background: var(--fill); }
.side-spacer { flex: 1; }
.side-account {
  display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer;
  padding: 8px 10px; border-radius: 10px; text-align: left; width: 100%;
}
.side-account:hover { background: var(--fill); }
.side-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--ink);
  font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none;
}
.side-account-text { display: flex; flex-direction: column; min-width: 0; }
.side-email { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sync { font-size: 11px; color: var(--tertiary); }

/* 가운데 */
.center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px 8px; }
.topbar h1 { font-size: 26px; font-weight: 600; }
.title-wrap { display: flex; align-items: center; gap: 10px; }
.streak { font-size: 13px; color: var(--secondary); background: var(--fill); border-radius: 999px; padding: 3px 10px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { background: none; border: none; font-size: 18px; color: var(--secondary); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--fill); }
.icon-btn.on { color: var(--ink); background: rgba(242,176,30,.35); }

.progress-ring { position: relative; background: none; border: none; cursor: default; width: 44px; height: 44px; }
.progress-ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--fill); stroke-width: 4; }
.ring-fill { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset .5s cubic-bezier(.3,1,.4,1); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--secondary); font-variant-numeric: tabular-nums; }
.ring-label.all-done { color: var(--gold); }

.sections { flex: 1; overflow-y: auto; padding: 0 28px 20px; }
.section-label { font-size: 13px; color: var(--secondary); padding: 18px 0 6px; display: flex; gap: 6px; align-items: center; }
.section-label .gold { color: var(--gold); }
.section-label .count { color: var(--tertiary); font-size: 12px; }

.row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--hairline); border-radius: 8px; cursor: default; }
.row:hover { background: var(--fill); }
.row.selected { background: rgba(242,176,30,.12); }
.check {
  width: 21px; height: 21px; border-radius: 50%; border: 1.8px solid var(--tertiary);
  flex: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s; font-size: 12px;
}
.check:hover { border-color: var(--gold); }
.check.done { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.check.pop { animation: pop .38s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.28)} 100%{transform:scale(1)} }
.row.leaving { animation: leave .32s ease forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(12px); } }

.row-body { flex: 1; min-width: 0; cursor: pointer; }
.row-title { font-size: 14.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done .row-title { color: var(--secondary); text-decoration: line-through; }
.row-sub { font-size: 12px; color: var(--tertiary); margin-top: 1px; }
.chip { font-size: 12px; color: var(--secondary); background: var(--fill); border-radius: 999px; padding: 3px 9px; flex: none; }
.chip.today { background: var(--gold); color: var(--ink); }
.empty { color: var(--tertiary); font-size: 14px; padding: 40px 8px; }

.addbar { padding: 10px 28px 18px; }
.addbar input {
  width: 100%; border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px 16px; font-size: 14.5px; background: var(--bg); color: var(--text); outline: none;
}
.addbar input:focus { border-color: var(--gold); }

/* 상세 패널 */
.detail {
  width: 320px; flex: none; border-left: 1px solid var(--hairline); overflow-y: auto;
  display: flex; flex-direction: column;
}
.detail-empty { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--tertiary); font-size: 13.5px; line-height: 1.6; }
.detail-body { padding: 22px 20px 30px; display: flex; flex-direction: column; gap: 0; }
.detail-title {
  width: 100%; border: none; outline: none; font-size: 18px; font-weight: 600; color: var(--text);
  background: none; padding: 2px 0 14px; border-bottom: 1px solid var(--hairline);
}
.d-label { font-size: 12px; color: var(--tertiary); padding: 16px 0 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  border: none; background: var(--fill); color: var(--text); font-size: 13px;
  border-radius: 999px; padding: 7px 13px; cursor: pointer;
}
.pill:hover { background: rgba(0,0,0,.09); }
.pill.on { background: var(--gold); color: var(--ink); font-weight: 600; }
.d-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.d-row .lab { color: var(--text); display: flex; align-items: center; gap: 8px; }
.d-row input[type="date"], .d-row input[type="time"], .d-row select {
  border: 1px solid var(--hairline); border-radius: 8px; padding: 5px 8px; font-size: 13px;
  background: var(--bg); color: var(--text); outline: none; font-family: inherit;
}
.d-clear { background: none; border: none; color: var(--tertiary); cursor: pointer; font-size: 14px; padding: 4px; }
.subtask-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--hairline); }
.subtask-row .check { width: 18px; height: 18px; font-size: 10px; }
.subtask-row input[type="text"] { flex: 1; border: none; outline: none; font-size: 13.5px; background: none; color: var(--text); }
.subtask-row.done input[type="text"] { color: var(--secondary); text-decoration: line-through; }
.subtask-add { display: flex; gap: 8px; padding: 8px 0; }
.subtask-add input { flex: 1; border: none; outline: none; font-size: 13.5px; background: none; color: var(--text); }
.subtask-add input::placeholder { color: var(--tertiary); }
.d-note {
  width: 100%; min-height: 90px; border: 1px solid var(--hairline); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; line-height: 1.5; resize: vertical; outline: none;
  background: var(--bg); color: var(--text); font-family: inherit;
}
.d-note:focus { border-color: var(--gold); }
.d-delete {
  margin-top: 20px; background: none; border: none; color: var(--tertiary); font-size: 13px;
  cursor: pointer; text-align: left; padding: 8px 0;
}
.d-delete:hover { color: #C0392B; }

/* ── 뷰 공통 ── */
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── 캘린더 — 데스크탑형 월 그리드(셀 안에 할 일 제목) ── */
.cal-wrap { flex: 1; overflow-y: auto; padding: 6px 28px 20px; display: flex; flex-direction: column; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 12px; }
.cal-title { font-size: 17px; font-weight: 600; }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-today-btn { background: var(--fill); border: none; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--secondary); padding: 0 0 6px; }
.cal-weekdays span { padding-left: 8px; }
.cal-weekdays .sun { color: #C4756E; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; flex: 1; grid-auto-rows: minmax(96px, auto); }
.cal-cell {
  border: 1px solid var(--hairline); background: none; border-radius: 10px;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 6px; font-size: 13px; color: var(--text); text-align: left; overflow: hidden;
}
.cal-cell.blank { border: none; }
.cal-cell .num {
  font-size: 12px; color: var(--secondary); width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; flex: none; margin-bottom: 1px;
}
.cal-cell.sun .num { color: #C4756E; }
.cal-cell.today .num { border: 1.5px solid var(--gold); border-radius: 50%; color: var(--text); font-weight: 600; }
.cal-task {
  font-size: 11.5px; line-height: 1.35; background: var(--fill); border: none; text-align: left;
  border-radius: 6px; padding: 3px 7px; cursor: pointer; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit;
}
.cal-task:hover { background: rgba(242,176,30,.18); }
.cal-task.selected { background: rgba(242,176,30,.22); }
.cal-task.done { color: var(--tertiary); text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--tertiary); padding: 1px 7px; }
.cal-caption { font-size: 12px; color: var(--tertiary); padding: 12px 0 4px; }

/* ── 기록 ── */
.record-wrap { flex: 1; overflow-y: auto; padding: 6px 28px 24px; max-width: 560px; }
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.seg button { border: none; background: none; padding: 6px 16px; font-size: 13px; border-radius: 8px; cursor: pointer; color: var(--secondary); }
.seg button.on { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.rec-summary { font-size: 15px; padding-bottom: 14px; }
.rec-summary b { font-weight: 600; }
.rec-bars { display: flex; flex-direction: column; gap: 8px; padding-bottom: 18px; }
.rec-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rec-bar-row .name { width: 74px; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-bar-row .bar { height: 10px; background: var(--gold); border-radius: 5px; min-width: 3px; }
.rec-bar-row .val { color: var(--tertiary); font-size: 12px; }
.rec-week { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding: 8px 0 18px; }
.rec-week .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rec-week .colbar { width: 100%; max-width: 34px; background: var(--gold); border-radius: 6px 6px 3px 3px; min-height: 2px; }
.rec-week .collab { font-size: 11px; color: var(--tertiary); }

/* ── 설정 ── */
.settings-wrap { flex: 1; overflow-y: auto; padding: 6px 28px 24px; max-width: 480px; }
.set-card { background: var(--fill); border-radius: var(--radius-card); padding: 16px; margin-bottom: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14px; }
.set-hint { font-size: 12px; color: var(--tertiary); padding: 2px 0 6px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .knob { position: absolute; inset: 0; background: rgba(0,0,0,.15); border-radius: 999px; cursor: pointer; transition: background .2s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .knob { background: var(--gold); }
.switch input:checked + .knob::after { transform: translateX(18px); }

/* ── 축하 ── */
.celebrate { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  pointer-events: none; animation: celebFade 2.2s ease forwards; }
@keyframes celebFade { 0%{background:rgba(255,255,255,0)} 15%{background:rgba(255,255,255,.55)} 80%{background:rgba(255,255,255,.55)} 100%{background:rgba(255,255,255,0)} }
.celebrate-inner { text-align: center; animation: celebPop 2.2s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes celebPop { 0%{transform:scale(.6);opacity:0} 12%{transform:scale(1);opacity:1} 80%{transform:scale(1);opacity:1} 100%{transform:scale(1.02);opacity:0} }
.celebrate-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--gold); color: var(--ink);
  font-size: 42px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  animation: celebRing 2.2s ease forwards; }
@keyframes celebRing { 0%{box-shadow:0 0 0 0 rgba(242,176,30,.5)} 30%{box-shadow:0 0 0 24px rgba(242,176,30,0)} }
.celebrate-text { font-size: 18px; font-weight: 600; }

/* ── 계정 시트 ── */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; z-index: 10; }
.sheet-card { width: 340px; background: var(--bg); border-radius: 18px; padding: 24px; }
.account-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: var(--ink);
  font-size: 20px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.account-email { font-size: 15px; font-weight: 500; }
.ghost-btn { width: 100%; background: var(--fill); border: none; border-radius: 12px;
  padding: 12px; font-size: 14px; color: var(--text); cursor: pointer; margin-top: 8px; }

/* 좁은 화면 — 사이드바 축소, 상세는 오버레이 */
@media (max-width: 900px) {
  .sidebar { width: 64px; padding: 14px 6px; }
  .side-brand { justify-content: center; padding-bottom: 12px; }
  .side-brand :not(.side-mark) { display: none; }
  .scope-item .name, .scope-item .cnt, .side-add, .side-account-text { display: none; }
  .detail { position: fixed; right: 0; top: 0; bottom: 0; background: var(--bg); box-shadow: -8px 0 30px rgba(0,0,0,.08); z-index: 5; transform: translateX(100%); transition: transform .25s ease; }
  .detail.open { transform: translateX(0); }
}

/* ── 드래그앤드랍 ── */
.row.dragging { opacity: .35; }
.row[draggable="true"] { cursor: grab; }
.row[draggable="true"]:active { cursor: grabbing; }
.dropping { background: rgba(242,176,30,.16) !important; border-radius: 10px; }
.section-label.dropping { outline: none; }
.cal-cell.dropping { border-color: var(--gold); }
.scope-item.dropping { background: rgba(242,176,30,.22); }
.dropzone {
  border: 1px dashed var(--hairline); border-radius: 10px; height: 38px;
}
.dropzone.dropping { border-color: var(--gold); }

/* ── 구글 일정(캘린더 셀) — 할 일(채움)과 구분되는 테두리+색점 ── */
.cal-event {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; line-height: 1.3; color: var(--secondary);
  border: 1px solid var(--hairline); border-radius: 6px; padding: 2px 6px;
  white-space: nowrap; overflow: hidden;
}
.cal-event .ev-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.cal-event .ev-title { overflow: hidden; text-overflow: ellipsis; }
.cal-gcal-btn {
  background: var(--fill); border: none; border-radius: 8px; padding: 6px 12px;
  font-size: 12px; color: var(--secondary); cursor: pointer;
}
.cal-gcal-btn:hover { background: rgba(0,0,0,.09); }
.cal-caption { display: flex; align-items: center; gap: 10px; }
.cal-gcal-who { color: var(--secondary); }
.cal-gcal-switch {
  background: none; border: none; font-size: 12px; color: var(--tertiary);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.cal-gcal-switch:hover { color: var(--secondary); }

/* ── 진행 중 카드(폰 FocusCard의 데스크탑 판) ── */
.focus-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--fill); border-radius: var(--radius-card); padding: 14px 16px; margin-top: 14px;
}
.fc-label { font-size: 11px; color: var(--gold); font-weight: 700; letter-spacing: .04em; }
.fc-title { font-size: 15px; font-weight: 600; cursor: pointer; margin: 2px 0; }
.fc-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.fc-time { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-actions { display: flex; gap: 8px; }
.fc-btn { border: none; background: rgba(0,0,0,.07); border-radius: 10px; padding: 9px 15px; font-size: 13px; cursor: pointer; color: var(--text); }
.fc-btn.gold { background: var(--gold); color: var(--ink); font-weight: 600; }

/* ── 되돌리기 배너 ── */
.undobar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #312F2C; color: #fff; border-radius: 14px; padding: 11px 16px;
  display: flex; align-items: center; gap: 10px; z-index: 30; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.undobar .u-mark { color: var(--gold); font-weight: 700; }
.undobar .u-title { color: rgba(255,255,255,.65); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undobar .u-undo { background: none; border: none; color: var(--gold); font-weight: 600; font-size: 14px; cursor: pointer; }
.undobar .u-time { background: rgba(255,255,255,.12); border: none; color: #fff; border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }

/* ── 캡처 미리보기 힌트 ── */
.add-hint { font-size: 12px; color: var(--tertiary); padding: 6px 4px 0; min-height: 16px; }

/* ── 상세: 시작 버튼 ── */
.d-start {
  margin-top: 18px; width: 100%; border: none; border-radius: var(--radius-cta);
  background: var(--gold); color: var(--ink); font-size: 15px; font-weight: 600;
  padding: 12px; cursor: pointer;
}
.d-start:active { opacity: .85; }

/* ── 개발 채널 표시 ── */
.dev-badge {
  margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  background: var(--gold); color: var(--ink); border-radius: 6px; padding: 2px 6px;
  vertical-align: middle;
}

/* ── 구글 로그인 버튼 (구글 브랜드 가이드: 흰 바탕 + G 로고, 로고 변색 금지) ── */
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px; border-radius: var(--radius-cta);
  background: #fff; border: 1px solid var(--hairline); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.google-btn:hover { background: var(--fill); }
.google-btn:active { opacity: .85; }
.g-logo { flex: none; }
