/* Google Calendar 톤 — 밝고 화사하되 간결하게. 흰 카드 + 옅은 회색 배경 + 파란 포인트. */

:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --line: #e3e6ea;
  --accent: #1a73e8;
  --accent-ink: #ffffff;
  --warn: #d93025;
  --good: #188038;
  --star: #f9ab00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.08), 0 1px 3px rgba(60, 64, 67, 0.12);
  --shadow-lift: 0 2px 6px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', Roboto, system-ui, sans-serif;
}

.shell { max-width: 720px; margin: 0 auto; padding: 20px 16px 64px; }

/* 상단 바 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 20px; color: var(--muted); letter-spacing: -0.01em; text-decoration: none; }
.brand-logo { width: 32px; height: 32px; display: block; }
.brand-mark {
  background: var(--accent); color: var(--accent-ink); border-radius: 8px;
  padding: 3px 8px; font-size: 14px; font-weight: 600;
}
.status-pill { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.status-dot.bad { background: var(--warn); }
.account-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.account-name { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-action { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: var(--card); color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; }
.account-action:hover { border-color: var(--accent); background: #e8f0fe; }

/* 통합 검색 */
.search-wrap {
  position: fixed; z-index: 30; right: max(16px, calc(50% - 360px)); bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  width: 44px; height: 44px; padding: 0; transition: width 0.22s ease, box-shadow 0.15s;
}
.search-wrap.is-open { width: min(440px, calc(100vw - 32px)); padding: 10px 12px 10px 18px; }
.search-wrap.is-focused { box-shadow: var(--shadow-lift); }
.search-wrap.is-error { outline: 1.5px solid var(--warn); outline-offset: -1px; }
.search-icon, .search-action { flex: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.search-icon { width: 44px; height: 44px; font-size: 21px; padding: 0; }
.search-action { display: none; font-size: 22px; line-height: 1; padding: 4px; }
.search-wrap.is-open .search-action { display: block; }
.search-wrap.is-open #search-close { color: var(--warn); }
.search-wrap input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: inherit; font-size: 15px; color: var(--ink);
}
.search-wrap:not(.is-open) input { display: none; }
.search-wrap input::placeholder { color: #9aa0a6; }

/* 입력(할일 추가) */
.capture { display: flex; gap: 8px; margin-bottom: 12px; }
.capture-wrap {
  position: relative; flex: 1; display: flex; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow 0.15s;
}
.capture-wrap.is-focused { box-shadow: var(--shadow-lift); outline: 2px solid var(--accent); outline-offset: -1px; }
.capture-wrap input {
  flex: 1; padding: 13px 16px; font: inherit; font-size: 14.5px;
  border: none; outline: none; background: transparent; color: var(--ink); border-radius: var(--radius);
}
.primary {
  padding: 0 22px; font: inherit; font-weight: 500; cursor: pointer;
  border: none; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.primary:hover { background: #1765cc; box-shadow: var(--shadow-lift); }

/* 제안 카드 — 입력상자처럼 보이지 않게, 카드형으로 */
.preview {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 16px; border-left: 4px solid var(--accent);
}
.preview-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.preview-title { font-weight: 500; font-size: 15px; }
.preview-warn { color: var(--warn); font-size: 12.5px; margin-top: 6px; }
.preview-warn:empty { display: none; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px;
  background: #f1f3f4; color: var(--muted);
}
.chip.when { background: #e8f0fe; color: #1967d2; }
.chip.ctx { background: #e6f4ea; color: #188038; }
.chip.tag { background: #fce8e6; color: #c5221f; }
.chip.rep { background: #fef7e0; color: #b06000; }

/* 필터 탭 */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filter {
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
  padding: 7px 14px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.filter:hover { background: #f1f3f4; }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter .n { opacity: 0.75; margin-left: 4px; font-variant-numeric: tabular-nums; }

.lists { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.list-chip {
  font: inherit; font-size: 12px; cursor: pointer;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.list-chip:hover { background: #f1f3f4; }
.list-chip.is-active { background: #e8f0fe; border-color: #e8f0fe; color: #1967d2; font-weight: 500; }

/* 목록 카드 */
.task {
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 15px; margin-bottom: 8px; transition: box-shadow 0.1s;
}
.task:hover { box-shadow: var(--shadow-lift); }
.task.overdue { border-left: 4px solid var(--warn); }
.task.is-cursor { outline: 2px solid var(--accent); outline-offset: -1px; }
.task.is-focused { outline: 3px solid var(--accent); outline-offset: 3px; box-shadow: var(--shadow-lift); position: relative; z-index: 1; }
.task.is-dimmed { opacity: 0.42; filter: saturate(0.65); }
.task.is-selected { background: #e8f0fe; }

.check {
  flex: none; width: 18px; height: 18px; margin-top: 2px; cursor: pointer;
  border: 2px solid #9aa0a6; border-radius: 50%; background: transparent;
}
.check:hover { border-color: var(--accent); background: #e8f0fe; }

.task-main { min-width: 0; flex: 1; }
.task-title { margin: -5px -8px 0; padding: 5px 8px; font-weight: 400; font-size: 14.5px; word-break: break-word; cursor: pointer; border-radius: 6px; }
.task-title:hover { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.star { color: var(--star); }

.task-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 5px; font-size: 12px; color: var(--muted); }
.task-meta .when { font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 12px; background: #f1f3f4; }
.task.overdue .when { color: var(--warn); font-weight: 500; background: #fce8e6; }
.task-meta .muted { opacity: 0.7; }
.task-meta .list { padding: 2px 8px; border-radius: 12px; background: #f1f3f4; }
.task-meta .rep { padding: 2px 8px; border-radius: 12px; background: #fef7e0; color: #b06000; }
.task-meta .rep.after { background: #f3e8fd; color: #8430ce; }
.task-meta .native { padding: 2px 8px; border-radius: 12px; border: 1px dashed var(--line); }

.time-btn {
  font: inherit; font-size: 12px; cursor: pointer;
  padding: 2px 9px; border-radius: 12px;
  border: 1px dashed var(--line); background: transparent; color: var(--muted);
}
.time-btn:hover { border-style: solid; border-color: var(--accent); color: var(--accent); }
.time-btn.has-time { border-style: solid; border-color: transparent; background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums; }

.task-note { margin-top: 6px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }

/* 시각 편집기 */
.editor {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  flex-basis: 100%; width: 100%;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.editor input, .editor select {
  font: inherit; font-size: 13px; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.primary.sm, .ghost.sm { font-size: 13px; padding: 7px 14px; border-radius: 6px; }
.ghost.sm { cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--muted); font-family: inherit; }
.ghost.sm:hover { color: var(--warn); border-color: var(--warn); }
.editor .hint { font-size: 12px; color: var(--muted); }

.title-edit {
  width: 100%; font: inherit; font-weight: 400;
  padding: 5px 9px; border: 1.5px solid var(--accent); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}

/* 추천 목록 */
.suggest {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-lift);
  padding: 6px; max-height: 260px; overflow-y: auto;
}
.suggest-item { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 11px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.suggest-item.is-active { background: #e8f0fe; color: #1967d2; }
.suggest-item .kind { font-size: 11px; opacity: 0.6; }
.suggest-item.is-new { font-style: italic; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 13.5px; }
.hidden { display: none; }

footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}
.legal-links { display: inline-flex; gap: 12px; }
footer a, .legal-footer a { color: inherit; text-decoration: none; }
footer a:hover, .legal-footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* 법적 문서 */
.legal-page { max-width: 760px; margin: 0 auto; padding: 24px 20px 56px; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.legal-back { color: var(--accent); font-size: 13px; text-decoration: none; }
.legal-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-content { max-width: 680px; padding: 54px 8px 20px; }
.legal-kicker { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.legal-content h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); line-height: 1.2; letter-spacing: -0.03em; }
.legal-updated { margin: 12px 0 44px; color: var(--muted); font-size: 13px; }
.legal-content h2 { margin: 30px 0 8px; font-size: 17px; }
.legal-content p { margin: 0 0 12px; color: var(--muted); line-height: 1.8; }
.legal-footer { display: flex; gap: 16px; margin-top: 34px; padding: 16px 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* 신규와 수정이 같은 입력 경험을 공유하는 편집 패널 */
.composer { width: min(680px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 32px)); overflow-y: auto; background: var(--card); border-radius: 14px; padding: 20px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.composer-head h3 { margin: 0; font-size: 17px; color: var(--ink); }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; line-height: 1; }
.icon-button:hover { background: var(--bg); color: var(--ink); }
.composer-input-wrap { position: relative; }
.composer-input { width: 100%; }
.composer textarea { display: block; width: 100%; min-height: 150px; resize: vertical; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; line-height: 1.6; outline: none; }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.16); }
.composer-preview { margin-top: 12px; padding: 13px 14px; border-left: 4px solid var(--accent); border-radius: 8px; background: var(--bg); }
.composer-preview.hidden { display: none; }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.composer-actions button:disabled { opacity: 0.55; cursor: wait; }

/* 오버레이 (postpone / palette / help) */
.overlay { position: fixed; inset: 0; background: rgba(32, 33, 36, 0.5); display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; z-index: 50; }
.overlay.hidden { display: none; }
.overlay-box { background: var(--card); border-radius: 12px; padding: 18px; min-width: 320px; max-width: 480px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }
.overlay-box h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 500; }
.overlay-box input { width: 100%; font: inherit; font-size: 15px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.overlay-box .hint { margin-top: 8px; font-size: 12px; color: var(--muted); }

.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; font-size: 13px; }
.help-grid kbd { font-family: inherit; background: #f1f3f4; border-radius: 4px; padding: 2px 8px; font-size: 12px; justify-self: start; color: #3c4043; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202124; --card: #292a2d; --ink: #e8eaed;
    --muted: #9aa0a6; --line: #3c4043; --accent: #8ab4f8; --accent-ink: #202124;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.5);
  }
  .chip, .task-meta .list, .task-meta .when, .help-grid kbd { background: #3c4043; color: #e8eaed; }
  .chip.when { background: #1e3a5f; color: #8ab4f8; }
  .chip.ctx { background: #1e3f2c; color: #81c995; }
  .chip.tag { background: #4b2a2a; color: #f28b82; }
  .chip.rep, .task-meta .rep { background: #3f2f14; color: #fdd663; }
  .task-meta .rep.after { background: #34243f; color: #d7aefb; }
  .task.overdue .when { background: #4b2a2a; color: #f28b82; }
  .task.is-selected { background: #1e3a5f; }
  .list-chip.is-active { background: #1e3a5f; border-color: #1e3a5f; color: #8ab4f8; }
  .suggest-item.is-active { background: #1e3a5f; color: #8ab4f8; }
}

@media (max-width: 600px) {
  .search-wrap { right: 12px; bottom: 12px; }
  .search-wrap.is-open { width: calc(100vw - 24px); }
  .overlay { padding-top: 12px; align-items: flex-start; }
  .composer { width: calc(100vw - 24px); max-height: calc(100vh - 24px); padding: 16px; }
  .composer textarea { min-height: 180px; font-size: 16px; }
  .task { gap: 10px; padding: 14px 12px; }
  .task-title { font-size: 16px; line-height: 1.45; }
  .task-meta { gap: 8px; font-size: 13px; }
  .time-btn { padding: 6px 10px; }
}
