:root {
  color-scheme: light;
  --bg: #eef1ed;
  --ink: #1d2522;
  --muted: #65706b;
  --line: #cfd8d2;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --pressure: #c84e3a;
  --open: #437b5c;
  --shadow: 0 18px 50px rgba(35, 45, 40, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior-y: contain;
}

button,
input {
  font: inherit;
}

button,
input[type="range"],
.sync-panel input {
  touch-action: manipulation;
}

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

.topbar {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(260px, 340px);
  align-items: center;
  gap: 14px;
  padding: 0 4px 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 0.98;
  letter-spacing: 0;
}

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

.capacity-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 8px;
}

.capacity-pill span {
  color: var(--muted);
  font-size: 13px;
}

.capacity-pill strong {
  font-size: 24px;
}

.sync-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.sync-key-row,
.sync-actions {
  display: grid;
  gap: 6px;
}

.sync-key-row {
  grid-template-columns: minmax(0, 1fr) 58px;
}

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

.sync-panel input,
.sync-panel button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sync-panel input {
  min-width: 0;
  padding: 6px 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 12px;
}

.sync-panel button {
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.sync-actions button:first-child {
  background: #28342f;
  color: #fff;
}

.sync-panel p {
  color: var(--muted);
  font-size: 11px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.landscape-panel,
.side-panel section,
.bottom-dock section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.landscape-panel {
  min-height: 500px;
  padding: 14px;
  overflow: hidden;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-switch {
  display: grid;
  grid-template-columns: 34px 58px 34px;
  gap: 4px;
}

.nav-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.today-nav {
  font-size: 12px;
  font-weight: 800;
}

.nav-button:hover {
  border-color: #28342f;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.view-button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.view-button.active {
  background: var(--ink);
  color: #fff;
}

.panel-header p,
.allocation p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.compact {
  margin-bottom: 12px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
}

.week-axis {
  display: grid;
  grid-template-columns: 160px repeat(6, minmax(84px, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 0 0 6px;
}

.week-axis[data-mode="day"] {
  grid-template-columns: 160px repeat(7, minmax(74px, 1fr));
}

.week-label {
  min-height: 28px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.week-label.selected {
  color: var(--ink);
  border-color: #28342f;
  font-weight: 800;
}

.landscape {
  display: grid;
  gap: 12px;
}

.area-group {
  display: grid;
  gap: 8px;
}

.area-label {
  min-height: 28px;
  padding: 7px 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.area-label strong,
.area-label span {
  display: inline;
}

.area-label strong {
  color: var(--ink);
  font-size: 14px;
}

.area-label span {
  margin-left: 8px;
  font-size: 12px;
}

.area-rows {
  display: grid;
  gap: 8px;
}

.project-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.project-name {
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  color: var(--ink);
}

.project-name.active {
  background: var(--surface-strong);
  outline: 2px solid color-mix(in srgb, var(--project) 50%, transparent);
}

.project-name strong {
  display: block;
  font-size: 15px;
}

.project-name span {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.project-name em {
  display: block;
  margin-top: 3px;
  color: var(--project);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.project-name small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.project-weeks {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(84px, 1fr));
  gap: 8px;
  min-height: 66px;
}

.project-weeks[data-mode="day"] {
  grid-template-columns: repeat(7, minmax(74px, 1fr));
}

.week-cell {
  position: relative;
  min-height: 66px;
  border: 1px solid rgba(207, 216, 210, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  overflow: hidden;
}

.week-cell.current {
  background: #fffdf5;
}

.allocation-band {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 9px;
  border-radius: 5px;
  background: var(--project);
  transition: height 180ms ease, opacity 180ms ease;
}

.week-cell.tentative .allocation-band {
  opacity: 0.28;
}

.week-cell.confirmed .allocation-band {
  opacity: 1;
}

.deadline {
  position: absolute;
  right: 6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--pressure);
}

.target {
  position: absolute;
  right: 6px;
  top: 10px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border: 2px solid var(--project);
  background: var(--surface-strong);
}

.milestone-stack {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 7px;
  z-index: 1;
}

.milestone-stack.inline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
}

.milestone-marker {
  position: relative;
  display: block;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--project);
  border-left-width: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.milestone-marker.hard {
  border-color: var(--pressure);
}

.milestone-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: color-mix(in srgb, var(--project) 30%, #ffffff);
}

.milestone-marker.hard .milestone-progress {
  background: color-mix(in srgb, var(--pressure) 30%, #ffffff);
}

.milestone-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.milestone-copy::before {
  position: absolute;
  inset: -2px -3px;
  z-index: -1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.54);
  content: "";
}

.milestone-marker b,
.milestone-marker small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.milestone-marker b {
  font-size: 11px;
}

.milestone-marker small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.milestone-marker.compact {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 3px 5px;
  border-left-width: 3px;
  background: rgba(255, 255, 255, 0.78);
}

.milestone-marker.compact b {
  max-width: 100%;
  font-size: 10px;
}

.milestone-marker.compact .milestone-copy::before {
  inset: -1px -2px;
}

.milestone-marker.compact small {
  display: none;
}

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

.side-panel section,
.bottom-dock section {
  padding: 16px;
}

.bottom-dock {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}

.day-button {
  min-width: 0;
  min-height: 42px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  cursor: pointer;
}

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

.day-button strong {
  color: var(--ink);
  font-size: 11px;
}

.day-button span {
  margin-top: 3px;
  font-size: 12px;
}

.day-button.active {
  border-color: #28342f;
  background: #28342f;
  color: #fff;
}

.day-button.active strong,
.day-button.active span {
  color: #fff;
}

.allocation-area {
  padding-top: 8px;
}

.copy-previous-button {
  width: 100%;
  min-height: 36px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #28342f;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

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

.capacity-control {
  display: grid;
  gap: 9px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.capacity-control-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.capacity-control-topline label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.capacity-control-topline strong {
  font-size: 18px;
}

.capacity-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.capacity-steps button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f2;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.allocation-area + .allocation-area {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.allocation-area > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.allocation-control {
  display: grid;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.control-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-topline label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--project);
}

.hours {
  color: var(--muted);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--project);
}

input[type="range"]::-webkit-slider-thumb {
  min-width: 24px;
  min-height: 24px;
}

.pressure-meter {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pressure-topline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meter-track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: #dfe6e1;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--open);
  transition: width 180ms ease, background 180ms ease;
}

.happened-panel h2,
.project-detail h2 {
  margin: 0;
}

.dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dock-switch {
  display: grid;
  grid-template-columns: repeat(2, 62px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.dock-tab {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.dock-tab.active {
  background: var(--ink);
  color: #fff;
}

.scenario-group {
  display: grid;
  gap: 8px;
}

.scenario-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
}

.scenario-button.active {
  border-color: #28342f;
  background: #28342f;
  color: #fff;
}

.today-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.today-note {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.today-note strong {
  font-size: 13px;
}

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

.today-note b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.today-row {
  display: grid;
  grid-template-columns: 12px 1fr auto 58px;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
}

.today-row strong {
  color: var(--ink);
  font-size: 12px;
}

.today-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.today-modes {
  grid-template-columns: 1fr;
}

.week-summary {
  display: grid;
  gap: 10px;
}

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

.drift-controls {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.drift-group {
  display: grid;
  gap: 7px;
}

.drift-group p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drift-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drift-chip {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--project) 46%, var(--line));
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.drift-chip.active {
  background: var(--project);
  color: #fff;
}

.drift-chip.neutral {
  border-color: var(--line);
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}

.progress-strip {
  height: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe6e1;
}

.progress-strip span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--project);
}

.milestone-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.empty-milestone,
.completed-milestones {
  margin-bottom: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

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

.completed-milestones {
  display: grid;
  gap: 7px;
}

.completed-milestones p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.completed-milestone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
}

.completed-milestone strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completed-milestone span {
  font-weight: 800;
}

.milestone-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.milestone-button.active {
  border-color: var(--project);
  box-shadow: inset 4px 0 0 var(--project);
}

.milestone-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.milestone-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.milestone-actions {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  margin-bottom: 12px;
}

.milestone-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.milestone-actions button:first-child {
  border-color: color-mix(in srgb, var(--project) 48%, var(--line));
}

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

.project-editors {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 12px;
}

.project-editors label:first-child {
  grid-column: 1 / -1;
}

.project-editors label {
  display: grid;
  gap: 7px;
}

.project-editors label span,
.deadline-picker-topline span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-editors input[type="date"],
.project-editors input[type="text"] {
  min-height: 38px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
}

.deadline-picker {
  display: grid;
  gap: 7px;
}

.deadline-picker-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deadline-picker-topline strong {
  color: var(--ink);
  font-size: 13px;
}

.deadline-calendar {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.calendar-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-month strong {
  font-size: 13px;
}

.calendar-steppers {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 5px;
}

.calendar-steppers button,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f6f2;
  color: var(--ink);
  cursor: pointer;
}

.calendar-steppers button {
  min-height: 28px;
  font-size: 12px;
  line-height: 1;
}

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

.calendar-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.calendar-blank,
.calendar-day {
  min-height: 28px;
}

.calendar-day {
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.calendar-day.selected {
  border-color: var(--project);
  background: var(--project);
  color: #fff;
}

.stat {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.reflow-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.reflow-preview h2 {
  margin-bottom: 4px;
}

.reflow-preview p {
  color: var(--muted);
  font-size: 14px;
}

.reflow-options {
  display: grid;
  gap: 7px;
}

.reflow-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-strong);
}

.reflow-card strong {
  display: block;
  margin-bottom: 8px;
}

.reflow-card span {
  color: var(--muted);
  font-size: 13px;
}

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

  .side-panel section,
  .bottom-dock section {
    box-shadow: 0 12px 32px rgba(35, 45, 40, 0.1);
  }

  .week-axis {
    grid-template-columns: 120px repeat(6, 112px);
    min-width: 840px;
  }

  .week-axis[data-mode="day"] {
    grid-template-columns: 120px repeat(7, 96px);
    min-width: 840px;
  }

  .project-row {
    grid-template-columns: 120px 1fr;
    min-width: 840px;
  }

  .project-weeks {
    grid-template-columns: repeat(6, 112px);
  }

  .project-weeks[data-mode="day"] {
    grid-template-columns: repeat(7, 96px);
  }

  .landscape-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

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

  .topbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .capacity-pill {
    width: 100%;
    justify-content: space-between;
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: stretch;
  }

  .nav-switch {
    grid-template-columns: 44px minmax(62px, 1fr) 44px;
  }

  .nav-button,
  .view-button,
  .icon-button,
  .scenario-button,
  .dock-tab,
  .sync-panel button,
  .sync-panel input,
  .copy-previous-button,
  .milestone-actions button {
    min-height: 44px;
  }

  .view-switch {
    grid-template-columns: repeat(2, 52px);
  }

  .day-picker {
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .day-button {
    min-height: 48px;
  }

  .project-stats,
  .week-metrics,
  .project-editors,
  .milestone-list,
  .milestone-actions,
  .reflow-options {
    grid-template-columns: 1fr;
  }

  .project-editors label:first-child {
    grid-column: auto;
  }

  .completed-milestone,
  .milestone-button {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 34px;
  }

  .app-shell {
    padding: 12px;
  }

  .landscape-panel,
  .side-panel section,
  .bottom-dock section {
    padding: 12px;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }

  .nav-switch,
  .view-switch {
    width: 100%;
  }

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

  .dock-header,
  .deadline-picker-topline,
  .control-topline,
  .pressure-topline {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .dock-switch {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .week-axis,
  .project-row {
    min-width: 760px;
  }

  .week-axis {
    grid-template-columns: 112px repeat(6, 104px);
  }

  .week-axis[data-mode="day"] {
    grid-template-columns: 112px repeat(7, 92px);
  }

  .project-row {
    grid-template-columns: 112px 1fr;
  }

  .project-weeks {
    grid-template-columns: repeat(6, 104px);
  }

  .project-weeks[data-mode="day"] {
    grid-template-columns: repeat(7, 92px);
  }
}
