/* JA-052 job B: Today (heading, date, reminders, notebook) and My Thoughts (board, notes, quick capture).
   Part 1 is the classic look: tokens only (var(--...)), no gradients, no raw colours. Part 2 is the desk look: every rule starts
   with :root[data-ui="desk"], and each value is var(--desk token, the V5 prototype's value) so it also renders on its own. */

/* ================================================================================================================
   Part 1. Classic look (also the base of the desk look)
   ============================================================================================================== */

/* ---- Today: the heading and the live date ---- */
.today-topline {
  align-items: baseline;
}

.today-topline .today-heading {
  margin: 0;
}

.today-date {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  color: var(--ink-2);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
  font-variant-numeric: tabular-nums;
}

.today-date-weekday {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Today: Reminders (due thoughts from My Thoughts) ---- */
.today-reminder-list {
  display: grid;
  margin: 0;
  padding: var(--sp-1) var(--sp-4) var(--sp-3);
  list-style: none;
}

.today-reminder {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rule);
}

.today-reminder:last-child {
  border-bottom: 0;
}

.today-reminder-copy {
  display: grid;
  flex: 1 1 260px;
  gap: var(--sp-1);
  min-width: 0;
}

.today-reminder-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  max-width: 70ch;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
  white-space: pre-wrap;
}

.today-reminder-when {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 16px;
}

.today-reminder-when.is-overdue {
  color: var(--bad);
}

.today-reminder-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

/* Nothing due: one quiet line, so the page does not start with an empty box. */
.today-reminders.is-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-4);
  min-height: 52px;
  padding: var(--sp-2) var(--sp-4);
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
}

.today-reminders-title {
  margin: 0;
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
}

.today-reminders-empty {
  flex: 1 1 260px;
  max-width: none;
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
}

.today-reminders-empty strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---- My Thoughts: the screen ---- */
.main-content.thoughts-page {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding: var(--sp-4) var(--sp-6) var(--sp-12);
}

.thoughts-room {
  display: grid;
  gap: var(--sp-3);
}

.thoughts-caption {
  margin: 0;
}

.thoughts-tips summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--navy);
  font-size: var(--t-meta-size);
  font-weight: 600;
  cursor: pointer;
}

.thoughts-help {
  max-width: 90ch;
  margin: 0 0 var(--sp-2);
}

.thoughts-slot:empty {
  display: none;
}

/* The board: a window onto a large sheet. Notes sit on the layer; the layer moves when the board is panned. The board is
   its own stacking context, so nothing on it (notes, the Undo bar) can paint over the top bar, the phone bar or a sheet. */
.thoughts-board {
  position: relative;
  isolation: isolate;
  height: min(68vh, 680px);
  min-height: 380px;
  overflow: hidden;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

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

.thoughts-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform: translate(calc(var(--pan-x, 0) * 1px), calc(var(--pan-y, 0) * 1px));
}

.thoughts-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-content: center;
  justify-items: start;
  gap: var(--sp-1);
  padding: var(--sp-6);
  color: var(--ink-2);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
  pointer-events: none;
}

.thoughts-empty strong {
  color: var(--ink);
  font-size: var(--t-body-size);
}

/* z-index 1 is enough: inside the board it only has to sit above the notes' layer (z-index auto). */
.thoughts-undo {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: calc(100% - var(--sp-6));
  padding: var(--sp-2) var(--sp-3);
  color: var(--page);
  background: var(--ink);
  border-radius: var(--r-box);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
  transform: translateX(-50%);
}

/* Note colours: a pale wash with a stronger edge, taken from the app's own colours. */
.thought-sticky.is-yellow,
.thought-swatch.is-yellow,
.thought-pad.is-yellow,
.thought-sheet[data-colour="yellow"] {
  --note-bg: var(--caution-wash);
  --note-edge: var(--caution);
}

.thought-sticky.is-pink,
.thought-swatch.is-pink,
.thought-pad.is-pink,
.thought-sheet[data-colour="pink"] {
  --note-bg: var(--bad-wash);
  --note-edge: var(--bad);
}

.thought-sticky.is-blue,
.thought-swatch.is-blue,
.thought-pad.is-blue,
.thought-sheet[data-colour="blue"] {
  --note-bg: var(--navy-wash);
  --note-edge: var(--navy);
}

.thought-sticky.is-green,
.thought-swatch.is-green,
.thought-pad.is-green,
.thought-sheet[data-colour="green"] {
  --note-bg: var(--good-wash);
  --note-edge: var(--good);
}

.thought-sticky.is-lilac,
.thought-swatch.is-lilac,
.thought-pad.is-lilac,
.thought-sheet[data-colour="lilac"] {
  --note-bg: var(--wash);
  --note-edge: var(--ink-3);
}

/* One note. Its place comes from --x, --y and --z, set by the script. */
.thought-sticky {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z, 0);
  display: grid;
  gap: var(--sp-2);
  width: 240px;
  padding: var(--sp-1) var(--sp-3) var(--sp-2);
  color: var(--ink);
  background: var(--note-bg, var(--wash));
  border: 1px solid var(--field-border);
  border-top: 4px solid var(--note-edge, var(--field-border));
  border-radius: var(--r-box);
  cursor: grab;
  touch-action: none;
  transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px));
  transition: box-shadow var(--t-ctl) ease;
}

.thought-sticky.is-dragging {
  cursor: grabbing;
  box-shadow: var(--shadow-sheet);
}

.thought-sticky:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.thought-grip {
  height: 14px;
}

.thought-grip span {
  display: block;
  width: 40px;
  height: 4px;
  margin: 5px auto 0;
  background: var(--note-edge, var(--rule));
  border-radius: var(--r-ctl);
  opacity: 0.5;
}

.thought-text {
  display: block;
  width: 100%;
  min-height: 88px;
  padding: var(--sp-1) 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--r-ctl);
  font-family: var(--font-sans);
  font-size: var(--t-body-size);
  line-height: var(--t-body-line);
  resize: none;
  user-select: text;
}

.thought-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.thought-sticky .btn {
  min-height: 44px;
}

.thought-remind {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
  padding: 0 var(--sp-2);
  text-align: left;
  white-space: normal;
}

.thought-remind.is-due {
  color: var(--bad);
}

.thought-remind.is-done {
  color: var(--ink-2);
}

.thought-remove {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 0;
}

.thought-colours {
  display: flex;
  flex-wrap: nowrap;
}

.thought-swatch {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.thought-swatch::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  background: var(--note-bg);
  border: 2px solid var(--note-edge);
  border-radius: var(--r-ctl);
}

.thought-swatch[aria-pressed="true"]::before {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.thought-swatch:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

.thought-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 20px;
}

.thought-status {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.thought-status.is-error {
  color: var(--bad);
}

/* Adding notes, and the note count. */
.thoughts-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
}

.thoughts-tray-label {
  color: var(--ink);
  font-size: var(--t-meta-size);
  font-weight: 600;
}

.thoughts-pads {
  display: flex;
  gap: var(--sp-2);
}

.thought-pad {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--note-bg);
  border: 1px solid var(--note-edge);
  border-top: 4px solid var(--note-edge);
  border-radius: var(--r-ctl);
  cursor: pointer;
}

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

.thoughts-recentre {
  margin-left: auto;
}

/* ---- The quick capture and the reminder sheet ---- */
.thought-sheet {
  border-top: 4px solid var(--note-edge, var(--rule));
}

.thought-field {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.thought-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.thought-capture-text {
  min-height: 128px;
  resize: vertical;
  background: var(--note-bg, var(--page));
}

.thought-remind-set {
  min-width: 0;
  margin: 0;
  padding: var(--sp-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
}

/* The legend sits inside the box, under its top edge (JA-052 F2). A legend is otherwise drawn across the border line, with
   the line broken around the words. Floating it takes it out of that slot; the next element clears it. */
.thought-remind-set legend {
  float: left;
  width: 100%;
  padding: 0 0 var(--sp-2);
  font-size: var(--t-meta-size);
  font-weight: 500;
}

.thought-remind-set legend + * {
  clear: both;
}

.thought-sheet .stack-md {
  gap: var(--sp-3);
}

.thought-sheet-actions {
  margin-top: var(--sp-2);
}

.thought-sheet-actions .btn-primary {
  margin-left: auto;
}

/* ---- Phone and narrow windows ---- */
@media (max-width: 899px) {
  .main-content.thoughts-page {
    padding: var(--sp-4) var(--sp-4) calc(var(--sp-16) + var(--sp-6));
  }

  .thoughts-board {
    height: min(58vh, 500px);
    min-height: 320px;
  }

  .today-reminder-actions .btn,
  .thoughts-tray .btn,
  .thought-sheet .btn {
    min-height: 44px;
  }
}

@media (max-width: 599px) {
  .main-content.thoughts-page {
    padding: var(--sp-3) var(--sp-3) calc(var(--sp-16) + var(--sp-6));
  }

  /* The date sits on its own row, at the right, under the heading. */
  .today-topline .today-date {
    align-self: flex-end;
  }

  .today-reminder-actions {
    flex: 1 1 100%;
  }

  .thoughts-recentre {
    margin-left: 0;
  }

  .thought-field-row {
    grid-template-columns: 1fr;
  }
}

/* ================================================================================================================
   Part 2. Desk look (AUTOPILOT_UI=desk). Everything below starts with :root[data-ui="desk"].
   Values: var(--desk token, V5 prototype value). The prototype's handwriting face is not shipped, so type stays IBM Plex Sans.
   ============================================================================================================== */

/* ---- Today as a notebook page: a red margin and punched holes (no ruled lines under the words) ---- */
:root[data-ui="desk"] .main-content.v7-today-page {
  position: relative;
  max-width: 1080px;
  margin: var(--sp-6) auto var(--sp-16);
  padding: 26px 34px 40px 84px;
  /* The red margin and the punched holes stay; the blue ruling does not (JA-052 F2): the headings, labels and cards on this
     page are not on a line grid, so the lines ran through their words. */
  background:
    linear-gradient(90deg, transparent 0 62px, var(--paper-margin, rgba(198, 62, 47, 0.5)) 62px 63.5px, transparent 63.5px),
    var(--paper, #FFFEFA);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 6px 16px 16px 6px;
  box-shadow: var(--desk-hard, 4px 4px 0 0 rgba(23, 40, 63, 0.92));
}

:root[data-ui="desk"] .main-content.v7-today-page::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: -15px;
  width: 46px;
  background:
    radial-gradient(ellipse 15px 4.5px at 18px 17px, #D6DCE5 0 50%, #6B7686 60% 84%, transparent 94%) 0 0 / 46px 34px repeat-y,
    radial-gradient(circle 5.5px at 35px 17px, var(--desk-bg, #1E4D43) 0 4.6px, rgba(0, 0, 0, 0.25) 5px, transparent 5.8px) 0 0 / 46px 34px repeat-y;
  pointer-events: none;
}

:root[data-ui="desk"] .today-topline {
  align-items: flex-end;
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--paper-margin, rgba(198, 62, 47, 0.5));
}

:root[data-ui="desk"] .today-topline .today-heading {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

:root[data-ui="desk"] .today-date {
  align-items: baseline;
  gap: 12px;
}

:root[data-ui="desk"] .today-date-weekday {
  color: var(--stamp-ink, #264CA7);
  font-size: 26px;
  line-height: 1.1;
}

:root[data-ui="desk"] .today-date-day {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

/* The panels on the page are paper leaves; tasks get a tick box in place of the dot. */
:root[data-ui="desk"] .v7-today-page .v7-panel,
:root[data-ui="desk"] .v7-today-page .v7-first-day-card,
:root[data-ui="desk"] .v7-today-page .v7-undo-bar,
:root[data-ui="desk"] .v7-today-page .v7-progress-bank {
  background: var(--paper, #FFFEFA);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 4px 12px 12px 4px;
  box-shadow: 2px 3px 0 rgba(23, 40, 63, 0.25);
}

:root[data-ui="desk"] .v7-today-page .v7-row-marker {
  width: 16px;
  height: 16px;
  background: var(--paper, #FFFEFA);
  border: 2px solid var(--window-ink, #17283F);
  border-radius: 3px;
}

:root[data-ui="desk"] .v7-today-page .v7-row-marker.is-overdue {
  border-color: var(--bad);
}

/* Reminders are sticky notes on the page. */
:root[data-ui="desk"] .v7-today-page .today-reminders {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

:root[data-ui="desk"] .v7-today-page .today-reminders.is-empty {
  padding: 16px;
  background: transparent;
  border: 1px dashed var(--window-ink, #17283F);
  border-radius: 0;
  box-shadow: none;
}

:root[data-ui="desk"] .today-reminders .v7-panel-head {
  padding: 4px 0 0;
  border-bottom: 0;
}

:root[data-ui="desk"] .today-reminders .v7-panel-head h2 {
  font-size: 24px;
  line-height: 1.15;
}

:root[data-ui="desk"] .today-reminder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 20px;
  padding: 18px 4px 6px;
}

:root[data-ui="desk"] .today-reminder {
  position: relative;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  width: 264px;
  min-height: 132px;
  padding: 22px 16px 14px;
  background: var(--sticky-yellow, #FFF3A0);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 3px 3px 16px 3px;
  box-shadow: 3px 4px 0 rgba(23, 40, 63, 0.35);
  transform: rotate(-1.1deg);
}

:root[data-ui="desk"] .today-reminder:last-child {
  border-bottom: 1.5px solid var(--window-ink, #17283F);
}

:root[data-ui="desk"] .today-reminder:nth-child(3n + 2) {
  background: var(--sticky-pink, #FFD3E3);
  transform: rotate(0.9deg);
}

:root[data-ui="desk"] .today-reminder:nth-child(3n) {
  background: var(--sticky-blue, #CDE6FF);
  transform: rotate(-0.4deg);
}

:root[data-ui="desk"] .today-reminder::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 68px;
  height: 18px;
  background: rgba(246, 237, 214, 0.9);
  border: 1px solid rgba(23, 40, 63, 0.22);
  transform: translateX(-50%) rotate(-3deg);
}

:root[data-ui="desk"] .today-reminder-copy {
  flex: 1 1 auto;
}

:root[data-ui="desk"] .today-reminder-actions {
  gap: 8px;
}

:root[data-ui="desk"] .today-reminder-actions .btn {
  min-height: 36px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1.5px solid var(--window-ink, #17283F);
  box-shadow: 2px 2px 0 rgba(23, 40, 63, 0.9);
}

:root[data-ui="desk"] .today-reminder-text {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

:root[data-ui="desk"] .today-reminder-when {
  color: var(--ink-2);
}

/* Nothing due is the prototype's dashed "Your desk is clear" box (above, with the leaf rules). */

/* ---- My Thoughts: a pinboard, and sticky notes with tape ---- */
:root[data-ui="desk"] .main-content.thoughts-page {
  max-width: none;
  padding: 16px;
  background: #F7F1E2;
}

:root[data-ui="desk"] .thoughts-board {
  background:
    radial-gradient(rgba(23, 40, 63, 0.16) 1px, transparent 1.4px) calc(var(--pan-x, 0) * 1px) calc(var(--pan-y, 0) * 1px) / 28px 28px,
    var(--paper, #FFFEFA);
  border: 2px solid var(--window-ink, #17283F);
  border-radius: 10px;
  box-shadow: var(--desk-hard, 4px 4px 0 0 rgba(23, 40, 63, 0.92));
}

:root[data-ui="desk"] .thoughts-tray {
  background: var(--paper, #FFFEFA);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 9px;
  box-shadow: 3px 3px 0 0 rgba(23, 40, 63, 0.92);
}

:root[data-ui="desk"] .thought-sticky.is-yellow,
:root[data-ui="desk"] .thought-swatch.is-yellow,
:root[data-ui="desk"] .thought-pad.is-yellow,
:root[data-ui="desk"] .thought-sheet[data-colour="yellow"] {
  --note-bg: var(--sticky-yellow, #FFF3A0);
}

:root[data-ui="desk"] .thought-sticky.is-pink,
:root[data-ui="desk"] .thought-swatch.is-pink,
:root[data-ui="desk"] .thought-pad.is-pink,
:root[data-ui="desk"] .thought-sheet[data-colour="pink"] {
  --note-bg: var(--sticky-pink, #FFD3E3);
}

:root[data-ui="desk"] .thought-sticky.is-blue,
:root[data-ui="desk"] .thought-swatch.is-blue,
:root[data-ui="desk"] .thought-pad.is-blue,
:root[data-ui="desk"] .thought-sheet[data-colour="blue"] {
  --note-bg: var(--sticky-blue, #CDE6FF);
}

:root[data-ui="desk"] .thought-sticky.is-green,
:root[data-ui="desk"] .thought-swatch.is-green,
:root[data-ui="desk"] .thought-pad.is-green,
:root[data-ui="desk"] .thought-sheet[data-colour="green"] {
  --note-bg: var(--sticky-green, #D4F2C0);
}

:root[data-ui="desk"] .thought-sticky.is-lilac,
:root[data-ui="desk"] .thought-swatch.is-lilac,
:root[data-ui="desk"] .thought-pad.is-lilac,
:root[data-ui="desk"] .thought-sheet[data-colour="lilac"] {
  --note-bg: var(--sticky-lilac, #F0E6FF);
}

:root[data-ui="desk"] .thought-sticky {
  border: 1.5px solid rgba(23, 40, 63, 0.8);
  border-radius: 3px 3px 15px 3px;
  box-shadow: 4px 5px 0 rgba(23, 40, 63, 0.28), 9px 12px 20px rgba(23, 40, 63, 0.14);
  transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px)) rotate(var(--tilt, 0deg));
}

:root[data-ui="desk"] .thought-sticky.is-dragging {
  box-shadow: 8px 12px 0 rgba(23, 40, 63, 0.3), 18px 28px 38px rgba(23, 40, 63, 0.25);
  transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px));
}

:root[data-ui="desk"] .thought-grip span {
  width: 58px;
  height: 14px;
  margin: 0 auto;
  background: rgba(246, 237, 214, 0.85);
  border: 1px solid rgba(23, 40, 63, 0.2);
  border-radius: 0;
  opacity: 1;
  transform: rotate(-2deg);
}

:root[data-ui="desk"] .thought-text {
  font-weight: 500;
}

:root[data-ui="desk"] .thought-swatch::before {
  background: var(--note-bg);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 50%;
}

:root[data-ui="desk"] .thought-pad {
  background: var(--note-bg);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 0;
  box-shadow: 2px 2px 0 rgba(23, 40, 63, 0.7);
}

:root[data-ui="desk"] .thoughts-undo {
  background: var(--window-ink, #17283F);
  border: 1px solid #FFFFFF;
  border-radius: 10px;
  box-shadow: var(--desk-hard, 4px 4px 0 0 rgba(23, 40, 63, 0.92));
}

/* The quick capture is a sticky note, taped to the screen; its button row is a dashed foot, not the plain sheet footer. */
:root[data-ui="desk"] .sheet.thought-sheet .thought-sheet-actions {
  background: transparent;
  border-top: 1px dashed rgba(23, 40, 63, 0.45);
}

:root[data-ui="desk"] .sheet.thought-sheet {
  position: relative;
  overflow: visible;
  background: var(--note-bg, var(--sticky-yellow, #FFF3A0));
  border: 2px solid var(--window-ink, #17283F);
  border-radius: 5px 16px 16px 5px;
  box-shadow: 8px 8px 0 rgba(8, 24, 20, 0.48);
}

:root[data-ui="desk"] .sheet.thought-sheet::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 82px;
  height: 17px;
  background: rgba(246, 237, 214, 0.9);
  border: 1px solid rgba(23, 40, 63, 0.2);
  transform: translateX(-50%) rotate(-2deg);
}

:root[data-ui="desk"] .thought-capture-text {
  background: rgba(255, 255, 255, 0.62);
  border: 1.5px solid var(--window-ink, #17283F);
  border-radius: 7px;
}

/* ---- Phone: flat paper, no shadows, no spiral ---- */
@media (max-width: 899px) {
  :root[data-ui="desk"] .main-content.v7-today-page {
    margin: 0;
    padding: 20px 14px 28px 48px;
    background:
      linear-gradient(90deg, transparent 0 34px, var(--paper-margin, rgba(198, 62, 47, 0.5)) 34px 35.5px, transparent 35.5px),
      var(--paper, #FFFEFA);
    border-width: 0;
    border-radius: 0;
    box-shadow: none;
  }

  :root[data-ui="desk"] .main-content.v7-today-page::before {
    display: none;
  }

  :root[data-ui="desk"] .v7-today-page .v7-panel,
  :root[data-ui="desk"] .v7-today-page .v7-first-day-card,
  :root[data-ui="desk"] .v7-today-page .v7-undo-bar,
  :root[data-ui="desk"] .v7-today-page .v7-progress-bank,
  :root[data-ui="desk"] .today-reminder,
  :root[data-ui="desk"] .thoughts-board,
  :root[data-ui="desk"] .thoughts-tray,
  :root[data-ui="desk"] .thought-sticky {
    box-shadow: none;
  }

  :root[data-ui="desk"] .today-reminder-list {
    flex-direction: column;
    gap: 22px;
    padding: 18px 4px 12px;
  }

  :root[data-ui="desk"] .today-reminder {
    width: auto;
    max-width: 360px;
    transform: none;
  }

  :root[data-ui="desk"] .today-reminder-actions .btn {
    min-height: 44px;
  }

  :root[data-ui="desk"] .main-content.thoughts-page {
    padding: 8px;
  }
}

@media (max-width: 599px) {
  /* The heading stays first; the date drops to its own row at the right. */
  :root[data-ui="desk"] .today-topline {
    align-items: stretch;
    gap: 2px;
  }
}
