:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --page: #f4f6fc;
  --glow-primary: #dbe3ff;
  --glow-secondary: #daf6ed;
  --surface: rgb(255 255 255 / 90%);
  --surface-solid: #fff;
  --surface-soft: #f7f8fd;
  --text: #182033;
  --muted: #66708d;
  --subtle: #7a849e;
  --border: #e1e5f0;
  --border-strong: #cfd5e9;
  --primary: #5648ce;
  --primary-hover: #4437b7;
  --primary-soft: #eceaff;
  --primary-contrast: #fff;
  --shadow: 0 18px 48px rgb(51 75 140 / 12%);
  color: var(--text);
  background: var(--page);
}

:root[data-accent="blue"] {
  --primary: #2875c7;
  --primary-hover: #1f61a7;
  --primary-soft: #e4f0ff;
}

:root[data-accent="green"] {
  --primary: #218568;
  --primary-hover: #176b53;
  --primary-soft: #e1f6ef;
}

:root[data-accent="orange"] {
  --primary: #b56722;
  --primary-hover: #955219;
  --primary-soft: #fff0df;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111524;
  --glow-primary: #202a50;
  --glow-secondary: #153a35;
  --surface: rgb(27 33 52 / 93%);
  --surface-solid: #20273b;
  --surface-soft: #1a2032;
  --text: #edf0fb;
  --muted: #b0b8d0;
  --subtle: #929db8;
  --border: #343d58;
  --border-strong: #46516f;
  --primary: #998eff;
  --primary-hover: #b0a6ff;
  --primary-soft: #312d5c;
  --primary-contrast: #171326;
  --shadow: 0 22px 60px rgb(0 0 0 / 28%);
}

:root[data-theme="dark"][data-accent="blue"] {
  --primary: #67b2ff;
  --primary-hover: #8ac4ff;
  --primary-soft: #203d5e;
}

:root[data-theme="dark"][data-accent="green"] {
  --primary: #62d3ad;
  --primary-hover: #82e0c0;
  --primary-soft: #20483e;
}

:root[data-theme="dark"][data-accent="orange"] {
  --primary: #ffb56f;
  --primary-hover: #ffc58d;
  --primary-soft: #513821;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, var(--glow-primary) 0, transparent 32rem),
    radial-gradient(circle at 94% 92%, var(--glow-secondary) 0, transparent 28rem),
    var(--page);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(113 102 221 / 30%);
  outline-offset: 2px;
}
h1, h2, p { margin-top: 0; }

.workbench-shell {
  width: min(calc(100% - 32px), 1180px);
  margin: 32px auto;
}

.workbench-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3d8bd1);
  box-shadow: 0 9px 22px rgb(76 77 194 / 24%);
}
.brand-mark svg { width: 29px; height: 29px; }
.header-copy { min-width: 0; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.13em; }
h1 { margin-bottom: 5px; font-size: clamp(1.7rem, 3.5vw, 2.25rem); letter-spacing: -0.04em; }
.subtitle { margin-bottom: 0; color: var(--muted); }

.header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.date-chip, .header-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-solid);
  white-space: nowrap;
}
.header-button:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.header-button:disabled { cursor: not-allowed; opacity: 0.62; }
.button-icon { width: 18px; height: 18px; }
.app-message { min-height: 1.3em; margin: 10px 4px 0; color: #c94352; font-size: 0.85rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.dashboard-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 280px;
  padding: 36px;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}
.dashboard-empty-mark { display: grid; width: 52px; height: 52px; margin-bottom: 14px; place-items: center; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.dashboard-empty-mark svg { width: 25px; height: 25px; }
.dashboard-empty h2 { margin-bottom: 8px; color: var(--text); font-size: 1.2rem; }
.dashboard-empty p { margin-bottom: 18px; }
.widget-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.widget-size-small { grid-column: span 4; }
.widget-size-medium { grid-column: span 8; }
.widget-size-large { grid-column: span 12; }
.widget-header { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.widget-kicker { margin-bottom: 5px; color: var(--primary); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; }
.widget-title { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.widget-status { display: inline-flex; gap: 7px; align-items: center; color: var(--subtle); font-size: 0.74rem; white-space: nowrap; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #41a980; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.notes-editor { display: block; margin-top: 18px; }
.notes-editor textarea {
  width: 100%;
  min-height: 190px;
  padding: 15px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  line-height: 1.7;
  background: var(--surface-solid);
}
.notes-editor textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgb(113 102 221 / 13%); }
.notes-footer { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: 12px; }
.notes-save-status { margin-bottom: 0; color: var(--subtle); font-size: 0.76rem; }
.notes-save-status[data-state="saved"] { color: #218568; }
.notes-save-status[data-state="error"] { color: #c94352; }
.secondary-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  background: var(--surface-solid);
}
.secondary-button:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.secondary-button:disabled { cursor: not-allowed; opacity: 0.55; }

.links-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.4fr) auto;
  gap: 12px;
  margin-top: 18px;
}
.links-form-actions { display: flex; gap: 8px; align-items: end; }
.links-form .add-button { grid-column: auto; min-width: 104px; }
.links-message { grid-column: 1 / -1; min-height: 1.2em; margin: 0; color: var(--subtle); font-size: 0.78rem; }
.links-message[data-state="success"] { color: #218568; }
.links-message[data-state="error"] { color: #c94352; }
.links-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.links-empty { grid-column: 1 / -1; padding: 24px; border: 1px dashed var(--border-strong); border-radius: 13px; color: var(--subtle); text-align: center; }
.link-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-solid); }
.link-anchor { display: flex; gap: 10px; align-items: center; min-width: 0; color: var(--text); text-decoration: none; }
.link-anchor:hover strong { color: var(--primary); }
.link-mark { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--primary); font-weight: 850; background: var(--primary-soft); }
.link-details { display: grid; gap: 3px; min-width: 0; }
.link-details strong, .link-details span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-details strong { font-size: 0.86rem; }
.link-details span { color: var(--subtle); font-size: 0.7rem; }
.link-actions { display: flex; flex-direction: column; }
.link-action { padding: 4px 6px; border: 0; color: var(--muted); font-size: 0.68rem; background: transparent; }
.link-action:hover { color: var(--primary); }
.link-action.is-danger:hover { color: #c94352; }

.timer-content { display: grid; gap: 20px; place-items: center; margin-top: 20px; }
.timer-dial {
  --timer-progress: 360deg;
  position: relative;
  display: grid;
  width: 178px;
  height: 178px;
  place-content: center;
  border-radius: 50%;
  text-align: center;
  background: conic-gradient(var(--primary) var(--timer-progress), var(--surface-soft) 0);
}
.timer-dial::before {
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--surface-solid);
  content: "";
}
.timer-time, .timer-duration { position: relative; z-index: 1; }
.timer-time { color: var(--text); font-size: clamp(2.1rem, 4vw, 2.7rem); font-variant-numeric: tabular-nums; letter-spacing: -0.06em; }
.timer-duration { margin-top: 4px; color: var(--subtle); font-size: 0.72rem; }
.timer-settings { display: grid; gap: 12px; width: 100%; }
.timer-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.timer-preset {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  background: var(--surface-solid);
}
.timer-preset:hover, .timer-preset[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.timer-custom-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.timer-custom-form .field input { height: 40px; }
.timer-custom-form .secondary-button { height: 40px; }
.timer-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 16px; }
.timer-actions .add-button { grid-column: auto; width: 100%; height: 42px; }
.timer-actions .secondary-button { min-width: 74px; height: 42px; }
.timer-message { min-height: 2.5em; margin: 10px 0 0; color: var(--subtle); font-size: 0.74rem; line-height: 1.55; }
.timer-message[data-state="success"] { color: #218568; }
.timer-message[data-state="error"] { color: #c94352; }

.task-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.field { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.field-title { grid-column: span 4; }
.field-category, .field-priority, .field-due-date { grid-column: span 2; }
.field input, .field select {
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--surface-solid);
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgb(113 102 221 / 13%); }
.field input[aria-invalid="true"] { border-color: #dc5360; }
.add-button {
  grid-column: span 2;
  align-self: end;
  height: 46px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  color: var(--primary-contrast);
  font-weight: 800;
  background: var(--primary);
  transition: transform 160ms ease, background 160ms ease;
}
.add-button:hover { background: var(--primary-hover); transform: translateY(-1px); }
.form-message { grid-column: 1 / -1; min-height: 1.2em; margin: 0; color: #c94352; font-size: 0.85rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.stat-card { display: grid; gap: 5px; padding: 14px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.stat-card span { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.stat-card strong { color: var(--primary); font-size: 1.35rem; }

.task-toolbar { display: flex; gap: 18px; align-items: end; justify-content: space-between; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.search-field { width: min(280px, 36vw); }
.search-field input { height: 39px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.filter-list button { min-height: 33px; padding: 0 10px; border: 0; border-radius: 9px; color: var(--muted); font-size: 0.78rem; background: transparent; }
.filter-list button:hover { background: var(--surface-soft); }
.filter-list button[aria-pressed="true"] { color: var(--primary); font-weight: 800; background: var(--primary-soft); }

.task-list { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.task-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 68px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); }
.task-item.is-completed { background: var(--surface-soft); }
.task-item.is-completed .task-title { color: var(--subtle); text-decoration: line-through; }
.task-toggle, .task-delete { width: 36px; height: 36px; border-radius: 10px; }
.task-toggle { border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-solid); }
.task-toggle:hover { border-color: var(--primary); color: var(--primary); }
.is-completed .task-toggle { border-color: var(--primary); color: var(--primary-contrast); background: var(--primary); }
.task-details { display: grid; gap: 7px; min-width: 0; }
.task-title { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.category-badge, .priority-badge, .due-date, .overdue-badge { padding: 4px 8px; border-radius: 7px; font-size: 0.7rem; font-weight: 750; }
.category-study { color: #345dc2; background: #e8f0ff; }
.category-daily { color: #19795c; background: #e5f8f0; }
.priority-low { color: #4d6875; background: #eaf0f3; }
.priority-medium { color: #8b6414; background: #fff3d2; }
.priority-high { color: #b83243; background: #ffe8eb; }
.due-date { color: var(--muted); background: var(--surface-soft); }
.overdue-badge { color: #fff; background: #c94352; }
:root[data-theme="dark"] .category-study { color: #a9c2ff; background: #293b68; }
:root[data-theme="dark"] .category-daily { color: #8de0c0; background: #204c40; }
:root[data-theme="dark"] .priority-low { color: #c0d2dc; background: #354450; }
:root[data-theme="dark"] .priority-medium { color: #f1cf7d; background: #514523; }
:root[data-theme="dark"] .priority-high { color: #ffb4bd; background: #5b2931; }
.task-delete { border: 0; color: var(--subtle); background: transparent; }
.task-delete:hover { color: #d44a59; background: #fff0f1; }
:root[data-theme="dark"] .task-delete:hover { background: #48262e; }
.empty-state { display: grid; min-height: 130px; place-items: center; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--subtle); text-align: center; }

.workbench-footer { display: flex; gap: 8px; align-items: center; margin: 18px 4px 0; color: var(--subtle); font-size: 0.76rem; }

.customize-dialog {
  width: min(460px, 100%);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--text);
  background: transparent;
}
.customize-dialog[open] { display: block; animation: panel-enter 180ms ease-out; }
.customize-dialog::backdrop { background: rgb(12 18 35 / 62%); }
@keyframes panel-enter {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
.customize-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; border-left: 1px solid var(--border); background: var(--surface-solid); box-shadow: -20px 0 60px rgb(19 30 62 / 22%); }
.customize-header { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; padding: 26px 24px 20px; border-bottom: 1px solid var(--border); }
.customize-header h2 { margin-bottom: 7px; font-size: 1.35rem; }
.customize-header p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.icon-button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: var(--surface-soft); }
.icon-button:hover { color: var(--primary); border-color: var(--primary); }
.icon-button svg { width: 19px; height: 19px; }
.customize-scroll { overflow-y: auto; padding: 8px 24px 28px; overscroll-behavior: contain; }
.customize-section { padding: 20px 0; border-bottom: 1px solid var(--border); }
.customize-section h3 { margin-bottom: 12px; font-size: 0.9rem; }
.customize-section-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.customize-section-heading span { color: var(--subtle); font-size: 0.7rem; }
.dashboard-title-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.dashboard-title-form .field input { height: 40px; }
.dashboard-title-form .secondary-button { height: 40px; }
.accent-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.accent-option { display: grid; gap: 7px; min-height: 62px; padding: 8px 5px; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); font-size: 0.68rem; font-weight: 750; background: var(--surface-soft); }
.accent-option:hover, .accent-option[aria-pressed="true"] { color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.accent-swatch { width: 22px; height: 22px; border: 3px solid var(--surface-solid); border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong); }
.accent-option[data-accent="violet"] .accent-swatch { background: #6a5ae0; }
.accent-option[data-accent="blue"] .accent-swatch { background: #2875c7; }
.accent-option[data-accent="green"] .accent-swatch { background: #218568; }
.accent-option[data-accent="orange"] .accent-swatch { background: #b56722; }
.widget-settings { display: grid; gap: 10px; }
.widget-setting { display: grid; gap: 13px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.widget-setting-heading { display: flex; gap: 11px; align-items: center; }
.widget-setting-heading > div { display: grid; gap: 3px; min-width: 0; }
.widget-setting-heading strong { font-size: 0.83rem; }
.widget-setting-heading > div span { color: var(--subtle); font-size: 0.68rem; }
.visibility-toggle { position: relative; display: block; width: 38px; height: 22px; flex: 0 0 auto; }
.visibility-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.visibility-control { position: absolute; inset: 0; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-solid); transition: background 150ms ease, border-color 150ms ease; }
.visibility-control::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--subtle); content: ""; transition: transform 150ms ease, background 150ms ease; }
.visibility-toggle input:checked + .visibility-control { border-color: var(--primary); background: var(--primary); }
.visibility-toggle input:checked + .visibility-control::after { background: var(--primary-contrast); transform: translateX(16px); }
.visibility-toggle input:focus-visible + .visibility-control { outline: 3px solid rgb(113 102 221 / 30%); outline-offset: 2px; }
.widget-setting-controls { display: grid; grid-template-columns: minmax(100px, 0.8fr) minmax(150px, 1.2fr); gap: 10px; align-items: end; }
.widget-size-field { display: grid; gap: 5px; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
.widget-size-field select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface-solid); }
.move-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.move-button { min-height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); font-size: 0.7rem; font-weight: 750; background: var(--surface-solid); }
.move-button:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.move-button:disabled { cursor: not-allowed; opacity: 0.45; }
.backup-section p { margin-bottom: 13px; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
.backup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.backup-actions .secondary-button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-width: 0; height: 40px; }
.backup-actions svg { width: 17px; height: 17px; flex: 0 0 auto; }
.reset-section { border-bottom: 0; }
.reset-section p { margin-bottom: 13px; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
.danger-button { min-height: 38px; padding: 0 12px; border: 1px solid #e7a7ae; border-radius: 10px; color: #b83243; font-size: 0.75rem; font-weight: 750; background: transparent; }
.danger-button:hover { border-color: #c94352; background: #fff0f1; }
:root[data-theme="dark"] .danger-button { color: #ffb4bd; border-color: #75414a; }
:root[data-theme="dark"] .danger-button:hover { background: #48262e; }
.customize-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 15px 24px; border-top: 1px solid var(--border); background: var(--surface-solid); }
.customize-footer p { min-height: 1.2em; margin: 0; color: var(--subtle); font-size: 0.72rem; line-height: 1.4; }
.customize-footer p[data-state="success"] { color: #218568; }
.customize-footer p[data-state="error"] { color: #c94352; }
.customize-footer .add-button { grid-column: auto; min-width: 88px; height: 40px; }

@media (max-width: 900px) {
  .workbench-header { grid-template-columns: auto minmax(0, 1fr); }
  .header-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .widget-size-small { grid-column: span 6; }
  .widget-size-medium, .widget-size-large { grid-column: span 12; }
  .task-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-title { grid-column: 1 / -1; }
  .field-category, .field-priority, .field-due-date, .add-button { grid-column: span 1; }
  .task-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: min(100%, 320px); }
  .filter-list { justify-content: flex-start; }
  .links-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .workbench-shell { width: min(calc(100% - 20px), 1180px); margin: 10px auto 22px; }
  .workbench-header { padding: 20px 18px; border-radius: 21px; }
  .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
  .subtitle { font-size: 0.88rem; line-height: 1.55; }
  .header-actions { align-items: stretch; flex-direction: column; }
  .date-chip, .header-button { justify-content: center; width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .widget-size-small, .widget-size-medium, .widget-size-large { grid-column: 1; }
  .widget-card { padding: 21px 18px; border-radius: 20px; }
  .widget-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .notes-editor textarea { min-height: 170px; }
  .notes-footer { align-items: stretch; flex-direction: column; }
  .notes-footer .secondary-button { width: 100%; }
  .links-form { grid-template-columns: 1fr; }
  .links-form-actions { align-items: stretch; flex-direction: column; }
  .links-form-actions .add-button, .links-form-actions .secondary-button { width: 100%; }
  .links-list { grid-template-columns: 1fr; }
  .timer-content { margin-top: 16px; }
  .timer-dial { width: 170px; height: 170px; }
  .task-form { grid-template-columns: 1fr; margin-top: 20px; }
  .field-title, .field-category, .field-priority, .field-due-date, .add-button { grid-column: 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .search-field { width: 100%; }
  .task-item { align-items: start; }
  .task-toggle, .task-delete { margin-top: 2px; }
  .customize-dialog { width: 100%; }
  .customize-panel { border-left: 0; }
  .customize-header { padding: 22px 18px 17px; }
  .customize-scroll { padding: 6px 18px 24px; }
  .customize-footer { padding: 13px 18px; }
}
