:root {
  color-scheme: dark;
  --bg: #050607;
  --surface: #0d1115;
  --surface-2: #141b20;
  --surface-3: #0a0e12;
  --line: #26333a;
  --line-strong: #435760;
  --text: #f3f8f7;
  --muted: #8fa0a4;
  --accent: #32e6a1;
  --accent-strong: #8fffd7;
  --blue: #42c8ff;
  --red: #ff5c7c;
  --amber: #f8bc45;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #050607 0%, #080c0f 42%, #050607 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

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

button {
  border: 0;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #ffffff;
  background: #101416;
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.day-actions,
.compact-actions,
.form-actions,
.settings-actions,
.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: #e6f3ef;
  border: 1px solid #bbd9d0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.mode-pill.live {
  color: #9c332b;
  background: #fff0ed;
  border-color: #eeb9b2;
}

.icon-button,
.small-button,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--surface-2);
  border-color: var(--line);
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

.ghost-button {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.secondary-button {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.danger-button {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.boot-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100vh;
  padding: 24px;
  color: var(--muted);
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #07100d;
  background: var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 32px rgba(50, 230, 161, 0.32);
  font-size: 22px;
  font-weight: 900;
}

.boot-screen p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: min(460px, 100%);
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(50, 230, 161, 0.12), rgba(66, 200, 255, 0.055)),
    var(--surface);
  border: 1px solid rgba(50, 230, 161, 0.3);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 8px;
}

.auth-card h1 {
  font-size: clamp(34px, 8vw, 56px);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form button {
  min-height: 44px;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.sidebar,
.workspace {
  min-width: 0;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
}

.workspace {
  display: grid;
  gap: 16px;
}

.tool-panel,
.composer-panel,
.planner-panel,
.calendar-panel,
.week-panel,
.utility-panel,
.slot-planner-panel,
.day-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-panel,
.composer-panel,
.planner-panel,
.calendar-panel,
.week-panel,
.utility-panel,
.slot-planner-panel,
.day-header {
  padding: 16px;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading,
.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-heading {
  margin-bottom: 0;
}

.divider {
  height: 1px;
  background: var(--line);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  letter-spacing: 0;
}

.eyebrow,
.composer-head p,
.fine-print,
#daySubtitle {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin-bottom: 6px;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 11px;
}

label,
.post-editor-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input {
  height: 38px;
  padding: 0 10px;
}

select {
  height: 38px;
  padding: 0 10px;
}

input[type="color"] {
  padding: 4px;
}

textarea {
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 109, 0.12);
}

.folder-create,
.account-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.folder-list {
  display: grid;
  gap: 8px;
}

.folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.folder-row.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.folder-row strong,
.folder-row small,
.folder-row em {
  display: block;
}

.folder-row strong {
  font-size: 20px;
  line-height: 1;
}

.folder-row small,
.folder-row em {
  color: inherit;
  opacity: 0.78;
  font-size: 12px;
  font-style: normal;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-row.dragging {
  opacity: 0.55;
}

.account-row.drag-over-before {
  box-shadow: inset 0 3px 0 var(--accent);
}

.account-row.drag-over-after {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.account-row.active {
  background: #f0f7f4;
  border-color: var(--accent);
}

.account-row.empty {
  border-left: 4px solid var(--line-strong);
}

.account-row.partial {
  background: #fffaf1;
  border-left: 4px solid var(--amber);
}

.account-row.complete {
  background: #f0f7f4;
  border-left: 4px solid var(--accent);
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 32px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}

.account-row:active .drag-handle {
  cursor: grabbing;
}

.account-select {
  display: grid;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.account-row.active .account-select {
  color: var(--accent-strong);
}

.account-dot {
  display: none;
  background: var(--accent);
}

.account-row strong,
.account-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row strong {
  font-size: 13px;
}

.account-row span {
  color: var(--muted);
  font-size: 12px;
}

.account-actions,
.post-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-actions button,
.post-actions button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.settings-panel {
  display: grid;
  gap: 12px;
}

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

.settings-panel-wide {
  grid-column: 1 / -1;
}

.safe-notice {
  padding: 10px;
  color: var(--accent-strong);
  background: #e7f4ef;
  border: 1px solid #bcd7cf;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.segmented,
.filters,
.quick-times {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button,
.filters button,
.quick-times button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button.active,
.filters button.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(31, 39, 45, 0.08);
}

.slot-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.45fr);
  gap: 10px;
  margin-bottom: 10px;
}

.quick-times {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 12px;
  overflow-x: auto;
}

.account-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  margin-bottom: 14px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.account-chip.active {
  color: #ffffff;
  border-color: var(--chip-color);
  background: var(--chip-color);
}

.post-editor {
  min-height: 160px;
  margin-top: 8px;
  font-size: 17px;
}

.composer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.composer-meta .over-limit {
  color: var(--red);
  font-weight: 700;
}

.composer-meta .warning {
  color: #8a4f0a;
  font-weight: 700;
}

.duplicate-warning {
  display: grid;
  gap: 8px;
  margin: -2px 0 16px;
  padding: 10px;
  color: #6b4507;
  background: #fff7e4;
  border: 1px solid #edcc8c;
  border-radius: 8px;
}

.duplicate-warning[hidden] {
  display: none;
}

.duplicate-warning strong {
  font-size: 13px;
}

.duplicate-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.duplicate-item,
.duplicate-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 9px;
  color: #6b4507;
  background: #ffffff;
  border: 1px solid #edcc8c;
  border-radius: 8px;
  font-size: 12px;
}

.duplicate-item {
  cursor: pointer;
}

.duplicate-item span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-item em {
  color: var(--muted);
  font-style: normal;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-hero,
.metric,
.chart-panel,
.account-stats-panel,
.debt-radar-panel,
.dashboard-timeline-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-hero {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  padding: 18px;
  background: #ffffff;
}

.dashboard-hero span,
.dashboard-hero p,
.metric span,
.metric em {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-hero span,
.metric span {
  font-weight: 700;
}

.dashboard-hero strong {
  display: block;
  margin-top: 8px;
  font-size: 50px;
  line-height: 0.95;
}

.dashboard-hero p {
  margin-top: 10px;
  line-height: 1.5;
}

.hero-side {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.hero-action {
  min-height: 34px;
  padding: 0 12px;
  color: #061014;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hero-chips em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: var(--accent-strong);
  background: rgba(50, 230, 161, 0.08);
  border: 1px solid rgba(50, 230, 161, 0.18);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  background:
    radial-gradient(circle, #ffffff 58%, transparent 59%),
    conic-gradient(var(--accent) var(--progress), #e4ebea 0);
  border-radius: 999px;
}

.progress-ring b {
  color: var(--accent-strong);
  font-size: 18px;
}

.metric {
  min-height: 78px;
  padding: 14px;
}

.metric span {
  display: block;
}

.metric strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.metric em {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-panel,
.account-stats-panel,
.debt-radar-panel,
.dashboard-timeline-panel {
  grid-column: span 2;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.dashboard-timeline-panel .timeline-list {
  gap: 8px;
}

.dashboard-timeline-panel .timeline-row {
  min-height: 58px;
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 150px;
}

.chart-bar {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.bar-track {
  position: relative;
  width: 100%;
  min-width: 18px;
  max-width: 34px;
  height: 92px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bar-track i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 3px;
  background: var(--line-strong);
}

.chart-bar.partial .bar-track i {
  background: var(--amber);
}

.chart-bar.complete .bar-track i {
  background: var(--accent);
}

.chart-bar strong {
  color: var(--text);
  font-size: 13px;
}

.chart-bar span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.heatmap-cell {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 54px;
  padding: 7px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.heatmap-cell span,
.heatmap-cell strong {
  display: block;
}

.heatmap-cell span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-cell strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.heatmap-cell.level-1 {
  background: rgba(248, 188, 69, 0.1);
  border-color: rgba(248, 188, 69, 0.32);
}

.heatmap-cell.level-2 {
  background: rgba(50, 230, 161, 0.1);
  border-color: rgba(50, 230, 161, 0.34);
}

.heatmap-cell.level-3 {
  color: #061014;
  background: var(--accent);
  border-color: var(--accent);
}

.heatmap-cell.level-3 strong,
.heatmap-cell.level-3 span {
  color: #061014;
}

.heatmap-cell.active {
  box-shadow: 0 0 0 2px rgba(66, 200, 255, 0.42);
}

.heatmap-cell.today:not(.active) {
  border-color: rgba(66, 200, 255, 0.46);
}

.debt-list {
  display: grid;
  gap: 8px;
}

.debt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.debt-row strong,
.debt-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debt-row strong {
  font-size: 13px;
}

.debt-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.debt-row em {
  color: var(--amber);
  font-size: 16px;
  font-style: normal;
  font-weight: 850;
}

.compact-empty {
  min-height: 72px;
}

.account-stat-list {
  display: grid;
  gap: 8px;
}

.account-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.account-stat-row.active {
  background: #f0f7f4;
  border-color: var(--accent);
}

.account-stat-row span,
.account-stat-row strong,
.account-stat-row small,
.account-stat-row em,
.account-stat-row b {
  min-width: 0;
}

.account-stat-row strong,
.account-stat-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat-row strong {
  font-size: 13px;
}

.account-stat-row small,
.account-stat-row b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-stat-row em {
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
}

.account-stat-progress {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.account-stat-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

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

.calendar-weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.calendar-day {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-height: 82px;
  padding: 8px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.calendar-day.outside {
  opacity: 0.48;
}

.calendar-day.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.calendar-day.has-posts:not(.active) {
  background: #f0f7f4;
  border-color: #bcd7cf;
}

.calendar-day.partial:not(.active) {
  background: #fff7e4;
  border-color: #edcc8c;
}

.calendar-day.complete:not(.active) {
  background: #f0f7f4;
  border-color: #bcd7cf;
}

.calendar-day strong,
.calendar-day span {
  display: block;
}

.calendar-day strong {
  font-size: 16px;
}

.calendar-day span {
  min-height: 16px;
  color: inherit;
  opacity: 0.78;
  font-size: 12px;
}

.calendar-day em {
  display: flex;
  gap: 4px;
  min-height: 8px;
  font-style: normal;
}

.calendar-day i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-strong);
}

.calendar-day i.draft {
  background: var(--muted);
}

.calendar-day i.scheduled {
  background: var(--amber);
}

.calendar-day i.failed {
  background: var(--red);
}

.calendar-day i.sent {
  background: var(--accent);
}

.calendar-grid-slots {
  gap: 7px;
}

.slot-calendar-day {
  min-height: 108px;
}

.calendar-slots {
  display: grid;
  gap: 3px;
}

.calendar-slots span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(173, 187, 184, 0.42);
  border-radius: 6px;
  font-size: 11px;
  opacity: 1;
}

.calendar-day.active .calendar-slots span {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.calendar-slots span.filled {
  color: var(--accent-strong);
  background: #ffffff;
  border-color: #c9ddd8;
  font-weight: 750;
}

.calendar-slots span.confirmed {
  color: var(--accent-strong);
  background: #ffffff;
  border-color: #bcd7cf;
  font-weight: 750;
}

.calendar-slots span.published {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 750;
}

.calendar-slots span.skipped {
  color: var(--muted);
  background: #eef2f3;
  border-color: var(--line);
  font-weight: 750;
}

.calendar-slots span.needs-changes {
  color: #9e3029;
  background: #fff0ed;
  border-color: #e4a39c;
  font-weight: 750;
}

.calendar-day.active .calendar-slots span.filled {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.32);
}

.week-panel {
  overflow: hidden;
}

.week-grid {
  display: grid;
  grid-template-columns: minmax(112px, 0.9fr) repeat(7, minmax(86px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.week-head,
.week-account,
.week-cell {
  min-height: 48px;
  padding: 8px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.week-head {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.week-head.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.week-account {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-account.active {
  color: var(--accent-strong);
  background: #f0f7f4;
  border-color: #bcd7cf;
}

.week-cell {
  display: grid;
  align-content: center;
  gap: 4px;
  cursor: pointer;
}

.week-cell strong,
.week-cell span {
  display: block;
}

.week-cell strong {
  font-size: 16px;
}

.week-cell span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-cell.partial {
  background: #fff7e4;
  border-color: #edcc8c;
}

.week-cell.complete {
  background: #e7f4ef;
  border-color: #bcd7cf;
}

.week-cell.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 109, 0.12);
}

.slot-planner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.slot-editor-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.slot-editor-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 109, 0.1);
}

.slot-editor-card.filled {
  background: #f0f7f4;
  border-color: #bcd7cf;
}

.slot-editor-card header,
.slot-editor-card footer,
.timeline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.slot-editor-card header strong,
.slot-editor-card header span {
  display: block;
}

.slot-editor-card header strong {
  font-size: 15px;
}

.slot-editor-card header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.slot-editor-card header em {
  padding: 4px 8px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.slot-editor-card.filled header em {
  color: var(--accent-strong);
  border-color: #bcd7cf;
}

.slot-editor-card textarea {
  min-height: 158px;
  background: #ffffff;
}

.slot-status-control {
  grid-template-columns: minmax(0, 1fr);
}

.slot-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slot-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.slot-check input {
  width: 14px;
  height: 14px;
  padding: 0;
}

.slot-char {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.slot-char.over-limit {
  color: var(--red);
}

.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-row {
  width: 100%;
  min-height: 52px;
  padding: 10px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.timeline-row.filled {
  background: #f0f7f4;
  border-color: #bcd7cf;
}

.timeline-row.status-needs_changes {
  background: #fffafa;
  border-color: #e4a39c;
}

.timeline-row.status-published {
  background: #eef8f2;
  border-color: #b8d9c6;
}

.timeline-row.status-skipped {
  background: #f3f5f5;
}

.timeline-row strong {
  font-size: 18px;
}

.timeline-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-row em {
  font-style: normal;
}

.review-checklist {
  display: grid;
  gap: 8px;
  margin: -2px 0 16px;
  padding: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.review-checklist strong {
  font-size: 13px;
}

.review-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.review-item.pass {
  color: var(--accent-strong);
  background: #e7f4ef;
}

.review-item.warn {
  color: #6b4507;
  background: #fff1cd;
}

.review-item.fail {
  color: #9e3029;
  background: #fff0ed;
}

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

.utility-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.batch-controls,
.library-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.batch-preview {
  display: grid;
  gap: 8px;
}

.batch-preview-list {
  display: grid;
  gap: 8px;
}

.batch-preview-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-preview-row.warn {
  background: #fffdf8;
  border-color: #edcc8c;
}

.batch-preview-row.fail {
  background: #fffafa;
  border-color: #e4a39c;
}

.batch-preview-row strong,
.batch-preview-row span {
  display: block;
}

.batch-preview-row strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.batch-preview-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.batch-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.batch-preview-meta em,
.batch-preview-more {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.batch-preview-meta em.pass {
  color: var(--accent-strong);
  background: #e7f4ef;
}

.batch-preview-meta em.warn,
.batch-preview-more {
  color: #6b4507;
  background: #fff1cd;
}

.batch-preview-meta em.fail {
  color: #9e3029;
  background: #fff0ed;
}

.template-list,
.library-list {
  display: grid;
  gap: 8px;
}

.library-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.library-row strong,
.library-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-row strong {
  font-size: 13px;
  white-space: nowrap;
}

.library-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-list em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  color: var(--accent-strong);
  background: #e7f4ef;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.lane-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
}

.account-lane {
  min-width: 0;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.lane-header {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.lane-color {
  width: 10px;
  height: 34px;
  border-radius: 999px;
  background: var(--lane-color);
}

.lane-header strong,
.lane-header small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-header strong {
  font-size: 14px;
}

.lane-header small,
.lane-header em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.lane-body {
  display: grid;
  gap: 10px;
  min-height: 120px;
  padding: 10px;
}

.slot-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--lane-color);
  border-radius: 8px;
}

.slot-card.has-duplicate {
  border-color: #edcc8c;
  background: #fffdf8;
}

.slot-card.has-conflict {
  border-color: #e4a39c;
  background: #fffafa;
}

.slot-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.slot-time {
  font-size: 18px;
  line-height: 1;
}

.status-badge,
.delivery-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.status-badge {
  color: var(--text);
  background: var(--surface-2);
}

.status-badge.review,
.status-badge.needs-changes,
.status-badge.confirmed,
.status-badge.published,
.status-badge.skipped,
.status-badge.draft {
  font-style: normal;
}

.status-badge.review {
  color: #6b4507;
  background: #fff1cd;
}

.status-badge.needs-changes {
  color: #9e3029;
  background: #fff0ed;
}

.status-badge.confirmed {
  color: var(--accent-strong);
  background: #e7f4ef;
}

.status-badge.published {
  color: #ffffff;
  background: var(--accent);
}

.status-badge.skipped {
  color: var(--muted);
  background: var(--surface-2);
}

.status-badge.scheduled {
  color: #6b4507;
  background: #fff1cd;
}

.status-badge.sent {
  color: var(--accent-strong);
  background: #e7f4ef;
}

.status-badge.failed {
  color: #9e3029;
  background: #fff0ed;
}

.status-badge.sending {
  color: var(--blue);
  background: #e7f1fa;
}

.post-copy {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  line-height: 1.45;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.delivery-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-pill {
  color: var(--muted);
  background: var(--surface-2);
}

.delivery-pill.sent {
  color: var(--accent-strong);
}

.delivery-pill.failed {
  color: #9e3029;
}

.delivery-pill.duplicate {
  color: #8a4f0a;
  background: #fff1cd;
}

.delivery-pill.conflict {
  color: #9e3029;
  background: #fff0ed;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 84px;
  padding: 12px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #ffffff;
  background: #1f2428;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
}

.modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, 100%);
  max-height: min(88vh, 920px);
  margin: auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
}

.modal-panel-wide {
  width: min(1320px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.modal-section {
  box-shadow: none;
}

.modal-tabs button.active {
  color: var(--text);
  background: #ffffff;
}

.resources-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.25fr);
  gap: 16px;
}

/* Dark command skin */
.topbar {
  background: rgba(5, 7, 8, 0.88);
  border-bottom-color: rgba(50, 230, 161, 0.22);
}

.brand-mark {
  color: #07100d;
  background: var(--accent);
  box-shadow: 0 0 28px rgba(50, 230, 161, 0.32);
}

.brand strong {
  color: #ffffff;
}

.mode-pill {
  color: var(--accent-strong);
  background: rgba(50, 230, 161, 0.1);
  border-color: rgba(50, 230, 161, 0.42);
  box-shadow: inset 0 0 18px rgba(50, 230, 161, 0.06);
}

.mode-pill.live {
  color: #ffd5dd;
  background: rgba(255, 92, 124, 0.12);
  border-color: rgba(255, 92, 124, 0.42);
}

.tool-panel,
.composer-panel,
.planner-panel,
.calendar-panel,
.week-panel,
.utility-panel,
.slot-planner-panel,
.day-header,
.dashboard-hero,
.metric,
.chart-panel,
.account-stats-panel,
.debt-radar-panel,
.dashboard-timeline-panel,
.modal-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--surface);
  border-color: rgba(143, 255, 215, 0.14);
  box-shadow: var(--shadow);
}

.day-header {
  border-color: rgba(66, 200, 255, 0.22);
}

h1 {
  color: #ffffff;
  text-shadow: 0 0 26px rgba(50, 230, 161, 0.18);
}

h2 {
  color: #ffffff;
}

.eyebrow {
  color: var(--accent-strong);
}

.icon-button,
.small-button,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.account-actions button,
.post-actions button,
.row-actions button {
  color: var(--text);
  background: #10171c;
  border-color: rgba(143, 255, 215, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.primary-button {
  color: #03100b;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(50, 230, 161, 0.22);
  font-weight: 800;
}

.secondary-button:hover,
.small-button:hover,
.ghost-button:hover,
.icon-button:hover,
.row-actions button:hover,
.account-actions button:hover {
  color: #ffffff;
  border-color: rgba(66, 200, 255, 0.48);
  background: #162129;
}

.segmented button.active,
.modal-tabs button.active,
.filters button.active {
  color: #061014;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(50, 230, 161, 0.18);
}

.danger-button {
  color: #ffffff;
  background: rgba(255, 92, 124, 0.18);
  border-color: rgba(255, 92, 124, 0.54);
}

input,
select,
textarea {
  color: #ffffff;
  background: #070b0e;
  border-color: rgba(143, 255, 215, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: #65777b;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(50, 230, 161, 0.14), 0 0 22px rgba(50, 230, 161, 0.12);
}

.folder-row,
.account-row,
.calendar-day,
.week-head,
.week-account,
.week-cell,
.slot-editor-card,
.timeline-row,
.debt-row,
.heatmap-cell,
.library-row,
.batch-preview-row,
.account-stat-row,
.review-checklist,
.duplicate-warning,
.empty-state {
  color: var(--text);
  background: var(--surface-3);
  border-color: rgba(143, 255, 215, 0.13);
}

.folder-row.active,
.calendar-day.active,
.week-head.active {
  color: #03100b;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(50, 230, 161, 0.24);
}

.account-row.active,
.week-account.active,
.account-stat-row.active {
  background: rgba(50, 230, 161, 0.1);
  border-color: rgba(50, 230, 161, 0.55);
}

.account-row.partial,
.calendar-day.partial:not(.active),
.week-cell.partial,
.batch-preview-row.warn {
  background: rgba(248, 188, 69, 0.09);
  border-color: rgba(248, 188, 69, 0.45);
}

.account-row.complete,
.calendar-day.complete:not(.active),
.calendar-day.has-posts:not(.active),
.week-cell.complete,
.timeline-row.filled,
.slot-editor-card.filled {
  background: rgba(50, 230, 161, 0.08);
  border-color: rgba(50, 230, 161, 0.38);
}

.account-row.empty {
  border-left-color: var(--line-strong);
}

.account-select,
.account-row.active .account-select {
  color: var(--text);
}

.account-row span,
.week-cell span,
.timeline-row span,
.library-row span,
.batch-preview-row span,
.slot-editor-card header span {
  color: var(--muted);
}

.safe-notice {
  color: var(--accent-strong);
  background: rgba(50, 230, 161, 0.08);
  border-color: rgba(50, 230, 161, 0.32);
}

.divider {
  background: rgba(143, 255, 215, 0.12);
}

.modal-header {
  border-bottom-color: rgba(143, 255, 215, 0.13);
}

.dashboard-hero {
  background:
    linear-gradient(135deg, rgba(50, 230, 161, 0.16), rgba(66, 200, 255, 0.06) 48%, rgba(248, 188, 69, 0.06)),
    #080d10;
  border-color: rgba(50, 230, 161, 0.34);
}

.dashboard-hero strong {
  color: #ffffff;
}

.progress-ring {
  background:
    radial-gradient(circle, #080d10 58%, transparent 59%),
    conic-gradient(var(--accent) var(--progress), #1d2930 0);
  box-shadow: 0 0 28px rgba(50, 230, 161, 0.16);
}

.progress-ring b {
  color: #ffffff;
}

.metric strong,
.chart-bar strong,
.account-stat-row em,
.heatmap-cell strong {
  color: #ffffff;
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--amber));
  content: "";
}

.bar-track {
  background: #071014;
  border-color: rgba(143, 255, 215, 0.16);
}

.chart-bar.empty .bar-track i {
  background: #34434a;
}

.account-stat-progress {
  background: #071014;
}

.calendar-slots span {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(143, 255, 215, 0.12);
}

.calendar-slots span.filled,
.calendar-slots span.confirmed {
  color: #07100d;
  background: var(--accent);
  border-color: var(--accent);
}

.calendar-slots span.published {
  color: #061014;
  background: var(--blue);
  border-color: var(--blue);
}

.calendar-slots span.needs-changes {
  color: #ffffff;
  background: rgba(255, 92, 124, 0.28);
  border-color: rgba(255, 92, 124, 0.6);
}

.calendar-slots span.skipped {
  color: #b7c3c5;
  background: #162129;
  border-color: rgba(143, 255, 215, 0.12);
}

.slot-editor-card textarea {
  background: #05090b;
}

.slot-editor-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(50, 230, 161, 0.12), 0 0 28px rgba(50, 230, 161, 0.14);
}

.slot-check {
  color: var(--muted);
  background: #070b0e;
  border-color: rgba(143, 255, 215, 0.14);
}

.status-badge,
.delivery-pill,
.slot-editor-card header em {
  color: var(--text);
  background: #151e24;
  border-color: rgba(143, 255, 215, 0.12);
}

.status-badge.review {
  color: #ffe2a3;
  background: rgba(248, 188, 69, 0.18);
}

.status-badge.needs-changes,
.review-item.fail,
.batch-preview-meta em.fail {
  color: #ffd5dd;
  background: rgba(255, 92, 124, 0.18);
}

.status-badge.confirmed,
.review-item.pass,
.batch-preview-meta em.pass,
.tag-list em {
  color: var(--accent-strong);
  background: rgba(50, 230, 161, 0.12);
}

.status-badge.published {
  color: #061014;
  background: var(--blue);
}

.status-badge.skipped {
  color: #b7c3c5;
  background: #1b242a;
}

.review-item.warn,
.batch-preview-meta em.warn,
.batch-preview-more,
.duplicate-warning,
.duplicate-item,
.duplicate-more {
  color: #ffe2a3;
  background: rgba(248, 188, 69, 0.12);
  border-color: rgba(248, 188, 69, 0.36);
}

.timeline-row.status-needs_changes {
  background: rgba(255, 92, 124, 0.1);
  border-color: rgba(255, 92, 124, 0.42);
}

.timeline-row.status-published {
  background: rgba(66, 200, 255, 0.09);
  border-color: rgba(66, 200, 255, 0.36);
}

.timeline-row.status-skipped {
  background: rgba(255, 255, 255, 0.035);
}

.toast {
  color: #061014;
  background: var(--accent);
  box-shadow: 0 0 30px rgba(50, 230, 161, 0.24);
  font-weight: 800;
}

::selection {
  color: #061014;
  background: var(--accent);
}

@media (min-width: 1121px) {
  body {
    overflow: hidden;
  }

  .shell {
    display: grid;
    height: 100vh;
    min-height: 0;
    padding: 12px;
  }

  .topbar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 30;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }

  .topbar .brand,
  .mode-pill {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
    padding: 6px;
    background: rgba(5, 7, 8, 0.82);
    border: 1px solid rgba(143, 255, 215, 0.14);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .topbar-actions .secondary-button,
  .topbar-actions .icon-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .topbar-actions .icon-button {
    width: 32px;
  }

  .planner-grid {
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    gap: 12px;
    width: min(1720px, 100%);
    height: calc(100vh - 24px);
    min-height: 0;
    padding: 0;
  }

  .sidebar,
  .workspace {
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  .workspace {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  .date-panel,
  .account-panel,
  .day-header,
  .metric,
  .chart-panel,
  .account-stats-panel,
  .debt-radar-panel,
  .dashboard-timeline-panel {
    padding: 12px;
  }

  .date-panel .folder-list {
    display: none;
  }

  .date-panel .panel-heading,
  .account-panel .panel-heading {
    margin-bottom: 10px;
  }

  .account-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
  }

  .account-list {
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .account-row {
    min-height: 46px;
    padding: 7px;
  }

  .account-actions button {
    min-height: 28px;
    padding: 0 7px;
    font-size: 12px;
  }

  .day-header {
    align-items: end;
    min-height: 116px;
  }

  .day-header h1 {
    font-size: clamp(56px, 7.2vh, 88px);
  }

  .day-actions {
    max-width: 760px;
    justify-content: flex-end;
    gap: 7px;
    padding-right: 172px;
  }

  .day-actions .primary-button,
  .day-actions .secondary-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .metrics-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(68px, auto);
    gap: 10px;
    min-height: 0;
    overflow: hidden;
  }

  .dashboard-hero {
    min-height: 94px;
    padding: 12px;
  }

  .dashboard-hero strong {
    margin-top: 4px;
    font-size: 38px;
  }

  .dashboard-hero p {
    margin-top: 6px;
    line-height: 1.35;
  }

  .progress-ring {
    width: 72px;
    height: 72px;
  }

  .metric {
    min-height: 68px;
  }

  .metric strong {
    margin-top: 6px;
    font-size: 20px;
  }

  .metric em {
    margin-top: 6px;
  }

  .chart-panel,
  .account-stats-panel,
  .debt-radar-panel,
  .dashboard-timeline-panel {
    gap: 10px;
    min-height: 0;
  }

  .heatmap-grid {
    gap: 5px;
  }

  .heatmap-cell {
    min-height: 42px;
    padding: 6px;
  }

  .debt-list {
    gap: 6px;
    min-height: 0;
    overflow: auto;
  }

  .debt-row {
    min-height: 38px;
    padding: 7px;
  }

  .mini-chart {
    gap: 6px;
    min-height: 92px;
  }

  .bar-track {
    height: 58px;
  }

  .account-stat-list {
    min-height: 0;
    max-height: 190px;
    overflow: auto;
  }

  .account-stat-row {
    min-height: 48px;
    padding: 8px;
  }

  .dashboard-timeline-panel .timeline-list {
    min-height: 0;
    overflow: auto;
  }

  .dashboard-timeline-panel .timeline-row {
    min-height: 44px;
    padding: 8px;
  }
}

@media (max-width: 1120px) {
  .planner-grid {
    grid-template-columns: 1fr;
  }

  .workflow-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .planner-grid {
    padding: 12px;
  }

  .sidebar,
  .slot-planner,
  .slot-fields,
  .batch-controls,
  .library-fields,
  .metrics-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .chart-panel,
  .account-stats-panel,
  .debt-radar-panel,
  .dashboard-timeline-panel {
    grid-column: 1 / -1;
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .day-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 540px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-actions,
  .day-actions,
  .compact-actions,
  .form-actions,
  .composer-actions,
  .account-create,
  .folder-create {
    width: 100%;
  }

  .topbar-actions button,
  .day-actions button,
  .compact-actions button,
  .form-actions button,
  .composer-actions button,
  .account-create button,
  .folder-create button {
    flex: 1;
  }

  .folder-create,
  .account-create {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .composer-panel,
  .planner-panel,
  .calendar-panel,
  .week-panel,
  .utility-panel,
  .slot-planner-panel,
  .day-header {
    padding: 14px;
  }

  .calendar-day {
    min-height: 64px;
    padding: 6px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: 94vh;
  }

  .modal-header {
    flex-direction: column;
  }

  .modal-actions,
  .modal-actions .segmented {
    width: 100%;
  }
}
