:root {
  color-scheme: dark;
  --ink: #f6f2e8;
  --muted: #c8d3c3;
  --soft: rgba(246, 242, 232, 0.72);
  --panel: rgba(18, 42, 31, 0.93);
  --panel-strong: rgba(14, 31, 25, 0.97);
  --line: rgba(246, 242, 232, 0.16);
  --line-strong: rgba(246, 242, 232, 0.28);
  --green: #62b36f;
  --leaf: #8fd16b;
  --moss: #244c36;
  --amber: #f4c267;
  --clay: #d98b5f;
  --teal: #8fd0bf;
  --danger: #f18f7f;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  --radius: 8px;
  --control: 46px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #10251f;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #10251f;
}

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.app-backdrop,
.leaf-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.app-backdrop {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 17, 15, 0.82), rgba(9, 32, 24, 0.58) 44%, rgba(6, 20, 18, 0.82)),
    url("../assets/jungle-focus-bg.webp");
  background-position: center;
  background-size: cover;
}

.leaf-wash {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, rgba(244, 194, 103, 0.18), transparent 25%),
    radial-gradient(circle at 72% 10%, rgba(143, 208, 191, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(9, 30, 25, 0.2), rgba(6, 15, 13, 0.62));
}

.app-shell {
  --shell-x: clamp(56px, 8vw, 120px);
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px calc(var(--shell-x) + env(safe-area-inset-right)) 24px calc(var(--shell-x) + env(safe-area-inset-left));
}

.topbar,
.workspace>section,
.workspace>aside,
.notes-panel,
.records-panel,
.timer-card,
.rest-card,
.account-dialog,
.record-dialog {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px;
  border-radius: var(--radius);
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand>span:last-child {
  min-width: 0;
}

.brand-mark,
.icon-only,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(143, 209, 107, 0.4);
  border-radius: var(--radius);
  color: #11251d;
  background: linear-gradient(135deg, var(--leaf), var(--amber));
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  max-width: 44vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(390px, 1.1fr);
  gap: 18px;
  align-items: start;
  padding-top: 18px;
}

.records-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.workspace>section,
.workspace>aside,
.notes-panel,
.records-panel {
  min-width: 0;
  border-radius: var(--radius);
}

.focus-panel,
.records-panel,
.notes-panel,
.account-panel {
  padding: 22px;
}

.panel-kicker {
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 6px 0 0;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  max-width: 9999ch;
  font-size: 2.8rem;
}

h2 {
  font-size: 1.28rem;
}

h3 {
  font-size: 1.06rem;
}

.focus-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field>span,
.search-field>span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: var(--control);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(7, 22, 18, 0.62);
  outline: none;
}

input,
textarea {
  padding: 11px 12px;
}

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

select {
  padding: 0 38px 0 12px;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: rgba(244, 194, 103, 0.74);
  box-shadow: 0 0 0 3px rgba(244, 194, 103, 0.18);
}

.duration-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr)) minmax(136px, 1.25fr);
  gap: 8px;
}


.pill-button,
.custom-duration {
  min-height: var(--control);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(7, 22, 18, 0.54);
}

.pill-button {
  padding: 0 10px;
  font-weight: 800;
}

.pill-button.is-selected {
  border-color: rgba(143, 209, 107, 0.72);
  color: #12251b;
  background: linear-gradient(135deg, var(--leaf), var(--amber));
}

.custom-duration {
  display: grid;
  grid-template-columns: max-content minmax(54px, 68px);
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
}

.custom-duration span {
  min-width: max-content;
  overflow: visible;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-overflow: clip;
  white-space: nowrap;
}

.custom-duration input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border-color: transparent;
  text-align: center;
  background: rgba(246, 242, 232, 0.08);
  appearance: textfield;
  -moz-appearance: textfield;
}

.custom-duration input::-webkit-inner-spin-button,
.custom-duration input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.timer-card,
.rest-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.rest-card {
  background: rgba(12, 31, 25, 0.72);
}

.timer-meta,
.section-head,
.week-grove-summary,
.record-tools,
.auth-actions,
.signed-in-actions,
.dialog-actions {
  display: flex;
  align-items: center;
}

.timer-meta,
.section-head,
.record-tools {
  justify-content: space-between;
  gap: 12px;
}

.timer-meta {
  color: var(--soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.growth-stage {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 210px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(246, 242, 232, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(143, 208, 191, 0.12), rgba(11, 27, 22, 0.44) 50%),
    linear-gradient(0deg, rgba(22, 57, 39, 0.88), rgba(12, 31, 25, 0.7));
}

.growth-stage::before,
.growth-stage::after {
  position: absolute;
  right: -12%;
  bottom: -18%;
  width: 58%;
  height: 46%;
  border-radius: 50%;
  background: rgba(143, 209, 107, 0.18);
  content: "";
}

.growth-stage::after {
  right: auto;
  left: -16%;
  width: 52%;
  background: rgba(217, 139, 95, 0.12);
}

.sun-orb {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--amber);
  filter: blur(0.2px);
  opacity: 0.8;
  box-shadow: 0 0 52px rgba(244, 194, 103, 0.46);
}

.plant {
  position: relative;
  width: 138px;
  height: 152px;
  transform: scale(var(--active-scale, calc(0.25 + (var(--growth) * 0.82))));
  transform-origin: center bottom;
  transition: transform 500ms ease;
  z-index: 1;
}

.tree-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tree-svg path,
.tree-svg circle,
.tree-svg ellipse,
.tree-svg rect {
  stroke-linejoin: round;
}

.timer-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin: 16px auto 0;
}

.progress-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.progress-ring-track {
  fill: none;
  stroke: rgba(246, 242, 232, 0.08);
  stroke-width: 5;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 540.35;
  stroke-dashoffset: 540.35;
  transition: stroke-dashoffset 0.9s ease, stroke 0.4s ease;
}

.timer-display {
  position: relative;
  font-variant-numeric: tabular-nums;
  font-size: 5.6rem;
  font-weight: 850;
  line-height: 0.96;
  text-align: center;
  z-index: 1;
}

.timer-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.timer-primary-actions {
  display: flex;
  gap: 9px;
}

.timer-primary-actions > button {
  flex: 1;
}

.rest-display {
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 2.8rem;
  font-weight: 850;
  line-height: 1;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.icon-only {
  min-height: var(--control);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.primary-button {
  border-color: rgba(143, 209, 107, 0.68);
  color: #10251f;
  background: linear-gradient(135deg, var(--leaf), var(--amber));
}

.google-button {
  width: 100%;
}

.secondary-button {
  color: var(--ink);
  background: rgba(246, 242, 232, 0.1);
}

.ghost-button {
  color: var(--soft);
  background: rgba(7, 22, 18, 0.2);
}

.icon-button {
  gap: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(246, 242, 232, 0.08);
}

.account-button {
  min-width: 104px;
}

.icon-only {
  width: var(--control);
  height: var(--control);
  padding: 0;
  color: var(--ink);
  background: rgba(246, 242, 232, 0.08);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stat {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 22, 18, 0.48);
}

.stat span,
.record-date,
.record-status,
.account-status {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--amber);
  font-size: 1.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-panel .notes-list {
  margin-top: 14px;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.notes-empty {
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.note-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 242, 232, 0.04);
}

.note-item.is-done {
  opacity: 0.5;
}

.note-item.is-done .note-text {
  text-decoration: line-through;
}

.note-checkbox {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: unset;
  cursor: pointer;
  accent-color: var(--leaf);
  border-radius: 3px;
}

.note-text {
  flex: 1;
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-word;
}

.note-delete {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.5;
}

.note-delete:hover {
  opacity: 1;
  color: var(--danger);
}

.drag-handle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  color: var(--muted);
  opacity: 0.35;
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.note-item:hover .drag-handle {
  opacity: 0.7;
}

.note-item.is-dragging {
  opacity: 0.35;
  border-style: dashed;
}

.note-item.drag-over-top {
  border-top: 2px solid var(--leaf);
}

.note-item.drag-over-bottom {
  border-bottom: 2px solid var(--leaf);
}

.notes-form {
  display: flex;
  gap: 8px;
}

.notes-form input {
  flex: 1;
}

.week-grove {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(143, 209, 107, 0.08), rgba(7, 22, 18, 0.48)),
    rgba(7, 22, 18, 0.4);
}

.week-grove-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grove-controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.week-grove-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}


.grove-view-toggle {
  display: flex;
  gap: 3px;
}

.grove-view-toggle .pill-button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.week-range-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.week-range-nav p {
  margin: 0 4px;
}

.range-nav-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.week-today {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.week-today:hover {
  background: rgba(246, 242, 232, 0.07);
}

.week-today.is-current {
  color: var(--leaf);
  border-color: rgba(143, 209, 107, 0.35);
}

.week-grove-summary {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.week-grove-summary span {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(246, 242, 232, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.week-forest {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: end;
  align-content: flex-end;
  justify-content: center;
  min-height: 174px;
  margin-top: 12px;
  padding: 18px 14px 18px;
  overflow: hidden;
  border: 1px solid rgba(246, 242, 232, 0.12);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(246, 242, 232, 0.08);
  background:
    linear-gradient(180deg, rgba(33, 66, 56, 0.86), rgba(13, 34, 27, 0.92) 44%, rgba(21, 55, 35, 0.9));
}

.week-forest-empty {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 1 0 100%;
  place-items: center;
  min-height: 108px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.grove-tree {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 0 0 calc(96px + var(--tree-girth, 0px));
  align-content: end;
  justify-items: center;
  min-width: 0;
  min-height: 164px;
  padding: 4px 2px calc(14px + var(--tree-depth, 0px));
  border: 1px solid transparent;
  border-radius: var(--radius);
  animation: tree-rise 220ms ease both;
  animation-delay: var(--tree-delay);
}

.grove-tree::before {
  position: absolute;
  bottom: calc(7px + var(--tree-depth, 0px));
  left: 50%;
  width: var(--tree-mound-width, 40px);
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(111, 93, 48, 0.68), rgba(35, 67, 37, 0.46) 58%, rgba(8, 23, 18, 0) 74%);
  box-shadow: inset 0 -3px 0 rgba(8, 23, 18, 0.18);
  content: "";
  transform: translateX(-50%);
  z-index: 0;
}

.grove-tree:hover {
  background: rgba(246, 242, 232, 0.05);
}

.grove-plant {
  position: absolute;
  bottom: calc(16px + var(--tree-depth, 0px));
  left: 50%;
  display: block;
  width: 138px;
  height: 152px;
  pointer-events: none;
  transform:
    translateX(-50%) translate(var(--tree-shift, 0), var(--tree-floor, 0)) rotate(var(--tree-tilt, 0deg)) scale(var(--active-scale, 0.56)) scaleX(var(--grove-stretch-x, 1)) scaleY(var(--grove-stretch-y, 1));
  transform-origin: center bottom;
  transition: none;
  z-index: 1;
}

.tree-label {
  position: absolute;
  bottom: 2px;
  left: 50%;
  overflow: hidden;
  max-width: calc(100% - 4px);
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid rgba(246, 242, 232, 0.14);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(7, 22, 18, 0.82);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  z-index: 5;
}

.grove-tree:hover .tree-label,
.grove-tree:focus-within .tree-label {
  opacity: 1;
  transform: translate(-50%, 0);
}


@keyframes tree-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.record-tools {
  margin-top: 16px;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 40px;
}

.record-tools select {
  width: min(168px, 38%);
}

.records-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.record-item {
  content-visibility: auto;
  contain-intrinsic-size: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 22, 18, 0.54);
}

.record-main {
  min-width: 0;
}

.record-title-row,
.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-title-row {
  min-width: 0;
}

.record-title {
  overflow: hidden;
  margin: 0;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-date {
  margin-top: 4px;
}

.record-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(143, 209, 107, 0.12);
  white-space: nowrap;
}

.record-status.abandoned {
  color: #ffd5ca;
  background: rgba(241, 143, 127, 0.12);
}

.record-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.metric {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(246, 242, 232, 0.1);
  font-size: 0.78rem;
  font-weight: 800;
}

.record-actions {
  align-self: start;
}

.record-actions .icon-only {
  width: 38px;
  height: 38px;
  min-height: 38px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-top: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: var(--amber);
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(143, 208, 191, 0.1);
  font-size: 0.76rem;
  font-weight: 900;
}

.account-status {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 22, 18, 0.48);
}

.auth-form,
.signed-in-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-form[hidden],
.signed-in-actions[hidden] {
  display: none;
}

.auth-actions,
.signed-in-actions {
  flex-wrap: wrap;
}

.auth-actions {
  gap: 9px;
}

.signed-in-actions {
  display: flex;
}

.account-dialog,
.record-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border-radius: var(--radius);
  color: var(--ink);
}

.account-dialog {
  width: min(440px, calc(100% - 28px));
}

.account-dialog::backdrop,
.record-dialog::backdrop {
  background: rgba(3, 10, 9, 0.64);
}

.account-dialog-body,
.record-dialog form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

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

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(380px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(14, 31, 25, 0.95);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1160px) {
  .workspace {
    grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  }

  .duration-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .duration-row .custom-duration {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(72px, 104px);
  }

  .account-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .app-shell {
    --shell-x: clamp(34px, 9vw, 58px);
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar {
    top: 8px;
    min-height: 62px;
    gap: 8px;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .top-actions .icon-button {
    width: auto;
    min-width: 84px;
    padding: 0 9px;
  }

  .top-actions span {
    display: inline;
    overflow: hidden;
    max-width: 62px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
  }

  .records-col {
    gap: 12px;
  }

  .focus-panel,
  .records-panel,
  .notes-panel,
  .account-panel {
    padding: 16px;
  }

  h1 {
    max-width: 9999ch;
    font-size: 1.55rem;
  }

  .duration-row,
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .week-forest {
    padding: 12px;
  }

  .grove-tree {
    flex-basis: calc(52px + var(--tree-girth, 0px));
  }

  .custom-duration {
    grid-template-columns: 1fr 88px;
  }

  .growth-stage {
    min-height: 184px;
  }

  .timer-display {
    font-size: 4.2rem;
  }

  .record-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .record-tools select {
    width: 100%;
  }

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

  .record-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 430px) {
  .app-shell {
    --shell-x: clamp(28px, 9vw, 38px);
  }

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

  .top-actions {
    width: 100%;
  }

  .top-actions .icon-button {
    flex: 1 1 0;
    min-width: 0;
  }

  .top-actions span {
    max-width: none;
  }

  .brand strong {
    max-width: 190px;
  }

  .brand small {
    max-width: 190px;
  }

  .timer-display {
    font-size: 3.4rem;
  }

  .record-title-row {
    flex-wrap: wrap;
  }
}

.timer-mode-toggle {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.timer-mode-toggle .pill-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

#durationField[hidden] {
  display: none;
}

.danger-zone {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.danger-button {
  width: 100%;
  color: var(--danger);
  border-color: rgba(241, 143, 127, 0.28);
}

.danger-button:hover:not(:disabled) {
  background: rgba(241, 143, 127, 0.1);
}

.sound-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(246, 242, 232, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 80px;
}

.volume-slider {
  flex: 1;
  min-width: 0;
  height: 4px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(246, 242, 232, 0.18);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--leaf);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--leaf);
  cursor: pointer;
}

.volume-slider:focus-visible {
  box-shadow: 0 0 0 3px rgba(143, 209, 107, 0.28);
}

.volume-label {
  width: 34px;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}