:root {
  --page-bg: #ece9e2;
  --page-text: #292b2a;
  --page-muted: #6f726f;
  --page-panel: rgba(255, 255, 255, 0.72);

  --bg-top: #f7f1de;
  --bg-bottom: #f3e4c5;
  --text: #3e3a2f;
  --text-muted: #756d59;
  --accent: #9e7139;
  --surface: rgba(255, 252, 243, 0.92);
  --surface-solid: #f8edd5;
  --border: rgba(72, 64, 48, 0.16);
  --shadow-color: rgba(97, 76, 37, 0.14);

  --category-work: #71809a;
  --category-life: #718f7d;
  --category-people: #b47c63;
  --category-self: #8b7897;
  --note-color: #8b8173;
  --row-surface: rgba(255, 252, 243, 0.70);

  --card-radius: 18px;
  --card-padding: 13px;
  --section-gap: 11px;
  --date-size: 32px;
  --heading-size: 21px;
  --body-size: 15px;
  --time-size: 12px;
  --panel-height: 90%;
  --shadow: 0 12px 30px var(--shadow-color);
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-heading: var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: var(--font-body);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.92), transparent 30rem),
    linear-gradient(145deg, #f4f1ea, #dedbd4);
}

button,
select,
input {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), white 30%);
  outline-offset: 2px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(390px, 480px) minmax(280px, 360px);
  justify-content: center;
  gap: 42px;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: 38px 24px 52px;
}

.preview-column {
  min-width: 0;
}

.preview-heading {
  width: min(100%, 430px);
  margin: 0 auto 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #7a776f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.preview-heading h1,
.controls h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.preview-heading > p:last-child,
.controls-header > p:last-child {
  margin: 7px 0 0;
  color: var(--page-muted);
  font-size: 12px;
  line-height: 1.65;
}

.device {
  position: relative;
  width: min(100%, 430px);
  height: min(860px, calc(100vh - 70px));
  min-height: 720px;
  margin: 0 auto;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgba(32, 34, 33, 0.35);
  border-radius: 48px;
  background: #111311;
  box-shadow: 0 28px 70px rgba(22, 25, 23, 0.28);
}

.device-speaker {
  position: absolute;
  z-index: 40;
  top: 18px;
  left: 50%;
  width: 74px;
  height: 19px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #080908;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 39px;
  background: linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  font-family: var(--font-body);
  transition: background 220ms ease-out, color 220ms ease-out;
}

.app[data-time="night"] {
  --bg-top: #0c121a;
  --bg-bottom: #151e28;
  --text: #e3e4e1;
  --text-muted: #a5adb0;
  --accent: #aaa17f;
  --surface: rgba(18, 27, 36, 0.96);
  --surface-solid: #121c26;
  --row-surface: rgba(18, 27, 36, 0.76);
  --border: rgba(230, 232, 228, 0.14);
  --shadow-color: rgba(0, 0, 0, 0.42);
}

.app[data-palette="a"],
.controls:has(#palette-control option[value="a"]:checked) {
  --category-work: #557d92;
  --category-life: #76936d;
  --category-people: #be7965;
  --category-self: #987692;
}

.app[data-palette="b"],
.controls:has(#palette-control option[value="b"]:checked) {
  --category-work: #6875a0;
  --category-life: #7f8c67;
  --category-people: #b16f72;
  --category-self: #7f729d;
}

.app[data-font="avenir"] {
  --font-body: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-heading: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.app[data-font="helvetica"] {
  --font-body: "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-heading: "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.app[data-font="futura"] {
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-heading: Futura, "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.atmosphere,
.atmosphere::before,
.atmosphere::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.atmosphere {
  overflow: hidden;
  opacity: 0.78;
}

.atmosphere::before {
  content: "";
  top: 23%;
  left: -16%;
  width: 132%;
  height: 13%;
  transform: rotate(-4deg);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  filter: blur(30px);
}

.atmosphere::after {
  content: "";
  top: 49%;
  left: -10%;
  width: 124%;
  height: 10%;
  transform: rotate(3deg);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  filter: blur(26px);
}

.haze {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(55px);
}

.haze-one {
  top: -10%;
  left: -24%;
  width: 84%;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.52);
}

.haze-two {
  top: 21%;
  right: -28%;
  width: 92%;
  aspect-ratio: 1.4;
  background: rgba(231, 214, 171, 0.28);
}

.haze-three {
  right: -15%;
  bottom: -8%;
  width: 74%;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.18);
}

.app[data-time="night"] .atmosphere {
  opacity: 0.48;
}

.app[data-time="night"] .haze-one {
  background: rgba(97, 117, 133, 0.22);
}

.app[data-time="night"] .haze-two {
  background: rgba(54, 67, 84, 0.22);
}

.app-header {
  position: relative;
  z-index: 2;
  padding: max(28px, env(safe-area-inset-top)) 16px 0;
}

.settings-action {
  position: absolute;
  z-index: 4;
  top: max(28px, env(safe-area-inset-top));
  right: 12px;
}

.brand-line {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-top: 5px;
}

.brand-name {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.brand-copy {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 660;
  letter-spacing: 0.04em;
}

.time-hub {
  display: grid;
  grid-template-columns: 1fr 138px 1fr;
  align-items: center;
  min-height: 160px;
  margin-top: 2px;
}

.selected-date {
  display: grid;
  justify-items: start;
  align-content: center;
  padding-left: 5px;
}

.date-year,
.date-weekday,
.today-return {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 620;
  letter-spacing: 0.04em;
}

.date-calendar {
  margin: 1px 0 2px;
  font-family: var(--font-heading);
  font-size: var(--date-size);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.today-return {
  min-height: 44px;
  margin: 5px 0 0 -6px;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor, transparent 58%);
  text-underline-offset: 3px;
}

.today-return:hover,
.today-return:active {
  color: var(--text);
}

.today-return[hidden] {
  display: none;
}

.celestial {
  position: relative;
  display: grid;
  width: 138px;
  height: 138px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.celestial::before,
.celestial::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.celestial::before {
  width: 128px;
  height: 128px;
  background: rgba(247, 216, 111, 0.22);
  filter: blur(17px);
}

.celestial::after {
  width: 112px;
  height: 112px;
  background: rgba(255, 246, 201, 0.34);
  filter: blur(9px);
}

.sun,
.moon {
  position: absolute;
  z-index: 1;
  width: 98px;
  height: 98px;
  border-radius: 50%;
}

.sun {
  background: radial-gradient(circle at 43% 38%, #fdf4c9 0, #f9e7a6 42%, #efd36c 100%);
  box-shadow: 0 0 24px rgba(240, 204, 95, 0.34);
}

.moon {
  display: none;
  background: radial-gradient(circle at 36% 30%, #ddd9cb 0, #c8c3b3 62%, #85857e 100%);
  box-shadow: 0 0 14px rgba(204, 201, 183, 0.14);
}

.moon::after {
  position: absolute;
  top: -4px;
  left: -25px;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: #111923;
  content: "";
  opacity: 0.97;
}

.app[data-time="night"] .celestial::before {
  width: 115px;
  height: 115px;
  background: rgba(181, 181, 165, 0.10);
  filter: blur(14px);
}

.app[data-time="night"] .celestial::after {
  background: rgba(197, 196, 179, 0.08);
}

.app[data-time="night"] .sun {
  display: none;
}

.app[data-time="night"] .moon {
  display: block;
}

.clock-hands {
  position: absolute;
  z-index: 3;
  inset: 0;
  opacity: 1;
  transition: opacity 180ms ease-out;
}

.celestial[data-clock="0"] .clock-hands {
  opacity: 0;
}

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  display: block;
  width: 3px;
  border-radius: 99px;
  background: #3d392f;
  opacity: 0.78;
  transform-origin: 50% 100%;
}

.clock-hand.hour {
  height: 27px;
  transform: translateX(-50%) rotate(53deg);
}

.clock-hand.minute {
  height: 39px;
  width: 2px;
  transform: translateX(-50%) rotate(28deg);
}

.clock-hand.second {
  display: none;
  height: 42px;
  width: 1px;
  background: #9c5f55;
  transform: translateX(-50%) rotate(178deg);
}

.celestial[data-clock="2"] .clock-hand.second {
  display: block;
}

.clock-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #423c31;
}

.app[data-time="night"] .clock-hand,
.app[data-time="night"] .clock-pin {
  background: #58c9c3;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  flex-direction: column;
  gap: 8px;
}

.close-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-solid), transparent 8%);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 140ms ease-out, color 140ms ease-out;
}

.icon-button:hover,
.icon-button:active {
  background: color-mix(in srgb, var(--surface-solid), transparent 78%);
  color: var(--text);
}

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

.week-navigation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  margin-top: -2px;
}

.week-strip {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}

.week-step {
  display: grid;
  width: 44px;
  height: 49px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: color-mix(in srgb, var(--text-muted), transparent 18%);
  cursor: pointer;
}

.week-step:hover,
.week-step:active {
  background: color-mix(in srgb, var(--surface-solid), transparent 80%);
  color: var(--text);
}

.week-step svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 49px;
  place-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.day span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
}

.day strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 570;
}

.day i {
  position: absolute;
  right: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  transform: translateX(50%);
  border-radius: 50%;
  background: var(--accent);
}

.day.is-selected {
  border-color: color-mix(in srgb, var(--accent), transparent 18%);
  background: color-mix(in srgb, var(--accent), transparent 89%);
}

.day.saturday strong,
.day.saturday span {
  color: #557dae;
}

.day.holiday strong,
.day.holiday span {
  color: #b65f67;
}

.main-content {
  position: relative;
  z-index: 2;
  height: calc(100% - 310px);
  padding: 12px 16px 102px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.main-content::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar,
.review-scroll::-webkit-scrollbar {
  display: none;
}

.section {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: var(--section-gap);
}

.section-header,
.review-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
}

.section h2,
.review-panel h2,
.placeholder-panel h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--heading-size);
  font-weight: 680;
  letter-spacing: 0.015em;
}

.count-label,
.section-date-note {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 620;
}

.input-actions {
  display: flex;
  gap: 5px;
}

.input-actions button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-solid), transparent 5%);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}

.entry-list {
  display: grid;
  gap: 2px;
}

.entry-row {
  --row-color: var(--category-work);
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--row-surface);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--shadow-color), transparent 54%);
}

.entry-row.category-work { --row-color: var(--category-work); }
.entry-row.category-life { --row-color: var(--category-life); }
.entry-row.category-people { --row-color: var(--category-people); }
.entry-row.category-self { --row-color: var(--category-self); }

.entry-row.plan-row {
  background: var(--row-surface);
}

.entry-row.done-row {
  --separator-inset: 34px;
  grid-template-columns: 34px minmax(0, 1fr) 48px;
  background: var(--row-surface);
}

.entry-row.note-row {
  --separator-inset: 34px;
  grid-template-columns: 34px minmax(0, 1fr) 48px;
  border-color: color-mix(in srgb, var(--border), transparent 22%);
  background: color-mix(in srgb, var(--row-surface), transparent 12%);
}

.app[data-treatment="band"] .entry-row:not(.note-row)::before {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 3px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 99px;
  background: var(--row-color);
  content: "";
}

.app[data-treatment="band"] .plan-row::before {
  opacity: 0.50;
}

.app[data-treatment="band"] .done-row::before {
  opacity: 0.95;
}

.app[data-treatment="dot"] .entry-row:not(.note-row)::before {
  position: absolute;
  top: 50%;
  left: 7px;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--row-color);
  content: "";
}

.app[data-treatment="dot"] .plan-row::before {
  opacity: 0.52;
}

.app[data-treatment="dot"] .done-row::before {
  opacity: 0.98;
}

.app[data-treatment="tint"] .entry-row:not(.note-row)::before {
  display: none;
}

.row-time {
  color: var(--text-muted);
  font-size: var(--time-size);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.plan-row .row-time {
  padding-left: 16px;
  text-align: left;
}

.done-row .row-time,
.note-row .row-time {
  padding: 0 10px 0 2px;
  text-align: right;
}

.row-copy {
  min-width: 0;
  padding: 6px 8px 6px 4px;
}

.row-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: var(--body-size);
  font-weight: 590;
  line-height: 1.42;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-row .row-title {
  color: color-mix(in srgb, var(--row-color) 62%, var(--text) 38%);
  font-weight: 570;
}

.done-row .row-title {
  color: color-mix(in srgb, var(--row-color) 80%, var(--text) 20%);
  font-weight: 640;
}

.note-row .row-title {
  color: color-mix(in srgb, var(--text-muted) 88%, var(--text));
  font-weight: 470;
}

.row-emoji {
  display: grid;
  min-width: 34px;
  place-items: center;
  font-size: 18px;
}

.row-state {
  padding-right: 13px;
  color: color-mix(in srgb, var(--row-color) 66%, var(--text) 34%);
  font-size: 18px;
  font-weight: 700;
}

.app[data-emoji="off"] .row-emoji,
.app[data-emoji="off"] .review-records > p > span {
  display: none;
}

.app[data-emoji="off"] .done-row,
.app[data-emoji="off"] .note-row {
  --separator-inset: 10px;
  grid-template-columns: minmax(0, 1fr) 48px;
}

.app[data-emoji="off"] .done-row .row-copy,
.app[data-emoji="off"] .note-row .row-copy {
  padding-left: 10px;
}

.app[data-emoji="off"] .review-records p {
  grid-template-columns: minmax(0, 1fr) auto;
}

.app[data-card="divider"] .entry-list {
  gap: 0;
}

.app[data-card="divider"] .entry-row {
  min-height: 44px;
  border-width: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.app[data-card="minimal"] .entry-row {
  min-height: 44px;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.app[data-separator="on"] .entry-row + .entry-row::after {
  position: absolute;
  top: 0;
  right: 8px;
  left: var(--separator-inset, 48px);
  height: 1px;
  background: color-mix(in srgb, var(--text-muted), transparent 82%);
  content: "";
  pointer-events: none;
}

.bottom-sheet {
  position: absolute;
  z-index: 8;
  right: 10px;
  bottom: 9px;
  left: 10px;
  height: 88px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  transition: height 220ms ease-out, border-radius 220ms ease-out;
}

.app[data-sheet="expanded"] .bottom-sheet {
  height: min(64%, 545px);
  border-radius: 25px 25px 34px 34px;
}

.sheet-header {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 87px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 19px 9px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.sheet-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 44px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: color-mix(in srgb, var(--text-muted), transparent 45%);
}

.sheet-heading {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 680;
}

.sheet-heading small {
  margin-left: 6px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
}

.sheet-chevron {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  transition: transform 220ms ease-out;
}

.app[data-sheet="expanded"] .sheet-chevron {
  transform: rotate(180deg);
}

.sheet-body {
  height: calc(100% - 82px);
  padding: 0 14px 22px;
  overflow: auto;
  opacity: 0;
  transition: opacity 150ms ease-out;
}

.app[data-sheet="expanded"] .sheet-body {
  opacity: 1;
}

.sheet-body .entry-row {
  background: color-mix(in srgb, var(--row-surface), var(--surface-solid) 18%);
}

.sheet-body .done-row {
  background: color-mix(in srgb, var(--row-surface), var(--surface-solid) 18%);
}

.panel-backdrop {
  position: absolute;
  z-index: 18;
  inset: 0;
  background: rgba(4, 7, 9, 0.30);
  backdrop-filter: blur(1px);
}

.review-panel,
.placeholder-panel {
  position: absolute;
  z-index: 20;
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: var(--panel-height);
  padding: 22px 18px 15px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.18);
  transform: translateY(calc(100% + 16px));
  transition: transform 220ms ease-out;
}

.review-panel.is-open,
.placeholder-panel.is-open {
  transform: translateY(0);
}

.placeholder-panel {
  top: 22%;
  bottom: auto;
  height: auto;
  min-height: 210px;
  padding-top: 30px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.98);
}

.placeholder-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

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

.panel-kicker {
  margin: 0 0 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.close-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  font-size: 23px;
  font-weight: 330;
  line-height: 1;
}

.review-scroll {
  height: calc(100% - 56px);
  padding: 17px 1px 40px;
  overflow: auto;
}

.review-scroll section + section {
  margin-top: 20px;
}

.week-story {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), var(--bg-top) 18%);
}

.week-story p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.review-scroll h3 {
  margin: 0 0 9px;
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.review-section-heading span {
  color: var(--text-muted);
  font-size: 10px;
}

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

.mosaic-item {
  --mosaic-color: var(--category-work);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--mosaic-color), transparent 58%);
  border-radius: 15px;
  background: color-mix(in srgb, var(--mosaic-color) 23%, var(--surface-solid));
}

.mosaic-item.category-work { --mosaic-color: var(--category-work); }
.mosaic-item.category-life { --mosaic-color: var(--category-life); }
.mosaic-item.category-people { --mosaic-color: var(--category-people); }
.mosaic-item.category-self { --mosaic-color: var(--category-self); }

.mosaic-item span,
.mosaic-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mosaic-item span {
  font-size: 10px;
  font-weight: 650;
}

.mosaic-item strong {
  grid-row: span 2;
  font-size: 22px;
  font-weight: 500;
}

.mosaic-item small {
  color: var(--text-muted);
  font-size: 8px;
}

.review-records {
  display: grid;
  gap: 6px;
}

.review-records p {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
}

.review-records strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-records small {
  color: var(--text-muted);
  font-size: 8px;
}

.weekly-notes blockquote {
  margin: 6px 0;
  padding: 9px 11px;
  border-left: 2px solid color-mix(in srgb, var(--accent), transparent 30%);
  background: color-mix(in srgb, var(--surface), transparent 18%);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.review-footnote {
  margin: 22px 0 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.6;
}

.placeholder-panel .close-button {
  position: absolute;
  top: 15px;
  right: 15px;
}

.placeholder-panel > p:last-child {
  max-width: 280px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.controls {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  padding: 22px;
  overflow: auto;
  border: 1px solid rgba(60, 62, 60, 0.13);
  border-radius: 24px;
  background: var(--page-panel);
  box-shadow: 0 18px 48px rgba(44, 46, 44, 0.09);
  backdrop-filter: blur(18px);
}

.controls-header {
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(54, 57, 55, 0.10);
}

.controls fieldset {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.controls legend {
  margin-bottom: 7px;
  color: #6f706d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.controls select {
  width: 100%;
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(54, 57, 55, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.74);
  color: #2f312f;
  cursor: pointer;
  font-size: 12px;
}

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

.control-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span,
.control-grid button {
  display: grid;
  min-height: 37px;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(54, 57, 55, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
  color: #555853;
  font-size: 11px;
  font-weight: 600;
}

.segmented input:checked + span {
  border-color: rgba(49, 74, 66, 0.45);
  background: #2f3c37;
  color: white;
}

.control-grid button {
  cursor: pointer;
}

.control-grid button:hover {
  background: #2f3c37;
  color: white;
}

.palette-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  margin-top: 9px;
}

.palette-preview i {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 99px;
}

.palette-preview span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--page-muted);
  font-size: 9px;
  white-space: nowrap;
}

.palette-preview .category-work { background: var(--category-work); }
.palette-preview .category-life { background: var(--category-life); }
.palette-preview .category-people { background: var(--category-people); }
.palette-preview .category-self { background: var(--category-self); }

.token-note {
  margin-top: 17px;
  padding: 12px;
  border-radius: 13px;
  background: rgba(48, 58, 54, 0.06);
}

.token-note strong {
  font-size: 11px;
}

.token-note p {
  margin: 4px 0 0;
  color: var(--page-muted);
  font-size: 10px;
  line-height: 1.65;
}

@media (max-width: 880px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 26px 18px 40px;
  }

  .controls {
    position: static;
    width: min(100%, 430px);
    max-height: none;
    margin: 0 auto;
  }

  .device {
    height: min(850px, calc(100svh - 48px));
  }
}

@media (max-width: 460px) {
  body {
    background: #111311;
  }

  .workbench {
    display: block;
    padding: 0;
  }

  .preview-heading,
  .controls {
    display: none;
  }

  .device {
    width: 100%;
    height: 100svh;
    min-height: 640px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .device-speaker {
    display: none;
  }

  .app {
    border-radius: 0;
  }
}

@media (max-height: 760px) and (min-width: 461px) {
  .device {
    min-height: 690px;
  }

  .time-hub {
    min-height: 142px;
  }

  .celestial {
    transform: scale(0.88);
  }

  .main-content {
    height: calc(100% - 288px);
  }
}

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