:root {
  color-scheme: dark;
  --bg: #0f1729;
  --bg-grad: radial-gradient(ellipse at top, #1a2340 0%, #0f1729 55%, #0a0f1f 100%);
  --surface: #1a2340;
  --surface-hi: #243050;
  --surface-lo: #141b33;
  --border: #2d3a5c;
  --border-hi: #3d4d72;

  --text: #e8e4d4;
  --text-dim: #b8b5a5;
  --text-muted: #8a96b5;

  --accent: #d4a94a;
  --accent-hi: #f0c870;
  --accent-dim: #8a6f2f;

  --status-draft: #6b7590;
  --status-tentative: #d4a94a;
  --status-checking: #e07b3e;
  --status-ready: #5b8fd9;
  --status-done: #6ab368;

  --type-announce: #d97a8a;
  --type-stream:   #a87bd4;
  --type-release:  #4abfa5;
  --type-other:    #8a96b5;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,.2);
  --shadow: 0 6px 20px rgba(0,0,0,.35);
  --shadow-hi: 0 10px 40px rgba(0,0,0,.5);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-grad);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(212,169,74,.3), transparent),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,.25), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 15% 70%, rgba(212,169,74,.2), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26,35,64,.8), rgba(15,23,41,.6));
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border-radius: 12px;
  font-size: 22px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.2);
}
.brand-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; letter-spacing: 0.02em; }
.brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.15em; text-transform: uppercase; margin-top: 2px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn:hover { background: var(--surface-hi); border-color: var(--border-hi); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border-color: var(--accent);
  color: #1a1406;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { color: var(--type-announce); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(20,27,51,.5);
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}
.tab {
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--accent-hi); border-bottom-color: var(--accent); }
.tab-badge {
  background: var(--surface-hi);
  color: var(--text-dim);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.tab.active .tab-badge { background: var(--accent-dim); color: var(--accent-hi); }

/* Main */
.main { flex: 1; min-height: 0; position: relative; z-index: 1; overflow: hidden; }
.tab-panel { display: none; height: 100%; overflow-y: auto; padding: 28px 32px 48px; }
.tab-panel.active { display: block; }

/* Loading / empty / error states */
.state-card {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.state-card .state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.state-card.error { color: var(--type-announce); }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Timeline */
.timeline-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.timeline-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.timeline-nav {
  display: flex; gap: 4px; align-items: center;
  background: var(--surface); padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.timeline-nav button {
  background: transparent; border: none;
  color: var(--text-dim);
  padding: 6px 10px; border-radius: 4px;
  cursor: pointer; font-family: inherit; font-size: 13px;
}
.timeline-nav button:hover { background: var(--surface-hi); color: var(--text); }
.timeline-nav .range-label { padding: 0 12px; font-size: 13px; color: var(--text); min-width: 140px; text-align: center; }

.legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.legend-group { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.legend-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

.timeline {
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 700px;
}
.timeline-scroll { overflow-x: auto; }

.timeline-header-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.timeline-corner {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-right: 1px solid var(--border);
}
.date-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); }
.date-cell { text-align: center; padding: 8px 4px; font-size: 12px; color: var(--text-muted); border-right: 1px solid var(--border); }
.date-cell:last-child { border-right: none; }
.date-cell.today { background: rgba(212,169,74,.1); color: var(--accent-hi); font-weight: 600; }
.date-cell.weekend { color: var(--type-announce); opacity: 0.7; }
.date-cell .dow { font-size: 10px; opacity: 0.7; margin-top: 2px; }

.timeline-row {
  display: grid; grid-template-columns: 240px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.timeline-row:last-child { border-bottom: none; }
.timeline-row:hover { background: rgba(36,48,80,.3); }
.row-label {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.row-label .row-title { font-size: 13px; font-weight: 500; }
.row-label .row-sub { font-size: 11px; color: var(--text-muted); }
.row-label.milestone .row-title { color: var(--accent-hi); font-weight: 600; }
.row-label.milestone { border-left: 3px solid var(--accent); }

.row-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(52px, 1fr);
}
.row-track .day-slot { border-right: 1px solid var(--border); position: relative; }
.row-track .day-slot:last-child { border-right: none; }
.row-track .day-slot.today { background: rgba(212,169,74,.06); }
.row-track .day-slot.weekend { background: rgba(217,122,138,.04); }

.bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
  overflow: hidden;
}
.bar:hover {
  transform: translateY(-50%) translateY(-2px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.2);
  z-index: 2;
}
/* イベントバーは JS が top を絶対値で指定する（レーン分割のため）→
   .bar の top:50% / translateY(-50%) を打ち消す */
.bar.event {
  transform: none;
  height: 24px;
  font-size: 11px;
}
.bar.event:hover {
  transform: translateY(-2px);
}

.bar.campaign {
  background: linear-gradient(135deg, rgba(212,169,74,.3), rgba(212,169,74,.15));
  border: 1px solid rgba(212,169,74,.6);
  color: var(--accent-hi);
  height: 28px;
  font-family: var(--font-serif);
  letter-spacing: 0.05em;
}
.bar.campaign.draft {
  background: linear-gradient(135deg, rgba(138,150,181,.2), rgba(138,150,181,.08));
  border: 1px dashed rgba(138,150,181,.5);
  color: var(--text-dim);
}
.bar.campaign.done { filter: saturate(0.5) brightness(0.7); }
.bar.campaign .bar-icon.strategy-badge {
  background: rgba(0,0,0,.2);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9px;
  letter-spacing: 0.1em;
  font-family: var(--font-sans);
}

.bar.event { color: #fff; }
.bar.event.announce { background: linear-gradient(135deg, #d97a8a, #b5536a); }
.bar.event.stream   { background: linear-gradient(135deg, #a87bd4, #7d52b0); }
.bar.event.release  { background: linear-gradient(135deg, #4abfa5, #2d9680); }
.bar.event.other    { background: linear-gradient(135deg, #8a96b5, #606d8b); }
.bar.event.draft     { opacity: 0.45; border-style: dashed; }
.bar.event.tentative { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px var(--status-tentative); }
.bar.event.checking  { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px var(--status-checking); animation: pulse 2s ease-in-out infinite; }
.bar.event.ready     { filter: saturate(1.2); }
.bar.event.done      { filter: saturate(0.5) brightness(0.75); }

@keyframes pulse {
  0%, 100% { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px var(--status-checking); }
  50% { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px var(--status-checking), 0 0 14px rgba(224,123,62,.6); }
}

.bar-icon { font-size: 14px; flex-shrink: 0; }

.milestone-flag {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  color: #1a1406;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow);
  border: 2px solid var(--accent-hi);
  z-index: 3;
  cursor: pointer;
}

/* Today */
.today-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) { .today-grid { grid-template-columns: 1fr; } }

.section-card {
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.section-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-count { font-size: 11px; color: var(--text-muted); background: var(--surface-lo); padding: 2px 8px; border-radius: 10px; }
.section-body { padding: 8px; }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  transition: background 0.1s;
}
.task-card:hover { background: var(--surface); }
.task-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border-hi);
  border-radius: 6px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--status-done); border-color: var(--status-done); }
.task-check.checked::after { content: '✓'; color: #fff; font-size: 14px; font-weight: bold; }
.task-body { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.task-title.done { text-decoration: line-through; color: var(--text-muted); }
.task-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  background: var(--surface-hi);
  border-radius: 4px;
  font-size: 11px;
}
.tag.announce { color: var(--type-announce); background: rgba(217,122,138,.12); }
.tag.stream   { color: var(--type-stream); background: rgba(168,123,212,.12); }
.tag.release  { color: var(--type-release); background: rgba(74,191,165,.12); }
.tag.other    { color: var(--type-other); background: rgba(138,150,181,.12); }

.alert-card {
  margin: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(224,123,62,.12), rgba(224,123,62,.06));
  border: 1px solid rgba(224,123,62,.3);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-icon { font-size: 18px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; color: var(--status-checking); font-size: 13px; margin-bottom: 2px; }
.alert-desc { font-size: 12px; color: var(--text-dim); }

/* AI view */
.ai-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) { .ai-layout { grid-template-columns: 1fr; } }

.ai-sidebar {
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  align-self: start;
}
.mode-option {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.mode-option:last-child { border-bottom: none; }
.mode-option:hover { background: var(--surface); }
.mode-option.active { background: var(--surface-hi); border-left: 3px solid var(--accent); padding-left: 13px; }
.mode-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface-hi);
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mode-option.active .mode-icon { background: linear-gradient(135deg, var(--accent-dim), var(--accent)); }
.mode-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.mode-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.ai-main {
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 500px;
}
.ai-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-context { font-size: 12px; color: var(--text-muted); }
.ai-context strong { color: var(--accent-hi); }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.msg { display: flex; gap: 12px; max-width: 85%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.msg.ai .msg-avatar { background: linear-gradient(135deg, var(--accent-dim), var(--accent)); }
.msg.user .msg-avatar { background: var(--surface-hi); border: 1px solid var(--border); }
.msg-body {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.7;
}
.msg.ai .msg-body { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg.user .msg-body { background: rgba(212,169,74,.12); border: 1px solid rgba(212,169,74,.3); color: var(--text); border-top-right-radius: 4px; }
.msg-body ul { margin: 8px 0; padding-left: 20px; }
.msg-body li { margin: 4px 0; }

.suggestion-card {
  margin: 10px 0;
  padding: 10px 14px;
  background: var(--surface-lo);
  border: 1px solid var(--border-hi);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.suggestion-card .suggestion-label {
  font-size: 10px; color: var(--accent-hi);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.suggestion-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
}
.btn-sm:hover { background: var(--surface-hi); }
.btn-sm.approve { background: var(--status-ready); color: #fff; border-color: var(--status-ready); }
.btn-sm.approve:hover { filter: brightness(1.1); }
.btn-sm.danger { color: var(--type-announce); }

.chat-input-wrap {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 14px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
}
.chat-input:focus { border-color: var(--accent); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.active { display: flex; }

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hi);
  max-height: 85vh;
  overflow-y: auto;
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.modal-title-wrap { flex: 1; min-width: 0; }
.modal-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.modal-sub { font-size: 12px; color: var(--text-muted); }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; padding: 4px 10px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }

.field-group { margin-bottom: 18px; }
.field-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.field-value {
  padding: 10px 12px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  min-height: 38px;
  white-space: pre-wrap;
}
.field-value.empty { color: var(--text-muted); font-style: italic; }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Placeholder & native controls in dark mode */
.input::placeholder, .textarea::placeholder, .chat-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
input[type="date"], input[type="time"] {
  color-scheme: dark;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.9) sepia(0.3) saturate(2) hue-rotate(-10deg);
  cursor: pointer;
  opacity: 0.7;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Autofill override — Chrome yellow→dark */
.input:-webkit-autofill, .textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-lo) inset;
  caret-color: var(--text);
}

/* Select option list in dark mode (Firefox/Chrome) */
.select option {
  background: var(--surface);
  color: var(--text);
}

.status-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.status-chip {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  background: var(--surface-lo);
  line-height: 1.4;
}
.status-chip.active { border-width: 2px; font-weight: 600; }
.status-chip[data-status="draft"].active     { border-color: var(--status-draft); color: var(--status-draft); }
.status-chip[data-status="tentative"].active { border-color: var(--status-tentative); color: var(--status-tentative); }
.status-chip[data-status="checking"].active  { border-color: var(--status-checking); color: var(--status-checking); }
.status-chip[data-status="ready"].active     { border-color: var(--status-ready); color: var(--status-ready); }
.status-chip[data-status="done"].active      { border-color: var(--status-done); color: var(--status-done); }

.status-chip[data-cstatus="draft"].active  { border-color: var(--text-muted); color: var(--text-dim); }
.status-chip[data-cstatus="active"].active { border-color: var(--accent); color: var(--accent-hi); background: rgba(212,169,74,.08); }
.status-chip[data-cstatus="done"].active   { border-color: var(--status-done); color: var(--status-done); }

.subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.subitem .platform-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--surface-hi);
  display: grid; place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}
.subitem .subitem-title { flex: 1; }
.subitem .subitem-status {
  font-size: 10px; padding: 2px 7px;
  border-radius: 3px;
  background: var(--surface-hi);
  color: var(--text-muted);
  text-transform: uppercase;
}
.subitem .subitem-status.ready { background: rgba(91,143,217,.15); color: var(--status-ready); }
.subitem .subitem-status.done  { background: rgba(106,179,104,.15); color: var(--status-done); }
.subitem .subitem-status.todo  { background: rgba(107,117,144,.15); color: var(--status-draft); }

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 240px;
  max-width: 400px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hi);
  color: var(--text);
  font-size: 13px;
  animation: toast-in 0.25s ease-out;
}
.toast.success { border-left: 3px solid var(--status-ready); }
.toast.error   { border-left: 3px solid var(--type-announce); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Setup banner */
.setup-banner {
  background: linear-gradient(135deg, rgba(224,123,62,.15), rgba(224,123,62,.05));
  border: 1px solid rgba(224,123,62,.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.setup-banner.success {
  background: linear-gradient(135deg, rgba(106,179,104,.12), rgba(106,179,104,.05));
  border-color: rgba(106,179,104,.4);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }
