/* daily — warm paper editorial shell */
:root {
  --paper: #f3eee6;
  --paper-2: #ebe4d8;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --line: #ddd5c8;
  --line-strong: #cfc5b5;
  --surface: #fffcf7;
  --surface-2: #faf6ef;
  --accent: #c45c26;
  --accent-ink: #9a3f12;
  --accent-soft: rgba(196, 92, 38, 0.12);
  --forest: #2f4a3c;
  --ok: #3d7a5a;
  --ok-bg: rgba(61, 122, 90, 0.1);
  --err: #b42318;
  --err-bg: rgba(180, 35, 24, 0.08);
  --warn: #c45c26;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(28, 25, 23, 0.04), 0 12px 32px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 24px 64px rgba(28, 25, 23, 0.12);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Instrument Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --topbar: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 92, 38, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(47, 74, 60, 0.07), transparent 50%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.12em 0.35em;
  border-radius: 5px;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }
.muted { color: var(--muted); }
.inline { display: inline; margin: 0; }

/* —— Brand —— */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-flex; color: var(--ink); }
.brand-text { font-size: 1.05rem; }

/* —— Topbar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar);
  padding: 0 1.5rem;
  background: rgba(243, 238, 230, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.topbar-left { flex: 1; }

.nav { display: flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; }
.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { background: rgba(28, 25, 23, 0.05); text-decoration: none; }
.nav-link.active { background: var(--ink); color: var(--paper); }
.nav-soon {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  cursor: default;
}

.user-menu { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--forest); color: #f3eee6;
  font-weight: 650; font-size: 0.9rem;
}
.user-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-email { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.user-actions { display: flex; gap: 0.5rem; align-items: center; }

.btn-text {
  background: none; border: none; padding: 0.25rem 0.35rem;
  color: var(--accent-ink); font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
}
.btn-text.muted { color: var(--muted); }
.btn-text.danger { color: var(--err); }
.btn-text:hover { text-decoration: underline; text-underline-offset: 3px; }

/* —— Layout —— */
.container { width: min(1080px, calc(100% - 2rem)); margin: 1.75rem auto 3rem; }

.page-hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  margin-bottom: 1.5rem;
}
.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.page-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-desc { margin: 0.45rem 0 0; color: var(--ink-2); max-width: 36rem; }
.hero-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 0.78rem; font-weight: 500; color: var(--ink-2);
}
.pill.live i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 122, 90, 0.2);
}
.soft-tag {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.72rem; font-weight: 600;
}

/* —— Bento panels —— */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
  min-height: 220px;
}
.panel-accent { border-color: rgba(196, 92, 38, 0.28); background: linear-gradient(180deg, #fff9f4 0%, var(--surface) 40%); }
.panel-wide { grid-column: 1 / -1; min-height: 0; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.9rem;
}
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.count {
  min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem;
  border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--paper-2); color: var(--ink-2);
  font-size: 0.78rem; font-weight: 650;
}

.feed { list-style: none; margin: 0; padding: 0; }
.feed-item {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.7rem 0; border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.feed-item:first-child { border-top: 0; padding-top: 0; }
.feed-dot {
  width: 8px; height: 8px; margin-top: 0.45rem; border-radius: 50%;
  background: var(--forest); flex-shrink: 0;
}
.feed-dot.warn { background: var(--warn); }

.empty-state {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem;
  padding: 1rem 0 0.25rem; color: var(--muted);
}
.empty-state svg { margin-bottom: 0.35rem; color: var(--line-strong); }
.empty-state.compact { padding-top: 0.25rem; }
.empty-title { margin: 0; color: var(--ink-2); font-weight: 600; font-size: 0.98rem; }
.empty-hint { margin: 0; font-size: 0.88rem; max-width: 22rem; }

.roadmap .road-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
.road-item {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.85rem; border-radius: 12px; background: var(--surface-2);
  border: 1px solid transparent;
}
.road-item.done { border-color: rgba(61, 122, 90, 0.25); background: var(--ok-bg); }
.road-step {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); padding-top: 0.15rem;
}
.road-item.done .road-step { color: var(--ok); }
.road-item strong { display: block; font-size: 0.92rem; margin-bottom: 0.15rem; }
.road-item p { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* —— Forms / table —— */
.panel + .panel, .alert + .panel { margin-top: 0; }
.form-inline { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field.grow { flex: 1 1 240px; }
.label { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
input[type=email], input[type=text] {
  width: 100%; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 0.95rem;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  border: none; border-radius: 12px; padding: 0.75rem 1.1rem;
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; color: var(--paper); }
.btn-google {
  width: 100%; background: #fff; color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.btn-google:hover { background: #fff; border-color: var(--ink-2); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line);
}
.table td { padding: 0.75rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.email-cell { font-weight: 500; margin-right: 0.4rem; }
.actions { text-align: right; }

.alert {
  padding: 0.75rem 0.9rem; border-radius: 12px; margin-bottom: 1rem;
  font-size: 0.92rem;
}
.alert-error { background: var(--err-bg); color: var(--err); border: 1px solid rgba(180,35,24,.15); }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(61,122,90,.2); }

/* —— Auth split —— */
.login-page { background: var(--paper); }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem;
  color: #f8f1e7;
  background:
    linear-gradient(145deg, #2a211c 0%, #3d2a22 42%, #1f3329 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero-glow {
  position: absolute; inset: -20% auto auto -10%;
  width: 70%; height: 70%;
  background: radial-gradient(circle, rgba(196,92,38,.45), transparent 65%);
  pointer-events: none;
}
.auth-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 90%);
  pointer-events: none;
}
.auth-hero-content { position: relative; z-index: 1; max-width: 28rem; margin-top: 18vh; }
.auth-kicker {
  margin: 0 0 1rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(248,241,231,.55);
}
.auth-display {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 400; line-height: 1.12; letter-spacing: -0.02em;
}
.auth-sub { margin: 1.1rem 0 0; color: rgba(248,241,231,.72); font-size: 1.02rem; max-width: 22rem; }
.auth-points {
  margin: 2rem 0 0; padding: 0; list-style: none;
  display: grid; gap: 0.55rem; color: rgba(248,241,231,.62); font-size: 0.9rem;
}
.auth-points li::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 0.55rem; vertical-align: middle;
}
.auth-ornament {
  position: relative; z-index: 1; width: min(320px, 70%); color: rgba(248,241,231,.7); margin-top: 2rem;
}

.auth-panel {
  display: grid; place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(600px 300px at 80% 0%, rgba(196,92,38,.08), transparent 60%),
    var(--paper);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem 1.6rem;
}
.brand-compact { margin-bottom: 1.75rem; }
.auth-title {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem; font-weight: 400; letter-spacing: -0.02em;
}
.auth-lead { margin: 0.4rem 0 1.35rem; color: var(--ink-2); }
.auth-footnote {
  margin: 1.25rem 0 0; text-align: center;
  font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: 280px; padding: 1.75rem; }
  .auth-hero-content { margin-top: 1.5rem; }
  .auth-display { font-size: 2.3rem; }
  .auth-ornament { display: none; }
  .bento { grid-template-columns: 1fr; }
  .roadmap .road-grid { grid-template-columns: 1fr 1fr; }
  .user-email { display: none; }
  .nav-soon:nth-child(n+3) { display: none; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 0.9rem; }
  .container { width: calc(100% - 1.25rem); }
  .page-hero { flex-direction: column; align-items: flex-start; }
  .roadmap .road-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
}

/* —— P1 Tasks —— */
.panel + .panel { margin-top: 1rem; }
.task-create-panel { min-height: 0; }
.task-create-form { display: grid; gap: 0.75rem; }
.task-list-panel { min-height: 0; }

textarea {
  width: 100%; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 0.95rem;
  resize: vertical; min-height: 4.5rem; line-height: 1.45;
}
textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
input[type=text] {
  width: 100%; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 0.95rem;
}
input[type=text]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}

.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.88rem; border-radius: 10px; }

.task-list { list-style: none; margin: 0; padding: 0; }
.task-item {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0;
}
.task-item:first-child { border-top: 0; padding-top: 0.15rem; }
.task-item.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.task-row {
  display: flex; align-items: flex-start; gap: 0.7rem;
}
.task-check-form { flex-shrink: 0; margin: 0; padding-top: 0.1rem; }
.task-check {
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: none; background: none; color: var(--line-strong);
  cursor: pointer; border-radius: 8px;
}
.task-check:hover { color: var(--ok); background: var(--ok-bg); }
.task-check.checked { color: var(--ok); }
.task-check.checked:hover { color: var(--muted); background: var(--paper-2); }

.task-body { flex: 1; min-width: 0; }
.task-title-line {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.task-title {
  font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em;
  word-break: break-word;
}
.task-note-preview {
  margin: 0.3rem 0 0;
  white-space: pre-wrap;
  color: var(--ink-2);
  font-size: 0.88rem;
  max-width: 40rem;
}
.task-meta { margin: 0.35rem 0 0; font-size: 0.78rem; }

.badge-overdue {
  display: inline-flex; align-items: center;
  padding: 0.12rem 0.45rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
}
.task-item.is-overdue {
  background: linear-gradient(90deg, rgba(196,92,38,0.06), transparent 60%);
  margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem;
  border-radius: 10px;
}

.task-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem;
  flex-shrink: 0;
}
.task-edit { position: relative; }
.task-edit > summary {
  list-style: none; cursor: pointer; user-select: none;
}
.task-edit > summary::-webkit-details-marker { display: none; }
.task-edit-form {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 20;
  width: min(340px, calc(100vw - 3rem));
  display: grid; gap: 0.65rem;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.task-edit-actions { display: flex; justify-content: flex-end; }

.quick-links {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}
.quick-card {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.quick-card:hover {
  text-decoration: none; border-color: var(--accent);
  transform: translateY(-1px);
}
.quick-card strong { font-size: 1rem; }
.quick-card span { font-size: 0.82rem; color: var(--muted); }

@media (max-width: 900px) {
  .quick-links { grid-template-columns: 1fr; }
  .task-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
  .task-edit-form { position: static; width: 100%; margin-top: 0.5rem; }
}
