/* ── the time grid ─────────────────────────────────────────────────────
   The engine behind Horaris and Torns (timegrid.js): a sticky row of
   rooms on top, a sticky ruler of hours on the left, the day running down
   from 06:00 to 06:00, and blocks that sit in lanes when they overlap.

   It stays on the admin's own tokens. Gold appears only where the grid
   speaks about time (the "ara" line, the selected block, what you are
   about to create); graphite only for midnight and the ruler's numerals.
   The room hues (.hue-or … .hue-grafit, which set --edge and --fill) come
   from kit.css; every var() here carries a fallback so the grid still
   reads if it loads alone. */

.tg{
  --tg-head:3.25rem;          /* the sticky row of rooms */
  --tg-gut:3.5rem;            /* the sticky ruler */
  --tg-col:10rem;             /* the narrowest a room may get before the grid scrolls sideways */
  --tg-extra:9rem;            /* the trailing "+ Sala" cell */
  --tg-night:#f6f7f9;         /* after midnight, a shade darker */
  position:relative;
  min-width:0;
}
.tg [hidden]{ display:none !important }

.tg-scroll{
  position:relative;
  height:calc(100vh - var(--tg-top, 13rem));
  height:calc(100dvh - var(--tg-top, 13rem));
  min-height:24rem;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:manipulation;
  background:var(--card, #fff);
  border:1px solid var(--line, #e7e9ee);
  border-radius:var(--r, 12px);
  box-shadow:var(--shadow, none);
}

.tg-grid{
  position:relative; z-index:0;
  display:grid;
  grid-template-rows:var(--tg-head) auto auto;
  /* never narrower than the rooms need: the sticky ruler and head are
     bounded by this box, so it must be as wide as what scrolls */
  width:max(100%, calc(var(--tg-gut) + var(--tg-n, 1) * var(--tg-col) + var(--tg-x, 0px)));
  -webkit-user-select:none; user-select:none;
  -webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
}

/* ── the head ─────────────────────────────────────────────────────── */

.tg-corner,.tg-head,.tg-headx{
  grid-row:1;
  position:sticky; top:0; z-index:7;
  height:var(--tg-head);
  background:var(--card, #fff);
  border-bottom:1px solid var(--line-strong, #d2d6de);
}
.tg-corner{ grid-column:1; left:0; z-index:8; border-right:1px solid var(--line, #e7e9ee) }
.tg-head{
  display:flex; flex-direction:column; justify-content:center; gap:1px;
  min-width:0; padding:.3rem .65rem;
  border-left:1px solid var(--line, #e7e9ee);
  font:inherit; color:var(--ink, #111827); text-align:left;
}
button.tg-head{ appearance:none; border-top:0; border-right:0; cursor:pointer; transition:background .15s }
button.tg-head:hover{ background:var(--well, #f8f9fb) }
button.tg-head:focus-visible{ outline:2px solid var(--accent, #3347c9); outline-offset:-3px; border-radius:6px }
.tg-head-top{ display:flex; align-items:center; gap:.45rem; min-width:0 }
.tg-dot{
  flex:none; width:.62rem; height:.62rem; border-radius:50%;
  background:var(--edge, var(--line-strong, #d2d6de));
  box-shadow:inset 0 0 0 1px rgba(17,24,39,.12);
}
.tg-name{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:.84rem; font-weight:650; letter-spacing:-.005em;
}
.tg-lock{ flex:none; display:inline-flex; color:var(--faint, #6b7280); margin-left:auto }
.tg-sub{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:.7rem; color:var(--faint, #6b7280);
  padding-left:1.07rem;       /* under the name, past the dot */
}
.tg-head:not(:has(.tg-dot)) .tg-sub{ padding-left:0 }
.tg-sub.is-warn{ color:var(--warn, #b54708) }
.tg-sub.is-bad{ color:var(--bad, #b42318) }
.tg-headx{
  display:flex; align-items:center; padding:.35rem .5rem;
  border-left:1px solid var(--line, #e7e9ee);
}

/* ── the strip of things with no set time ─────────────────────────────
   Sticky under the rooms: scrolled to the evening, "Sense hora" and the
   all-day shifts would otherwise be out of sight above the day. */

.tg-ucorner,.tg-untimed,.tg-fill-u{
  grid-row:2;
  position:sticky; top:var(--tg-head); z-index:6;
  background:var(--well, #f8f9fb);
  border-bottom:1px solid var(--line-strong, #d2d6de);
}
.tg-ucorner{
  grid-column:1; left:0; z-index:7;
  display:flex; align-items:flex-start; justify-content:flex-end;
  padding:.45rem .4rem 0 .2rem;
  border-right:1px solid var(--line, #e7e9ee);
  font-size:.6rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  line-height:1.2; text-align:right; color:var(--faint, #6b7280);
}
.tg-untimed{
  display:flex; flex-direction:column; gap:3px; min-width:0;
  max-height:6.6rem; overflow-y:auto; overscroll-behavior:contain;
  padding:4px 3px;
  border-left:1px solid var(--line, #e7e9ee);
}
.tg-fill-u{ border-left:1px solid var(--line, #e7e9ee) }
.tg-grid:not(.has-untimed) > .tg-ucorner,
.tg-grid:not(.has-untimed) > .tg-untimed,
.tg-grid:not(.has-untimed) > .tg-fill-u{ display:none }

/* ── the ruler ────────────────────────────────────────────────────── */

.tg-gutter{
  grid-row:3; grid-column:1;
  position:sticky; left:0; z-index:6;
  height:var(--tg-h);
  background:var(--card, #fff);
  border-right:1px solid var(--line, #e7e9ee);
}
.tg-hour{
  position:absolute; right:.4rem;
  transform:translateY(-50%);
  font-size:.68rem; font-weight:550; line-height:1;
  color:var(--graphite, #1f2229);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.tg-hour.half{ font-size:.6rem; font-weight:500; color:var(--faint, #6b7280) }
.tg-hour.first{ transform:translateY(3px) }
.tg-midlabel{
  display:flex; flex-direction:column; align-items:flex-end; gap:2px;
  transform:translateY(-.34rem);
}
.tg-midlabel b{ font-size:.7rem; font-weight:750 }
.tg-midlabel small{ font-size:.58rem; font-weight:650; letter-spacing:.02em; color:var(--graphite, #1f2229); opacity:.8 }
.tg-midlabel.first{ transform:translateY(3px) }

/* "ara 23:42": gold ink, not gold, so the small type stays readable */
.tg-nowpill{
  position:absolute; left:3px; z-index:2;
  transform:translateY(-50%);
  padding:.14rem .32rem; border-radius:1rem;
  background:var(--gold-ink, #7a5a14); color:#fff;
  font-size:.6rem; font-weight:700; line-height:1.15; white-space:nowrap;
  font-variant-numeric:tabular-nums;
  box-shadow:0 0 0 2px var(--card, #fff);
}

/* ── columns ──────────────────────────────────────────────────────── */

.tg-col,.tg-fill{
  grid-row:3;
  position:relative;
  height:var(--tg-h);
  min-width:0;
  border-left:1px solid var(--line, #e7e9ee);
  background:var(--card, #fff);
}
.tg:not(.is-ro) .tg-col:not(.is-locked){ cursor:cell }
.tg.is-placing .tg-col{ cursor:crosshair }
.tg-col.is-locked,.tg-untimed.is-locked{ background:var(--well, #f8f9fb) }

/* the hours: a solid line on the hour, a dashed one on the half, and a
   shade from midnight on, so the night reads as night at a glance */
.tg-lines{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  background:
    repeating-linear-gradient(to bottom, var(--line, #e7e9ee) 0 1px, transparent 1px var(--tg-hour)),
    var(--tg-nights, linear-gradient(to bottom, transparent var(--tg-mid), var(--tg-night) var(--tg-mid)));
}
.tg-col.is-locked .tg-lines{
  background:
    repeating-linear-gradient(to bottom, var(--line, #e7e9ee) 0 1px, transparent 1px var(--tg-hour));
}
.tg-lines::after{
  content:''; position:absolute; inset:0;
  background:repeating-linear-gradient(to bottom,
    transparent 0 calc(var(--tg-hour) / 2),
    var(--line, #e7e9ee) calc(var(--tg-hour) / 2) calc(var(--tg-hour) / 2 + 1px),
    transparent calc(var(--tg-hour) / 2 + 1px) var(--tg-hour));
  -webkit-mask-image:repeating-linear-gradient(to right, #000 0 3px, transparent 3px 7px);
          mask-image:repeating-linear-gradient(to right, #000 0 3px, transparent 3px 7px);
}

/* lines that run across every room */
/* the midnights ride in one layer as tall as the day */
.tg-marks{
  grid-row:3; grid-column:2 / -1;
  align-self:start;
  position:relative; z-index:0;
  height:var(--tg-h);
  pointer-events:none;
}
.tg-marks .tg-midnight{ position:absolute; left:0; right:0; height:2px }
.tg-marks .tg-midnight.is-day{ height:3px; background:var(--gold-ink, #7a5a14); opacity:.9 }
.tg-midlabel.is-day b,.tg-midlabel.is-day small{ color:var(--gold-ink, #7a5a14); opacity:1 }
.tg-now{
  grid-row:3; grid-column:2 / -1;
  align-self:start;
  position:relative;
  height:2px;
  pointer-events:none;
}
.tg-midnight{ z-index:0; background:var(--graphite, #1f2229); opacity:.85 }
.tg-now{ z-index:4; background:var(--gold, #b8892b); box-shadow:0 0 0 1px rgba(255,255,255,.7) }
.tg-now::before{
  content:''; position:absolute; left:-4px; top:-3px;
  width:8px; height:8px; border-radius:50%;
  background:var(--gold, #b8892b); box-shadow:0 0 0 2px var(--card, #fff);
}

.tg-empty{
  grid-row:3; grid-column:2 / -1;
  align-self:start; justify-self:center;
  position:sticky; left:calc(var(--tg-gut) + 1rem);
  z-index:2; margin-top:3rem; max-width:min(28rem, calc(100% - 2rem));
  padding:.8rem 1.1rem;
  border:1px dashed var(--line-strong, #d2d6de); border-radius:var(--r, 12px);
  background:rgba(255,255,255,.88);
  color:var(--muted, #4b5563); font-size:.84rem; line-height:1.45; text-align:center;
  pointer-events:none;
}

/* ── blocks ───────────────────────────────────────────────────────── */

.tg-item{
  position:absolute; z-index:1;
  display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start;
  min-width:0; margin:0; overflow:hidden;
  padding:3px 6px 3px 7px;
  border:1px solid var(--line-strong, #d2d6de);
  border-left:3px solid var(--edge, var(--line-strong, #d2d6de));
  border-radius:7px;
  background:var(--fill, var(--well, #f8f9fb));
  color:var(--ink, #111827);
  font:inherit; font-size:.74rem; line-height:1.25; text-align:left;
  box-shadow:0 1px 2px rgba(17,24,39,.07);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
@supports (color:color-mix(in srgb, red 50%, blue)){
  .tg-item{ border-color:color-mix(in srgb, var(--edge, #d2d6de) 34%, #fff); border-left-color:var(--edge, #d2d6de) }
}
.tg.tg-anim .tg-item:not(.tg-ghost){
  transition:top .15s cubic-bezier(.2,.8,.3,1), height .15s cubic-bezier(.2,.8,.3,1),
             left .15s, width .15s, box-shadow .15s, transform .15s, opacity .15s;
}
.tg.tg-anim .tg-item.tg-still{ transition:box-shadow .15s, transform .15s, opacity .15s }
@media (hover:hover){
  .tg-item:hover{ box-shadow:0 4px 12px -4px rgba(17,24,39,.28) }
}
.tg-item:focus-visible{ outline:2px solid var(--accent, #3347c9); outline-offset:2px; z-index:4 }
@media (any-pointer:fine){
  .tg:not(.is-ro) .tg-item:not(.is-locked):not(.is-untimed){ cursor:grab }
}

/* the content the page renders; these are the classes it may use */
.tg-in{
  display:flex; flex-direction:column; gap:1px;
  min-width:0; width:100%; overflow:hidden;
  pointer-events:none;
}
.tg-title{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  overflow:hidden; overflow-wrap:anywhere;
  font-size:.76rem; font-weight:650; line-height:1.22;
}
.tg-meta{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:.68rem; color:var(--muted, #4b5563);
  font-variant-numeric:tabular-nums;
}
.tg-row{ display:flex; align-items:center; gap:.3rem; min-width:0 }
.tg-ico{ flex:none; display:inline-flex; width:14px; height:14px; color:var(--edge, var(--muted, #4b5563)) }
.tg-ico svg{ width:100%; height:100% }

/* content tiers: a 15-minute block keeps its title on one line and
   nothing else; a block sharing its room drops some padding */
.tg-item.tiny{ justify-content:center; padding-block:1px }
.tg-item.tiny .tg-in{ flex-direction:row; align-items:center; gap:.35rem }
.tg-item.tiny .tg-title{ display:block; white-space:nowrap; text-overflow:ellipsis; -webkit-line-clamp:1; font-size:.7rem }
.tg-item.tiny .tg-meta:not(.tg-keep){ display:none }
.tg-item.narrow{ padding-inline:5px 3px; border-left-width:2px }
.tg-item.narrow .tg-title{ font-size:.72rem; overflow-wrap:normal }
/* three or more abreast: a word is cut at the edge rather than stacked a
   letter per line, and the meta line gives way to the title */
.tg-item.slim{ padding-inline:4px 2px }
.tg-item.slim .tg-title{ display:block; white-space:nowrap; text-overflow:clip; -webkit-line-clamp:none }
.tg-item.slim .tg-meta:not(.tg-keep){ display:none }

/* resize handles: top and bottom edges, mouse and pen only */
.tg-h{ position:absolute; left:0; right:0; z-index:2; height:6px; display:none; cursor:ns-resize }
.tg-h-top{ top:-1px }
.tg-h-bot{ bottom:-1px }
.tg-h::after{
  content:''; position:absolute; left:50%; top:2px;
  width:18px; height:2px; margin-left:-9px; border-radius:2px;
  background:var(--edge, var(--faint, #6b7280));
  opacity:0; transition:opacity .15s;
}
@media (any-pointer:fine){
  .tg:not(.is-ro) .tg-item:not(.is-locked):not(.is-untimed):not(.tiny) .tg-h,
  .tg:not(.is-ro) .tg-item.tiny:not(.is-locked):not(.is-untimed) .tg-h-bot{ display:block }
  .tg-item:hover .tg-h::after,.tg-item.is-selected .tg-h::after{ opacity:.6 }
}

/* the blocks' states */
.tg-item.is-selected{
  z-index:3;
  box-shadow:0 0 0 2px var(--gold, #b8892b), 0 8px 18px -6px rgba(17,24,39,.35);
  transform:translateY(-1px);
}
.tg-item.is-tentative{
  border-style:dashed;
  background-image:repeating-linear-gradient(45deg, rgba(17,24,39,.07) 0 5px, transparent 5px 10px);
}
@supports (color:color-mix(in srgb, red 50%, blue)){
  .tg-item.is-tentative{
    background-image:repeating-linear-gradient(45deg, color-mix(in srgb, var(--edge, #6b7280) 16%, transparent) 0 5px, transparent 5px 10px);
  }
}
.tg-item.is-cancelled{ opacity:.45 }
.tg-item.is-cancelled .tg-title{ text-decoration:line-through; text-decoration-thickness:1.5px }
.tg-item.is-untimed{ position:relative; min-height:26px; justify-content:center }
.tg-item.is-dragging{ opacity:.35 }
.tg-item.is-saving{ cursor:progress }

/* glyphs in the corner: a lock for crew-only, ✦ for a surprise; an amber
   triangle for a warning, a red one (and a red ring) for a clash */
.tg-item.is-crew,.tg-item.is-teaser{ padding-right:17px }
.tg-item.is-crew::before,.tg-item.is-teaser::before{
  position:absolute; top:3px; right:4px; z-index:1;
  color:var(--muted, #4b5563);
}
.tg-item.is-crew::before{
  content:''; width:11px; height:11px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='7' width='9' height='6.5' rx='1.5'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 0 1 5 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='7' width='9' height='6.5' rx='1.5'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 0 1 5 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tg-item.is-teaser::before{ content:'✦'; font-size:.72rem; line-height:1; color:var(--gold-ink, #7a5a14) }
.tg-item.warn,.tg-item.bad{ padding-right:14px }
.tg-item.warn.is-crew,.tg-item.warn.is-teaser,.tg-item.bad.is-crew,.tg-item.bad.is-teaser{ padding-right:27px }
.tg-item.warn.is-crew::before,.tg-item.warn.is-teaser::before,
.tg-item.bad.is-crew::before,.tg-item.bad.is-teaser::before{ right:15px }
.tg-item.warn::after,.tg-item.bad::after{
  content:''; position:absolute; top:0; right:0; z-index:1;
  width:12px; height:12px;
  background:var(--warn, #b54708);
  clip-path:polygon(0 0, 100% 0, 100% 100%);
}
.tg-item.bad::after{ background:var(--bad, #b42318) }
.tg-item.bad{ box-shadow:0 0 0 1.5px var(--bad, #b42318), 0 1px 2px rgba(17,24,39,.07) }
.tg-item.bad.is-selected{ box-shadow:0 0 0 1.5px var(--bad, #b42318), 0 0 0 3.5px var(--gold, #b8892b), 0 8px 18px -6px rgba(17,24,39,.35) }

/* ── dragging ─────────────────────────────────────────────────────── */

.tg-item.tg-ghost{
  z-index:5; pointer-events:none;
  opacity:.97; transform-origin:top center;
  box-shadow:0 0 0 2px var(--gold, #b8892b), var(--shadow-pop, 0 12px 32px rgba(17,24,39,.16));
}
.tg-item.tg-ghost.is-refused{
  opacity:.75;
  box-shadow:0 0 0 2px var(--bad, #b42318), var(--shadow-pop, 0 12px 32px rgba(17,24,39,.16));
}
.tg-item.tg-ghost.is-arriving{ opacity:.6; box-shadow:0 0 0 2px var(--gold, #b8892b) }
/* the time it will land at, on the block itself where the eye already is */
.tg-gtime{
  position:absolute; left:4px; bottom:3px; z-index:2;
  padding:.06rem .3rem; border-radius:4px;
  background:var(--gold-ink, #7a5a14); color:#fff;
  font-size:.62rem; font-weight:700; line-height:1.2; white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.tg-item.tiny .tg-gtime{ bottom:auto; top:50%; transform:translateY(-50%); left:auto; right:4px }
.tg-gcopy{
  position:absolute; right:3px; bottom:3px; z-index:2;
  display:none; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:50%;
  background:var(--gold, #b8892b); color:#fff;
  font-size:.8rem; font-weight:800; line-height:1;
}
.tg-ghost.is-copy .tg-gcopy{ display:inline-flex }
.tg-item.is-arriving .tg-gtime,.tg-item.is-arriving .tg-gcopy{ display:none }

/* what you are about to create */
.tg-create,.tg-hover{
  position:absolute; left:2px; right:2px; top:0; z-index:5;
  pointer-events:none;
  padding:2px 6px; border-radius:7px;
  font-size:.7rem; font-weight:700; line-height:1.3;
  font-variant-numeric:tabular-nums;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tg-create{
  border:2px dashed var(--gold, #b8892b);
  background:var(--gold-soft, #f8f0dc);
  color:var(--gold-ink, #7a5a14);
}
@supports (color:color-mix(in srgb, red 50%, blue)){
  .tg-create{ background:color-mix(in srgb, var(--gold, #b8892b) 13%, transparent) }
}
.tg-create.is-pending{ border-style:solid; box-shadow:0 0 0 3px var(--gold-soft, #f8f0dc) }
.tg-create.is-refused{ border-color:var(--bad, #b42318); background:var(--bad-bg, #fef3f2); color:var(--bad, #b42318) }
.tg-hover{
  z-index:0;
  background:var(--well, #f8f9fb);
  color:var(--faint, #6b7280); font-weight:600;
  box-shadow:inset 0 0 0 1px var(--line, #e7e9ee);
}
.tg-hover.is-place{
  z-index:5;
  background:var(--gold-soft, #f8f0dc);
  border:2px dashed var(--gold, #b8892b);
  color:var(--gold-ink, #7a5a14);
}
.tg-hover.is-refused{ border-color:var(--bad, #b42318); background:var(--bad-bg, #fef3f2); color:var(--bad, #b42318) }

/* the cursor belongs to the drag for as long as it lasts, wherever the
   pointer wanders */
html[data-tg-drag],html[data-tg-drag] *{ cursor:grabbing !important }
html[data-tg-drag="top"],html[data-tg-drag="top"] *,
html[data-tg-drag="bot"],html[data-tg-drag="bot"] *{ cursor:ns-resize !important }
html[data-tg-drag="create"],html[data-tg-drag="create"] *{ cursor:cell !important }
html[data-tg-drag="copy"],html[data-tg-drag="copy"] *{ cursor:copy !important }
html[data-tg-drag="no"],html[data-tg-drag="no"] *{ cursor:not-allowed !important }

/* anything outside the grid the page marked data-tg-drop, lit while a
   block hovers it; kit's day-strip pills get their own ring from
   kit.css (.is-drop), so they are left to it */
[data-tg-drop].tg-drop-over:not(.kit-daystrip .cal-tab){
  outline:2px dashed var(--gold, #b8892b); outline-offset:2px;
  background:var(--gold-soft, #f8f0dc);
  color:var(--gold-ink, #7a5a14);
}

/* ── the tooltip ──────────────────────────────────────────────────── */

.tg-tip{
  position:fixed; left:0; top:0; z-index:60;
  max-width:20rem; padding:.42rem .62rem;
  border-radius:9px;
  background:var(--graphite, #1f2229); color:#fff;
  font-size:.76rem; line-height:1.38;
  box-shadow:0 10px 28px rgba(17,24,39,.28);
  pointer-events:none;
  font-variant-numeric:tabular-nums;
  will-change:transform;
}
.tg-tip-main{ font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.tg-tip-main + .tg-tip-probe{ margin-top:.18rem }
.tg-tip-probe{ display:flex; gap:.35rem; align-items:baseline; font-weight:500 }
/* never colour alone: each level has its glyph */
.tg-tip-probe::before{ flex:none; font-size:.68rem }
.tg-tip-probe.lv-ok{ color:#86efac }
.tg-tip-probe.lv-ok::before{ content:'✓' }
.tg-tip-probe.lv-warn{ color:#fcd34d }
.tg-tip-probe.lv-warn::before{ content:'▲' }
.tg-tip-probe.lv-bad{ color:#fca5a5 }
.tg-tip-probe.lv-bad::before{ content:'✕' }

/* ── tap-to-place ─────────────────────────────────────────────────── */

.tg-place{
  position:absolute; z-index:20;
  top:calc(var(--tg-head) + .6rem); left:50%;
  transform:translateX(-50%);
  display:flex; align-items:center; gap:.4rem;
  max-width:calc(100% - 1.5rem);
  padding:.32rem .35rem .32rem .9rem;
  border:1px solid var(--gold, #b8892b); border-radius:2rem;
  background:var(--gold-ink, #7a5a14); color:#fff;
  font-size:.82rem; font-weight:600; line-height:1.3;
  box-shadow:0 10px 24px -8px rgba(17,24,39,.45);
  animation:tg-in .18s cubic-bezier(.2,.8,.3,1);
}
.tg-place-text{ min-width:0 }
.tg-place-x{
  flex:none; display:inline-flex; align-items:center; justify-content:center;
  width:1.9rem; height:1.9rem; border:0; border-radius:50%;
  background:rgba(255,255,255,.16); color:#fff;
  font:inherit; font-size:1.05rem; line-height:1; cursor:pointer;
}
.tg-place-x:hover{ background:rgba(255,255,255,.28) }
.tg-place-x:focus-visible{ outline:2px solid #fff; outline-offset:1px }
@keyframes tg-in{ from{ opacity:0; transform:translate(-50%, -4px) } }

/* read aloud, never seen */
.tg-live{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0; border:0;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
}

/* ── phone and touch ──────────────────────────────────────────────── */

@media (max-width:699px){
  .tg{ --tg-col:8.5rem; --tg-extra:7.5rem }
  .tg-scroll{ border-radius:var(--r-sm, 9px) }
  .tg-head{ padding:.3rem .5rem }
  .tg-place{ font-size:.78rem; width:max-content }
}
@media (pointer:coarse){
  .tg-place-x{ width:2.75rem; height:2.75rem }
  .tg-item.is-untimed{ min-height:36px }
}

@media (prefers-reduced-motion:reduce){
  .tg *,.tg *::before,.tg *::after{ transition:none !important; animation:none !important }
  .tg-item.is-selected{ transform:none }
}

/* the day before (above 06:00) and the day after (below 06:00 of the next
   morning), in grey: to read, never to draw on */
.tg-other{
  grid-row:3; grid-column:2 / -1;
  align-self:start;
  position:relative; z-index:0;
  display:flex; justify-content:center;
  pointer-events:none;
  background:repeating-linear-gradient(135deg, rgba(17,24,39,.045) 0 8px, rgba(17,24,39,.075) 8px 16px);
  font-size:.7rem; font-weight:650; letter-spacing:.03em; text-transform:uppercase;
  color:var(--faint, #6b7280);
}
.tg-other[hidden]{ display:none }
.tg-other.is-before{ align-items:flex-end; padding-bottom:4px; border-bottom:2px solid var(--line-strong, #d2d6de) }
.tg-other.is-after{ align-items:flex-start; padding-top:4px; border-top:2px solid var(--line-strong, #d2d6de) }
