:root {
  --panel-width: 380px;
  --board-width: 2400px;
  --board-height: 1600px;
  --bg: #f3efe5;
  --panel: rgba(255, 250, 240, 0.84);
  --panel-strong: #fffaf0;
  --line: #cbb89d;
  --line-active: #b4562d;
  --text: #2e241c;
  --muted: #736251;
  --accent: #d96a3b;
  --accent-soft: #f6d5be;
  --node-a: #fff9f0;
  --node-b: #f3e4cc;
  --done: #7a8f62;
  --shadow: 0 20px 50px rgba(83, 54, 28, 0.16);
  --group-sand-a: #fff9f0;
  --group-sand-b: #f3e4cc;
  --group-sun-a: #fff0da;
  --group-sun-b: #f2c98d;
  --group-coral-a: #ffe6dc;
  --group-coral-b: #efb198;
  --group-sage-a: #edf4e4;
  --group-sage-b: #bfd3a4;
  --group-sky-a: #e7f4f9;
  --group-sky-b: #aacddd;
  --group-plum-a: #f3e7f5;
  --group-plum-b: #cfb0d3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 106, 59, 0.14), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(163, 120, 69, 0.2), transparent 22%),
    linear-gradient(135deg, #f8f2e8, #ece1d0 58%, #efe8dc);
}

body.project-page {
  overflow: hidden;
}

body.auth-page,
body.dashboard-page {
  overflow: auto;
}

a {
  color: inherit;
}

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

.eyebrow {
  margin-bottom: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.button {
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.button.secondary {
  background: #eadbc3;
  color: #61452e;
}

.button.ghost {
  background: rgba(46, 36, 28, 0.08);
  color: var(--text);
}

.button.danger {
  background: rgba(197, 106, 77, 0.16);
  color: #7d3c28;
}

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

.alert {
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 14px;
}

.alert.error {
  background: rgba(197, 106, 77, 0.15);
  color: #7d3c28;
}

.auth-shell,
.dashboard-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-card,
.panel-card {
  border: 1px solid rgba(101, 69, 42, 0.12);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.84);
  box-shadow: 0 28px 80px rgba(83, 54, 28, 0.16);
  backdrop-filter: blur(14px);
}

.auth-card {
  width: min(520px, 100%);
  padding: 32px;
}

.auth-copy,
.dashboard-subcopy {
  color: var(--muted);
}

.auth-form,
.stack-form {
  display: grid;
  gap: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

label span {
  display: block;
  margin-bottom: 8px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(101, 69, 42, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.66);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.auth-submit {
  width: 100%;
}

.auth-switch {
  margin-top: 18px;
  color: var(--muted);
}

.dashboard-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 24px;
}

.panel-card {
  padding: 26px;
}

.project-list {
  display: grid;
  gap: 14px;
}

.project-card-link {
  text-decoration: none;
}

.project-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 0 0 1px rgba(101, 69, 42, 0.08);
}

.project-card:hover {
  box-shadow: inset 0 0 0 1px rgba(217, 106, 59, 0.32), 0 16px 30px rgba(83, 54, 28, 0.08);
}

.project-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-card h3 {
  margin-bottom: 0;
}

.project-card-meta,
.empty-card {
  color: var(--muted);
}

.role-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(217, 106, 59, 0.12);
  color: #7a391f;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-shell {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.project-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(101, 69, 42, 0.12);
  background: rgba(255, 250, 240, 0.84);
  backdrop-filter: blur(12px);
}

.project-header h1 {
  margin-bottom: 6px;
}

.project-header-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.project-back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  text-decoration: none;
}

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

.history-actions {
  display: inline-flex;
  gap: 10px;
}

.save-state {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(122, 143, 98, 0.12);
  color: #4e6440;
  font-size: 0.82rem;
}

.save-state.saving {
  background: rgba(196, 138, 44, 0.14);
  color: #8c6220;
}

.save-state.dirty {
  background: rgba(217, 106, 59, 0.14);
  color: #8a4426;
}

.save-state.error {
  background: rgba(197, 106, 77, 0.15);
  color: #7d3c28;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px var(--panel-width);
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.board-viewport {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  scroll-padding: 120px;
  overscroll-behavior: none;
  cursor: crosshair;
}

.board-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 93, 67, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 93, 67, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.board-viewport.is-panning {
  cursor: grabbing;
}

.board-viewport.is-selecting {
  cursor: crosshair;
}

.board-viewport.is-selecting * {
  cursor: crosshair !important;
}

.readonly-board .board-viewport {
  cursor: grab;
}

.board-viewport.pan-ready,
.board-viewport.pan-ready * {
  cursor: grab !important;
}

.board-viewport.is-panning * {
  cursor: grabbing !important;
}

body.panning-board {
  user-select: none;
}

.board-stage {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.board {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--board-width);
  height: var(--board-height);
  transform-origin: top left;
  will-change: transform;
}

svg.connections {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.branch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.branch-toggle {
  position: absolute;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(101, 69, 42, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: 0 10px 24px rgba(83, 54, 28, 0.16);
  color: var(--accent);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
}

.branch-toggle:hover,
.branch-toggle:focus-visible {
  border-color: var(--accent);
  background: #fff7f0;
  outline: none;
}

.branch-toggle.collapsed {
  background: rgba(246, 213, 190, 0.9);
}

.node-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.selection-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.node {
  position: absolute;
  width: 240px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(101, 69, 42, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--node-a), var(--node-b));
  box-shadow: var(--shadow);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.readonly-board .node {
  cursor: default;
  touch-action: pan-x pan-y;
}

.node:hover,
.node:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px rgba(83, 54, 28, 0.2);
}

.node.selected {
  border-color: var(--accent);
  box-shadow: 0 26px 60px rgba(180, 86, 45, 0.28);
}

.node.multi-selected {
  border-color: rgba(217, 106, 59, 0.58);
  box-shadow: 0 22px 50px rgba(180, 86, 45, 0.2);
}

.node.grouped:not(.selected):not(.multi-selected) {
  border-color: rgba(217, 106, 59, 0.28);
  box-shadow: 0 18px 44px rgba(180, 86, 45, 0.12);
}

.node.dragging {
  cursor: grabbing;
  transform: rotate(-1deg);
  z-index: 5;
}

.node.root {
  background: linear-gradient(180deg, #fff4dc, #efd1a2);
}

.node.group-sand { --node-a: var(--group-sand-a); --node-b: var(--group-sand-b); }
.node.group-sun { --node-a: var(--group-sun-a); --node-b: var(--group-sun-b); }
.node.group-coral { --node-a: var(--group-coral-a); --node-b: var(--group-coral-b); }
.node.group-sage { --node-a: var(--group-sage-a); --node-b: var(--group-sage-b); }
.node.group-sky { --node-a: var(--group-sky-a); --node-b: var(--group-sky-b); }
.node.group-plum { --node-a: var(--group-plum-a); --node-b: var(--group-plum-b); }

.marquee-selection {
  position: absolute;
  border: 1.5px dashed rgba(217, 106, 59, 0.82);
  border-radius: 24px;
  background: rgba(217, 106, 59, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.6);
}

.selection-group-frame {
  position: absolute;
  border: 2px solid rgba(217, 106, 59, 0.48);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.48);
}

.selection-group-badge {
  position: absolute;
  top: -18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(101, 69, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.98);
  box-shadow: 0 14px 32px rgba(83, 54, 28, 0.16);
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.selection-group-badge:hover,
.selection-group-badge:focus-visible {
  background: #fff7ef;
  border-color: rgba(217, 106, 59, 0.4);
  outline: none;
}

.selection-group-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.selection-group-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selection-group-count {
  min-width: 10px;
  text-align: center;
}

.node-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.node-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.node-meta {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.badge {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(217, 106, 59, 0.13);
  color: var(--accent);
  font-size: 0.76rem;
  text-align: center;
}

.task-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(46, 36, 28, 0.08);
  font-size: 0.76rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.task-pill.done {
  background: rgba(122, 143, 98, 0.18);
  color: #476035;
}

.task-pill:hover,
.task-pill:focus-visible {
  background: rgba(217, 106, 59, 0.16);
  outline: none;
}

.add-node {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--accent-soft);
  color: #7a391f;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.readonly-board .add-node,
.readonly-board .node-direction {
  display: none;
}

.node-direction {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 8px;
  background: rgba(217, 106, 59, 0.18);
  color: transparent;
  cursor: pointer;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.node-direction:hover,
.node-direction:focus-visible,
.node-direction.active {
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(180, 86, 45, 0.28);
}

.node-direction.left {
  left: -16px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

.node-direction.right {
  right: -16px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}

.node-direction.bottom {
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%) rotate(180deg);
}

.node-direction.left:hover,
.node-direction.left:focus-visible,
.node-direction.left.active {
  transform: translateY(-50%) rotate(-90deg) scale(1.05);
}

.node-direction.right:hover,
.node-direction.right:focus-visible,
.node-direction.right.active {
  transform: translateY(-50%) rotate(90deg) scale(1.05);
}

.node-direction.bottom:hover,
.node-direction.bottom:focus-visible,
.node-direction.bottom.active {
  transform: translateX(-50%) rotate(180deg) scale(1.05);
}

.side-panel {
  position: relative;
  display: flex;
  height: 100%;
  min-width: 280px;
  min-height: 0;
  padding: 24px;
  background: var(--panel);
  border-left: 1px solid rgba(101, 69, 42, 0.12);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.panel-resizer {
  position: relative;
  cursor: col-resize;
  background: linear-gradient(
    90deg,
    transparent 0,
    transparent 4px,
    rgba(101, 69, 42, 0.12) 4px,
    rgba(101, 69, 42, 0.12) 10px,
    transparent 10px,
    transparent 100%
  );
}

.panel-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 72px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(101, 69, 42, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 250, 240, 0.7);
}

body.resizing-panel {
  cursor: col-resize;
  user-select: none;
}

.side-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(101, 69, 42, 0.08);
  border-radius: 28px;
  pointer-events: none;
}

.panel-content {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.intro {
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px rgba(101, 69, 42, 0.08);
}

.field {
  margin-bottom: 16px;
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1 1 0;
}

.task-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 0 0 1px rgba(101, 69, 42, 0.08);
}

.task-item span.done {
  color: var(--muted);
  text-decoration: line-through;
}

.task-button {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.task-preview {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.mini {
  font-size: 0.78rem;
  color: var(--muted);
}

.empty {
  padding: 14px;
  border-radius: 18px;
  background: rgba(46, 36, 28, 0.05);
  color: var(--muted);
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(101, 69, 42, 0.16);
  border-radius: 999px;
  cursor: pointer;
}

.swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 106, 59, 0.16);
}

.swatch[data-group="sand"] { background: linear-gradient(180deg, var(--group-sand-a), var(--group-sand-b)); }
.swatch[data-group="sun"] { background: linear-gradient(180deg, var(--group-sun-a), var(--group-sun-b)); }
.swatch[data-group="coral"] { background: linear-gradient(180deg, var(--group-coral-a), var(--group-coral-b)); }
.swatch[data-group="sage"] { background: linear-gradient(180deg, var(--group-sage-a), var(--group-sage-b)); }
.swatch[data-group="sky"] { background: linear-gradient(180deg, var(--group-sky-a), var(--group-sky-b)); }
.swatch[data-group="plum"] { background: linear-gradient(180deg, var(--group-plum-a), var(--group-plum-b)); }

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

.line-style-button,
.order-mode-button {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 12px;
  border: 1px solid rgba(101, 69, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  color: var(--text);
  text-align: left;
}

.line-style-button.active,
.order-mode-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 106, 59, 0.12);
}

.structure-menu-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.structure-menu-button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(101, 69, 42, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.structure-menu-button:hover,
.structure-menu-button:focus-visible,
.structure-menu-button.active {
  border-color: var(--accent);
  background: rgba(246, 213, 190, 0.36);
  box-shadow: 0 0 0 3px rgba(217, 106, 59, 0.1);
  outline: none;
}

.structure-menu-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-height: 20px;
  color: var(--accent);
  font-weight: 700;
}

.structure-menu-label {
  line-height: 1.35;
}

.popover-layer {
  position: fixed;
  inset: 0;
  z-index: 18;
}

.direction-menu {
  position: absolute;
  width: 360px;
  padding: 18px;
  border: 1px solid rgba(101, 69, 42, 0.12);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.97);
  box-shadow: 0 24px 60px rgba(46, 36, 28, 0.22);
  backdrop-filter: blur(14px);
  max-height: min(74vh, 560px);
  overflow: auto;
}

.direction-menu h3 {
  margin-bottom: 8px;
}

.line-style-sample {
  width: 100%;
  height: 0;
  border-top-color: currentColor;
  border-top-style: solid;
}

.line-style-sample.solid { border-top-width: 3px; }
.line-style-sample.dashed { border-top-width: 3px; border-top-style: dashed; }
.line-style-sample.dotted { border-top-width: 4px; border-top-style: dotted; }
.line-style-sample.accent { border-top-width: 5px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(46, 36, 28, 0.32);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.97);
  box-shadow: 0 28px 80px rgba(46, 36, 28, 0.28);
}

.modal.wide {
  width: min(760px, 100%);
}

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

.close-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(46, 36, 28, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.zoom-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
}

.zoom-stack {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.zoom-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(101, 69, 42, 0.12);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 18px 40px rgba(83, 54, 28, 0.12);
  backdrop-filter: blur(14px);
}

.history-panel {
  justify-content: end;
}

.mode-panel {
  justify-content: end;
}

.zoom-button {
  min-width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(46, 36, 28, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.zoom-button.reset {
  min-width: auto;
  padding: 0 14px;
  font-size: 0.9rem;
}

.zoom-button.icon-button {
  min-width: 42px;
  width: 42px;
  border-radius: 999px;
}

.zoom-button.mode-button {
  min-width: 46px;
  width: 46px;
  border-radius: 16px;
}

.zoom-button.is-active {
  background: rgba(217, 106, 59, 0.22);
  color: #8a4426;
  box-shadow: inset 0 0 0 1px rgba(217, 106, 59, 0.2);
}

.zoom-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoom-button:hover,
.zoom-button:focus-visible {
  background: rgba(217, 106, 59, 0.16);
  outline: none;
}

.zoom-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.zoom-level {
  min-width: 68px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

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

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 0 0 1px rgba(101, 69, 42, 0.08);
}

.member-row strong,
.project-summary strong {
  display: block;
}

.member-row span,
.project-summary span {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-summary {
  display: grid;
  gap: 12px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.project-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.share-link-box {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.share-link-box input {
  flex: 1 1 auto;
}

.status-note {
  margin-top: 10px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  body,
  body.project-page {
    overflow: auto;
  }

  .dashboard-grid,
  .split-grid,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .project-header,
  .dashboard-header {
    flex-direction: column;
  }

  .project-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .panel-resizer {
    display: none;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid rgba(101, 69, 42, 0.12);
  }

  .zoom-controls {
    top: 16px;
    right: 16px;
  }

  .zoom-panel {
    flex-wrap: wrap;
  }

  .board-stage {
    min-height: 720px;
  }
}

@media (max-width: 780px) {
  :root {
    --panel-width: min(100vw, 420px);
  }

  body.project-page {
    min-height: 100dvh;
    overflow: auto;
  }

  .project-shell {
    height: auto;
    min-height: 100dvh;
  }

  .project-header {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 14px;
    padding: 14px 14px 12px;
    backdrop-filter: blur(18px);
  }

  .project-header h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.1;
  }

  .project-header-copy {
    width: 100%;
  }

  .project-meta,
  #projectMeta {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .project-actions {
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .project-actions::-webkit-scrollbar {
    display: none;
  }

  .project-actions .button,
  .project-actions .save-state {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(56dvh, 1fr) auto;
    min-height: calc(100dvh - 92px);
  }

  .workspace {
    min-height: 56dvh;
  }

  .board-viewport {
    padding: 12px 12px 96px;
    scroll-padding: 56px;
    -webkit-overflow-scrolling: touch;
  }

  .board-viewport::before {
    background-size: 24px 24px;
  }

  .zoom-controls {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 16;
  }

  .zoom-stack {
    justify-items: stretch;
  }

  .zoom-panel {
    justify-content: center;
    width: 100%;
    padding: 8px;
    gap: 6px;
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.94);
    box-shadow: 0 18px 36px rgba(83, 54, 28, 0.18);
  }

  .zoom-button {
    min-width: 40px;
    height: 40px;
  }

  .zoom-button.reset {
    padding: 0 12px;
  }

  .zoom-level {
    min-width: 56px;
    font-size: 0.84rem;
  }

  .side-panel {
    min-width: 0;
    height: auto;
    max-height: 42dvh;
    padding: 12px;
    border-left: 0;
    border-top: 1px solid rgba(101, 69, 42, 0.12);
    background: rgba(255, 250, 240, 0.92);
  }

  .side-panel::before {
    inset: 8px;
    border-radius: 22px;
  }

  .panel-content {
    padding-right: 0;
  }

  .intro {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 18px;
  }

  .row {
    flex-wrap: wrap;
  }

  .row > * {
    min-width: 0;
  }

  .split-grid,
  .share-link-box,
  .member-row {
    grid-template-columns: 1fr;
  }

  .member-row {
    gap: 8px;
  }

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

  .task-item .button,
  .task-item .button.ghost {
    grid-column: 2;
    justify-self: start;
  }
}
