:root {
  --bg: #f5ecdc;
  --surface: rgba(255, 249, 240, 0.82);
  --surface-strong: #fffdf8;
  --surface-soft: rgba(255, 244, 229, 0.86);
  --surface-dark: #1a2740;
  --surface-dark-soft: rgba(26, 39, 64, 0.08);
  --ink: #162238;
  --muted: #657188;
  --line: rgba(22, 34, 56, 0.12);
  --line-strong: rgba(22, 34, 56, 0.2);
  --orange: #d86a35;
  --orange-deep: #a94826;
  --blue: #3563b5;
  --green: #2f7f67;
  --gold: #ca8b2e;
  --rose: #c45c65;
  --danger: #a23f4c;
  --success: #216d54;
  --shadow-lg: 0 28px 70px rgba(24, 34, 54, 0.14);
  --shadow-md: 0 14px 36px rgba(24, 34, 54, 0.1);
  --radius-2xl: 34px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --font-ui: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-copy: "Iowan Old Style", "Palatino Linotype", serif;

  /* 字體大小系統 */
  --text-xs:   0.72rem;   /* eyebrow, section-label */
  --text-sm:   0.82rem;   /* badge, meta */
  --text-base: 0.96rem;   /* 內文 */
  --text-md:   1.08rem;   /* 小標 */
  --text-lg:   1.3rem;    /* 面板標題 */
  --text-xl:   1.56rem;   /* 卡片大數字 */
  --text-2xl:  clamp(1.45rem, 3vw, 2rem);   /* 月曆標題 */
  --text-hero: clamp(2.35rem, 6vw, 4.35rem); /* 英雄大標 */

  /* 間距系統 */
  --gap-xs:  6px;
  --gap-sm:  10px;
  --gap-md:  14px;
  --gap-lg:  18px;
  --gap-xl:  22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--ink);
  overflow: hidden;
  background: #f7efe0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; }

/* ─── 佈局殼層 ──────────────────────────────────── */

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell,
.auth-stage,
.page-stack,
.workspace-stage,
.studio-stack,
.column-stack,
.agenda-stack,
.stack-list {
  display: grid;
  gap: 10px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100dvh;
  gap: 0;
}

.app-main {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 10px 85px 10px;
  -webkit-overflow-scrolling: touch;
}

.page-stack,
.stack-list,
.panel,
.todo-mobile-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ─── Topbar ─────────────────────────────────────── */

.topbar {
  display: grid;
  gap: var(--gap-sm);
  padding: 10px;
}

.topbar-main,
.topbar-user,
.topbar-space {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: center;
}

.topbar-main {
  flex-wrap: nowrap;
  justify-content: space-between;
}

.topbar-main-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.topbar-user {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.topbar-user strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
}

.topbar .summary-label::before { display: none; }
.topbar .summary-label { gap: 0; }

.topbar-space {
  position: relative;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}

.topbar-space-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.topbar-manage-button {
  min-height: 34px;
  padding-inline: 11px;
  white-space: nowrap;
  font-size: var(--text-sm);
}

.topbar-space-label { flex: 0 0 auto; }

.topbar-space-picker {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 50%, rgba(22, 34, 56, 0.66) 50%),
    linear-gradient(135deg, rgba(22, 34, 56, 0.66) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 242, 232, 0.92));
  background-position: calc(100% - 20px) 18px, calc(100% - 14px) 18px, 0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.topbar-space-picker.active {
  border-color: rgba(53, 99, 181, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 3px rgba(53, 99, 181, 0.08);
}

.topbar-space-picker span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── 空間切換彈出選單 ─────────────────────────────── */

.workspace-switcher-popover,
.workspace-switcher-list {
  display: grid;
  gap: 10px;
}

.workspace-switcher-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  right: auto;
  width: min(360px, calc(100vw - 24px));
  transform: translateX(-50%);
  z-index: 16;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 20px 48px rgba(20, 30, 48, 0.16);
  backdrop-filter: blur(18px);
}

.workspace-switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.workspace-switcher-item.active {
  border-color: rgba(53, 99, 181, 0.26);
  background: rgba(232, 239, 255, 0.86);
}

.workspace-switcher-name { font-weight: 600; }

.workspace-switcher-meta {
  color: var(--muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.workspace-switcher-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* ─── 卡片 / 面板基礎 ─────────────────────────────── */

.masthead,
.hero-panel,
.panel,
.command-card,
.identity-card,
.workspace-command,
.studio-panel,
.notice-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.masthead,
.hero-panel,
.workspace-command {
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: var(--gap-lg);
  padding: 28px;
  background: linear-gradient(145deg, rgba(255, 247, 233, 0.96) 0%, rgba(255, 249, 240, 0.78) 100%);
}

.masthead-copy,
.auth-hero-copy {
  display: grid;
  gap: var(--gap-md);
  align-content: start;
}

.masthead h1,
.hero-panel h1,
.workspace-command h2 {
  margin: 0;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.masthead h1,
.hero-panel h1 {
  font-size: clamp(2rem, 10vw, 2.9rem);
}

.workspace-command h2 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
}

/* ─── 文字樣式 ───────────────────────────────────── */

.lede,
.workspace-copy,
.member-note,
.access-preview p {
  margin: 0;
  font-family: var(--font-copy);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--muted);
}

.eyebrow,
.summary-label,
.section-label,
.notice-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--text-xs);
  color: var(--muted);
}

.eyebrow::before,
.summary-label::before,
.section-label::before,
.notice-label::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* ─── 格線佈局 ───────────────────────────────────── */

.masthead-meta,
.auth-grid,
.onboarding-grid,
.workspace-columns,
.planner-grid,
.tasks-grid {
  display: grid;
  gap: var(--gap-lg);
}

.masthead-meta { align-content: start; }

.auth-grid,
.onboarding-grid,
.workspace-columns,
.planner-grid,
.tasks-grid {
  grid-template-columns: 1fr;
}

/* ─── 卡片種類 ───────────────────────────────────── */

.identity-card,
.command-card,
.panel,
.studio-panel {
  border-radius: var(--radius-xl);
  padding: 16px;
}

.identity-card {
  display: grid;
  gap: var(--gap-sm);
  background: linear-gradient(180deg, rgba(25, 39, 64, 0.98) 0%, rgba(38, 56, 89, 0.92) 100%);
  color: #fff8ee;
}

.identity-card p { margin: 0; color: rgba(255, 248, 238, 0.72); }
.identity-card .summary-label { color: rgba(255, 248, 238, 0.72); }
.identity-card strong { font-size: var(--text-xl); }

.command-card {
  background: linear-gradient(180deg, rgba(255, 249, 239, 0.98) 0%, rgba(255, 245, 231, 0.8) 100%);
}

/* ─── Flex 工具列 ────────────────────────────────── */

.hero-actions,
.toolbar,
.action-row,
.command-row,
.member-actions,
.filter-row,
.meta-row,
.day-summary-pills,
.calendar-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: center;
}

.hero-actions {
  justify-content: space-between;
  flex-direction: column;
  align-items: stretch;
}

.toolbar,
.action-row,
.command-row,
.filter-row { width: 100%; }

.toolbar {
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar > * {
  flex: 0 0 auto;
  min-width: 86px;
  white-space: nowrap;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
}

.action-row > * { width: 100%; }

.calendar-meta-row { display: none; }

/* ─── 診斷 / debug ───────────────────────────────── */

.auth-debug {
  width: 100%;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--muted);
  word-break: break-word;
}

.auth-diagnostic-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(53, 99, 181, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.auth-diagnostic-card p,
.auth-diagnostic-card code { margin: 0; }

.auth-diagnostic-card code {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
  word-break: break-word;
}

/* ─── 表單欄位 ───────────────────────────────────── */

.command-grid { display: grid; gap: var(--gap-md); }

.select-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.select-field span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.select-field-wide { width: 100%; }

.select-field select,
.inline-form input,
.inline-form select,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  color: var(--ink);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.select-field select:focus,
.inline-form input:focus,
.inline-form select:focus {
  outline: 2px solid rgba(53, 99, 181, 0.2);
  outline-offset: 1px;
}

/* ─── 按鈕系統 ───────────────────────────────────── */

.primary-link,
.secondary-link,
.ghost-button,
.danger-button,
.tab,
.calendar-day,
.filter-chip {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.primary-link,
.secondary-link,
.ghost-button,
.danger-button,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  font-weight: 700;
  font-size: var(--text-base);
}

.primary-link {
  color: #fff7ef;
  border-color: rgba(216, 106, 53, 0.4);
  background: linear-gradient(135deg, var(--orange) 0%, #ea9d38 100%);
  box-shadow: 0 8px 20px rgba(216, 106, 53, 0.24);
}

.secondary-link {
  color: #fffaf1;
  background: linear-gradient(135deg, #1f3459 0%, #2c4d83 100%);
}

.ghost-button {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.danger-button {
  color: var(--danger);
  border-color: rgba(162, 63, 76, 0.18);
  background: rgba(162, 63, 76, 0.1);
}

.primary-link:hover,
.secondary-link:hover,
.ghost-button:hover,
.danger-button:hover,
.tab:hover,
.filter-chip:hover,
.calendar-day:hover {
  transform: translateY(-1px);
}

/* ─── 標籤 / 徽章 / Chip ─────────────────────────── */

.status-chip,
.pill,
.workspace-token,
.role-badge,
.meta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: var(--text-sm);
}

.status-chip { color: var(--muted); }

.meta-badge {
  min-height: auto;
  background: rgba(22, 34, 56, 0.05);
  color: var(--muted);
  font-size: var(--text-xs);
  padding: 4px 9px;
}

/* ─── 優先級色彩 ─────────────────────────────────── */

.priority-high   { background: rgba(196, 92, 101, 0.12); color: var(--danger); }
.priority-medium { background: rgba(202, 139, 46, 0.12);  color: #986418; }
.priority-low    { background: rgba(47, 127, 103, 0.12);  color: var(--green); }

.status-todo { background: rgba(53, 99, 181, 0.12); color: var(--blue); }
.status-done { background: rgba(47, 127, 103, 0.12); color: var(--green); }

/* ─── Toast 通知 ─────────────────────────────────── */

.toast-notice {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 40;
  width: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(15, 24, 38, 0.16);
  backdrop-filter: blur(20px);
  transform: none;
  animation: toast-in 160ms ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast-notice strong {
  font-size: var(--text-sm);
  font-weight: 600;
}

.toast-notice.success {
  border-color: rgba(33, 109, 84, 0.22);
  background: rgba(236, 250, 244, 0.94);
  color: var(--success);
}

.toast-notice.error {
  border-color: rgba(162, 63, 76, 0.24);
  background: rgba(255, 239, 242, 0.94);
  color: var(--danger);
}

.toast-notice.info {
  border-color: rgba(53, 99, 181, 0.22);
  background: rgba(238, 245, 255, 0.94);
  color: var(--blue);
}

/* ─── 認證英雄 ───────────────────────────────────── */

.auth-hero {
  padding: 30px;
  background: linear-gradient(140deg, rgba(255, 250, 241, 0.95) 0%, rgba(255, 240, 224, 0.84) 100%);
}

/* ─── 項目列表 ───────────────────────────────────── */

.point-list { display: grid; gap: 10px; }

.point-item,
.access-preview,
.mini-stat,
.metric-card,
.list-block,
.member-card,
.invite-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-md);
}

.point-item,
.access-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--gap-md);
  align-items: start;
  padding: 14px 16px;
  border-radius: 20px;
}

.point-item strong,
.access-preview strong,
.member-card strong,
.list-block strong,
.event-row strong,
.todo-copy strong,
.invite-card strong {
  display: block;
  margin-bottom: 4px;
}

.point-item p,
.access-preview p,
.event-row p,
.todo-copy p,
.member-head span,
.page-list li,
.empty-state {
  margin: 0;
  color: var(--muted);
}

.point-icon,
.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.point-icon { margin-top: 6px; }

.dot.amber, .point-icon.amber { background: var(--gold); }
.dot.blue,  .point-icon.blue  { background: var(--blue); }
.dot.green, .point-icon.green { background: var(--green); }
.dot.rose   { background: var(--rose); }
.dot.slate  { background: #6e7e95; }
.dot.violet { background: #8c62d6; }

/* ─── 頁面列表 ───────────────────────────────────── */

.page-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.numbered-list li { padding-left: 4px; }

/* ─── 空間指令卡 ─────────────────────────────────── */

.workspace-command {
  padding: 26px;
  background: linear-gradient(145deg, rgba(255, 247, 233, 0.96) 0%, rgba(255, 250, 242, 0.82) 100%);
}

.workspace-headline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: stretch;
  flex-direction: column;
}

.workspace-token {
  align-self: start;
  font-weight: 700;
}

.workspace-token.personal { background: rgba(202, 139, 46, 0.12); color: #8b5b12; }
.workspace-token.shared   { background: rgba(53, 99, 181, 0.12);  color: var(--blue); }

/* ─── KPI / 統計格線 ─────────────────────────────── */

.workspace-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: var(--gap-xl);
}

.metric-card,
.mini-stat {
  border-radius: 18px;
  padding: 14px 16px;
}

.metric-card span,
.mini-stat span { color: var(--muted); }

.metric-card strong,
.mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: var(--text-xl);
  line-height: 1.05;
}

.metric-card small,
.mini-stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.workspace-alert {
  margin-top: var(--gap-lg);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(53, 99, 181, 0.15);
  background: rgba(238, 245, 255, 0.82);
  color: var(--blue);
  font-size: var(--text-sm);
}

/* ─── 空間詳細佈局 ───────────────────────────────── */

.workspace-hub,
.workspace-detail-grid {
  display: grid;
  gap: var(--gap-md);
}

.workspace-strip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.84);
  box-shadow: var(--shadow-md);
  flex-direction: column;
}

.workspace-strip-main,
.workspace-strip-actions { display: grid; gap: 8px; }

.workspace-strip-top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: center;
}

.workspace-strip-top strong { font-size: var(--text-md); }

.workspace-inline-metrics {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.workspace-inline-metrics::-webkit-scrollbar { display: none; }

.workspace-inline-metrics .meta-badge { flex: none; }

.workspace-strip-actions { justify-items: stretch; }

.compact-select { min-width: min(240px, 100%); }
.compact-select select { min-height: 40px; padding: 8px 12px; }

.month-picker-field { min-width: 170px; }

.workspace-detail-grid {
  grid-template-columns: 1fr;
}

/* ─── Studio 面板 ────────────────────────────────── */

.studio-panel { padding: 16px; }

.studio-panel--accent {
  background: linear-gradient(180deg, rgba(238, 245, 255, 0.92) 0%, rgba(248, 251, 255, 0.82) 100%);
}

.studio-panel--warm {
  background: linear-gradient(180deg, rgba(255, 243, 227, 0.94) 0%, rgba(255, 249, 240, 0.82) 100%);
}

/* ─── Panel head ─────────────────────────────────── */

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-head {
  margin-top: -2px;
  margin-bottom: 10px;
}

.panel-head h2,
.list-block-head strong,
.day-summary h2 {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.15;
}

.panel-head > div { display: grid; gap: 5px; }

.panel-head span,
.list-block-head span,
.member-head span,
.weekdays span { color: var(--muted); }

/* ─── 成員 ───────────────────────────────────────── */

.member-grid { display: grid; gap: 8px; grid-template-columns: 1fr; }
.member-list { display: grid; gap: 8px; }

.member-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
}

.member-list-copy,
.member-inline-copy { display: grid; gap: 3px; }

.member-list-copy span,
.member-inline-copy span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.member-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.member-inline-panel { display: grid; gap: 10px; padding-top: 4px; }

.member-card {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.member-card-top,
.access-preview-head,
.invite-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: stretch;
  flex-direction: column;
}

.member-card-top {
  flex-direction: row;
  align-items: center;
}

.member-card .role-badge { align-self: auto; }

.member-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.member-head strong,
.member-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge { font-weight: 700; font-size: var(--text-xs); }
.role-owner  { background: rgba(202, 139, 46, 0.14); color: #8b5b12; }
.role-editor { background: rgba(53, 99, 181, 0.12);  color: var(--blue); }
.role-viewer { background: rgba(47, 127, 103, 0.12); color: var(--green); }

/* ─── 邀請碼 ─────────────────────────────────────── */

.invite-grid { display: grid; gap: 10px; }
.studio-stack { display: grid; gap: var(--gap-md); }

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: var(--text-sm);
}

.settings-tab.active {
  border-color: rgba(53, 99, 181, 0.2);
  background: rgba(53, 99, 181, 0.1);
  color: var(--ink);
  font-weight: 700;
}

.compact-button[disabled] { opacity: 0.7; }

.share-link-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.helper-copy {
  display: grid;
  gap: 6px;
}

.helper-copy strong {
  color: var(--ink);
  font-size: var(--text-sm);
}

.share-link-url {
  color: var(--blue);
  font-size: var(--text-sm);
  line-height: 1.6;
  word-break: break-all;
  text-decoration: none;
}

.share-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-form { align-items: stretch; }

.invite-card {
  border-radius: 18px;
  padding: 14px 16px;
}

.invite-code {
  font-size: var(--text-md);
  letter-spacing: 0.1em;
}

.home-hero,
.home-section-panel,
.todo-mobile-shell {
  display: grid;
  gap: var(--gap-md);
}

.home-overview-shell,
.home-list-shell { display: grid; gap: 10px; }

.home-overview-head { display: grid; gap: 5px; }

.home-overview-head h2 {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.1;
}

.home-overview-head span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.home-overview-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.home-overview-card-grid { display: grid; gap: 8px; }

.home-overview-card {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
}

.home-overview-card span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.home-overview-card strong {
  font-size: var(--text-base);
  line-height: 1.28;
}

.home-overview-card small {
  color: var(--muted);
  font-size: var(--text-xs);
}

.home-list-head { margin-bottom: 0; }

.owner-tools-panel { display: grid; gap: 10px; }
.owner-tools-actions { display: grid; gap: 8px; }
.owner-tools-note { margin: 0; color: var(--muted); font-size: var(--text-sm); }

.management-panel-intro .panel-head span { max-width: 42rem; }

.home-hero-copy { display: grid; gap: 6px; }

/* ─── 待辦行動列 (手機) ──────────────────────────── */

.todo-mobile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.todo-mobile-head > div { display: grid; gap: 3px; min-width: 0; }

.todo-mobile-head h2 {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.12;
}

.todo-mobile-head span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.todo-mobile-add-button {
  flex: none;
  min-height: 34px;
  padding-inline: 14px;
  font-size: var(--text-sm);
}

.todo-summary-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.todo-summary-strip::-webkit-scrollbar { display: none; }

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(22, 34, 56, 0.05);
  color: var(--muted);
  font-size: var(--text-sm);
  flex: none;
}

.summary-pill strong {
  color: var(--ink);
  font-size: var(--text-sm);
}

.filter-row-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-row-scroll::-webkit-scrollbar { display: none; }

/* ─── 面板種類 ───────────────────────────────────── */

.editor-panel,
.calendar-panel,
.inspector-panel,
.panel,
.studio-panel { display: grid; gap: 10px; }

/* ─── 行事曆佈局 ─────────────────────────────────── */

.calendar-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  align-items: start;
}

.list-block {
  border-radius: 18px;
  padding: 12px;
}

.list-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.list-block-head strong { font-size: var(--text-base); font-weight: 700; }
.list-block-head span   { font-size: var(--text-sm); }

/* ─── 行程列 / 待辦列 ────────────────────────────── */

.event-row,
.todo-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.row-copy,
.todo-copy { min-width: 0; display: grid; gap: 6px; }

.row-title-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.row-title-line strong,
.todo-copy strong { line-height: 1.3; font-size: var(--text-base); }

/* ─── 手機殼層 ───────────────────────────────────── */

.todo-mobile-shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  align-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.todo-mobile-shell .section-label {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
}

.todo-mobile-shell .filter-row {
  gap: 8px;
  margin-top: 2px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.todo-mobile-shell .filter-chip {
  min-height: 32px;
  padding-inline: 11px;
  font-size: var(--text-sm);
}

.todo-mobile-shell .filter-chip span {
  min-width: 18px;
  height: 18px;
  font-size: var(--text-xs);
}

.todo-mobile-shell .stack-list {
  display: grid;
  gap: 8px;
  align-content: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ─── Compact 行 ─────────────────────────────────── */

.todo-row.compact-row {
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}

.todo-row.compact-row .todo-copy { gap: 5px; }

.todo-row.compact-row .todo-copy strong {
  font-size: var(--text-base);
  line-height: 1.25;
  margin-bottom: 0;
}

.todo-row.compact-row .meta-row { gap: 5px; }

.todo-row.compact-row .meta-badge {
  padding: 3px 7px;
  font-size: var(--text-xs);
}

.todo-row.compact-row .row-toolbar { gap: 5px; }

.todo-row.compact-row .row-toolbar .ghost-button,
.todo-row.compact-row .row-toolbar .danger-button,
.todo-row.compact-row .row-toolbar .secondary-link {
  min-height: 32px;
  padding-inline: 11px;
  font-size: var(--text-sm);
}

.compact-empty-state {
  padding: 10px 14px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.meta-row { display: flex; flex-wrap: wrap; gap: 6px; }

.selected-row {
  border-color: rgba(53, 99, 181, 0.3);
  box-shadow: inset 0 0 0 1px rgba(53, 99, 181, 0.15);
}

.warning-row {
  border-color: rgba(202, 139, 46, 0.26);
  background: rgba(255, 248, 238, 0.96);
}

.done { opacity: 0.65; }

/* ─── 行事曆工具列 ───────────────────────────────── */

.calendar-toolbar,
.calendar-month-group,
.calendar-month-copy,
.calendar-head-actions { display: grid; gap: var(--gap-md); }

.calendar-toolbar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.calendar-month-group {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.calendar-month-copy {
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
  justify-items: center;
  text-align: center;
}

.calendar-month-copy h2 {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.15;
}

.calendar-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.calendar-nav-button:hover { transform: translateY(-1px); }

.calendar-head-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.calendar-head-actions .secondary-link {
  width: auto;
  min-width: 120px;
}

.agenda-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: stretch;
  width: 100%;
}

.agenda-actions .secondary-link,
.agenda-actions .ghost-button { width: 100%; }

/* ─── 月曆格線 ───────────────────────────────────── */

.calendar-frame {
  overflow: hidden;
  border: 1px solid rgba(22, 34, 56, 0.1);
  border-radius: 20px;
  background: rgba(22, 34, 56, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}

.weekdays span {
  padding: 7px 2px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.calendar-day {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 3px;
  min-height: 70px;
  padding: 6px 4px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover {
  transform: none;
  background: #f6f9ff;
}

.calendar-day-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.calendar-date-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
}

.calendar-day-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(22, 34, 56, 0.08);
  color: var(--muted);
  font-size: 0.62rem;
}

.calendar-day small {
  margin-top: auto;
  color: rgba(101, 113, 136, 0.72);
  font-size: var(--text-xs);
}

.calendar-snippets {
  display: grid;
  gap: 4px;
  width: 100%;
}

.calendar-snippet {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 0.62rem;
  line-height: 1.3;
  background: rgba(22, 34, 56, 0.06);
  color: var(--ink);
}

.calendar-snippet.event {
  background: rgba(245, 188, 63, 0.26);
  border-left: 3px solid rgba(222, 159, 18, 0.9);
}

.calendar-snippet.event.tone-blue   { background: rgba(152, 182, 244, 0.25); border-left: 3px solid rgba(53, 99, 181, 0.72); }
.calendar-snippet.event.tone-amber  { background: rgba(245, 188, 63, 0.26);  border-left: 3px solid rgba(222, 159, 18, 0.9); }
.calendar-snippet.event.tone-green  { background: rgba(103, 187, 155, 0.22); border-left: 3px solid rgba(47, 127, 103, 0.82); }
.calendar-snippet.event.tone-rose   { background: rgba(220, 162, 187, 0.22); border-left: 3px solid rgba(180, 89, 120, 0.78); }
.calendar-snippet.event.tone-slate  { background: rgba(171, 184, 203, 0.22); border-left: 3px solid rgba(91, 108, 134, 0.78); }
.calendar-snippet.event.tone-violet { background: rgba(195, 174, 235, 0.24); border-left: 3px solid rgba(140, 98, 214, 0.82); }
.calendar-snippet.todo { background: rgba(152, 182, 244, 0.25); border-left: 3px solid rgba(53, 99, 181, 0.72); }

.calendar-more {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.6rem;
}

.calendar-snippets .calendar-snippet:nth-child(n + 2) { display: none; }

.calendar-day.active          { background: #f4f7ff; }
.calendar-day.active .calendar-date-pill { background: var(--blue); color: #fff; }
.calendar-day.active small    { color: var(--muted); }

.calendar-day.today { box-shadow: inset 0 0 0 2px rgba(53, 99, 181, 0.18); }
.calendar-day.today .calendar-date-pill { box-shadow: inset 0 0 0 2px rgba(53, 99, 181, 0.3); }

.calendar-day.muted { background: rgba(251, 251, 252, 0.98); color: rgba(101, 113, 136, 0.6); }

/* ─── 日程摘要 ───────────────────────────────────── */

.day-summary {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-md);
  align-items: stretch;
  flex-direction: column;
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(255, 244, 229, 0.98) 0%, rgba(255, 249, 240, 0.84) 100%);
}

.day-summary h2 {
  margin-top: 6px;
  font-size: 1.5rem;
  line-height: 1.04;
}

.pill {
  border-color: rgba(22, 34, 56, 0.09);
  background: rgba(255, 255, 255, 0.72);
}

/* ─── Tab Dock ───────────────────────────────────── */

.tab-dock {
  display: flex;
  gap: 8px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  padding: 10px 10px calc(20px + env(safe-area-inset-bottom)) 10px;
  border: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: rgba(255, 249, 240);
  overflow-x: auto;
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  border-color: transparent;
  color: var(--ink);
  background: transparent;
  font-size: var(--text-base);
}

.tab.active {
  color: #fff8ef;
  background: linear-gradient(135deg, #1f3459 0%, #2c4d83 100%);
  box-shadow: 0 8px 20px rgba(31, 52, 89, 0.2);
}

/* ─── Overlay / Sheet ────────────────────────────── */

.overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(14, 22, 38, 0.46);
  backdrop-filter: blur(3px);
  pointer-events: auto;
  cursor: default;
}

.overlay-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, calc(100% - 16px));
  max-height: min(92vh, 920px);
  overflow: hidden;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.97);
  box-shadow: 0 28px 72px rgba(12, 20, 32, 0.28);
  pointer-events: auto;
  animation: sheet-in 180ms ease;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.overlay-sheet::before { display: none; }

.agenda-sheet    { width: min(500px, calc(100% - 20px)); }
.workspace-sheet { width: min(720px, calc(100% - 20px)); }

.overlay-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.agenda-sheet-head,
.workspace-sheet-head,
.agenda-sheet-actions,
.agenda-sheet-body,
.workspace-sheet-body,
.workspace-sheet-main { display: grid; gap: 10px; }

.agenda-sheet-actions {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.workspace-hub--overlay .workspace-strip { box-shadow: none; }

/* ─── Row toolbar ────────────────────────────────── */

.row-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }

.row-toolbar .ghost-button,
.row-toolbar .secondary-link {
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--text-sm);
}

/* ─── Compact button (통용) ──────────────────────── */

.compact-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.8);
}

/* ─── Sheet close button ─────────────────────────── */

.sheet-close {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 999px;
  flex: none;
}

/* ─── Overlay head / body ────────────────────────── */

.overlay-head,
.overlay-body { display: grid; gap: 12px; }

.overlay-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 14px 11px;
  border-bottom: 1px solid rgba(22, 34, 56, 0.08);
  background: rgba(255, 250, 242, 0.97);
}

.overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px;
}

.overlay-head h2 {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.15;
}

.overlay-head span { color: var(--muted); font-size: var(--text-sm); }

.overlay-day-summary {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-md);
  align-items: center;
}

.overlay-list-block { box-shadow: none; }

/* ─── 表單格線 ───────────────────────────────────── */

.inline-form,
.editor-form,
.form-grid,
.field { display: grid; gap: 10px; }

.is-hidden { display: none !important; }

.inline-form,
.invite-form,
.form-grid.two-up { grid-template-columns: 1fr; }

.field span { color: var(--muted); font-size: var(--text-sm); }

/* ─── 事件模式切換 ───────────────────────────────── */

.event-mode-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.event-mode-toggle input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.event-mode-toggle span  { font-weight: 700; color: var(--ink); }

.event-mode-toggle small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: var(--text-sm);
}

.event-mode-toggle + .form-grid { margin-top: -2px; }

/* ─── 選擇 Chip ──────────────────────────────────── */

.choice-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-chip-group legend {
  width: 100%;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.choice-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.choice-chip:disabled { cursor: default; opacity: 0.55; }

.choice-chip.active { border-color: transparent; color: #fff8ef; }
.choice-chip.active.priority-low    { background: linear-gradient(135deg, #5d8f7b 0%, #467360 100%); }
.choice-chip.active.priority-medium { background: linear-gradient(135deg, #ca8b2e 0%, #a66d1d 100%); }
.choice-chip.active.priority-high   { background: linear-gradient(135deg, #c66c5b 0%, #a74d3d 100%); }

/* ─── 停用狀態 ───────────────────────────────────── */

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  color: var(--muted);
  background: rgba(22, 34, 56, 0.04);
}

/* ─── Filter Chip ────────────────────────────────── */

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  border-radius: var(--radius-pill);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.58);
  padding: 8px 13px;
  color: var(--ink);
  white-space: nowrap;
  font-size: var(--text-sm);
}

.filter-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(22, 34, 56, 0.08);
  color: var(--muted);
  font-size: var(--text-xs);
}

.filter-chip.active {
  color: #fff8ef;
  border-color: transparent;
  background: linear-gradient(135deg, #1f3459 0%, #2c4d83 100%);
}

.filter-chip.active span {
  color: #fff8ef;
  background: rgba(255, 255, 255, 0.16);
}

/* ─── Calendar Chip ──────────────────────────────── */

.calendar-chip { border-width: 1px; }
.calendar-chip.tone-blue   { border-color: rgba(53, 99, 181, 0.22); }
.calendar-chip.tone-amber  { border-color: rgba(202, 139, 46, 0.24); }
.calendar-chip.tone-green  { border-color: rgba(47, 127, 103, 0.24); }
.calendar-chip.tone-rose   { border-color: rgba(180, 89, 120, 0.22); }
.calendar-chip.tone-slate  { border-color: rgba(91, 108, 134, 0.24); }
.calendar-chip.tone-violet { border-color: rgba(140, 98, 214, 0.22); }

.calendar-chip.active.tone-blue   { background: linear-gradient(135deg, #244782 0%, #4972b2 100%); }
.calendar-chip.active.tone-amber  { background: linear-gradient(135deg, #9c6a1d 0%, #c89231 100%); }
.calendar-chip.active.tone-green  { background: linear-gradient(135deg, #225b49 0%, #2f7f67 100%); }
.calendar-chip.active.tone-rose   { background: linear-gradient(135deg, #8e4b63 0%, #bb6d8b 100%); }
.calendar-chip.active.tone-slate  { background: linear-gradient(135deg, #4d5d74 0%, #6e7e95 100%); }
.calendar-chip.active.tone-violet { background: linear-gradient(135deg, #6b45ad 0%, #8c62d6 100%); }

/* ─── Calendar Admin ─────────────────────────────── */

.calendar-category-strip,
.calendar-admin-list { display: grid; gap: 10px; }

.calendar-category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.calendar-category-strip::-webkit-scrollbar { display: none; }

.calendar-category-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.calendar-admin-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.calendar-admin-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.calendar-admin-card span:last-child { color: var(--muted); font-size: var(--text-sm); }

.calendar-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.calendar-color-dot.tone-blue,
.calendar-badge.tone-blue   { background: rgba(53, 99, 181, 0.14);  color: #244782; }

.calendar-color-dot.tone-amber,
.calendar-badge.tone-amber  { background: rgba(202, 139, 46, 0.16); color: #8b5b12; }

.calendar-color-dot.tone-green,
.calendar-badge.tone-green  { background: rgba(47, 127, 103, 0.16); color: #225b49; }

.calendar-color-dot.tone-rose,
.calendar-badge.tone-rose   { background: rgba(180, 89, 120, 0.16); color: #8e4b63; }

.calendar-color-dot.tone-slate,
.calendar-badge.tone-slate  { background: rgba(91, 108, 134, 0.16); color: #4d5d74; }

.calendar-color-dot.tone-violet,
.calendar-badge.tone-violet { background: rgba(140, 98, 214, 0.16); color: #6b45ad; }

/* ─── 空白狀態 ───────────────────────────────────── */

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
  line-height: 1.55;
}

.muted-copy { color: var(--muted); }

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(22, 34, 56, 0.08);
  font-size: 0.92em;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
