/* ============================================
   DASHBOARD POPOVER
   Each page's dashboard (sort, filters, tag clouds, Find More) opens from a filters
   button: top right of home's categories column, top right of the page elsewhere, and
   in the header on a phone (<=819px), where it's a panel from the right edge instead.
   application.js places it under the button that opened it.
   ============================================ */
/* Zero-height strip: the button sits in the top-right corner of the page (or of home's
   categories column) without pushing anything down, and scrolls away with it. It used to
   be sticky, riding the corner over whatever scrolled beneath it; it's only needed now and
   then, and it's back at the top. */
.dashboard-corner {
  position: relative;
  z-index: 6;
  height: 0;
}
.dashboard-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface-1);
  color: var(--text-2);
  font-size: var(--fs-14);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.dashboard-btn:hover,
.dashboard-btn[aria-expanded="true"] { background-color: var(--surface-2); border-color: var(--border-strong); color: #fff; }
/* The word beside the icon where there's room for it; the icon alone below that. */
.dashboard-btn-label { display: none; }
@media (min-width: 1500px) {
  .dashboard-btn { width: auto; gap: 7px; padding: 0 12px 0 11px; font-size: var(--fs-13); font-weight: 500; }
  .dashboard-btn i { font-size: var(--fs-13); }
  .dashboard-btn-label { display: inline; }
}

.dashboard-popover {
  display: none;
  position: fixed;
  z-index: 900;
  width: 300px;
  box-sizing: border-box;
  padding: 12px 10px 10px;
  background-color: var(--surface-pop);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  flex-direction: column;
}
.dashboard-popover.is-open { display: flex; }
#dashboard-section {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 819px) {
  /* The header's button stands in for the corner one. */
  .dashboard-corner { display: none; }
  .dashboard-popover {
    top: 52px;
    right: 0;
    z-index: 1002;
    width: min(300px, 88vw);
    border-radius: 0;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
  }
  .mobile-dashboard-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text-2);
    font-size: var(--fs-18);
    cursor: pointer;
  }
  .mobile-dashboard-btn[aria-expanded="true"] { background-color: var(--surface-2); color: #fff; }
}


/* Task-row hover icons. These tables are table-layout:fixed, so the column size comes
   from the <th> sizing row, not from the cells — the floor lives there as
   `width: max(68px, 14%)`. Nothing to set on the cell itself. */

/* Sit the icons against the cancel button with just a little air between them. The cell
   itself is 68px so the stack never gets squeezed; right-aligning means the slack shows
   up on the left (against the title) instead of as a gap before the cancel button. */
td.task-row-icon-cell > div {
  justify-content: flex-end;
  padding-right: 1px;
}

/* ============================================================
   AMBIENT + TACTILITY
   Three things the app didn't have. All neutral - no hue is
   introduced, so the tuned palette is untouched.
   ============================================================ */

/* (1) Removed: a soft overhead radial wash on body. It showed as a semi-circle
   bulging down from the top-centre of every page, so the app stays an evenly
   lit field. (If a light source comes back, keep it off background-attachment:
   fixed - that made every Turbo Stream row swap repaint the layer and flash.) */

/* (2) Cards answer the cursor. Deliberately no transform: this is a working
   surface, and shifting a card under the pointer while you are aiming at a
   checkbox is worse than no feedback at all. The lift is pure light - a
   brighter edge and a deeper cast shadow, which only became possible once the
   page ground moved off #000. */
.daily-column .day-section {
  transition: box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
}

.daily-column .day-section:hover {
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10),
              inset 1px 0 0 rgba(255, 255, 255, 0.03),
              inset 0 -1px 0 rgba(255, 255, 255, 0.024),
              0 3px 7px rgba(0, 0, 0, 0.6), 0 18px 44px rgba(0, 0, 0, 0.55);
}
/* Categories cards get their lift from drop-shadow(), which follows the rounded
   card's alpha shape - .handle is a transparent wrapper, so a box-shadow here
   would draw a hard rectangle around nothing. The shadow is carried at rest and
   simply deepens on hover, rather than appearing only while pointed at. */
#categories-list > div.handle:hover {
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.55));
}
/* Hovering a category lifts its edge, matching how the day panel brightens its
   own top highlight on hover. Only the custom properties are redeclared; the
   ::after already reads them, so the shadow list is not duplicated. */
#categories-list > div.handle:hover .category-card-border {
  --cat-hairline: 17%;
  --cat-toplight: 0.045;
}

/* (3) Keyboard focus. Inputs already draw their own ring, so this covers only
   what was left silent - links, buttons and anything else tab-reachable. */
a:focus-visible,
button:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.85);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  .daily-column .day-section,
  #categories-list > div.handle,
  .category-card-border::after { transition: none; }
}

/* ============================================================
   SURFACE GRADATION
   Every one of these surfaces was a flat fill. Each now carries a
   wash lit from the same direction as the inset top-edge
   highlights, so they read as one family of materials.

   All are applied as background-image, never background, so the
   colour underneath - category tints, tracker status washes, a
   Thing's own hue - is left exactly as it was.
   ============================================================ */

/* Schedule column: the month calendar panel. */
/* The panel's surface used to be declared inline, which meant no stylesheet rule
   - including :hover - could reach its border or shadow. Everything visual now
   lives here; only the dynamic margins and the 100px em-base (the calendar grid
   sizes itself in em from it) remain inline. */
.schedule-calendar-panel {
  color: var(--text-1);
  text-transform: uppercase;
  font-weight: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Glass, not a fill: the surface colour is carried at ~72% so the page ground
     shows through, and the blur behind it keeps that from reading as a merely
     faded panel. Falls back to the opaque --surface-card below, so a browser
     without backdrop-filter gets exactly the panel it had before. */
  background-color: var(--surface-card);
  background-image: var(--sheen);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: box-shadow var(--dur-base) ease, border-color var(--dur-base) ease,
              background-color var(--dur-base) ease;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .schedule-calendar-panel {
    background-color: rgba(6, 6, 8, 0.72);
    /* The wash is angled rather than straight down, and carries a second, cooler
       stop at the far corner - the two together are what make the pane read as a
       sheet catching light across it instead of a gradient laid on a fill. Kept
       within a couple of points of --sheen's strength: this is looked at all day. */
    background-image: linear-gradient(145deg,
                        rgba(255, 255, 255, 0.055) 0%,
                        rgba(255, 255, 255, 0.014) 42%,
                        rgba(255, 255, 255, 0.028) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(135%);
    backdrop-filter: blur(14px) saturate(135%);
    /* A rim rather than a top edge alone: the left and bottom hairlines are what
       give a translucent pane its thickness. All three are inset shadows so they
       sit inside the radius and never mitre against the border. */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.075),
                inset 1px 0 0 rgba(255, 255, 255, 0.022),
                inset 0 -1px 0 rgba(255, 255, 255, 0.018),
                0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
/* Same lift the day panel gets on hover; the glass version also clarifies a
   little - less veil, more of what is behind it. */
.schedule-calendar-panel:hover {
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.075),
              0 3px 7px rgba(0, 0, 0, 0.6), 0 18px 44px rgba(0, 0, 0, 0.55);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .schedule-calendar-panel:hover {
    background-color: rgba(6, 6, 8, 0.64);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10),
                inset 1px 0 0 rgba(255, 255, 255, 0.03),
                inset 0 -1px 0 rgba(255, 255, 255, 0.024),
                0 3px 7px rgba(0, 0, 0, 0.6), 0 18px 44px rgba(0, 0, 0, 0.55);
  }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-calendar-panel { transition: none; }
}

/* ============================================================
   CATEGORY CARD HAIRLINE
   Drawn on a positioned pseudo-element, for two separate reasons.

   1. Not real borders: a border on the top and bottom makes the
      browser MITRE the corners against the inline 4px left stripe,
      cutting its ends on a diagonal so it looks shortened - and
      with box-sizing: border-box it also steals a pixel of content
      width on three sides.

   2. Not a plain inset box-shadow on the card either: the card has
      no padding and its first child (.category-header) paints an
      opaque background edge to edge. Inset shadows are painted
      BELOW in-flow child content, so that header covered the ring
      completely - which is why it stayed invisible at every value
      from 9% to 18%. An absolutely positioned pseudo-element paints
      above in-flow children, so it actually shows.

   The colour is the card's own accent mixed toward TRANSPARENT, not
   toward --border: --border is #2d2d33, far lighter than these
   surfaces (#030d1a, #060a08), and mixing into it gave a pale grey
   line that read as bright at any percentage. */
.category-card-border {
  position: relative;
}
.category-card-border::after {
  content: '';
  position: absolute;
  /* Stretched over the BORDER box, not the padding box. An absolutely positioned
     child resolves `inset` against the padding box, which excludes the 4px left
     stripe - so the ring landed just inside the stripe as a second parallel line,
     and `border-radius: inherit` on a box 4px narrower gave corners that did not
     match the card's, leaving the stripe's tips visually detached. Pulling the
     left edge out by the stripe's width makes the pseudo-element exactly the
     card's border box: the radii line up and the hairline meets the stripe. */
  top: 0;
  right: 0;
  bottom: 0;
  left: calc(-1 * var(--cat-stripe, 4px));
  border-radius: inherit;
  /* The day panel's top edge is not just its 1px inset line - it also carries
     --sheen, a wash fading down from the top, and the two together are what give
     it its thickness. This card cannot use a card background for that: its
     opaque .category-header covers it. So the falloff rides on the pseudo-element
     instead, clipped to the top ~26px so it reads as a lit edge rather than a
     wash over the whole card. */
  background: linear-gradient(180deg, rgba(255, 255, 255, var(--cat-toplight)), rgba(255, 255, 255, 0) 26px);
  /* Lit top edge, the same idiom the day panel and the calendar panel carry
     idiom, dialled below their .05/.045 - listed first so it paints above the
     tinted ring along the top. */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, var(--cat-toplight)),
              inset 0 0 0 1px color-mix(in srgb, var(--cat-color, #ffffff) var(--cat-hairline), transparent);
  transition: box-shadow var(--dur-base) ease, background var(--dur-base) ease;
  pointer-events: none;
}

/* ============================================================
   HOVER AFFORDANCES
   Hover should preview what a control does, not just glow.
   ============================================================ */

/* (1) Task titles read as clickable. Their colour is dynamic - task_title_color()
   varies by category and state - so brightness is used rather than a fixed hue,
   which would overwrite that meaning. Same idiom as a.pin-avatar:hover. */
.task-title-link {
  transition: filter var(--dur-fast) ease;
  /* At the 420px column cap a long title regularly wraps to a one-word last
     line. `pretty` lets the browser pull a word down from the line above to
     even the rag out; it changes only where the breaks fall, never the text. */
  text-wrap: pretty;
}
.task-title-link:hover {
  filter: brightness(1.3);
}

@media (hover: hover) { /* (2) Each row icon previews the state it is about to enter. Every colour below
   is lifted from _task_row.html.erb's own "is set" branch, so hovering shows
   exactly what the icon will look like once the thing is true:

     star        task.priority?              -> var(--gold)      + fills solid
     pen-fancy   task.infos/journals.any?    -> #f97316
     caret       _has_visible_subtasks       -> var(--accent-bright)
     calendar    task.due_date.present?      -> var(--blue)
     tag         task.tags.any?              -> #a855f7

   Each icon needs the wrapper-hover variants, not just `i:hover`. The icons sit
   inside <button> and <span> wrappers, and the generic white rule above matches
   `.task-row-hover-buttons button:hover i.fa-solid` at (0,3,2) - a bare
   `i.fa-pen-fancy:hover` at (0,3,1) loses to it, which is why the first attempt
   at this stayed white. Matching the wrapper brings these to (0,3,2), and being
   later in the file they win.

   Copy, paste and share keep the generic brighten: they are actions with no set
   state, so a colour would be decoration rather than a preview. */
.task-row-hover-buttons i.star-priority:hover,
.task-row-hover-buttons span:hover > i.star-priority {
  color: var(--gold) !important;
  font-weight: 900;
} }
@media (hover: hover) { .task-row-hover-buttons i.star-priority.fa-solid:hover {
  color: var(--gold-bright) !important;
} }

@media (hover: hover) { .task-row-hover-buttons i.fa-pen-fancy:hover,
.task-row-hover-buttons button:hover i.fa-pen-fancy,
.task-row-hover-buttons span:hover i.fa-pen-fancy,
.task-row-hover-buttons a:hover i.fa-pen-fancy {
  color: #f97316 !important;
} }

@media (hover: hover) { /* The caret needs MORE specificity than the others. The generic white rule
   catches it through `.task-row-hover-buttons span:hover > i.fa-solid` at
   (0,3,2); a `.subtask-caret-toggle:hover i.fa-caret-right` is only (0,3,1) and
   loses. Naming both the wrapper class and span takes this to (0,4,2). */
.task-row-hover-buttons span.subtask-caret-toggle:hover > i.fa-solid,
.task-row-hover-buttons span.subtask-caret-toggle > i.fa-solid:hover {
  color: var(--accent-bright) !important;
} }

@media (hover: hover) { .task-row-hover-buttons i.calendar-date-picker:hover,
.task-row-hover-buttons button:hover i.calendar-date-picker,
.task-row-hover-buttons span:hover i.calendar-date-picker,
.task-row-hover-buttons a:hover i.calendar-date-picker {
  color: var(--blue) !important;
} }

@media (hover: hover) { .task-row-hover-buttons i.fa-tag:hover,
.task-row-hover-buttons button:hover i.fa-tag,
.task-row-hover-buttons span:hover i.fa-tag,
.task-row-hover-buttons a:hover i.fa-tag {
  color: #a855f7 !important;
} }

/* (6) The category header's + now previews the same blue as the + on a task row
   (#79b8ff), so the two add actions on the home page read as the same verb.
   !important because the icon's resting colour is set inline. */
.add-task-button i.fa-plus,
.category-plus-btn i.fa-plus {
  transition: color var(--dur-fast) ease;
}
.add-task-button:hover i.fa-plus,
.category-plus-btn:hover i.fa-plus {
  color: #79b8ff !important;
}

/* A category card's footer + (calendars/_categories_column): out of sight until the
   footer is hovered, or tapped once on a touch screen (.is-revealed, task_form_button.js),
   so the column doesn't carry a permanent extra icon per card. Clickable only while
   shown, so a tap can't hit it unseen. Shown, the whole footer is the button and lights
   up the way a task row's + cell does: the same blue tint, the same + a size smaller. */
.category-card-footer { position: relative; }
.category-add-after {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0 0 12px 12px;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
@media (hover: hover) {
  .category-card-footer:hover .category-add-after { opacity: 1; pointer-events: auto; }
}
.category-card-footer.is-revealed .category-add-after,
.category-add-after:focus-visible { opacity: 1; pointer-events: auto; }
.category-add-after:hover,
.category-add-after:focus-visible { color: #79b8ff; background-color: rgba(77, 159, 255, 0.13); }

/* (4) The month already links to calendar_path(year:, month:); it just had no
   hover state, and its colour was inline where no rule could reach it. */
.schedule-month-link {
  color: #ededf0;
  transition: color var(--dur-fast) ease;
}
.schedule-month-link:hover {
  color: #fff;
  /* The global a:hover underline applies unless restated here. */
  text-decoration: none;
}

/* The < > month steppers get the same treatment: full white on hover. Their
   colour moved out of the inline style so a rule can reach it. */
.schedule-month-nav {
  color: #6b6b76;
  transition: color var(--dur-fast) ease;
}
.schedule-month-nav:hover {
  color: #fff;
  text-decoration: none;
}

/* (5) The category header is one link now. Brightness rather than a fixed colour,
   because the header inherits the category's own hue. */
.category-header-link {
  display: inline;
  transition: filter var(--dur-fast) ease;
}
.category-header-link:hover {
  filter: brightness(1.3);
}

@media (prefers-reduced-motion: reduce) {
  .schedule-month-link,
  .schedule-month-nav,
  .category-header-link { transition: none; }
}

/* ============================================================
   TOUCH & SMALL SCREEN
   Everything below is about devices that cannot hover or that
   drive the layout with a thumb. Appended last so these win over
   the desktop hover rules they are correcting.
   ============================================================ */

/* ---- Row tools where there is no hover to reveal them ----
   Every icon in .task-row-hover-buttons - date picker, caret, tag, share, star,
   pencil, copy/paste - sits at opacity 0 until the row is hovered, and the timer
   is display:none until then. A touch screen cannot hover, so on a phone that
   whole toolbar was unreachable.

   Revealing all of it at rest was the first attempt and it was wrong: a row stops
   reading as a title and becomes a wall of icons. So one ellipsis stands in for
   the toolbar and opens it for a single row at a time. At rest the stacks are
   display:none rather than transparent, which also hands their width back to the
   title - worth more on a phone than anywhere else.

   The comma is an OR: either the device cannot hover, or the viewport is down in
   the range where the home page has already gone single-column. */
.row-tools-more {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-3);
  font-size: var(--fs-13);
  cursor: pointer;
}

@media (hover: none), (max-width: 819px) {
  .task-row .row-tools-more {
    display: inline-flex;
    /* The toolbar cell is justify-content: flex-end, so the ellipsis is pinned to
       its right edge and this is what walks it back toward the title - 1px of
       margin is 1px left, with the cancel and add cells and the title cell all
       staying exactly where they are.

       Set by eye, between two rejected ends: matching the cancel/add gap
       arithmetically gives 3px and reads as crowded, 12px reads as adrift.
       Travel runs out around 21px, where the button reaches the left edge of
       its own cell. */
    margin-right: 8px;
  }
  /* The ellipsis glyph is an <i class="fa-solid">, so it was caught by the same
     `.task-row-hover-buttons i.fa-solid { opacity: 0 }` rule it exists to work
     around - the button was laid out and tappable, but invisible until a hover
     that never comes. It is the one control here that must never wait on hover. */
  /* 0.6, not 1: the ban and plus in the two cells beside it rest at 0.6, and the
     ellipsis at full strength made three bright dots the loudest mark in every
     row - five of them marching down a five-task day. The trailing controls read
     as one set at one weight. Full strength on touch, where it is being used. */
  .task-row .row-tools-more i.fa-solid { opacity: 0.6; }
  .task-row .row-tools-more:hover i.fa-solid,
  .task-row .row-tools-more:active i.fa-solid { opacity: 1; }
  /* Collapsed: the ellipsis is the only thing in the cell. */
  .task-row:not(.row-tools-open) .row-tools-stack { display: none; }

  /* The ellipsis stands in for the toolbar, so it steps aside once the toolbar is
     there - leaving it in place cost the icons the width they need and they piled
     up inside the cell. Closing is by tapping outside the row, or Escape. */
  .task-row.row-tools-open .row-tools-more { display: none; }
  /* Opened: the icons are no longer waiting on a hover that will never arrive. */
  .task-row.row-tools-open .task-row-hover-buttons i.fa-solid,
  .task-row.row-tools-open .task-row-hover-buttons i.star-priority {
    opacity: 1;
  }
  /* These two rest at 0.28 rather than 0, so they were always reachable - but
     there is no hover here to take them the rest of the way. */
  #home-container .task-row .delete-cancel-cell i,
  #home-container .task-row .add-cell i,
  #home-container .block-cancel-row .add-task-button i {
    opacity: 0.6;
  }
}

@media (min-width: 820px) {
  /* ---- The title gets more of the row on desktop ----
     Lead 11%, category 17%, title 45%, cancel 8%, add 9%; the hover toolbar keeps its
     fixed width. Same lever as the phone block below: these tables are table-layout:
     fixed, so the widths come from the <thead> spacer row, whose inline styles need
     !important to override. */
  .daily-column table thead th:nth-child(1) { width: 11% !important; }
  .daily-column table thead th:nth-child(2) { width: 17% !important; }
  .daily-column table thead th:nth-child(3) { width: 45% !important; }
  .daily-column table thead th:nth-child(5) { width: 8% !important; }
  .daily-column table thead th:nth-child(6) { width: 9% !important; }
  /* The categories column's rows (categories_column, subcategory_card, inbox) have no
     category cell: lead 8.5%, the title the rest, the 59px toolbar, cancel 6.5%, add 8%. */
  .categories-column table thead th.col-sizer:nth-child(1) { width: 8.5% !important; }
  .categories-column table thead th.col-sizer:nth-child(4) { width: 6.5% !important; }
  .categories-column table thead th.col-sizer:nth-child(5) { width: 8% !important; }
}

@media (max-width: 819px) {
  /* ---- Give the title back some of the row ----
     At 390px the title cell was 130px - a third of the screen - with the other
     62% spent on chrome. These tables are `table-layout: fixed`, so every column
     width comes from the zero-height <thead> spacer row and nothing a <td> says
     about its own width matters. Re-proportioning that row is the only lever.

     Only the two columns that were plainly oversized give anything up: the lead
     cell, 13% around a 22px checkbox, and the toolbar cell, a hard 59px holding
     a 30px ellipsis - a fixed px column, so it ate a steadily larger share as the
     screen narrowed. The category column is deliberately untouched: taking it to
     6% wraps its label and drives the row from 48px to 76px tall.

     Title goes 130px -> 160px, 33% of the screen to 41%. Measured at 390x844.

     !important because the spacer row writes its widths as inline styles. */
  .daily-column table thead th:nth-child(1) { width: 10% !important; }
  .daily-column table thead th:nth-child(3) { width: 48% !important; }
  .daily-column table thead th:nth-child(4) { width: 46px !important; }
  .daily-column table thead th:nth-child(5),
  .daily-column table thead th:nth-child(6) { width: 9% !important; }

  /* ---- The opened toolbar is a floating strip, not a cell's worth of icons ----
     Two things were stacking up against it. The desktop layout is a deliberate
     two-line cluster of icons, tuned to a 59px cell; this column is now 46px, so
     it wrapped again into a bunched-up block. And no cell width would have fixed
     that - at any size that leaves the title room, a seven-icon toolbar laid out
     in two lines is cramped.

     So while open it stops being table-cell content: absolutely positioned, sized
     to its contents rather than to the column, and flattened to one evenly spaced
     horizontal strip on its own surface. It reaches left over the title, which is
     fine - it is transient, and the title is what you opened the row from. The
     cancel and add cells sit to its right and stay clear. */
  /* Positioned on a box inside the cell (.row-tools-host), never the cell itself: a
     positioned table cell is painted on its own layer, and Safari then drew a block's
     borders unevenly around it. The host sits at the cell's vertical middle, so the
     strip's top: 50% centres on the row. */
  .task-row.row-tools-open .row-tools-host { display: block; position: relative; }
  .task-row.row-tools-open .row-tools {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: max-content;
    /* .row-tools is height:100% for its life as a table cell's content. Left on,
       it made the floating strip 65px tall around 16px of icons - taller than the
       51px row it sits in - which read as the icons rattling around inside it. */
    height: auto;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 7px 11px;
    border-radius: var(--radius-md);
    background-color: var(--surface-pop);
    box-shadow: var(--shadow-card);
  }
  /* The two-line stacks flatten into the strip, and every margin that spaced them
     as stacks gives way to the strip's own gap. */
  .task-row.row-tools-open .row-tools-stack,
  .task-row.row-tools-open .row-tools-line {
    flex-direction: row;
    align-items: center;
    gap: 15px;
    margin: 0;
  }
  .task-row.row-tools-open .row-tools-anchor,
  .task-row.row-tools-open .inline-tag-btn,
  .task-row.row-tools-open .calendar-date-picker {
    margin: 0;
  }

  /* ---- The category label is metadata, not the row ----
     It wears the task's own title colour (the cell carries an inline
     `color: task_title_color`), at title size, immediately beside the title - so
     a priority task announced its category in gold just as loudly as its name,
     and a five-row day read as five categories with titles attached. Dropped to
     the same muted grey the row's other furniture uses. !important for the
     inline colour; the icon variant of this cell dims with it, which is right. */
  .daily-column .schedule-icon-cell {
    color: var(--text-3) !important;
    font-size: var(--fs-11);
    /* And it does not get to set the row's height. A long category name wrapped
       inside this cell - "Relationships" is two lines at the current width and
       three if the column narrows - so rows grew or shrank according to the
       length of a label, not their own content. One line, clipped, means the
       column's width is now free to change without the rows moving. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Freed by the line above: 18% -> 15%, which the title takes. */
  .daily-column table thead th:nth-child(2) { width: 15% !important; }

  /* ---- iOS zoom on focus ----
     Mobile Safari zooms the viewport in whenever a focused field is under 16px,
     and does not zoom back out afterwards - so adding a task left the page
     stranded mid-zoom and you had to pinch back. 16px is the threshold, not a
     design choice. The alternative fix, maximum-scale=1 on the viewport meta,
     would stop the zoom by disabling pinch-zoom for everyone; this does not. */
  .task-form-input,
  .task-form-select,
  .task-form textarea,
  #home-container input[type="text"],
  #home-container input[type="date"],
  #home-container input[type="number"],
  #home-container select,
  #home-container textarea {
    font-size: 16px !important;
  }

  /* ---- Scroll chaining ----
     Reaching the end of a column handed the scroll to the document, which on iOS
     fires pull-to-refresh and reloads the page out from under a half-read list. */

  /* ---- Tap targets ----
     Both controls stay exactly the size they are drawn; only the hit area grows,
     via an overlay that reaches past the painted edge. The reveal bar's overlay
     is deliberately +8px rather than the +13 that would reach 44px: below it sits
     the first card, and a taller overlay would start swallowing taps meant for
     the day header inside it. */
  .home-reveal-btn {
    position: relative;
  }
  .home-reveal-btn::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 0;
    bottom: -8px;
    left: 0;
  }
  .home-col-switch {
    position: relative;
  }
  .home-col-switch::after {
    content: '';
    position: absolute;
    /* 44px tall inside a 52px header, and only 40px wide so the overlay does not
       reach into the logo link sitting alongside it. */
    top: -5px;
    bottom: -5px;
    left: -3px;
    right: -3px;
  }
}
