:root {
  --paper: #f7f4e8;
  --paper-deep: #efe8d3;
  --ink: #163321;
  --green: #08742b;
  --green-rgb: 8, 116, 43;
  --green-active: #075f24;
  --green-dark: #052f13;
  --green-meta: #147045;
  --green-soft: #dcefd7;
  --green-soft-light: #e9fff3;
  --coral: #d45b4c;
  --amber: #e4ad37;
  --line: rgba(45, 75, 70, 0.18);
  --shadow: 0 18px 50px rgba(26, 35, 28, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-palette="yellow"] {
  --green: #d99a14;
  --green-rgb: 217, 154, 20;
  --green-active: #a86105;
  --green-dark: #713f12;
  --green-meta: #b7791f;
  --green-soft: #fff0b8;
  --green-soft-light: #fff8db;
}

:root[data-palette="coral"] {
  --green: #d45b4c;
  --green-rgb: 212, 91, 76;
  --green-active: #b64235;
  --green-dark: #7f2c24;
  --green-meta: #c34d40;
  --green-soft: #f8d8d3;
  --green-soft-light: #fff0ee;
}

:root[data-palette="olive"] {
  --green: #6f7d35;
  --green-rgb: 111, 125, 53;
  --green-active: #586329;
  --green-dark: #3b421c;
  --green-meta: #64722e;
  --green-soft: #e5ebc7;
  --green-soft-light: #f4f7e6;
}

:root[data-palette="rose"] {
  --green: #be3a5b;
  --green-rgb: 190, 58, 91;
  --green-active: #9f2f4d;
  --green-dark: #6f2035;
  --green-meta: #be3a5b;
  --green-soft: #f8dce4;
  --green-soft-light: #fff0f4;
}

:root[data-palette="brick"] {
  --green: #9f4f37;
  --green-rgb: 159, 79, 55;
  --green-active: #823e2a;
  --green-dark: #5f2d1f;
  --green-meta: #934933;
  --green-soft: #efd8cf;
  --green-soft-light: #fbf0eb;
}

:root[data-palette="mint"] {
  --green: #1fa66a;
  --green-rgb: 31, 166, 106;
  --green-active: #147d4e;
  --green-dark: #0d5234;
  --green-meta: #188c58;
  --green-soft: #c8f0dd;
  --green-soft-light: #edfff6;
}

:root[data-palette="tangerine"] {
  --green: #f07822;
  --green-rgb: 240, 120, 34;
  --green-active: #c35a10;
  --green-dark: #803a0a;
  --green-meta: #d76618;
  --green-soft: #ffd9b8;
  --green-soft-light: #fff2e5;
}

:root[data-palette="berry"] {
  --green: #e23d70;
  --green-rgb: 226, 61, 112;
  --green-active: #bd2856;
  --green-dark: #7a1735;
  --green-meta: #cc315f;
  --green-soft: #f8c9d9;
  --green-soft-light: #fff0f6;
}

:root[data-palette="lavender"] {
  --green: #7b61d1;
  --green-rgb: 123, 97, 209;
  --green-active: #6048ad;
  --green-dark: #3d2b78;
  --green-meta: #6d55bf;
  --green-soft: #ddd5ff;
  --green-soft-light: #f3efff;
}

:root[data-palette="cocoa"] {
  --green: #8a5a2b;
  --green-rgb: 138, 90, 43;
  --green-active: #70451e;
  --green-dark: #4b2d13;
  --green-meta: #7a4d24;
  --green-soft: #ead6bd;
  --green-soft-light: #f8efe3;
}

:root[data-palette="ocean"] {
  --green: #1688a8;
  --green-rgb: 22, 136, 168;
  --green-active: #0f6b85;
  --green-dark: #0a4859;
  --green-meta: #137a98;
  --green-soft: #c7edf5;
  --green-soft-light: #ecfbff;
}

:root[data-palette="lemon"] {
  --green: #f3c63a;
  --green-rgb: 243, 198, 58;
  --green-active: #c99b12;
  --green-dark: #755909;
  --green-meta: #b68710;
  --green-soft: #fff1a8;
  --green-soft-light: #fff9d8;
}

:root[data-palette="peach"] {
  --green: #f08a5d;
  --green-rgb: 240, 138, 93;
  --green-active: #c86539;
  --green-dark: #813d20;
  --green-meta: #d7744a;
  --green-soft: #ffd3bc;
  --green-soft-light: #fff0e7;
}

:root[data-palette="sky"] {
  --green: #54a9e8;
  --green-rgb: 84, 169, 232;
  --green-active: #2f82bd;
  --green-dark: #1f567d;
  --green-meta: #3b91cf;
  --green-soft: #c7e6ff;
  --green-soft-light: #eef8ff;
}

:root[data-palette="lilac"] {
  --green: #a985e8;
  --green-rgb: 169, 133, 232;
  --green-active: #8060bd;
  --green-dark: #513b7d;
  --green-meta: #8f6fd0;
  --green-soft: #e2d3ff;
  --green-soft-light: #f5efff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 244, 232, 0.88), rgba(247, 244, 232, 0.88)),
    url("assets/paper-texture.png"),
    var(--paper);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.section-head,
.log-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  min-height: 58px;
  padding: 10px 0 14px;
  border-bottom: 1px solid rgba(22, 51, 33, 0.24);
}

.undo-button,
.metadata-button {
  align-self: end;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(22, 51, 33, 0.16);
  border-radius: 999px;
  color: rgba(22, 51, 33, 0.58);
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 750;
}

.metadata-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.undo-button:not(:disabled):hover,
.metadata-button:hover {
  border-color: rgba(var(--green-rgb), 0.28);
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.08);
}

.undo-button:disabled {
  cursor: default;
  border-color: rgba(22, 51, 33, 0.12);
  color: rgba(22, 51, 33, 0.36);
  background: rgba(255, 255, 255, 0.28);
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--green);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.2vw, 2.4rem);
}

h3 {
  font-size: 1.05rem;
}

.calendar-date-controls,
.journal-meta,
.inline-form,
.goal-form,
.calendar-actions,
.range-switch {
  display: flex;
  align-items: end;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: rgba(22, 51, 33, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
}

.special-task-shelf {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.special-task-shelf-content {
  display: flex;
  align-items: start;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.special-task-display-switch {
  align-self: center;
  flex: 0 0 auto;
}

.display-switch {
  position: relative;
  width: 32px;
  min-width: 32px;
  min-height: 18px;
  padding: 0;
  border: 1px solid rgba(var(--green-rgb), 0.18);
  border-radius: 999px;
  background: rgba(22, 51, 33, 0.12);
  box-shadow: none;
}

.display-switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(26, 35, 28, 0.12);
  transform: translateY(-50%);
  transition: left 140ms ease, background 140ms ease;
}

.display-switch[data-switch-on="true"] {
  border-color: rgba(var(--green-rgb), 0.24);
  background: rgba(var(--green-rgb), 0.34);
}

.display-switch[data-switch-on="true"]::before {
  left: 16px;
  background: #fff;
}

.display-switch:hover {
  background: rgba(var(--green-rgb), 0.18);
}

.display-switch[data-switch-on="true"]:hover {
  background: rgba(var(--green-rgb), 0.42);
}

.special-task-add {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px dashed rgba(var(--green-rgb), 0.32);
  border-radius: 8px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.24);
  font-size: 1.34rem;
  font-weight: 900;
}

.special-task-add:hover {
  background: rgba(255, 255, 255, 0.4);
}

.special-task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.special-task-empty-message {
  align-self: center;
  padding: 0 4px;
  color: rgba(22, 51, 33, 0.44);
  font-size: 0.78rem;
  font-weight: 750;
}

.special-task-chip {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto 1fr;
  align-items: center;
  width: fit-content;
  max-width: min(100%, 320px);
  min-height: 48px;
  border: 1px solid rgba(22, 51, 33, 0.12);
  border-left: 4px solid var(--task-color, var(--coral));
  border-radius: 8px;
  background: var(--task-tint, rgba(255, 255, 255, 0.56));
  overflow: visible;
}

.special-task-chip.is-dragging,
.goal-group-tab.is-dragging {
  opacity: 0.62;
}

.special-task-chip.is-drop-target,
.goal-group-tab.is-drop-target {
  border-color: rgba(var(--green-rgb), 0.38);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.12);
}

.special-task-drag-handle {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  width: 100%;
  height: 9px;
  min-height: 9px;
  cursor: pointer;
  touch-action: none;
}

.special-task-drag-handle::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: rgba(var(--green-rgb), 0.22);
}

.special-task-drag-handle:hover::before,
.special-task-chip.is-dragging .special-task-drag-handle::before {
  background: rgba(var(--green-rgb), 0.44);
}

.special-task-name {
  display: block;
  min-width: 78px;
  width: auto;
  max-width: 250px;
  min-height: 46px;
  padding: 10px 8px 8px 9px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.18;
  overflow: hidden;
  overflow-wrap: normal;
  resize: none;
  white-space: nowrap;
}

.special-task-name:focus {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 0 0 1px rgba(var(--green-rgb), 0.2);
}

.special-task-name.is-locked-edit {
  cursor: pointer;
}

.special-task-color-menu {
  position: relative;
  width: auto;
  min-width: 16px;
}

.special-task-color-menu summary {
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  font-size: 0.64rem;
}

.special-task-color-items {
  z-index: 8;
}

.special-task-color-grid {
  gap: 5px;
}

.special-task-remove {
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: rgba(156, 51, 40, 0.44);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 900;
}

.special-task-remove:hover {
  color: #9c3328;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(22, 51, 33, 0.2);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 116px;
  padding: 12px;
  line-height: 1.55;
}

#journalText {
  min-height: 180px;
  padding: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.68;
  overflow: hidden;
  resize: none;
}

#selectedDateInput,
#journalDate,
#journalTime,
#journalFilterDate {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

#selectedDateInput,
#journalDate,
#journalFilterDate {
  width: 112px;
}

#journalTime {
  width: 64px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.14);
}

.section-switcher {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
}

.section-meta-controls {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-left: auto;
}

.journal-site-shell {
  width: min(1320px, calc(100% - 32px));
}

.journal-site-topbar {
  align-items: center;
}

.journal-site-topbar h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.45rem);
  line-height: 1;
}

.journal-site-view {
  display: block;
  margin-top: 18px;
}

.journal-planner-link {
  min-height: 32px;
  padding: 0 11px;
}

.backup-control {
  position: relative;
  align-self: end;
}

.backup-control.entry-menu summary {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(22, 51, 33, 0.16);
  border-radius: 999px;
  color: rgba(22, 51, 33, 0.58);
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 750;
}

.backup-control.entry-menu summary:hover {
  border-color: rgba(var(--green-rgb), 0.28);
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.08);
}

.backup-control .entry-menu-items {
  min-width: 132px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 4px;
  width: fit-content;
  border: 1px solid rgba(22, 51, 33, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.38);
}

.tab,
.range-button,
.primary-button,
.ghost-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: white;
  background: var(--green);
  font-weight: 800;
}

.tab {
  min-width: 112px;
  padding: 0 18px;
}

.tab.is-active,
.range-button.is-active,
.primary-button {
  border-color: var(--green-dark);
  color: white;
  background: var(--green-active);
}

.range-switch {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(var(--green-rgb), 0.3);
  border-radius: var(--radius);
  background: rgba(var(--green-rgb), 0.12);
}

.range-button {
  min-width: 88px;
  padding: 0 12px;
}

.ghost-button,
.primary-button {
  padding: 0 16px;
}

.ghost-button:hover,
.tab:hover,
.icon-button:hover {
  border-color: var(--green-dark);
  background: var(--green-active);
}

.cleanup-button {
  align-self: end;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(22, 51, 33, 0.16);
  border-radius: var(--radius);
  color: rgba(22, 51, 33, 0.58);
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 750;
}

.cleanup-button:hover {
  border-color: rgba(156, 51, 40, 0.24);
  color: #8d3f14;
  background: rgba(255, 243, 229, 0.56);
}

.danger {
  color: white;
}

.danger-soft {
  border-color: #f4c48b;
  color: #8d3f14;
  background: #fff3e5;
}

.danger-soft:hover {
  border-color: #e5a866;
  color: #7b310d;
  background: #ffe7cc;
}

.danger-text {
  color: #a13636;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-head {
  margin: 24px 0 14px;
}

.calendar-layout,
.journal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.calendar-panel,
.side-panel,
.quick-add-panel,
.goal-section,
.journal-form,
.log-panel {
  border: 1px solid rgba(22, 51, 33, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(to bottom, transparent 31px, var(--line) 32px, transparent 33px),
    rgba(255, 255, 255, 0.28);
  background-size: 100% 34px;
  box-shadow: var(--shadow);
}

.calendar-panel {
  position: relative;
  overflow: visible;
}

.panel-collapse-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(var(--green-rgb), 0.14);
  border-radius: 999px;
  color: rgba(var(--green-rgb), 0.72);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(26, 35, 28, 0.07);
}

.panel-collapse-toggle:hover {
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.84);
}

.calendar-panel-toggle {
  position: absolute;
  top: -14px;
  right: 14px;
  z-index: 3;
}

.calendar-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.24);
}

.special-task-tracker {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.special-task-tracker-area {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.special-task-tracker-toggle {
  flex: 0 0 auto;
}

.special-task-tracker-area[data-panel-collapsed="true"] .special-task-tracker {
  display: none;
}

.special-task-count-empty {
  color: rgba(22, 51, 33, 0.44);
  font-size: 0.76rem;
  font-weight: 750;
}

.special-task-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  max-width: 220px;
  min-height: 28px;
  padding: 0;
  border: 0;
  color: rgba(22, 51, 33, 0.72);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.15;
}

.special-task-count-period {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 2px;
  color: var(--green-meta);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.special-task-count-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(22, 51, 33, 0.12);
  border-left: 3px solid var(--task-color, rgba(22, 51, 33, 0.24));
  border-radius: 999px;
  background: var(--task-tint, rgba(255, 255, 255, 0.48));
  overflow-wrap: anywhere;
}

.special-task-count-number {
  color: var(--green-meta);
  font-weight: 900;
  white-space: nowrap;
}

.special-task-count-remove {
  display: grid;
  place-items: center;
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: rgba(156, 51, 40, 0.46);
  background: transparent;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.special-task-count-remove:hover {
  color: #9c3328;
  background: rgba(255, 240, 238, 0.7);
}

.special-task-counter-add-menu {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.special-task-counter-add-menu summary {
  display: grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px dashed rgba(var(--green-rgb), 0.26);
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.special-task-counter-add-menu summary::-webkit-details-marker {
  display: none;
}

.special-task-counter-add-menu summary:hover,
.special-task-counter-add-menu[open] summary {
  background: rgba(var(--green-rgb), 0.08);
}

.special-task-counter-add-items {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  min-width: 150px;
  max-width: 220px;
  padding: 6px;
  border: 1px solid rgba(22, 51, 33, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(22, 51, 33, 0.14);
}

.special-task-counter-add-items button,
.special-task-counter-empty {
  display: block;
  width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  color: rgba(22, 51, 33, 0.72);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: left;
}

.special-task-counter-add-items button:hover {
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.08);
}

.special-task-counter-add-items .special-task-counter-all {
  border-bottom: 1px solid rgba(22, 51, 33, 0.1);
  border-radius: 6px 6px 2px 2px;
  color: var(--green-meta);
}

.special-task-counter-empty {
  color: rgba(22, 51, 33, 0.48);
}

.calendar-nav-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-arrow-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.weekday {
  display: grid;
  place-items: center;
  min-width: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.78rem, 1.4vw, 1.2rem);
  font-weight: 800;
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-height: 208px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 232, 0.58);
  text-align: left;
}

.calendar-grid.is-week-view .day-cell {
  min-height: 520px;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell.is-muted {
  background: rgba(239, 232, 211, 0.44);
}

.day-cell.is-selected {
  outline: 3px solid rgba(var(--green-rgb), 0.22);
  outline-offset: -3px;
}

.day-cell.is-task-drop-target {
  outline: 3px solid rgba(var(--green-rgb), 0.28);
  outline-offset: -3px;
  background: rgba(var(--green-rgb), 0.08);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--green);
  background: transparent;
  font-weight: 900;
}

.day-cell.is-today .day-number {
  color: white;
  background: var(--green);
}

.day-emoji-marks {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
  font-size: 1rem;
  line-height: 1;
}

.day-emoji-mark {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  min-height: 19px;
  border-radius: 999px;
  color: initial;
  background: rgba(255, 255, 255, 0.72);
  filter: saturate(1.28) contrast(1.08);
}

.day-cell.is-muted .day-emoji-mark {
  opacity: 1;
  background: rgba(255, 255, 255, 0.86);
}

.cell-notes {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.note-pill,
.goal-pill {
  display: block;
  overflow: visible;
  min-height: 22px;
  padding: 4px 7px;
  border-left: 3px solid var(--coral);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.calendar-task {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 5px;
  align-items: center;
  border-left-color: var(--task-color, var(--coral));
  background: var(--task-tint, rgba(255, 255, 255, 0.56));
}

.calendar-task.is-special-calendar-task .task-text-input[readonly] {
  cursor: default;
}

.calendar-task.is-special-calendar-task .task-text-input[readonly]:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.calendar-task-actions {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 1px;
  white-space: nowrap;
}

.task-text-wrap {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.task-drag-handle {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  width: 100%;
  height: 10px;
  min-height: 10px;
  margin: -2px 0 0;
  cursor: pointer;
  touch-action: none;
}

.task-drag-handle::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: rgba(var(--green-rgb), 0.28);
}

.task-drag-handle:hover::before,
.calendar-task.is-task-dragging .task-drag-handle::before {
  background: rgba(var(--green-rgb), 0.5);
}

.task-drag-handle:active {
  cursor: pointer;
}

.calendar-task.is-task-dragging {
  opacity: 0.62;
}

.subtask-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  min-width: 0;
  padding-left: 24px;
}

.subtask-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.subtask-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.subtask-row input[type="checkbox"] {
  width: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--green);
}

.subtask-add-button {
  display: grid;
  place-items: center;
  align-self: center;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.34);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-task-actions .subtask-add-button {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  font-size: 0.74rem;
}

.task-duplicate-button {
  display: grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: rgba(22, 51, 33, 0.58);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.task-duplicate-button:hover {
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.08);
}

.subtask-add-button:hover {
  color: white;
  background: var(--green-active);
}

.subtask-text-input {
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(22, 51, 33, 0.78);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
}

.subtask-text-input:focus {
  border-color: rgba(var(--green-rgb), 0.22);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 2px rgba(var(--green-rgb), 0.08);
}

.subtask-row.is-done .subtask-text-input {
  color: rgba(22, 51, 33, 0.46);
  text-decoration: line-through;
}

.subtask-delete-button {
  display: grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: rgba(156, 51, 40, 0.44);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 900;
}

.subtask-delete-button:hover {
  color: #9c3328;
  background: #fff0ee;
}

.calendar-task input[type="checkbox"],
.mini-item input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.task-text-input {
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: inherit;
  font-weight: 700;
  line-height: 1.25;
}

.task-text-input:focus {
  border-color: rgba(var(--green-rgb), 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(var(--green-rgb), 0.1);
}

.task-time-menu {
  position: relative;
  display: grid;
  place-items: center;
}

.task-time-button {
  display: grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--green-meta);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.task-time-button::-webkit-details-marker {
  display: none;
}

.task-time-button:hover,
.task-time-menu[open] .task-time-button {
  background: rgba(var(--green-rgb), 0.08);
}

.task-time-popover {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  padding: 5px;
  border: 1px solid rgba(22, 51, 33, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(22, 51, 33, 0.14);
}

.task-time-input {
  width: 64px;
  min-width: 64px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color-scheme: light;
}

.task-time-badge {
  width: fit-content;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.36);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.45;
}

.task-delete-button {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #9c3328;
  background: transparent;
  font-weight: 900;
}

.calendar-task-actions .task-delete-button {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  font-size: 0.68rem;
}

.task-delete-button:hover {
  border-color: #f0b0a8;
  background: #fff0ee;
}

.calendar-task.is-done .task-text-input {
  color: rgba(22, 51, 33, 0.52);
  text-decoration: line-through;
}

.goal-pill {
  border-left-color: var(--amber);
}

.side-panel,
.journal-form,
.log-panel,
.quick-add-panel {
  padding: 18px;
}

.calendar-date-controls {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-date-controls label {
  flex: 0 0 auto;
  min-width: 0;
}

#selectedDateInput {
  width: 112px;
}

#monthSelect {
  width: 118px;
}

#yearInput {
  width: 82px;
}

.calendar-date-controls .ghost-button {
  align-self: end;
  min-width: 64px;
}

.palette-control {
  position: relative;
  align-self: end;
  color: rgba(22, 51, 33, 0.58);
  font-size: 0.78rem;
  font-weight: 750;
}

.color-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 0;
  border: 1px solid rgba(22, 51, 33, 0.18);
  border-radius: 999px;
  color: rgba(22, 51, 33, 0.66);
  background: var(--menu-color, white);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.34);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.color-menu summary::-webkit-details-marker {
  display: none;
}

.color-menu summary:hover {
  color: var(--green-meta);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.46), 0 0 0 2px rgba(22, 51, 33, 0.08);
}

.color-menu-current {
  display: none;
}

.color-menu-items {
  position: absolute;
  right: 0;
  z-index: 8;
  display: grid;
  gap: 5px;
  min-width: 118px;
  margin-top: 6px;
  padding: 7px;
  border: 1px solid rgba(22, 51, 33, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.98);
  box-shadow: 0 14px 32px rgba(22, 51, 33, 0.14);
}

.color-menu-label {
  padding: 4px 6px 2px;
  color: var(--green-meta);
  font-size: 0.72rem;
  font-weight: 900;
}

.color-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 2px;
}

.color-option {
  display: grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(22, 51, 33, 0.18);
  border-radius: 999px;
  color: var(--ink);
  background: var(--option-color, white);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.32);
}

.color-option-swatch {
  display: none;
}

.color-option.is-active {
  border-color: rgba(var(--green-rgb), 0.34);
  box-shadow: 0 0 0 2px rgba(var(--green-rgb), 0.1);
}

.palette-control summary {
  min-width: 26px;
  min-height: 26px;
}

.special-task-color-menu.color-menu summary {
  min-width: 16px;
  min-height: 16px;
  border-width: 0;
  box-shadow: none;
}

.special-task-color-menu.color-menu summary:hover {
  box-shadow: 0 0 0 2px rgba(22, 51, 33, 0.08);
}

.emoji-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.emoji-palette {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.emoji-display-switch {
  flex: 0 0 auto;
  margin-left: auto;
}

.emoji-section[data-panel-collapsed="true"] {
  justify-content: flex-end;
}

.emoji-section[data-panel-collapsed="true"] .emoji-palette {
  display: none;
}

.emoji-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  font-size: 1.2rem;
}

.emoji-button.is-active {
  border-color: var(--green-dark);
  color: white;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.18);
}

.stacked-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  align-items: end;
  gap: 12px;
  margin-top: 16px;
}

.mini-list,
.journal-log {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.mini-item,
.journal-entry {
  padding: 12px;
  border: 1px solid rgba(22, 51, 33, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.mini-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.mini-item p,
.journal-entry p,
.journal-entry-text {
  margin: 0;
  white-space: pre-wrap;
}

.journal-entry p,
.journal-entry-text {
  color: rgba(22, 51, 33, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.68;
}

.journal-entry-text {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  resize: none;
  overflow: hidden;
}

.journal-entry-text:focus {
  border-color: rgba(var(--green-rgb), 0.18);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 2px rgba(var(--green-rgb), 0.08);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.goals-layout {
  display: grid;
  gap: 18px;
}

.goal-group-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  padding: 0 2px;
  border: 0;
  background: transparent;
}

.goal-group-tab,
.goal-group-add {
  min-height: 42px;
  border: 1px solid rgba(22, 51, 33, 0.12);
  border-radius: 8px;
  color: rgba(22, 51, 33, 0.7);
  background: rgba(255, 255, 255, 0.42);
  font-size: 1rem;
  font-weight: 800;
}

.goal-group-tab {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto 1fr;
  align-items: start;
  width: fit-content;
  min-width: 168px;
  max-width: min(360px, 100%);
  overflow: visible;
  padding: 3px 6px 3px 4px;
  box-shadow: inset 0 -2px 0 rgba(var(--green-rgb), 0.08);
}

.goal-group-drag-handle {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  width: 100%;
  height: 9px;
  min-height: 9px;
  cursor: pointer;
  touch-action: none;
}

.goal-group-drag-handle::before {
  content: "";
  width: 30px;
  height: 3px;
  border-radius: 999px;
  background: rgba(var(--green-rgb), 0.2);
}

.goal-group-drag-handle:hover::before,
.goal-group-tab.is-dragging .goal-group-drag-handle::before {
  background: rgba(var(--green-rgb), 0.42);
}

.goal-group-add {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 1.15rem;
}

.goal-group-tab.is-active {
  border-color: rgba(var(--green-rgb), 0.3);
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.1);
  box-shadow: inset 0 -2px 0 rgba(var(--green-rgb), 0.24);
}

.goal-group-name {
  display: block;
  width: auto;
  max-width: 310px;
  min-width: 128px;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 9px 12px 8px 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  font: inherit;
  line-height: 1.18;
  outline: 0;
  overflow: hidden;
  resize: none;
  white-space: nowrap;
  overflow-wrap: normal;
  cursor: pointer;
}

.goal-group-name:focus {
  background: rgba(255, 255, 255, 0.36);
  box-shadow: none;
}

.goal-group-name.is-locked-edit {
  caret-color: transparent;
}

.goal-group-name.is-locked-edit:focus {
  background: rgba(255, 255, 255, 0.16);
}

.goal-group-name.is-editing {
  cursor: text;
  caret-color: auto;
}

.goal-group-delete {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  color: rgba(22, 51, 33, 0.42);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.goal-group-tab.is-active .goal-group-delete {
  color: rgba(22, 51, 33, 0.48);
}

.goal-group-delete:hover {
  color: white;
  background: rgba(22, 51, 33, 0.28);
}

.goal-group-tab:not(.is-active):hover,
.goal-group-add:hover {
  border-color: rgba(var(--green-rgb), 0.22);
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.58);
}

.inline-form {
  width: min(720px, 100%);
}

.inline-form label {
  flex: 1;
}

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

.goal-section {
  min-height: 420px;
  padding: 16px;
  background:
    linear-gradient(to bottom, transparent 31px, var(--line) 32px, transparent 33px),
    var(--goal-paper-bg, rgba(255, 255, 255, 0.28));
  background-size: 100% 34px;
  transition: border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease, transform 140ms ease;
  cursor: default;
}

.goal-section header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 20px;
  margin-bottom: 10px;
  padding-top: 2px;
  padding-right: 64px;
}

.goal-section.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
}

.goal-section.is-drop-target {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.14), var(--shadow);
  transform: translateY(-2px);
}

.goal-section.is-goal-item-drop-target {
  border-color: rgba(var(--green-rgb), 0.34);
  background:
    linear-gradient(to bottom, transparent 31px, var(--line) 32px, transparent 33px),
    rgba(var(--green-rgb), 0.08);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.1), var(--shadow);
}

.goal-section input,
.goal-section button {
  cursor: auto;
}

.goal-section button {
  cursor: pointer;
}

.goal-section-drag-handle {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  width: 100%;
  height: 10px;
  min-height: 10px;
  cursor: pointer;
  touch-action: none;
}

.goal-section-drag-handle::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: rgba(var(--green-rgb), 0.24);
}

.goal-section-drag-handle:hover::before,
.goal-section.is-dragging .goal-section-drag-handle::before {
  background: rgba(var(--green-rgb), 0.48);
}

.section-title-input {
  display: block;
  width: min(360px, 100%);
  max-width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.18;
  overflow: hidden;
  overflow-wrap: anywhere;
  resize: none;
  white-space: normal;
  cursor: text;
}

.section-title-input:focus {
  border-color: rgba(var(--green-rgb), 0.28);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(var(--green-rgb), 0.08);
}

.goal-form {
  display: block;
  margin-bottom: 12px;
}

.goal-form input {
  width: 100%;
}

.goal-section-add {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed rgba(var(--green-rgb), 0.28);
  border-radius: var(--radius);
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.24);
  font-size: 1.2rem;
  font-weight: 900;
}

.goal-section-add:hover {
  border-color: rgba(var(--green-rgb), 0.36);
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.38);
}

.goal-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.goal-list.is-goal-list-drop-target {
  min-height: 44px;
  border-radius: var(--radius);
  outline: 2px dashed rgba(var(--green-rgb), 0.28);
  outline-offset: 4px;
}

.goal-item {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: start;
  min-height: 38px;
  padding: 8px;
  border: 1px solid rgba(22, 51, 33, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.goal-item-drag-handle {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  width: 100%;
  height: 8px;
  min-height: 8px;
  cursor: pointer;
  touch-action: none;
}

.goal-item-drag-handle::before {
  content: "";
  width: 30px;
  height: 3px;
  border-radius: 999px;
  background: rgba(var(--green-rgb), 0.22);
}

.goal-item-drag-handle:hover::before,
.goal-item.is-goal-dragging .goal-item-drag-handle::before {
  background: rgba(var(--green-rgb), 0.44);
}

.goal-item.is-goal-dragging {
  opacity: 0.6;
}

.goal-item.is-goal-drop-target {
  border-color: rgba(var(--green-rgb), 0.36);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.12);
}

.goal-item input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin-top: 3px;
  accent-color: var(--green);
}

.goal-text,
.goal-text-input,
.goal-text-wrap {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.goal-text-wrap {
  display: grid;
  gap: 5px;
}

.goal-title-row {
  display: block;
  align-items: center;
  min-width: 0;
}

.goal-text-input {
  display: block;
  width: 100%;
  height: auto;
  min-height: 30px;
  max-height: none;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  box-sizing: border-box;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  overflow-y: hidden;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.goal-date-badge {
  width: fit-content;
  margin-top: -2px;
  padding: 0;
  color: var(--green-meta);
  background: transparent;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.4;
}

.goal-text-input:focus {
  border-color: rgba(var(--green-rgb), 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(var(--green-rgb), 0.1);
}

.goal-item.is-done .goal-text,
.goal-item.is-done .goal-text-input {
  color: rgba(22, 51, 33, 0.52);
  text-decoration: line-through;
}

.quiet-delete-button,
.goal-section [data-action="delete-section"] {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(156, 51, 40, 0.34);
  background: transparent;
  font-weight: 900;
}

.goal-section .goal-section-color-menu,
.goal-section .goal-section-move-menu,
.goal-section [data-action="delete-section"] {
  position: absolute;
  top: 10px;
}

.goal-section .goal-section-color-menu {
  right: 38px;
}

.goal-section .goal-section-move-menu {
  right: 20px;
}

.goal-section [data-action="delete-section"] {
  right: 0;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  font-size: 0.68rem;
}

.quiet-delete-button:hover,
.goal-section [data-action="delete-section"]:hover {
  border-color: #f0b0a8;
  color: #9c3328;
  background: #fff0ee;
}

.goal-item-actions {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 1px;
  min-width: 0;
  white-space: nowrap;
}

.goal-date-button,
.goal-delete-button {
  display: grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  border: 0;
  border-radius: 999px;
  color: rgba(22, 51, 33, 0.62);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 900;
}

.goal-date-picker-control {
  position: relative;
  display: grid;
  place-items: center;
}

.goal-date-button {
  cursor: pointer;
}

.goal-delete-button {
  display: grid;
  place-items: center;
  padding: 0;
  color: rgba(156, 51, 40, 0.48);
}

.goal-section-move-menu {
  position: relative;
  align-self: start;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
}

.goal-section-color-menu {
  position: relative;
  align-self: start;
  width: auto;
  min-width: 18px;
  min-height: 18px;
}

.goal-section-color-menu summary {
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  font-size: 0.64rem;
}

.goal-section-move-menu summary {
  display: grid;
  place-items: center;
  width: 20px;
  min-height: 20px;
  border-radius: 999px;
  color: rgba(22, 51, 33, 0.62);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.goal-section-move-menu summary::-webkit-details-marker {
  display: none;
}

.goal-section-move-items {
  position: absolute;
  right: 0;
  z-index: 6;
  display: grid;
  gap: 4px;
  min-width: 132px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(22, 51, 33, 0.16);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 14px 38px rgba(26, 35, 28, 0.16);
}

.goal-section-move-label {
  padding: 4px 8px 2px;
  color: var(--green-meta);
  font-size: 0.72rem;
  font-weight: 900;
}

.goal-section-color-grid {
  gap: 5px;
}

.goal-section-move-items button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 800;
}

.goal-section-move-items button:hover {
  background: var(--green-soft-light);
}

.goal-date-button:hover,
.goal-section-move-menu summary:hover {
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.08);
}

.goal-delete-button:hover {
  color: #9c3328;
  background: #fff0ee;
}

.calendar-goal-task {
  border-left-color: var(--amber);
}

.goal-source-label {
  align-self: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(22, 51, 33, 0.12);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.3;
}

.journal-layout {
  --journal-entry-width: 42%;
  --journal-log-width: 58%;
  --journal-reading-width: 1100px;
  grid-template-columns:
    minmax(420px, calc(var(--journal-entry-width) - 18px))
    0
    minmax(360px, calc(var(--journal-log-width) - 10px));
  gap: 9px;
}

.journal-layout[data-entry-collapsed="true"] {
  grid-template-columns: 42px 0 minmax(0, 1fr);
}

.journal-form {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: visible;
  transition: min-height 160ms ease, opacity 160ms ease;
}

.entry-panel-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(22, 51, 33, 0.12);
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.24rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(26, 35, 28, 0.08);
}

.journal-layout .entry-panel-toggle {
  right: -14px;
}

.journal-layout[data-entry-collapsed="true"] .journal-form {
  min-height: 520px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  background-size: 100% 34px;
  box-shadow: none;
  opacity: 1;
}

.journal-layout[data-entry-collapsed="true"] .log-panel {
  width: min(100%, var(--journal-reading-width));
  justify-self: center;
}

.journal-layout[data-entry-collapsed="true"] .journal-form > :not(.entry-panel-toggle) {
  display: none;
}

.journal-layout[data-entry-collapsed="true"] .entry-panel-toggle {
  inset: 0 auto auto 4px;
  align-items: start;
  width: 14px;
  height: 100%;
  min-height: 520px;
  padding-top: 14px;
  border: 1px solid rgba(var(--green-rgb), 0.16);
  border-radius: 999px;
  color: rgba(var(--green-rgb), 0.72);
  background: rgba(var(--green-rgb), 0.08);
  font-size: 0.9rem;
  box-shadow: none;
}

.special-task-shelf[data-panel-collapsed="true"] {
  justify-content: flex-end;
}

.special-task-shelf[data-panel-collapsed="true"] .special-task-shelf-content {
  display: none;
}

.calendar-panel[data-panel-collapsed="true"] {
  min-height: 38px;
  background:
    linear-gradient(to bottom, transparent 31px, var(--line) 32px, transparent 33px),
    rgba(255, 255, 255, 0.18);
  background-size: 100% 34px;
}

.calendar-panel[data-panel-collapsed="true"] > :not(.calendar-panel-toggle) {
  display: none;
}

.calendar-panel[data-panel-collapsed="true"] .calendar-panel-toggle {
  inset: -14px 14px auto auto;
  width: 26px;
  min-width: 26px;
  min-height: 22px;
  border-color: rgba(var(--green-rgb), 0.12);
  background: rgba(var(--green-rgb), 0.07);
  box-shadow: none;
}

.time-panel[data-panel-collapsed="true"] {
  align-self: stretch;
  width: 32px;
  min-width: 32px;
  min-height: 420px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.time-panel[data-panel-collapsed="true"] > :not(.time-panel-toggle) {
  display: none;
}

.time-panel[data-panel-collapsed="true"] .time-panel-toggle {
  inset: 0 auto auto 8px;
  align-items: start;
  width: 14px;
  min-width: 14px;
  height: 100%;
  min-height: 420px;
  padding-top: 14px;
  border: 1px solid rgba(var(--green-rgb), 0.14);
  border-radius: 999px;
  color: rgba(var(--green-rgb), 0.68);
  background: rgba(var(--green-rgb), 0.07);
  font-size: 0.84rem;
  box-shadow: none;
}

.journal-resize-handle {
  align-self: stretch;
  justify-self: center;
  width: 18px;
  min-height: 220px;
  border-radius: 999px;
  cursor: col-resize;
  background: transparent;
  transition: background 120ms ease;
}

.journal-resize-handle:hover,
.is-resizing-journal .journal-resize-handle {
  background:
    linear-gradient(to right, transparent 7px, rgba(var(--green-rgb), 0.36) 8px, rgba(var(--green-rgb), 0.36) 10px, transparent 11px);
}

.is-resizing-journal .journal-layout[data-default-split="true"] .journal-resize-handle {
  background:
    linear-gradient(to right, transparent 6px, rgba(228, 173, 55, 0.84) 7px, rgba(228, 173, 55, 0.84) 11px, transparent 12px);
}

.is-resizing-journal {
  cursor: col-resize;
  user-select: none;
}

.journal-meta,
.journal-label-row,
.journal-form-actions,
.journal-filter-controls {
  align-items: stretch;
}

.journal-meta {
  display: grid;
  grid-template-columns: 160px max-content max-content;
  justify-content: start;
  gap: 8px;
}

.journal-meta label,
.journal-label-row label,
.journal-filter-controls label {
  min-width: 0;
}

.journal-label-row,
.journal-form-actions,
.journal-filter-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.picker-input-row {
  position: relative;
  display: grid;
  grid-template-columns: max-content 22px;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  align-items: center;
}

.picker-open-button {
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.34);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.picker-open-button:hover {
  background: rgba(var(--green-rgb), 0.08);
}

.native-picker-input {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.journal-label-row {
  display: inline-grid;
  grid-template-columns: minmax(130px, 190px) 24px;
  justify-content: start;
  width: fit-content;
  gap: 6px;
}

.journal-label-row label {
  max-width: 190px;
  flex: unset;
}

.journal-label-row select {
  min-height: 36px;
  font-size: 0.8rem;
}

.label-menu {
  align-self: end;
  justify-self: start;
  width: 22px;
}

.label-menu .entry-menu-items {
  right: auto;
  left: 0;
  min-width: 132px;
}

.journal-filter-controls {
  display: grid;
  grid-template-columns: max-content 120px 82px 130px repeat(4, max-content);
  width: fit-content;
  max-width: 100%;
}

.journal-label-row select,
.journal-filter-controls select,
.journal-filter-controls input {
  border-radius: 999px;
}

.log-panel {
  min-height: 260px;
  container-type: inline-size;
}

.journal-entry {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  border-left: 3px solid var(--green);
}

.journal-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: var(--green-meta);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.journal-entry-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(22, 51, 33, 0.12);
}

.journal-entry-head + .journal-entry-item {
  padding-top: 0;
  border-top: 0;
}

.journal-entry-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.entry-time-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.entry-time {
  color: var(--green-meta);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.entry-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  color: #8d3f14;
  background: rgba(228, 173, 55, 0.18);
  border: 1px solid rgba(141, 63, 20, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entry-menu {
  position: relative;
  justify-self: end;
}

.entry-menu summary {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  color: rgba(var(--green-rgb), 0.68);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.entry-menu summary:hover {
  color: var(--green-meta);
  background: var(--green-soft-light);
}

.entry-menu summary::-webkit-details-marker {
  display: none;
}

.entry-menu-items {
  position: absolute;
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 118px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(22, 51, 33, 0.16);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 14px 38px rgba(26, 35, 28, 0.16);
}

.entry-menu-items button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 800;
}

.entry-menu-items button:hover {
  background: var(--green-soft-light);
}

@container (max-width: 520px) {
  .journal-entry-head,
  .journal-entry-item-head {
    grid-template-columns: 1fr;
  }

  .entry-menu {
    justify-self: start;
  }

  .entry-menu-items {
    right: auto;
    left: 0;
  }
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(22, 51, 33, 0.24);
  border-radius: var(--radius);
  color: rgba(22, 51, 33, 0.62);
  background: rgba(255, 255, 255, 0.28);
}

/* ── Time pie chart & timer ── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.side-panel-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.side-panel-split:has(.time-panel[data-panel-collapsed="true"]) {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.side-panel-main {
  min-width: 0;
}

.side-panel-tasks {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.side-panel-tasks .mini-list {
  margin-top: 0;
}

.task-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.task-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.task-entry-form label {
  gap: 6px;
}

.task-entry-form label > span {
  color: var(--green-meta);
  font-size: 0.86rem;
  font-weight: 850;
}

.info-dump-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(22, 51, 33, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(to bottom, transparent 31px, var(--line) 32px, transparent 33px),
    rgba(255, 255, 255, 0.36);
  background-size: 100% 34px;
  box-shadow: 0 12px 28px rgba(26, 35, 28, 0.06);
}

.info-dump-list {
  gap: 8px;
}

.info-dump-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
}

.info-dump-item.is-done .info-dump-text-input {
  color: rgba(22, 51, 33, 0.52);
  text-decoration: line-through;
}

.info-dump-text-input {
  min-height: 30px;
  padding: 3px 6px;
  font-weight: 700;
}

.info-dump-actions {
  align-self: start;
  padding-top: 5px;
}

.time-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(22, 51, 33, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.time-panel-toggle {
  position: absolute;
  top: 10px;
  left: -12px;
  z-index: 3;
}

.time-panel select,
.time-panel input[type="text"] {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.82rem;
}

.time-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.time-panel-title {
  margin: 0;
  color: var(--green-meta);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.time-clear-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.time-chart-area {
  flex: 1 1 210px;
  min-height: 100px;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-panel[data-legend-density="sparse"] .time-chart-area {
  flex-basis: 300px;
  max-height: 340px;
}

.time-panel[data-legend-density="medium"] .time-chart-area {
  flex-basis: 250px;
  max-height: 300px;
}

.time-chart-area[hidden] {
  display: none;
}

.time-chart {
  position: relative;
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 1;
}

.time-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.time-chart-track {
  stroke: rgba(22, 51, 33, 0.16);
  stroke-width: 20;
}

.time-slice {
  fill: none;
  stroke-width: 20;
}

.time-chart-mode-toggle {
  align-self: center;
}

.time-chart-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.time-chart-total {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.4rem;
  font-weight: 900;
}

.time-legend {
  display: grid;
  gap: 5px;
}

.time-legend[hidden] {
  display: none;
}

.time-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: rgba(22, 51, 33, 0.82);
}

.time-legend-hint {
  display: block;
  text-align: center;
  color: rgba(22, 51, 33, 0.4);
  font-size: 0.8rem;
  font-weight: 650;
}

.time-legend-swatch {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 999px;
}

.time-legend-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-legend-seconds {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--green-meta);
}

.time-legend-time {
  flex: 0 0 auto;
  width: 60px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
}

.time-legend-duration {
  flex: 0 0 auto;
}

.time-legend-delete {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: rgba(156, 51, 40, 0.46);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.time-legend-delete:hover {
  color: #9c3328;
  background: rgba(255, 240, 238, 0.7);
}

.time-legend-edit {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: rgba(22, 51, 33, 0.4);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.time-legend-edit:hover {
  color: var(--green-meta);
  background: rgba(var(--green-rgb), 0.1);
}

.time-legend-edit + .time-legend-delete {
  margin-left: -5px;
}

.time-legend-item.is-editing {
  align-items: center;
}

.time-sequence-list {
  display: grid;
  gap: 8px;
  flex: 0 1 auto;
  min-height: 60px;
  align-content: start;
}

.time-sequence-list[hidden] {
  display: none;
}

.time-legend-inline-add {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px dashed rgba(var(--green-rgb), 0.32);
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.time-legend-inline-add:hover {
  border-color: var(--green);
  background: rgba(var(--green-rgb), 0.1);
}

.time-legend-add-wrapper {
  justify-content: flex-start;
  padding-top: 2px;
}

.time-legend-add-row select {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  font-size: 0.82rem;
}

.timer-controls {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.timer-controls[hidden] {
  display: none;
}

.timer-session {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 260px;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(22, 51, 33, 0.1);
}

.timer-session[hidden] {
  display: none;
}

.timer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.timer-row label {
  gap: 3px;
  font-size: 0.78rem;
}

.timer-row label span {
  display: none;
}

.duration-mask {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(22, 51, 33, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.duration-mask.is-invalid {
  border-color: rgba(156, 51, 40, 0.5);
  box-shadow: 0 0 0 3px rgba(156, 51, 40, 0.12);
}

.time-panel .duration-mask input[type="text"] {
  width: 1.5em;
  min-width: 0;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
}

.duration-mask input:focus {
  outline: none;
}

.duration-mask-unit {
  color: rgba(22, 51, 33, 0.55);
  font-size: 0.85rem;
  font-weight: 800;
}

.timer-display-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-adjust-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(22, 51, 33, 0.2);
  border-radius: 999px;
  color: var(--green-meta);
  background: rgba(255, 255, 255, 0.46);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.timer-adjust-button:hover {
  border-color: var(--green-dark);
  background: rgba(var(--green-rgb), 0.14);
}

.timer-adjust-button[hidden] {
  display: none;
}

.timer-display {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid rgba(22, 51, 33, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.timer-display #timerTimeText {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.timer-display.is-alarm #timerTimeText {
  animation: timer-alarm-flash 0.6s ease-in-out infinite alternate;
}

@keyframes timer-alarm-flash {
  from { color: var(--ink); }
  to   { color: #9c3328; }
}

.timer-display.is-alarm {
  animation: timer-alarm-bg-flash 0.6s ease-in-out infinite alternate;
}

@keyframes timer-alarm-bg-flash {
  from { background: rgba(255, 255, 255, 0.4);  border-color: rgba(22, 51, 33, 0.12); }
  to   { background: #fff0ee;                     border-color: rgba(156, 51, 40, 0.35); }
}

.timer-buttons,
.timer-finished {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timer-finished[hidden] {
  display: none;
}

.timer-main-button {
  min-height: 40px;
  padding: 0 24px;
  font-size: 0.88rem;
}

.timer-stop-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.timer-stop-confirm[hidden] {
  display: none;
}

.timer-stop-confirm span {
  color: var(--green-meta);
  font-size: 0.78rem;
  font-weight: 800;
  width: 100%;
  text-align: center;
}

.timer-finished button,
.timer-stop-confirm button {
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.72rem;
}

.timer-finished {
  color: #9c3328;
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 980px) {
  .topbar,
  .section-head,
  .calendar-layout,
  .journal-layout {
    display: grid;
  }

  .calendar-layout,
  .journal-layout,
  .journal-layout[data-entry-collapsed="true"] {
    grid-template-columns: 1fr;
  }

  .journal-resize-handle {
    display: none;
  }

  .journal-layout[data-entry-collapsed="true"] .journal-form {
    min-height: 42px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .journal-layout[data-entry-collapsed="true"] .entry-panel-toggle {
    transform: rotate(90deg);
  }

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

  .side-panel-split {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .section-switcher {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-date-controls,
  .journal-meta,
  .journal-label-row,
  .journal-form-actions,
  .journal-filter-controls,
  .inline-form,
  .goal-form,
  .calendar-actions,
  .stacked-form,
  .tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .range-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab {
    width: 100%;
  }

  .journal-label-row {
    grid-template-columns: minmax(0, 1fr) 24px;
  }

  .journal-label-row label {
    max-width: none;
  }

  .palette-control {
    width: 100%;
  }

  .weekday {
    font-size: 0.68rem;
  }

  .day-cell {
    min-height: 168px;
    padding: 6px;
  }

  .calendar-grid.is-week-view .day-cell {
    min-height: 340px;
  }

  .note-pill,
  .goal-pill {
    font-size: 0.68rem;
  }

  .goal-sections {
    grid-template-columns: 1fr;
  }

  .timer-buttons,
  .timer-finished {
    display: grid;
    grid-template-columns: 1fr;
  }
}
