:root {
  --bg: #eeece7;
  --surface: #eeece7;
  --surface-raised: #f8f7f3;
  --surface-muted: #e4e1da;
  --ink: #4c4944;
  --ink-strong: #2e2c29;
  --muted: #77736c;
  --muted-2: #9b968d;
  --line: rgba(255, 255, 255, 0.72);
  --line-strong: rgba(170, 165, 154, 0.28);
  --accent: #f4bf32;
  --accent-dark: #d99b00;
  --accent-soft: #ffedb9;
  --blue: #7f8d8f;
  --blue-soft: #e9e9e4;
  --amber: #c38409;
  --amber-soft: #fff0c4;
  --red: #b7654f;
  --red-soft: #f8e7df;
  --purple: #8a837e;
  --purple-soft: #ebe8e3;
  --shadow-sm:
    8px 8px 18px rgba(176, 171, 160, 0.48),
    -8px -8px 18px rgba(255, 255, 255, 0.9);
  --shadow-md:
    16px 16px 34px rgba(170, 165, 153, 0.52),
    -16px -16px 34px rgba(255, 255, 255, 0.92);
  --shadow-inset:
    inset 7px 7px 16px rgba(174, 169, 158, 0.42),
    inset -7px -7px 16px rgba(255, 255, 255, 0.9);
  --shadow-pressed:
    inset 5px 5px 12px rgba(169, 164, 153, 0.44),
    inset -5px -5px 12px rgba(255, 255, 255, 0.92);
  --radius: 8px;
  --side-width: 286px;
  font-family: "Outfit", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 96px;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f7f3 0, var(--bg) 340px, #ebe9e3 100%);
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
select,
input {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 120ms ease;
}

button:active {
  transform: translateY(1px);
}

:focus-visible {
  outline: 3px solid rgba(244, 191, 50, 0.36);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
}

.side-panel {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(180deg, #f5f4f0 0, var(--bg) 100%);
  color: var(--ink);
  box-shadow:
    10px 0 28px rgba(190, 186, 176, 0.28),
    inset -1px 0 0 rgba(255, 255, 255, 0.68);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #fffdf8, #e1ded6);
  color: var(--accent-dark);
  font-weight: 850;
  box-shadow: var(--shadow-sm);
}

.brand-block h1,
.topbar h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 300;
}

.brand-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 300;
}

.status-nav {
  min-width: 0;
  display: grid;
  gap: 7px;
  scrollbar-width: none;
}

.status-nav::-webkit-scrollbar {
  display: none;
}

.nav-button,
.icon-action,
.segmented,
.ghost-button,
.primary-button,
.task-action {
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  user-select: none;
}

.nav-button {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-button:hover {
  background: rgba(248, 247, 243, 0.72);
  color: var(--ink-strong);
  box-shadow: var(--shadow-sm);
}

.nav-button.is-active {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-pressed);
}

.nav-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-button span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.nav-button strong {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-raised);
  font-size: 0.78rem;
  box-shadow: var(--shadow-sm);
}

.nav-button.is-active strong {
  background: var(--accent);
  color: #4a3700;
  box-shadow:
    5px 5px 12px rgba(183, 149, 45, 0.22),
    -4px -4px 10px rgba(255, 255, 255, 0.82);
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-actions.sync-panel {
  grid-template-columns: 1fr;
}

.sync-status {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  box-shadow: var(--shadow-inset);
}

.sync-status svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sync-status span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sync-status.is-syncing {
  color: var(--accent-dark);
}

.sync-status.is-synced {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.sync-status.is-offline {
  color: var(--red);
  background: var(--red-soft);
}

.icon-action {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(145deg, var(--surface-raised), #e2dfd7);
  color: var(--muted);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.icon-action:hover {
  background: var(--surface-raised);
  color: var(--ink-strong);
  box-shadow: var(--shadow-pressed);
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
}

.view-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
}

.segmented {
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.segmented:hover {
  color: var(--ink);
  background: rgba(248, 247, 243, 0.78);
  box-shadow: var(--shadow-sm);
}

.segmented.is-active {
  background: linear-gradient(145deg, #ffd96f, var(--accent));
  color: #4a3700;
  box-shadow:
    5px 5px 12px rgba(178, 142, 31, 0.18),
    -4px -4px 10px rgba(255, 255, 255, 0.88);
}

.segmented svg,
.ghost-button svg,
.primary-button svg,
.task-action svg,
.icon-action svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

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

.metric {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-raised), #e5e2db);
  box-shadow: var(--shadow-sm);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  display: block;
  margin-top: 7px;
  color: var(--ink-strong);
  font-size: 1.48rem;
  line-height: 1;
  font-weight: 500;
}

.overview-insights {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.overview-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-raised), #e6e3dc);
  box-shadow: var(--shadow-sm);
}

.completion-card {
  display: grid;
  align-content: center;
  gap: 16px;
  grid-row: span 2;
}

.completion-card h3,
.chart-heading h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.96rem;
  font-weight: 500;
}

.completion-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.completion-ring {
  --completion: 0%;
  width: 152px;
  height: 152px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--surface-raised) 0 55%, transparent 56%),
    conic-gradient(var(--accent) var(--completion), #dedbd3 0);
  box-shadow:
    var(--shadow-md),
    inset 4px 4px 10px rgba(174, 169, 158, 0.3),
    inset -5px -5px 12px rgba(255, 255, 255, 0.86);
}

.completion-ring strong,
.completion-ring span {
  grid-area: 1 / 1;
}

.completion-ring strong {
  margin-top: -10px;
  color: var(--ink-strong);
  font-size: 2rem;
  line-height: 1;
  font-weight: 500;
}

.completion-ring span {
  margin-top: 42px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.chart-heading span {
  color: var(--muted-2);
  font-size: 0.76rem;
  font-weight: 400;
  white-space: nowrap;
}

.chart-list {
  display: grid;
  gap: 11px;
}

.chart-row {
  display: grid;
  gap: 6px;
}

.chart-row-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-row-label strong {
  color: var(--ink-strong);
  font-weight: 500;
}

.chart-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
  box-shadow: var(--shadow-inset);
}

.chart-fill {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffe07a, var(--accent));
  box-shadow: 0 0 12px rgba(244, 191, 50, 0.25);
}

.chart-fill.status-todo {
  background: #87948f;
}

.chart-fill.status-doing,
.chart-fill.priority-low {
  background: var(--blue);
}

.chart-fill.status-waiting,
.chart-fill.kind-client {
  background: var(--purple);
}

.chart-fill.kind-unclassified {
  background: var(--muted-2);
}

.chart-fill.status-done,
.chart-fill.kind-brand {
  background: var(--accent);
}

.chart-fill.priority-high {
  background: var(--red);
}

.chart-fill.priority-normal {
  background: var(--amber);
}

.focus-card {
  grid-column: span 2;
}

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

.focus-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-strong);
}

.focus-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.focus-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.focus-item strong {
  color: var(--ink-strong);
  font-size: 0.9rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.focus-item span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.focus-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  border: 1px dashed rgba(170, 165, 154, 0.42);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
}

.focus-empty svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.task-entry,
.controls-bar,
.board-column,
.list-view {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-raised), #e5e2db);
  box-shadow: var(--shadow-sm);
}

.task-entry {
  padding: 14px;
}

#taskForm {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(220px, 1.15fr) minmax(180px, 1fr) repeat(3, minmax(128px, 0.72fr)) minmax(150px, 0.8fr) minmax(154px, 0.9fr) minmax(220px, 1.35fr) auto;
  gap: 10px;
  align-items: end;
}

.field,
.priority-field {
  min-width: 0;
}

.field label,
.priority-field legend {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.field input,
.field select,
.controls-bar select,
.search-wrap input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-inset);
}

.field input::placeholder,
.search-wrap input::placeholder {
  color: var(--muted-2);
}

.field input:hover,
.field select:hover,
.controls-bar select:hover,
.search-wrap input:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field select:focus,
.controls-bar select:focus,
.search-wrap input:focus {
  border-color: var(--accent);
  background: #f9f8f4;
  box-shadow:
    var(--shadow-inset),
    0 0 0 3px rgba(244, 191, 50, 0.2);
}

.priority-field {
  min-height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
}

.priority-field label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-right: 0;
  background: var(--surface);
  color: var(--muted);
  overflow: hidden;
  box-shadow: var(--shadow-inset);
}

.priority-field label:first-of-type {
  border-radius: var(--radius) 0 0 var(--radius);
}

.priority-field label:last-of-type {
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.priority-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.priority-field input:checked + span {
  color: var(--accent-dark);
  font-weight: 600;
}

.priority-field label:has(input:checked) {
  background: linear-gradient(145deg, #ffdf7a, var(--accent));
  border-color: rgba(216, 156, 0, 0.32);
  box-shadow:
    5px 5px 12px rgba(178, 142, 31, 0.16),
    -4px -4px 10px rgba(255, 255, 255, 0.84);
}

.primary-button {
  min-width: 96px;
  padding: 10px 14px;
  background: linear-gradient(145deg, #ffdd75, var(--accent));
  color: #4a3700;
  font-weight: 600;
  box-shadow:
    8px 8px 16px rgba(181, 144, 35, 0.2),
    -7px -7px 16px rgba(255, 255, 255, 0.86);
}

.primary-button:hover {
  background: linear-gradient(145deg, #ffd25b, #e3a600);
  box-shadow: var(--shadow-pressed);
}

.controls-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(130px, auto) minmax(220px, auto) minmax(160px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.search-wrap {
  position: relative;
  min-width: 0;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: var(--accent-dark);
  transform: translateY(-50%);
}

.search-wrap input {
  padding-left: 36px;
}

.ghost-button {
  min-width: 118px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(145deg, var(--surface-raised), #e3e0d8);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-pressed);
}

.board-view {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.board-column {
  min-width: 0;
  padding: 12px;
  border-color: rgba(255, 255, 255, 0.58);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
}

.column-header h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.94rem;
  font-weight: 500;
}

.column-header span {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  box-shadow: var(--shadow-pressed);
}

.task-stack {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #faf9f5, #e8e5dd);
  box-shadow: var(--shadow-sm);
}

.task-card:hover {
  border-color: var(--line-strong);
  border-left-color: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.task-card.is-overdue {
  border-color: rgba(163, 59, 52, 0.4);
  border-left-color: var(--red);
  background: linear-gradient(145deg, #fff8f5, #eadfd8);
}

.task-card h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.meta-row,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-actions {
  padding-top: 2px;
}

.pill {
  min-height: 24px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.2;
  box-shadow: var(--shadow-pressed);
}

.pill.priority-high {
  border-color: #f5c1bd;
  background: var(--red-soft);
  color: var(--red);
}

.pill.priority-normal {
  border-color: #f3dda7;
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.priority-low {
  border-color: rgba(127, 141, 143, 0.22);
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.kind-brand {
  border-color: rgba(216, 156, 0, 0.22);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.pill.kind-unclassified,
.pill.created-pill {
  border-color: rgba(154, 150, 141, 0.24);
  background: var(--surface);
  color: var(--muted);
}

.pill.kind-client {
  border-color: rgba(138, 131, 126, 0.22);
  background: var(--purple-soft);
  color: var(--purple);
}

.pill.status-todo {
  color: #43504c;
}

.pill.status-doing {
  border-color: rgba(127, 141, 143, 0.22);
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.status-waiting {
  border-color: rgba(138, 131, 126, 0.22);
  background: var(--purple-soft);
  color: var(--purple);
}

.pill.status-done {
  border-color: rgba(216, 156, 0, 0.22);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.task-action {
  min-width: 36px;
  width: 36px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(145deg, var(--surface-raised), #e3e0d8);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}

.task-action:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pressed);
}

.task-action.is-danger:hover {
  border-color: rgba(163, 59, 52, 0.4);
  background: var(--red-soft);
  color: var(--red);
}

.list-view {
  overflow: hidden;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th,
.list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
}

.list-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.list-table tr:last-child td {
  border-bottom: 0;
}

.list-table tbody tr:hover {
  background: rgba(248, 247, 243, 0.72);
}

.list-title {
  display: grid;
  gap: 4px;
}

.list-title strong {
  color: var(--ink-strong);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.list-title span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  border: 1px dashed rgba(170, 165, 154, 0.42);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
}

.empty-state svg {
  width: 28px;
  height: 28px;
  color: var(--muted-2);
}

.bottom-function-bar {
  position: fixed;
  left: calc(var(--side-width) + 24px);
  right: 24px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  height: 66px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    12px 12px 28px rgba(167, 162, 151, 0.5),
    -10px -10px 24px rgba(255, 255, 255, 0.88),
    inset 1px 1px 0 rgba(255, 255, 255, 0.78);
}

.bar-button {
  min-width: 0;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.bar-button svg {
  width: 19px;
  height: 19px;
}

.bar-button:hover,
.bar-button.is-active {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-pressed);
}

.bar-button-primary {
  background: linear-gradient(145deg, #ffdc70, var(--accent));
  color: #4a3700;
  box-shadow:
    8px 8px 16px rgba(181, 144, 35, 0.2),
    -7px -7px 16px rgba(255, 255, 255, 0.86);
}

.bar-button-primary:hover,
.bar-button-primary.is-active {
  background: linear-gradient(145deg, #ffd25b, #e3a600);
  color: #4a3700;
  box-shadow: var(--shadow-pressed);
}

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

@media (max-width: 1400px) {
  #taskForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide,
  .field-notes {
    grid-column: auto;
  }

  .primary-button {
    align-self: stretch;
  }
}

@media (max-width: 1180px) {
  .overview-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .completion-card {
    grid-row: auto;
  }

  .focus-card {
    grid-column: span 2;
  }

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

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

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    width: 100%;
    overflow: hidden;
    height: auto;
    padding: 14px;
  }

  .brand-block {
    min-height: 48px;
  }

  .status-nav {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    width: auto;
    min-width: 138px;
  }

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

  .workspace {
    padding: 16px;
  }

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

  .metrics-strip,
  .overview-insights,
  .board-view,
  #taskForm,
  .controls-bar {
    grid-template-columns: 1fr;
  }

  .completion-card,
  .focus-card {
    grid-column: auto;
    grid-row: auto;
  }

  .completion-ring {
    width: 136px;
    height: 136px;
  }

  .view-toggle,
  .segmented,
  .ghost-button,
  .primary-button {
    width: 100%;
  }

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

  .metric {
    min-height: 72px;
  }

  .list-view {
    overflow-x: auto;
  }

  .list-table {
    min-width: 1040px;
  }

  .bottom-function-bar {
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 64px;
    border-radius: var(--radius);
  }

  .bar-button {
    min-height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
