:root {
  color-scheme: light;
  --bg: #c8a058;
  --surface: #f9e0bb;
  --surface-strong: #e8c890;
  --surface-soft: #f1cb9f;
  --control-bg: #fdf0d8;
  --card-bg: #f9e0bb;
  --toolbar-bg: rgba(240, 200, 150, 0.95);
  --clock-bg: rgba(248, 224, 184, 0.90);
  --ink: #1e130b;
  --muted: #4e3928;
  --line: #8e6346;
  --line-soft: #b8906a;
  --subtle-line: #d4b088;
  --blue: #5060a8;
  --blue-dark: #384880;
  --green: #456a3c;
  --red: #8e3028;
  --amber: #8e6820;
  --violet: #704888;
  --accent: #a06838;
  --accent-strong: #7a4e24;
  --accent-ink: #fffff0;
  --hover-border: #7a5838;
  --button-hover-bg: #f0ca90;
  --tab-active-bg: #402d1c;
  --tab-active-ink: #f1cb9f;
  --pressed-bg: #e8c078;
  --pressed-hover-bg: #e0b860;
  --placeholder: #a08060;
  --delete-line: #b87068;
  --edit-line: #7890b0;
  --settings-backdrop-bg: rgba(40, 24, 8, 0.38);
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: 0 4px 16px rgba(40, 20, 0, 0.18);
  --modal-shadow: 0 14px 40px rgba(40, 20, 0, 0.28);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #232323;
  --surface-strong: #171717;
  --surface-soft: #2e2e2e;
  --control-bg: #1d1d1d;
  --card-bg: #2a2a2a;
  --toolbar-bg: rgba(23, 23, 23, 0.97);
  --clock-bg: rgba(30, 30, 30, 0.92);
  --ink: #eeeeee;
  --muted: #9a9a9a;
  --line: #4a3e2a;
  --line-soft: #302618;
  --subtle-line: #201c12;
  --blue: #6ea2ff;
  --blue-dark: #4d7ed8;
  --green: #5bc596;
  --red: #e36a62;
  --amber: #d8bd55;
  --violet: #b58cff;
  --accent: #d8bd55;
  --accent-strong: #ffd232;
  --accent-ink: #0c0800;
  --hover-border: #6a5838;
  --button-hover-bg: #343434;
  --tab-active-bg: #171717;
  --tab-active-ink: #eeeeee;
  --pressed-bg: #3a3520;
  --pressed-hover-bg: #48432a;
  --placeholder: #5a5848;
  --delete-line: #704040;
  --edit-line: #3a4858;
  --settings-backdrop-bg: rgba(0, 0, 0, 0.80);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.60);
  --modal-shadow: 0 22px 56px rgba(0, 0, 0, 0.70);
  --radius: 3px;
  --radius-sm: 2px;
}

:root[data-theme="classic-ff"] {
  color-scheme: dark;
  --bg: #04102e;
  --surface: #190090;
  --surface-strong: #100881;
  --surface-soft: #140070;
  --control-bg: #0d0560;
  --card-bg: #1a0898;
  --toolbar-bg: rgba(5, 2, 82, 0.98);
  --clock-bg: rgba(16, 8, 129, 0.92);
  --ink: #ffffff;
  --muted: #c8cef8;
  --line: #737072;
  --line-soft: #4a4850;
  --subtle-line: #303038;
  --blue: #7fb7ff;
  --blue-dark: #5187d6;
  --green: #6dd49c;
  --red: #ff8179;
  --amber: #f0d070;
  --violet: #caa4ff;
  --accent: #5171fb;
  --accent-strong: #8090f8;
  --accent-ink: #ffffff;
  --hover-border: #8090f8;
  --button-hover-bg: #2930d4;
  --tab-active-bg: #100881;
  --tab-active-ink: #ffffff;
  --pressed-bg: #2920d4;
  --pressed-hover-bg: #3530e0;
  --placeholder: #7070a8;
  --delete-line: #9a5555;
  --edit-line: #5080c8;
  --settings-backdrop-bg: rgba(2, 0, 30, 0.80);
  --shadow: 0 16px 40px rgba(0, 0, 12, 0.65);
  --modal-shadow: 0 22px 56px rgba(0, 0, 12, 0.75);
  --radius: 2px;
  --radius-sm: 2px;
}

:root[data-theme^="clear-"] {
  --radius: 2px;
  --radius-sm: 2px;
}

:root[data-theme^="clear-"] .planner,
:root[data-theme^="clear-"] .tool-panel,
:root[data-theme^="clear-"] .tool-link,
:root[data-theme^="clear-"] .dashboard-panel,
:root[data-theme^="clear-"] .settings-panel,
:root[data-theme^="clear-"] .add-task-popover,
:root[data-theme^="clear-"] .clock-panel span {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

:root[data-theme="dark"] .section-kicker,
:root[data-theme="dark"] .tool-link-kicker {
  color: var(--accent);
}

:root[data-theme="clear-blue"] {
  color-scheme: dark;
  --bg: #1a3460;
  --surface: rgba(23, 46, 100, 0.80);
  --surface-strong: rgba(8, 31, 97, 0.84);
  --surface-soft: rgba(40, 60, 116, 0.74);
  --control-bg: rgba(13, 30, 75, 0.90);
  --card-bg: rgba(29, 53, 122, 0.82);
  --toolbar-bg: rgba(8, 31, 97, 0.82);
  --clock-bg: rgba(8, 31, 97, 0.72);
  --ink: #eeeff1;
  --muted: #afb9cb;
  --line: rgba(48, 90, 207, 0.65);
  --line-soft: rgba(24, 71, 154, 0.48);
  --subtle-line: rgba(24, 71, 154, 0.30);
  --blue: #6ea2ff;
  --blue-dark: #4d7ed8;
  --green: #5bc596;
  --red: #e36a62;
  --amber: #d8bd55;
  --violet: #b58cff;
  --accent: #305acf;
  --accent-strong: #5080e0;
  --accent-ink: #040c28;
  --hover-border: rgba(80, 128, 224, 0.80);
  --button-hover-bg: rgba(40, 72, 180, 0.88);
  --tab-active-bg: rgba(8, 31, 97, 0.84);
  --tab-active-ink: #ffffff;
  --pressed-bg: rgba(30, 56, 140, 0.88);
  --pressed-hover-bg: rgba(38, 70, 160, 0.92);
  --placeholder: rgba(175, 185, 203, 0.55);
  --delete-line: rgba(180, 80, 80, 0.60);
  --edit-line: rgba(60, 100, 200, 0.60);
  --settings-backdrop-bg: rgba(4, 12, 48, 0.76);
  --shadow: 0 4px 20px rgba(24, 48, 120, 0.30);
  --modal-shadow: 0 14px 40px rgba(8, 24, 80, 0.50);
}

:root[data-theme="clear-white"] {
  color-scheme: light;
  --bg: #b0b5ba;
  --surface: rgba(180, 183, 186, 0.82);
  --surface-strong: rgba(160, 164, 168, 0.84);
  --surface-soft: rgba(195, 198, 201, 0.74);
  --control-bg: rgba(200, 203, 206, 0.90);
  --card-bg: rgba(186, 189, 192, 0.82);
  --toolbar-bg: rgba(160, 164, 168, 0.82);
  --clock-bg: rgba(160, 164, 168, 0.72);
  --ink: #3a302f;
  --muted: #6a6060;
  --line: rgba(90, 84, 80, 0.44);
  --line-soft: rgba(90, 84, 80, 0.28);
  --subtle-line: rgba(90, 84, 80, 0.22);
  --accent: #4e4b48;
  --accent-strong: #312e2c;
  --accent-ink: #f8f5f0;
  --hover-border: rgba(74, 68, 62, 0.70);
  --button-hover-bg: rgba(164, 160, 156, 0.88);
  --tab-active-bg: rgba(60, 56, 52, 0.88);
  --tab-active-ink: #f8f5f0;
  --pressed-bg: rgba(148, 144, 140, 0.90);
  --pressed-hover-bg: rgba(136, 132, 128, 0.94);
  --placeholder: rgba(106, 96, 96, 0.55);
  --delete-line: rgba(160, 60, 60, 0.60);
  --edit-line: rgba(50, 80, 140, 0.60);
  --settings-backdrop-bg: rgba(30, 26, 24, 0.40);
  --shadow: 0 4px 16px rgba(30, 26, 22, 0.22);
  --modal-shadow: 0 14px 40px rgba(20, 16, 14, 0.36);
}

:root[data-theme="clear-green"] {
  color-scheme: dark;
  --bg: #1e4810;
  --surface: rgba(38, 91, 23, 0.80);
  --surface-strong: rgba(24, 72, 10, 0.84);
  --surface-soft: rgba(52, 112, 36, 0.74);
  --control-bg: rgba(16, 60, 6, 0.90);
  --card-bg: rgba(46, 108, 28, 0.82);
  --toolbar-bg: rgba(24, 72, 10, 0.82);
  --clock-bg: rgba(24, 72, 10, 0.72);
  --ink: #eff1ee;
  --muted: #a8c0a0;
  --line: rgba(79, 178, 59, 0.60);
  --line-soft: rgba(40, 130, 20, 0.44);
  --subtle-line: rgba(24, 90, 10, 0.30);
  --blue: #6db8e0;
  --blue-dark: #4e90b8;
  --green: #4fb23b;
  --red: #e06055;
  --amber: #d4c450;
  --violet: #b07adf;
  --accent: #4fb23b;
  --accent-strong: #74d458;
  --accent-ink: #0a1e05;
  --hover-border: rgba(79, 178, 59, 0.80);
  --button-hover-bg: rgba(52, 120, 32, 0.88);
  --tab-active-bg: rgba(24, 72, 10, 0.84);
  --tab-active-ink: #ffffff;
  --pressed-bg: rgba(44, 104, 24, 0.88);
  --pressed-hover-bg: rgba(56, 124, 34, 0.92);
  --placeholder: rgba(168, 192, 160, 0.55);
  --delete-line: rgba(180, 70, 70, 0.60);
  --edit-line: rgba(60, 160, 40, 0.60);
  --settings-backdrop-bg: rgba(4, 20, 2, 0.76);
  --shadow: 0 4px 20px rgba(8, 40, 4, 0.30);
  --modal-shadow: 0 14px 40px rgba(4, 24, 2, 0.52);
}

:root[data-theme="clear-grey"] {
  color-scheme: dark;
  --bg: #25262a;
  --surface: rgba(53, 55, 59, 0.82);
  --surface-strong: rgba(38, 39, 43, 0.86);
  --surface-soft: rgba(66, 68, 73, 0.76);
  --control-bg: rgba(28, 29, 32, 0.90);
  --card-bg: rgba(60, 62, 67, 0.84);
  --toolbar-bg: rgba(38, 39, 43, 0.84);
  --clock-bg: rgba(38, 39, 43, 0.72);
  --ink: #e8e8e8;
  --muted: #979797;
  --line: rgba(131, 130, 131, 0.60);
  --line-soft: rgba(80, 80, 82, 0.44);
  --subtle-line: rgba(60, 60, 62, 0.32);
  --blue: #89aed8;
  --blue-dark: #6890bc;
  --green: #7ac07e;
  --red: #d87070;
  --amber: #d4b856;
  --violet: #b090d8;
  --accent: #838283;
  --accent-strong: #a0a0a0;
  --accent-ink: #0e0e0f;
  --hover-border: rgba(160, 160, 160, 0.70);
  --button-hover-bg: rgba(76, 78, 84, 0.90);
  --tab-active-bg: rgba(38, 39, 43, 0.88);
  --tab-active-ink: #e8e8e8;
  --pressed-bg: rgba(68, 70, 76, 0.90);
  --pressed-hover-bg: rgba(80, 82, 88, 0.94);
  --placeholder: rgba(151, 151, 151, 0.55);
  --delete-line: rgba(180, 80, 80, 0.60);
  --edit-line: rgba(100, 140, 200, 0.60);
  --settings-backdrop-bg: rgba(8, 8, 10, 0.76);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.36);
  --modal-shadow: 0 14px 40px rgba(0, 0, 0, 0.56);
}

:root[data-theme="clear-pink"] {
  color-scheme: light;
  --bg: #d070b0;
  --surface: rgba(231, 167, 214, 0.84);
  --surface-strong: rgba(216, 148, 196, 0.86);
  --surface-soft: rgba(242, 186, 228, 0.76);
  --control-bg: rgba(248, 196, 235, 0.90);
  --card-bg: rgba(240, 174, 224, 0.84);
  --toolbar-bg: rgba(216, 148, 196, 0.84);
  --clock-bg: rgba(216, 148, 196, 0.74);
  --ink: #3a272e;
  --muted: #7a5068;
  --line: rgba(203, 68, 162, 0.54);
  --line-soft: rgba(180, 60, 140, 0.38);
  --subtle-line: rgba(160, 50, 120, 0.26);
  --blue: #5060c8;
  --blue-dark: #3848aa;
  --green: #3e8050;
  --red: #b83850;
  --amber: #9e7220;
  --violet: #8848b8;
  --accent: #cb44a2;
  --accent-strong: #f061c7;
  --accent-ink: #ffffff;
  --hover-border: rgba(203, 68, 162, 0.78);
  --button-hover-bg: rgba(220, 152, 202, 0.90);
  --tab-active-bg: #cb44a2;
  --tab-active-ink: #ffffff;
  --pressed-bg: rgba(200, 132, 180, 0.92);
  --pressed-hover-bg: rgba(188, 118, 168, 0.96);
  --placeholder: rgba(122, 80, 104, 0.55);
  --delete-line: rgba(180, 50, 80, 0.60);
  --edit-line: rgba(80, 60, 200, 0.60);
  --settings-backdrop-bg: rgba(48, 20, 38, 0.50);
  --shadow: 0 4px 16px rgba(80, 20, 60, 0.22);
  --modal-shadow: 0 14px 40px rgba(60, 12, 44, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior-y: none;
}

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

button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--hover-border);
  background: var(--button-hover-bg);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:disabled:hover {
  border-color: var(--line);
  background: var(--surface);
}

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

.primary-button:hover {
  background: var(--accent-strong);
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 24px 24px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -24px 10px;
  padding: 6px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--toolbar-bg);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(12, 18, 28, 0.08);
}

.app-titlebar {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.app-titlebar h1,
.app-titlebar .home-lead {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-titlebar .home-lead[hidden] {
  display: none;
}

.back-button {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.back-button:hover {
  border-color: var(--hover-border);
  background: var(--button-hover-bg);
  color: var(--accent);
}

.home-shell .back-button {
  display: none;
}

.eyebrow {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 650;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
}

.clock-panel {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.settings-button,
.settings-close {
  min-width: 42px;
  white-space: nowrap;
}

.settings-button {
  flex-shrink: 0;
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.header-link {
  color: inherit;
  text-decoration: none;
}

.header-link:hover {
  color: var(--accent);
}

.home-shell {
  max-width: 1080px;
}

.app-footer {
  margin-top: 32px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--subtle-line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.app-footer p {
  margin: 0;
}

.news-bar {
  margin-bottom: 18px;
}

.news-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
}

.news-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.news-link::after {
  content: " →";
}

.news-link:hover {
  text-decoration: underline;
}

.home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 56px 0 24px;
}

.home-lead {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tool-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tool-link {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.tool-link:hover {
  border-color: var(--hover-border);
  transform: translateY(-1px);
}

.tool-link strong {
  font-size: 19px;
}

.tool-link span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.tool-link-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-link.is-pending {
  opacity: 0.68;
  cursor: default;
}

.tool-link.is-pending:hover {
  border-color: var(--line);
  transform: none;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.clock-panel span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--clock-bg);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start end;
  padding: 24px;
  background: var(--settings-backdrop-bg);
}

.settings-backdrop[hidden] {
  display: none;
}

.settings-panel {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
}

.settings-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.settings-item h3 {
  margin: 0;
  font-size: 15px;
}

.settings-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.settings-item :disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.settings-status {
  flex-basis: 100%;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.calendar-panel {
  min-width: 0;
}

.calendar-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.planner,
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.planner {
  min-width: 0;
  overflow: hidden;
}

.planner-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--toolbar-bg);
}

.range-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
  letter-spacing: 0;
}

.toolbar-spacer {
  flex: 1;
}

.add-task-popover {
  position: fixed;
  z-index: 100;
  width: min(380px, calc(100vw - 48px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--modal-shadow);
}

.add-task-popover[hidden] {
  display: none;
}

.date-controls,
.view-tabs,
.form-actions,
.set-controls,
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.view-tabs {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--surface-strong);
}

.view-tab {
  border: 0;
  background: transparent;
  min-height: 32px;
}

.view-tab.is-active {
  background: var(--tab-active-bg);
  color: var(--tab-active-ink);
  box-shadow: 0 1px 2px rgba(23, 32, 42, 0.12);
}

.schedule-view {
  min-height: 640px;
}

.calendar-reset-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.month-calendar {
  display: grid;
  min-height: 640px;
}

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

.calendar-weekdays {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.calendar-weekday {
  padding: 9px 8px;
  border-right: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-weekday:last-child {
  border-right: 0;
}

.calendar-weekday.is-weekend {
  color: var(--red);
}

.calendar-grid {
  grid-auto-rows: minmax(104px, 1fr);
  min-height: 592px;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 104px;
  padding: 9px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:hover {
  background: var(--button-hover-bg);
}

.calendar-day.is-outside {
  background: var(--surface-soft);
  color: var(--muted);
  opacity: 0.72;
}

.calendar-day.is-weekend .calendar-day-number {
  color: var(--red);
}

.calendar-day.is-reset-day {
  background: color-mix(in srgb, var(--surface) 78%, var(--red) 22%);
}

.calendar-day.is-today .calendar-day-number {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.calendar-day.is-selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 850;
}

.calendar-event {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--delete-line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.calendar-event-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.calendar-reset-card,
.calendar-detail-event {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--delete-line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.calendar-reset-card strong,
.calendar-detail-event strong {
  color: var(--red);
}

.calendar-reset-card span,
.calendar-detail-event span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.calendar-empty {
  min-height: 120px;
  padding: 16px;
  text-align: center;
}

.hour-view {
  display: grid;
}

.hour-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
}

.hour-label {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-soft);
  border-right: 1px solid var(--line-soft);
}

.hour-slot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
  padding: 8px;
}

.day-view {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.day-empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.week-view {
  display: grid;
  grid-template-columns: repeat(7, minmax(142px, 1fr));
  min-height: 640px;
  overflow-x: auto;
}

.week-day {
  min-width: 142px;
  border-right: 1px solid var(--line-soft);
}

.week-day:last-child {
  border-right: 0;
}

.week-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 2px;
  padding: 12px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line-soft);
}

.week-date {
  font-size: 20px;
  font-weight: 800;
}

.week-name {
  color: var(--muted);
  font-size: 13px;
}

.week-tasks {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.week-tasks .task-chip {
  min-width: 0;
}

.week-tasks .task-title {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.week-tasks .item-actions {
  justify-self: start;
}

.task-chip,
.task-item,
.template-item {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.task-chip {
  min-width: 180px;
  max-width: 100%;
  padding: 8px 10px;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

.task-item,
.template-item {
  padding: 10px;
}

.task-chip[data-category="daily"],
.task-item[data-category="daily"],
.template-item[data-category="daily"] {
  border-left-color: var(--green);
}

.task-chip[data-category="weekly"],
.task-item[data-category="weekly"],
.template-item[data-category="weekly"] {
  border-left-color: var(--blue);
}

.task-chip[data-category="raid"],
.task-item[data-category="raid"],
.template-item[data-category="raid"] {
  border-left-color: var(--red);
}

.task-chip[data-category="craft"],
.task-item[data-category="craft"],
.template-item[data-category="craft"] {
  border-left-color: var(--amber);
}

.task-chip[data-category="event"],
.task-item[data-category="event"],
.template-item[data-category="event"] {
  border-left-color: var(--violet);
}

.task-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.task-title span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.task-title-toggle {
  min-width: 0;
  min-height: auto;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.task-title-toggle:hover {
  border: 0;
  background: transparent;
  color: var(--accent);
}

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

.task-meta,
.task-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.task-note {
  overflow-wrap: anywhere;
}

.subtask-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--subtle-line);
}

.subtask-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.subtask-controls {
  display: grid;
  gap: 6px;
}

.subtask-controls[hidden] {
  display: none;
}

.subtask-row {
  display: flex;
  align-items: start;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.subtask-row input {
  width: 15px;
  height: 15px;
  min-height: auto;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 auto;
}

.subtask-row span {
  overflow-wrap: anywhere;
}

.subtask-row.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}

.delete-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
  color: var(--red);
  border-color: var(--delete-line);
  white-space: nowrap;
}

.edit-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
  color: var(--blue);
  border-color: var(--edit-line);
  white-space: nowrap;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.tool-panel {
  padding: 16px;
}

.panel-heading {
  margin-bottom: 14px;
}

.task-form,
.task-list,
.template-list {
  display: grid;
  gap: 10px;
}

.task-form label,
.set-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--control-bg);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.weekday-picker legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.weekday-picker button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.weekday-picker button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--pressed-bg);
  color: var(--accent);
}

.weekday-picker button:hover {
  border-color: var(--hover-border);
}

.weekday-picker button[aria-pressed="true"]:hover {
  border-color: var(--accent-strong);
  background: var(--pressed-hover-bg);
}

.set-controls {
  align-items: end;
  margin-bottom: 10px;
}

.set-controls label {
  flex: 1;
}

.inline-form {
  margin-bottom: 12px;
}

.inline-form input {
  flex: 1;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.dashboard-panel,
.macro-editor-panel,
.tool-panel,
.side-panel,
.command-panel {
  min-width: 0;
}

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

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

.checklist-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.checklist-item.is-done {
  border-left-color: var(--green);
}

.checklist-item-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.checklist-subtasks {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--subtle-line);
}

.subtask-progress {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.reset-info {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

.checklist-row {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: start;
}

.checklist-row input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  min-height: auto;
  margin: 3px 0 0;
  padding: 0;
}

.checklist-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.checklist-row strong,
.saved-macro strong {
  overflow-wrap: anywhere;
}

.checklist-row small,
.saved-macro span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.checklist-item.is-done .checklist-row strong {
  color: var(--muted);
  text-decoration: line-through;
}

.macro-layout {
  display: grid;
  grid-template-columns: minmax(380px, 460px) minmax(300px, 1fr);
  grid-template-areas: "editor commands";
  gap: 14px;
  align-items: start;
}

.macro-editor-panel {
  grid-area: editor;
  position: relative;
  overflow: visible;
}

.macro-editor-panel .planner-toolbar {
  flex-wrap: nowrap;
}


.command-panel {
  grid-area: commands;
}

.macro-editor-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.saved-toggle {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.saved-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.saved-macro-popover {
  position: absolute;
  z-index: 30;
  top: 52px;
  right: 12px;
  width: min(320px, calc(100% - 24px));
  max-height: min(420px, calc(100vh - 92px));
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
}

.saved-macro-popover[hidden] {
  display: none;
}

.macro-title-input {
  min-height: 34px;
  padding: 6px 10px;
}

.macro-lines {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--control-bg);
  padding: 6px 0;
}

.macro-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 0;
  align-items: center;
  min-height: 28px;
}

.macro-line:focus-within {
  background: var(--surface-soft);
}

.macro-line span {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  min-height: 28px;
  padding-right: 12px;
  color: var(--placeholder);
  font-size: 12px;
  font-weight: 800;
  user-select: none;
}

.macro-line input {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 3px 6px 3px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.macro-line input:focus {
  outline: none;
}

.macro-line-clear {
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
}

.macro-line:hover .macro-line-clear,
.macro-line:focus-within .macro-line-clear {
  opacity: 1;
}

.macro-line-clear:hover {
  background: transparent;
  color: var(--red);
}

.macro-actions,
.command-filters,
.command-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.macro-actions {
  align-items: center;
}

#saveMacroButton:not(:disabled) {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

#saveMacroButton:not(:disabled):hover {
  border-color: var(--green);
  filter: brightness(1.08);
}

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

.saved-macro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.saved-macro.is-active {
  border-left-color: var(--accent);
}

.saved-macro > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.command-heading {
  justify-content: space-between;
}

.command-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.command-mode-tabs[hidden],
.command-mode-panel[hidden] {
  display: none;
}

.command-mode-tab {
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.command-mode-tab.is-active {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 -2px 0 var(--accent-strong);
}

.command-mode-tab:not(.is-active):hover {
  background: var(--button-hover-bg);
  color: var(--ink);
}

.command-sub-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
}

.command-sub-tab {
  min-height: 30px;
  border-color: var(--line-soft);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.command-sub-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.command-sub-panel[hidden] {
  display: none;
}

.command-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 12px;
}

.action-filters {
  display: grid;
  grid-template-columns:
    minmax(96px, 0.55fr)
    minmax(110px, 0.7fr)
    minmax(200px, 1.6fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.action-filters > * {
  min-width: 0;
}

.battle-action-filters {
  grid-template-columns:
    minmax(110px, 0.7fr)
    minmax(200px, 1.6fr);
}

.action-tools .task-meta {
  min-height: 20px;
  margin: 0 0 8px;
}

.command-table-wrap {
  max-height: calc(100vh - 188px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
}

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

.battle-action-list,
.craft-action-list {
  display: grid;
  gap: 6px;
}

.command-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  overflow: hidden;
}

.command-entry:hover {
  border-color: var(--hover-border);
}

.pronoun-range-entry {
  grid-column: 1 / -1;
  grid-template-columns: minmax(72px, 0.62fr) minmax(96px, 0.86fr) 24px;
}

.pronoun-range-entry .command-button {
  padding: 0 5px;
}

.pronoun-range-controls {
  display: grid;
  grid-template-columns: 22px minmax(46px, 1fr) 22px;
  gap: 2px;
  align-items: center;
  min-width: 0;
  padding: 0 2px;
}

.pronoun-range-controls button {
  min-height: 24px;
  width: 22px;
  padding: 0;
  font-size: 12px;
  font-weight: 900;
}

.pronoun-range-controls input {
  min-height: 26px;
  padding: 0;
}

.command-button,
.command-info-button {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.command-button {
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-info-button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-left: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
}

.command-button:hover,
.command-info-button:hover {
  background: var(--button-hover-bg);
}

.craft-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(154px, auto);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 5px 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.craft-action-row:hover {
  border-color: var(--hover-border);
}

.craft-action-main {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.craft-action-main:hover {
  border: 0;
  background: transparent;
}

.craft-action-main img {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.craft-action-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.craft-action-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.craft-action-text span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.craft-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: end;
}

.craft-action-meta span,
.craft-action-meta small {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.command-info-popover {
  position: fixed;
  z-index: 120;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
}

.command-info-popover[hidden] {
  display: none;
}

.command-info-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.command-info-title strong,
.command-info-detail code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.command-info-title span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.command-info-detail {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.command-info-detail dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.command-info-detail dd {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

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

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .macro-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 14px 14px;
  }

  .app-header {
    gap: 8px;
    margin: 0 -14px 10px;
    padding: 6px 14px;
  }

  .clock-panel span {
    min-height: 38px;
    padding: 0 7px;
    font-size: 11px;
  }

  h1 {
    font-size: 16px;
  }

  .planner-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

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

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

  .macro-layout {
    grid-template-areas:
      "editor"
      "commands";
  }

  .checklist-item-main,
  .saved-macro {
    grid-template-columns: minmax(0, 1fr);
  }

  .macro-editor-body {
    padding: 10px;
  }

  .macro-line-clear {
    opacity: 1;
  }

  .macro-actions button {
    flex: 1 1 120px;
  }

  .command-heading {
    align-items: start;
  }

  .command-table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
    padding: 0;
  }

  .command-list {
    gap: 5px;
  }

  .pronoun-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .pronoun-bar .pronoun-range-entry {
    grid-template-columns: minmax(56px, 0.58fr) minmax(0, 1fr) 24px;
  }

  .pronoun-range-controls {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    gap: 4px;
    padding: 0 3px;
  }

  .pronoun-range-controls button {
    width: 26px;
  }

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

  .action-filters {
    grid-template-columns:
      minmax(78px, 0.55fr)
      minmax(86px, 0.65fr)
      minmax(128px, 1.35fr);
  }

  .battle-action-filters {
    grid-template-columns:
      minmax(96px, 0.7fr)
      minmax(160px, 1.5fr);
  }

  .craft-action-meta {
    justify-content: start;
  }

  .command-entry {
    grid-template-columns: minmax(0, 1fr) 24px;
    min-height: 30px;
  }

  .command-button {
    min-height: 28px;
    padding: 0 6px;
    font-size: 12px;
  }

  .command-info-button {
    width: 24px;
    min-height: 28px;
    font-size: 12px;
  }

  .range-title {
    flex: 1;
  }

  .calendar-reset-pill {
    order: 10;
    width: 100%;
    justify-content: center;
  }

  .calendar-grid {
    grid-auto-rows: minmax(82px, 1fr);
  }

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

  .calendar-day-number {
    width: 24px;
    min-height: 24px;
    font-size: 13px;
  }

  .calendar-event {
    justify-items: center;
    padding: 3px 2px;
    font-size: 10px;
    overflow-wrap: normal;
  }

  .calendar-event-time {
    font-size: 9px;
  }

  .calendar-event-title {
    font-size: 0;
  }

  .calendar-event-title::before {
    content: "更新";
    font-size: 10px;
  }

  .toolbar-spacer {
    display: none;
  }

  .macro-editor-panel .toolbar-spacer {
    display: block;
  }

  .view-tabs {
    order: 10;
    width: 100%;
    margin-left: 0;
  }

  .side-panel,
  .calendar-side,
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-backdrop {
    padding: 12px;
    place-items: start stretch;
  }

  .settings-panel {
    max-height: calc(100vh - 24px);
  }

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

  .settings-actions {
    justify-content: start;
  }

  .date-controls,
  .view-tabs,
  .form-actions,
  .set-controls,
  .inline-form {
    flex-wrap: wrap;
  }

  .view-tabs button {
    flex: 1;
  }

  .hour-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .weekday-picker {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    padding: 8px 6px;
  }

  .weekday-picker button {
    min-height: 32px;
    font-size: 12px;
  }
}

/* ---- dark theme: inner panel glow ---- */

:root[data-theme="dark"] .planner,
:root[data-theme="dark"] .tool-panel,
:root[data-theme="dark"] .add-task-popover,
:root[data-theme="dark"] .settings-panel {
  box-shadow:
    0 0 0 1px #8f764c,
    0 16px 38px rgba(0, 0, 0, 0.42);
}

/* ---- classic-ff theme: double-frame border ---- */

:root[data-theme="classic-ff"] .planner,
:root[data-theme="classic-ff"] .tool-panel,
:root[data-theme="classic-ff"] .add-task-popover,
:root[data-theme="classic-ff"] .settings-panel {
  border-color: #737072;
  box-shadow:
    0 0 0 1px #000000,
    inset 0 0 0 1px rgba(255, 255, 255, 0.40),
    0 14px 32px rgba(0, 0, 12, 0.60);
}

/* ---- dark + classic-ff: underline tab style ---- */

:root[data-theme="dark"] .view-tabs,
:root[data-theme="classic-ff"] .view-tabs {
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  background: transparent;
}

:root[data-theme="dark"] .view-tab,
:root[data-theme="classic-ff"] .view-tab {
  border-radius: 0;
  padding: 6px 14px;
  color: var(--muted);
  position: relative;
}

:root[data-theme="dark"] .view-tab.is-active,
:root[data-theme="classic-ff"] .view-tab.is-active {
  background: transparent;
  box-shadow: none;
  color: var(--tab-active-ink);
}

:root[data-theme="dark"] .view-tab.is-active::after,
:root[data-theme="classic-ff"] .view-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* ---- clear themes: frosted glass header titlebar ---- */

:root[data-theme^="clear-"] .app-titlebar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px 12px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
