@import url("./rose-pine.css");

:root {
  --accent: var(--rp-pine);
  --on-accent: #fff;
  --radius: 12px;
  --radius-sm: 8px;
  --card-shadow: 0 1px 2px rgba(40, 30, 60, 0.05), 0 4px 16px rgba(40, 30, 60, 0.04);
  --soft: color-mix(in srgb, var(--rp-overlay) 55%, transparent);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  background: var(--rp-base); color: var(--rp-text);
  font: 14.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--rp-hl-high) transparent; }
kbd {
  display: inline-block; min-width: 1.5em; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--rp-surface); color: var(--rp-subtle); font: 600 0.7rem/1.6 ui-monospace, monospace; text-align: center;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.muted { color: var(--rp-muted); }
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Controls */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--rp-surface);
  color: var(--rp-text); font-size: 0.84rem; font-weight: 500; white-space: nowrap; transition: background 0.12s, border-color 0.12s;
}
.button:hover { background: var(--rp-overlay); }
.button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.button.primary:hover { filter: brightness(1.08); }
.button.ghost { background: none; border-color: transparent; color: var(--rp-subtle); }
.button.ghost:hover { background: var(--soft); color: var(--rp-text); }
.button.danger { color: var(--rp-love); }
.button.small { height: 26px; padding: 0 10px; font-size: 0.78rem; border-radius: 7px; }
.button:disabled { opacity: 0.5; cursor: default; }
.link-btn { color: var(--rp-subtle); font-size: 0.84rem; padding: 6px 2px; }
.link-btn:hover { color: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--rp-muted); }
.icon-btn:hover { background: var(--soft); color: var(--rp-text); }
.input {
  width: 100%; height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--rp-surface); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input::placeholder { color: var(--rp-muted); }
textarea.input { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
textarea.input.mono { font-size: 0.8rem; }
select.input { padding-right: 6px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { color: var(--rp-subtle); font-size: 0.74rem; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.check-label { display: inline-flex; align-items: center; gap: 7px; color: var(--rp-subtle); font-size: 0.84rem; cursor: pointer; }
.actions-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.link-input { width: 16rem; max-width: 100%; }
.link-owner { cursor: pointer; }
.spacer { flex: 1; }

/* Layout */
.app { display: flex; flex: 1; min-height: 0; }
.sidebar { display: flex; flex-direction: column; width: 196px; flex-shrink: 0; padding: 20px 12px 12px; background: var(--rp-surface); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { padding: 0 10px 18px; font-weight: 700; font-size: 0.95rem; color: var(--accent); letter-spacing: 0.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--rp-subtle); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--soft); color: var(--rp-text); }
.nav a.active { background: var(--rp-overlay); color: var(--rp-text); }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--rp-love); color: var(--on-accent); font-size: 0.7rem; font-weight: 700; text-align: center; line-height: 18px; }
.nav .dot { width: 8px; height: 8px; margin: 0 4px; border-radius: 50%; background: var(--rp-iris); }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.main { flex: 1; min-width: 0; overflow-y: auto; }
.page-header, .content { max-width: 1120px; margin: 0 auto; padding-inline: 40px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 34px; padding-bottom: 20px; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.015em; }
.sub { margin-top: 2px; color: var(--rp-subtle); font-size: 0.86rem; }
.header-actions { display: flex; gap: 8px; align-items: center; position: relative; }
.content { padding-bottom: 80px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* Blocks */
.block-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.block-head h2 { font-size: 0.95rem; font-weight: 650; color: var(--rp-text); }
.block-head .muted { font-size: 0.8rem; }
.block-head .bar { flex: 1; max-width: 220px; margin-left: auto; align-self: center; }
.card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--rp-surface); box-shadow: var(--card-shadow); }
.card + .card { margin-top: 16px; }
.card h2 { display: flex; align-items: baseline; gap: 10px; font-size: 0.98rem; font-weight: 650; margin-bottom: 12px; }
.card h2 .muted { font-size: 0.8rem; font-weight: 400; }
.card .sub { margin-bottom: 10px; }
.empty { padding: 14px 4px; color: var(--rp-muted); font-size: 0.88rem; }
.bar { display: flex; height: 6px; border-radius: 3px; background: var(--rp-overlay); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.3s; }
.bar-done { height: 100%; border-radius: 3px 0 0 3px; background: color-mix(in srgb, var(--accent) 40%, var(--rp-overlay)); transition: width 0.3s; }
.bar-done + .bar-fill { border-radius: 0 3px 3px 0; }
.bar.over .bar-fill { background: var(--rp-gold); }

/* Quick add */
/* One way to add anything: a bar that opens the add dialog. */
.add-bar { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px 0 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--rp-surface); box-shadow: var(--card-shadow); color: var(--rp-muted); font-size: 0.95rem; text-align: left; transition: border-color 0.12s; }
.add-bar:hover { border-color: var(--accent); color: var(--rp-subtle); }
.add-bar.small { height: 36px; box-shadow: none; font-size: 0.86rem; }
.grow { flex: 1; min-width: 0; }
.add-form { display: flex; flex-direction: column; gap: 12px; }
.add-form > .seg { align-self: flex-start; }
.small { font-size: 0.78rem; }

/* Items (tasks, practice) */
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--rp-surface); box-shadow: var(--card-shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border-top: 1px solid var(--border); transition: background 0.1s; }
.item:first-child { border-top: none; }
.item:hover { background: color-mix(in srgb, var(--rp-overlay) 40%, transparent); }
.item.cursor { background: var(--rp-overlay); box-shadow: inset 3px 0 0 var(--accent); }
.item-main { flex: 1; min-width: 0; }
.item-title { overflow-wrap: anywhere; } /* a long title wraps: read whole without opening it */
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1px; }
.item.done .item-title { color: var(--rp-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--rp-muted) 60%, transparent); }
.tag { color: var(--rp-muted); font-size: 0.76rem; white-space: nowrap; }
.tag.due { color: var(--rp-gold); }
.tag.due.hard { color: var(--rp-love); font-weight: 500; }
.tag.practice { color: var(--rp-foam); }
.weight { font-variant-numeric: tabular-nums; min-width: 46px; padding: 2px 8px; border-radius: 20px; background: var(--rp-overlay); color: var(--rp-subtle); font-size: 0.74rem; font-weight: 500; text-align: center; white-space: nowrap; }
button.weight:hover { background: var(--rp-hl-med); color: var(--rp-text); }
.check { position: relative; width: 20px; height: 20px; flex-shrink: 0; border: 1.8px solid var(--rp-muted); border-radius: 50%; transition: border-color 0.12s, background 0.12s; }
button.check:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.check.disabled { opacity: 0.35; }
.done .check { background: var(--accent); border-color: var(--accent); }
.done .check::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.actual { width: 58px; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: 0.78rem; text-align: right; color: var(--rp-subtle); opacity: 0; }
.item:hover .actual, .actual:focus, .actual.set { opacity: 1; border-color: var(--border); }
.hover-only { opacity: 0; transition: opacity 0.1s; }
.item:hover .hover-only, .item.cursor .hover-only { opacity: 1; }

/* Alerts */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--rp-surface); box-shadow: var(--card-shadow); }
.alert-dot { width: 8px; height: 8px; margin-top: 7px; flex-shrink: 0; border-radius: 50%; background: var(--rp-iris); }
.alert.k-red .alert-dot { background: var(--rp-love); }
.alert.k-orange .alert-dot { background: var(--rp-gold); }
.alert.k-split .alert-dot { background: transparent; border: 1.6px dashed var(--rp-muted); }
.alert.k-reminder .alert-dot { background: var(--rp-foam); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; }
.alert-text { margin-top: 2px; color: var(--rp-subtle); font-size: 0.86rem; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-btn { padding: 4px 11px; border: 1px solid var(--border); border-radius: 20px; background: var(--rp-base); font-size: 0.8rem; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Days strip */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--rp-surface); cursor: pointer; text-align: left; transition: border-color 0.12s; }
.day:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.day.open { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.day.today .day-name { color: var(--accent); }
.day.off { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--soft) 6px 12px); }
.day-name { font-size: 0.8rem; font-weight: 600; color: var(--rp-subtle); }
.day-date { font-size: 1.05rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-foot { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 0.74rem; }
.hours { padding: 1px 6px; margin-left: -6px; border-radius: 6px; color: var(--rp-subtle); font-size: 0.76rem; }
.hours:hover { background: var(--rp-overlay); color: var(--rp-text); }
.hours-input { width: 52px; height: 22px; padding: 0 4px; font-size: 0.76rem; }
.day-detail { margin-top: 10px; }
.day-detail .actions-row { margin-top: 10px; }

/* Where I stand */
.aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--rp-surface); box-shadow: var(--card-shadow); }
.aside > h2 { font-size: 0.98rem; font-weight: 650; margin-bottom: 6px; }
.stand { padding: 12px 0; border-top: 1px solid var(--border); }
.stand:first-of-type { border-top: none; padding-top: 4px; }
.stand-label { margin-bottom: 6px; color: var(--rp-subtle); font-size: 0.8rem; font-weight: 600; }
.stand-value { font-size: 1.15rem; font-weight: 650; margin-bottom: 6px; }
.stand-value .muted { font-size: 0.85rem; font-weight: 400; }
.stand .muted { font-size: 0.78rem; margin-top: 5px; }
.stand-row { display: flex; align-items: center; gap: 9px; padding: 5px 6px; margin: 0 -6px; border-radius: 7px; font-size: 0.86rem; cursor: pointer; }
.stand-row:hover { background: var(--soft); }
.stand-row .grow { flex: 1; min-width: 0; }
.stand-row > .st { align-self: flex-start; margin-top: calc((1lh - 9px) / 2); }
.stand-row .line2 { color: var(--rp-muted); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stand-row .num { color: var(--rp-subtle); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* Status dots */
.st { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--rp-muted); }
.st.green { background: var(--rp-pine); }
.st.orange { background: var(--rp-gold); }
.st.red { background: var(--rp-love); }
.st.done { background: var(--rp-hl-high); }
.st.undated { background: var(--rp-iris); }
.st.empty { padding: 0; background: transparent; border: 1.6px dashed var(--rp-muted); }

/* Plan: Gantt */
.gantt { border: 1px solid var(--border); border-radius: var(--radius); background: var(--rp-surface); box-shadow: var(--card-shadow); overflow: hidden; }
.g-row { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 38px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.g-row:first-child { border-top: none; }
.g-row.click { cursor: pointer; }
.g-row.click:hover, .g-row.cursor { background: color-mix(in srgb, var(--rp-overlay) 45%, transparent); }
.g-row.cursor { box-shadow: inset 3px 0 0 var(--accent); }
.g-name { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 14px; border-right: 1px solid var(--border); }
.g-name .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name .meta { margin-left: auto; color: var(--rp-muted); font-size: 0.74rem; white-space: nowrap; }
.g-track { position: relative; min-height: 38px; }
.g-head { position: sticky; top: 0; z-index: 2; background: var(--rp-surface); border-bottom: 1px solid var(--border); min-height: 34px; }
.g-head .g-name { color: var(--rp-muted); font-size: 0.74rem; }
.g-axis { min-height: 40px; background: color-mix(in srgb, var(--rp-overlay) 35%, transparent); }
.g-axis .g-name { font-weight: 650; }
.g-axis .chev { width: 12px; color: var(--rp-muted); font-size: 0.7rem; }
.g-month { position: absolute; top: 0; bottom: 0; padding: 9px 0 0 7px; border-left: 1px solid var(--border); color: var(--rp-subtle); font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--border) 70%, transparent); pointer-events: none; }
.g-grid.month { border-left: 1px solid var(--border); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); opacity: 0.55; pointer-events: none; z-index: 1; }
.g-bar { position: absolute; top: 50%; height: 16px; margin-top: -8px; border-radius: 6px; background: var(--rp-pine); min-width: 6px; }
.g-bar.green { background: color-mix(in srgb, var(--rp-pine) 85%, transparent); }
.g-bar.orange { background: var(--rp-gold); }
.g-bar.red { background: var(--rp-love); }
.g-bar.undated { background: linear-gradient(90deg, color-mix(in srgb, var(--rp-iris) 75%, transparent), transparent); }
.g-bar.empty { height: 0; margin-top: 0; padding: 0; border-radius: 0; background: none; border-top: 1.5px dashed var(--rp-muted); opacity: 0.55; min-width: 0; }
.g-beyond { position: absolute; right: 6px; top: 50%; margin-top: -8px; color: var(--rp-muted); font-size: 0.72rem; line-height: 16px; white-space: nowrap; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--rp-surface); }
.seg button { height: 26px; padding: 0 11px; border-radius: 6px; color: var(--rp-subtle); font-size: 0.8rem; font-weight: 500; }
.seg button.on { background: var(--rp-overlay); color: var(--rp-text); }
.icon.more { stroke-width: 3.2; }
.g-bar.axis { height: 4px; margin-top: -2px; border-radius: 2px; background: var(--rp-hl-high); }
.g-bar.axis.red { background: color-mix(in srgb, var(--rp-love) 70%, transparent); }
.g-bar.axis.green { background: color-mix(in srgb, var(--rp-pine) 75%, transparent); }
.g-bar.axis.orange { background: color-mix(in srgb, var(--rp-gold) 75%, transparent); }
.g-deadline { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; transform: rotate(45deg); border: 2px solid var(--rp-subtle); background: var(--rp-surface); z-index: 1; }
.g-deadline.hard { border-color: var(--rp-love); background: var(--rp-love); }
.g-deadline.small { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-width: 1.5px; }
.g-deadline.decision { border-color: var(--rp-iris); background: var(--rp-iris); border-radius: 50%; transform: none; }
.g-end { position: absolute; top: 50%; margin-top: -8px; padding-left: 7px; color: var(--rp-muted); font-size: 0.72rem; line-height: 16px; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: var(--rp-muted); font-size: 0.78rem; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .g-deadline, .legend .g-bar { position: static; margin: 0; }
.legend .g-bar { width: 22px; height: 8px; display: inline-block; }
.legend .g-bar.empty { height: 0; }

/* Drawer (a project) */
.drawer-wrap { position: fixed; inset: 0; z-index: 8; background: color-mix(in srgb, var(--backdrop) 45%, transparent); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); padding: 22px 24px 40px; overflow-y: auto; background: var(--rp-base); border-left: 1px solid var(--border); box-shadow: var(--shadow); animation: slide 0.16s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.title-input { flex: 1; min-width: 0; height: 40px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; font-size: 1.3rem; font-weight: 700; outline: none; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { border-color: var(--accent); background: var(--rp-surface); }
.drawer .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.drawer section { margin-top: 22px; }
.status-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--rp-surface); border: 1px solid var(--border); font-size: 0.86rem; }
.status-line .st { margin-top: 6px; }
.status-line .muted { font-size: 0.8rem; margin-top: 2px; }
.drawer .list .item { min-height: 42px; padding: 6px 12px; }
.task-edit { height: 28px; }
details.more summary { cursor: pointer; color: var(--rp-subtle); font-size: 0.82rem; margin-top: 16px; list-style: none; }
details.more summary::before { content: "▸ "; }
details.more[open] summary::before { content: "▾ "; }
.explain { color: var(--rp-muted); font-size: 0.78rem; margin-top: 6px; }

/* Menu */
.menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 200px; padding: 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--rp-surface); box-shadow: var(--shadow); }
.menu button { display: block; width: 100%; padding: 7px 10px; border-radius: 6px; text-align: left; font-size: 0.86rem; }
.menu button:hover { background: var(--rp-overlay); }
.menu button.danger { color: var(--rp-love); }

/* Dialog */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: start center; padding-top: 8vh; background: var(--backdrop); }
.dialog { width: min(780px, 94vw); max-height: 86vh; overflow-y: auto; padding: 22px 24px; border-radius: 16px; background: var(--rp-base); box-shadow: var(--shadow); animation: pop 0.14s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.dialog-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.dialog-head > div:first-child { flex: 1; min-width: 0; }
.dialog-head h2 { font-size: 1.1rem; font-weight: 700; }
.dialog-head .sub { margin-top: 3px; font-size: 0.8rem; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.88rem; align-items: center; }

/* Statusbar */
.statusbar { display: flex; align-items: center; gap: 14px; height: 28px; padding: 0 14px; border-top: 1px solid var(--border); background: var(--rp-surface); font-size: 0.75rem; color: var(--rp-subtle); }
/* Above a project open on the side: its Undo stays at hand. */
.statusbar { position: relative; z-index: 9; }
.status-msg { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-msg.error { color: var(--rp-love); }
.status-hints { display: flex; gap: 14px; }
.status-hints button { color: inherit; font: inherit; }
.status-hints button:hover { color: var(--rp-text); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; color: var(--rp-muted); font-size: 0.76rem; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: min(60vh, 32rem); margin: 0 -18px; padding: 0 8px; overscroll-behavior: contain; }
/* The header stays while the rows scroll (its line drawn by a shadow: a
   collapsed border scrolls away). */
.table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--rp-surface); box-shadow: inset 0 -1px 0 var(--border); }
.table-wrap td { white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }

/* The planner: conversations and proposals */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rp-iris); flex-shrink: 0; }
p.intro { margin: -8px 0 22px; color: var(--rp-subtle); font-size: 0.95rem; }
.action:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 2px 4px rgba(40, 30, 60, 0.05), 0 8px 24px rgba(40, 30, 60, 0.07); }
.action-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.action-label .tag { margin-left: auto; }
.action-help { color: var(--rp-subtle); font-size: 0.82rem; }
.section-title { margin: 30px 0 10px; color: var(--rp-text); font-size: 0.95rem; font-weight: 650; display: flex; gap: 10px; align-items: baseline; }
.section-title .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.turn { margin: 10px 0; padding: 12px 14px; border-radius: var(--radius); white-space: pre-wrap; font-size: 0.9rem; line-height: 1.55; }
.turn.me { background: var(--rp-overlay); margin-left: 48px; }
.turn.ai { border: 1px solid var(--border); background: var(--rp-surface); margin-right: 24px; }
.op { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.op:first-child { border-top: none; }
.op input[type=checkbox] { margin-top: 4px; accent-color: var(--accent); }
.op .op-mark { margin-top: 1px; width: 13px; text-align: center; color: var(--muted); }
.op.bad { opacity: 0.7; }
.op-error { color: var(--rp-love); font-size: 0.8rem; }
.op-warn { color: var(--rp-gold); font-size: 0.8rem; }
.op .sub { margin-top: 2px; }
.sheet { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.55; }
details summary { cursor: pointer; color: var(--rp-subtle); font-size: 0.84rem; }
.md-table { overflow-x: auto; }
.turn.prose > :last-child, .sheet.prose > :last-child { margin-bottom: 0; }
.md-table td { white-space: normal; }
.prose pre.md-code { margin-bottom: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre; border-radius: var(--radius-sm); background: var(--rp-overlay); font-family: ui-monospace, monospace; font-size: 0.8rem; }
.prose hr { margin: 14px 0; border: none; border-top: 1px solid var(--border); }
.turn code, .sheet code { font-family: ui-monospace, monospace; font-size: 0.82em; padding: 0 4px; border-radius: 4px; background: var(--rp-overlay); }
.wikilink { color: var(--rp-iris); }
.steps { display: flex; gap: 6px; align-items: center; margin: 4px 0 10px; color: var(--rp-muted); font-size: 0.8rem; }
.steps .on { color: var(--accent); font-weight: 600; }
.strip { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; margin: 10px 0; }
.strip .cell { height: 16px; border-radius: 4px; background: var(--accent); }
.row-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: 0.88rem; }
.row-line:first-child { border-top: none; }
.row-line .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-line.click { cursor: pointer; }
.row-line.click:hover .grow { color: var(--accent); }
.hours-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }

@media (max-width: 980px) {
  .columns { grid-template-columns: 1fr; }
  .aside { position: static; }
}

.field.ref { margin-top: 10px; }
.table-search { width: 200px; height: 28px; font-size: 0.82rem; }
.check.done-check { background: var(--accent); border-color: var(--accent); }
.check.done-check::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* What waits for Ben (no notification, just a glance). */
.nav .count.soft { background: var(--rp-gold); }
.dot.busy, .st.busy { animation: busy 1.4s ease-in-out infinite; }
@keyframes busy { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .dot.busy, .st.busy { animation: none; outline: 2px solid currentColor; outline-offset: 1px; } }

/* A call's answer, in blocks. */
.op-head { margin: 14px 0 8px; font-size: 0.82rem; font-weight: 600; color: var(--rp-subtle); }
.verdict { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--soft); }
.verdict .lbl { margin-bottom: 4px; color: var(--rp-subtle); font-size: 0.78rem; font-weight: 600; }
.filed { margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--rp-subtle); font-size: 0.84rem; }
.filed details { margin-top: 6px; }
.filed summary { cursor: pointer; color: var(--rp-muted); font-size: 0.78rem; }
.sub-op { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Settings: axes, profile, usage. */
.axis-row { gap: 10px; }
.axis-row .rank { width: 22px; height: 22px; border-radius: 50%; background: var(--rp-overlay); color: var(--rp-subtle); font-size: 0.76rem; font-weight: 700; text-align: center; line-height: 22px; flex-shrink: 0; }
.axis-name { max-width: 220px; height: 32px; }
.axis-row a.tag { text-decoration: none; }
.prose { line-height: 1.6; }
.prose h2, .prose h3, .prose h4, .prose h5 { margin: 18px 0 6px; font-weight: 650; }
.prose h2 { font-size: 1.1rem; } .prose h3 { font-size: 1rem; } .prose h4, .prose h5 { font-size: 0.92rem; color: var(--rp-subtle); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 3px; }
.prose blockquote { padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 6px 6px 0; }
.prose table, .card table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.prose th, .prose td, .card th, .card td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th, .card th { color: var(--rp-muted); font-size: 0.76rem; font-weight: 600; }
.card td.num { text-align: right; font-variant-numeric: tabular-nums; }
.usage-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 12px; }
.usage-tile { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--soft); }
.usage-tile .big { margin: 2px 0; font-size: 1.15rem; font-weight: 650; }
.archives { margin-top: 16px; }
.archives summary { cursor: pointer; color: var(--rp-muted); font-size: 0.84rem; }
.archives .list { margin-top: 8px; }
.archives .row-line { padding: 8px 14px; }
.alert.k-done .alert-dot { background: var(--rp-pine); }
.link-btn.undo { color: var(--accent); font-weight: 600; }
.click { cursor: pointer; }
.seg button { white-space: nowrap; }
.op-info { color: var(--rp-pine); font-size: 0.82rem; margin-top: 4px; }

/* Lists shared by the phone views. */
.chev-r { color: var(--rp-muted); font-size: 1.25rem; line-height: 1; }
.count-pill { min-width: 22px; padding: 1px 7px; border-radius: 11px; background: var(--rp-gold); color: var(--on-accent); font-size: 0.74rem; font-weight: 700; text-align: center; }
.axis-block + .axis-block { margin-top: 22px; }
.axis-block .block-head { align-items: center; }
.tabbar { display: none; }

/* ------------------------------------------------------------------------
   Phone (iOS first): the same app, laid out for the thumb. A tab bar at the
   bottom with the add button in the middle, sheets that slide up, large
   titles, 44 px targets, 16 px fields (no zoom on focus), safe areas.
   ------------------------------------------------------------------------ */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; font-size: 15px; }
  .sidebar, .status-hints, kbd { display: none; }
  .app { padding-top: env(safe-area-inset-top); }
  /* The page never moves sideways: what is wider scrolls inside its card. */
  html, body { overflow-x: clip; }
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .content, .stack, .columns, .aside { max-width: 100%; min-width: 0; }
  .page-header, .content { padding-inline: max(16px, env(safe-area-inset-left)); }
  .page-header { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 18px; padding-bottom: 14px; }
  h1 { font-size: 2.05rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
  .header-actions { flex-wrap: wrap; gap: 8px; }
  .header-actions .seg { max-width: 100%; flex-wrap: wrap; height: auto; }
  /* A page whose only action is its ⋯ keeps it beside its title. */
  .page-header { position: relative; }
  .header-actions:has(> .menu-wrap:only-child) { position: absolute; top: 18px; right: max(16px, env(safe-area-inset-right)); }
  .header-actions .seg::-webkit-scrollbar { display: none; }
  .seg button { height: 32px; padding: 0 13px; font-size: 0.86rem; }

  /* Tab bar: translucent, like iOS. */
  .tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--rp-surface) 80%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--border);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px 0; color: var(--rp-muted); text-decoration: none; font-size: 0.66rem; font-weight: 600; }
  .tab.on { color: var(--accent); }
  .tab-icon { position: relative; display: grid; place-items: center; }
  .tab-icon svg { width: 25px; height: 25px; }
  .tab-badge { position: absolute; top: -5px; left: 15px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rp-love); color: var(--on-accent); font-size: 0.66rem; font-weight: 700; line-height: 18px; text-align: center; }
  .tab-busy { position: absolute; top: -2px; left: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--rp-gold); animation: busy 1.4s ease-in-out infinite; }
  .tab-add { justify-self: center; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 0.12s; }
  .tab-add:active { transform: scale(0.94); }
  .tab-add svg { width: 26px; height: 26px; }

  /* Messages (and Undo) float above the tab bar. */
  .statusbar { position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 9; height: auto; min-height: 46px;
    padding: 10px 16px; border: none; border-radius: 14px; background: var(--rp-overlay); box-shadow: var(--shadow); font-size: 0.88rem; color: var(--rp-text); }
  .statusbar:has(.status-msg:empty) { display: none; }
  .link-btn.undo { font-size: 0.95rem; padding: 4px 6px; }

  /* Touch targets. */
  .button { min-height: 42px; padding: 0 16px; font-size: 0.93rem; border-radius: 10px; }
  .button.small { min-height: 34px; height: auto; padding: 0 12px; font-size: 0.84rem; }
  .icon-btn { width: 40px; height: 40px; }
  .input { height: 44px; font-size: 16px; border-radius: 10px; }
  textarea.input { height: auto; font-size: 16px; }
  select.input { font-size: 16px; }
  .item { min-height: 58px; padding: 9px 14px; gap: 12px; }
  .item-title { font-size: 1rem; }
  .check { width: 26px; height: 26px; }
  .check.done-check::after { left: 8.5px; top: 4px; width: 6px; height: 12px; }
  .weight { min-width: 52px; padding: 4px 10px; font-size: 0.8rem; }
  .chip-btn { padding: 7px 13px; font-size: 0.86rem; max-width: 100%; text-align: left; }
  .menu button { min-height: 44px; font-size: 0.95rem; }
  .row-line { min-height: 44px; }

  /* Now: one column; the next days scroll sideways. */
  .columns { grid-template-columns: 1fr; gap: 22px; }
  .aside { position: static; }
  .days { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .days::-webkit-scrollbar { display: none; }
  .day { flex: 0 0 30%; scroll-snap-align: start; }
  .alert { padding: 14px; }
  .alert-actions { flex-wrap: wrap; }
  /* A task line keeps its title: the rest is in its ⋯. */
  .item .hover-only { display: none; }
  .item-title { overflow-wrap: anywhere; }
  .item-main { min-width: 0; }

  /* Sheets: dialogs and the project slide up from the bottom. */
  .overlay { place-items: end stretch; padding-top: 0; }
  .dialog { width: 100%; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top) - 12px); padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0; animation: sheet 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .dialog::before, .drawer::before { content: ""; display: block; width: 38px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--rp-hl-high); }
  /* A sheet is pulled down to close (main.js): no rubber band of its own. */
  .dialog, .drawer { overscroll-behavior-y: none; touch-action: pan-y; }
  .sheet-moving { transition: none !important; animation: none !important; }
  .sheet-back { transition: transform 0.2s ease-out; }
  .drawer { top: calc(10px + env(safe-area-inset-top)); left: 0; right: 0; width: 100%; padding: 8px 18px calc(40px + env(safe-area-inset-bottom));
    border-left: none; border-radius: 16px 16px 0 0; animation: sheet 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .drawer .form-grid, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-form .form-grid { grid-template-columns: 1fr; }
  .title-input { font-size: 1.35rem; }

  /* Wide content scrolls sideways inside its card. */
  .card { padding: 14px; overflow-x: auto; }
  .gantt { overflow-x: auto; }
  .g-row { min-width: 760px; grid-template-columns: 170px minmax(0, 1fr); }
  .g-name { font-size: 0.86rem; }
  .hours-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .usage-tiles { grid-template-columns: 1fr; }
  .card h2 { flex-wrap: wrap; row-gap: 2px; }
  .verdict .row-line { flex-wrap: wrap; row-gap: 2px; }
  .verdict .row-line .grow { flex: 1 1 60%; }
  .verdict .row-line .muted { white-space: nowrap; font-size: 0.8rem; }
  .op-head { line-height: 1.4; }
  .axis-name { max-width: 150px; }
  .legend { flex-wrap: wrap; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (hover: none) {
  .hover-only { opacity: 1; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .dialog, .drawer { animation: none; } }

/* ------------------------------------------------------------------------
   Shared controls: one look for links as buttons, tooltips, questions, the
   date picker, the palette, the filter, pickers.
   ------------------------------------------------------------------------ */
a.button { text-decoration: none; }
.button.danger-solid { background: var(--rp-love); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.button.danger-solid:hover { filter: brightness(1.06); }
button.tag { padding: 0; font: inherit; font-size: 0.76rem; }
button.tag:hover, .link-tag:hover { color: var(--accent); }
.badge { white-space: nowrap; padding: 0 7px; border-radius: 10px; background: var(--soft); color: var(--rp-subtle); font-size: 0.7rem; font-weight: 600; line-height: 18px; }
.field-label { margin-bottom: 6px; color: var(--rp-subtle); font-size: 0.8rem; font-weight: 600; }

.tip { position: fixed; z-index: 40; max-width: 340px; padding: 6px 10px; border-radius: 8px; background: var(--rp-text); color: var(--rp-base);
  font-size: 0.78rem; line-height: 1.45; white-space: pre-line; pointer-events: none; box-shadow: var(--shadow); animation: fade 0.1s ease-out; }
@keyframes fade { from { opacity: 0; } }

.ask-layer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center; padding-top: 18vh; background: color-mix(in srgb, var(--backdrop) 60%, transparent); }
.ask { display: flex; flex-direction: column; gap: 10px; width: min(440px, 92vw); padding: 20px 22px 16px; border-radius: 14px; background: var(--rp-base); box-shadow: var(--shadow); animation: pop 0.12s ease-out; }
.ask-text { font-weight: 600; }
.ask .actions-row { margin-top: 6px; }

.date-field { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.date-field .icon { color: var(--rp-muted); }
.date-field.empty { color: var(--rp-muted); }
.date-field:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.datepick { position: fixed; z-index: 25; width: 276px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--rp-surface); box-shadow: var(--shadow); outline: none; animation: pop 0.1s ease-out; }
.dp-head { display: flex; align-items: center; margin-bottom: 6px; }
.dp-head .icon-btn { font-size: 1.15rem; }
.dp-month { flex: 1; text-align: center; font-weight: 650; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { padding: 4px 0; color: var(--rp-muted); font-size: 0.72rem; font-weight: 600; text-align: center; }
.dp-day { position: relative; height: 34px; border-radius: 8px; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--rp-overlay); }
.dp-day.out { color: var(--rp-muted); opacity: 0.55; }
.dp-day.past { color: var(--rp-muted); }
.dp-day.off { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--rp-muted) 50%, transparent); }
.dp-day.today { color: var(--accent); font-weight: 700; }
.dp-day.cur { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.sel { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.dp-load { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--rp-hl-high); }
.dp-load.mid { background: var(--rp-gold); }
.dp-load.full { background: var(--rp-love); }
.dp-day.sel .dp-load { background: var(--on-accent); }
.dp-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 0 4px; }
.dp-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--rp-muted); font-size: 0.72rem; }
.dp-legend .dp-load { position: static; margin: 0; }

.palette-layer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center; padding-top: 12vh; background: color-mix(in srgb, var(--backdrop) 55%, transparent); }
.palette { display: flex; flex-direction: column; width: min(620px, 94vw); max-height: 64vh; border: 1px solid var(--border); border-radius: 16px; background: var(--rp-surface); box-shadow: var(--shadow); overflow: hidden; animation: pop 0.12s ease-out; }
.palette-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--rp-muted); }
.palette-input { flex: 1; height: 52px; border: none; outline: none; background: none; font-size: 1.02rem; color: var(--rp-text); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-item, .pick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; text-align: left; }
.palette-item.on, .pick-item.on { background: var(--rp-overlay); }
.palette-item .grow, .pick-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-kind { color: var(--rp-muted); font-size: 0.78rem; white-space: nowrap; }

.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--rp-muted); }
.pick-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; margin-top: 8px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--rp-surface); }
.pick-item.new { color: var(--accent); }
.pick-current { margin-bottom: 12px; }
.pick-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

.g-cluster { position: absolute; top: 50%; z-index: 1; height: 16px; min-width: 22px; margin: -8px 0 0 0; transform: translateX(-50%); padding: 0 5px; white-space: nowrap; border: 1.5px solid var(--rp-subtle); border-radius: 8px;
  background: var(--rp-surface); color: var(--rp-subtle); font-size: 0.66rem; font-weight: 700; line-height: 13px; text-align: center; }
.g-cluster.hard { border-color: var(--rp-love); background: var(--rp-love); color: var(--on-accent); }

/* Axes: plain names, ordered by dragging or Alt+arrows. */
.axes-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 12px; }
.axes-list .axis-item { border-top: 1px solid var(--border); background: var(--rp-surface); }
.axes-list .axis-item:first-child { border-top: none; }
.axes-list .axis-row { padding: 8px 10px; }
.axis-guide { padding: 0 12px 9px 52px; color: var(--rp-subtle); font-size: 0.8rem; cursor: pointer; }
.axis-guide:hover { color: var(--rp-text); }
.axis-row.cursor { background: var(--rp-overlay); box-shadow: inset 3px 0 0 var(--accent); }
.axis-row.dragging { opacity: 0.4; }
.axis-row.drop { box-shadow: inset 0 2px 0 var(--accent); }
.axis-row .grip { color: var(--rp-muted); cursor: grab; display: inline-grid; }
.axis-label { font-weight: 600; cursor: default; }
.row-tools { display: flex; gap: 2px; }
@media (hover: hover) { .axis-row .row-tools { opacity: 0; transition: opacity 0.1s; } .axis-row:hover .row-tools, .axis-row.cursor .row-tools { opacity: 1; } }

/* Settings of the engine: one value, its unit and what it does. */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 24px; }
.setting .hint { margin-top: 5px; color: var(--rp-muted); font-size: 0.78rem; line-height: 1.4; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit .input { max-width: 120px; }
.with-unit .date-field { max-width: 200px; }
.unit { color: var(--rp-muted); font-size: 0.84rem; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { max-width: 260px; }

/* Keys. */
.help-cols { columns: 2 300px; column-gap: 28px; }
.help-group { break-inside: avoid; margin-bottom: 18px; }
.help-grid { grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 14px; font-size: 0.86rem; }
.help-grid .keys { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.keys { white-space: nowrap; }
.keys kbd + kbd { margin-left: 3px; }
.action-label kbd { margin-left: auto; opacity: 0; transition: opacity 0.12s; }
.action-label .badge { margin-left: auto; }
.action-label .badge + kbd { margin-left: 6px; }
.action:hover kbd, .action:focus-visible kbd { opacity: 1; }

@media (max-width: 760px) {
  .datepick { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; animation: sheet 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .dp-day { height: 44px; font-size: 1rem; }
  .palette-layer { padding-top: calc(10px + env(safe-area-inset-top)); }
  .palette-input { font-size: 16px; }
  .ask-layer { padding-top: 22vh; }
  .help-cols { columns: 1; }
  .settings-grid { grid-template-columns: 1fr; }
}
.seg { flex-wrap: nowrap; }
@media (min-width: 761px) { .add-form .form-grid { grid-template-columns: minmax(180px, 1fr) auto; } }

/* Numbers are typed, not spun. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* A select in the theme: a button that opens a list for the keyboard. */
.select-field { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; min-width: 0; }
.select-field .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-field.empty .grow { color: var(--rp-muted); }
.select-field:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.sf-meta { color: var(--rp-muted); font-size: 0.76rem; white-space: nowrap; }
.sf-caret { color: var(--rp-muted); font-size: 0.7rem; }
.selectpick { position: fixed; z-index: 25; max-width: min(420px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--rp-surface); box-shadow: var(--shadow); outline: none; animation: pop 0.1s ease-out; }
.sp-filter { margin-bottom: 6px; }
.sp-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; }
.sp-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-item.on { background: var(--rp-overlay); }
.sp-item.sel { color: var(--accent); font-weight: 600; }

/* A row of fields ending with its button, aligned on the inputs. */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row > .field { flex: 1 1 150px; }
.form-row > .field.wide { flex: 3 1 220px; }
.form-row > .button { flex: none; }

/* A row of a table: short fields in a grid, long texts across. */
.row-form { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.row-form .field.wide { grid-column: 1 / -1; }
.dialog .card { margin-top: 18px; box-shadow: none; }
.dialog .actions-row .danger { align-self: center; }
.input.computed { display: flex; align-items: center; background: var(--soft); color: var(--rp-subtle); cursor: help; }

/* Deadline rules of a calendar. */
.rules { display: flex; flex-direction: column; gap: 6px; }
.rule { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.rule-label { min-width: 90px; font-weight: 600; font-size: 0.86rem; }
.rule-words { display: flex; gap: 6px; flex-wrap: wrap; }
.rule-words code { padding: 1px 7px; border-radius: 6px; background: var(--soft); font-size: 0.8rem; }
.dialog .hint, .hint { color: var(--rp-muted); font-size: 0.78rem; line-height: 1.4; margin-top: 4px; }

@media (max-width: 760px) {
  .selectpick { left: 0 !important; right: 0; bottom: 0; top: auto !important; max-width: none; min-width: 0 !important; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; animation: sheet 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .sp-item { padding: 12px; font-size: 1rem; }
  .sp-list { max-height: 50vh; }
  .form-row > .field, .form-row > .field.wide { flex: 1 1 100%; }
  .form-row > .button { width: 100%; }
}
.dialog .status-line + .field-label, .dialog .hint + .field-label { margin-top: 16px; }

/* Days: gold eats into the free share, red goes past the hours declared. */
.bar.red .bar-fill { background: var(--rp-love); }
.alert-text .lever { margin-top: 4px; color: var(--rp-text); }
.alert-text .why { margin-top: 4px; }
.ref-line { margin-left: auto; color: var(--rp-muted); font-size: 0.8rem; text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-line:hover { color: var(--accent); }
.model-field { flex-direction: row; align-items: center; gap: 8px; }
.model-field .select-field { min-width: 170px; }
.turn.me.again { font-style: italic; color: var(--rp-subtle); }

/* How to read: each mark next to what it means. */
.read { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.read-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; padding: 4px 0; font-size: 0.88rem; }
.read-mark { display: flex; align-items: center; justify-content: center; position: relative; min-height: 18px; }
.read-mark > * { position: static !important; margin: 0 !important; transform: none; }
.read-mark .g-deadline { transform: rotate(45deg); }
.read-bar { display: block; width: 70px; height: 8px; border-radius: 4px; }
.read-today { display: block; width: 2px; height: 18px; }
.read-cluster { transform: none !important; }
@media (max-width: 760px) { .read-row { grid-template-columns: 70px 1fr; } }

.tip-list { margin: 0; padding-left: 16px; }
.tip-list li { margin: 1px 0; }

/* A recurrence's days. */
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip { width: 40px; height: 32px; border: 1px solid var(--border); border-radius: 8px; color: var(--rp-subtle); font-weight: 600; font-size: 0.82rem; }
.day-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Calibrating a day: what it took, the whole day or each axis. */
.worked-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.worked-row .hours-input { width: 64px; margin-left: auto; }
.worked-day { font-weight: 600; min-width: 110px; }
.icon-gap { width: 28px; }
.check-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.86rem; }
.stand-row.calib { cursor: default; }
.stand-row.calib .line2 { white-space: normal; }
.stand-row .line2 .st { width: 6px; height: 6px; vertical-align: 1px; }
.knows .more { margin-top: 14px; }
.calib-line { display: flex; align-items: center; gap: 6px; margin-top: 6px; white-space: nowrap; }
.calib-line > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.split-btn { border: 1px solid var(--border); border-radius: 12px; padding: 1px 9px; background: var(--rp-surface); white-space: nowrap; }
.split-btn:hover { border-color: var(--accent); color: var(--accent); }
.op .grow { min-width: 0; }
.action-help { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.help-list { margin: 0 0 12px 18px; color: var(--rp-subtle); font-size: 0.9rem; line-height: 1.5; }
.help-list li + li { margin-top: 4px; }
.help-keys .help-group { margin-bottom: 14px; }
p.how { margin: 0 0 8px; line-height: 1.55; }
.stack > section > .block-head { margin-top: 10px; }

/* Attachments of a message */
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.attach-list:empty { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 9px; border: 1px solid var(--border); border-radius: 20px; background: var(--rp-base); font-size: 0.8rem; color: var(--rp-text); text-decoration: none; white-space: nowrap; }
a.attach-chip { padding-right: 10px; }
a.attach-chip:hover { border-color: var(--accent); color: var(--accent); }
.attach-chip svg { width: 13px; height: 13px; }
.attach-chip .icon-btn { padding: 1px; }
.turn .attach-list { margin-bottom: 0; white-space: normal; }
.drop-on { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* The ⋯ of a task: every key of the task as a button, shown on hover. */
.task-menu { flex: none; opacity: 0; transition: opacity 0.1s; }
.item:hover .task-menu, .item.cursor .task-menu, .g-row:hover .task-menu, .g-row.cursor .task-menu, .task-menu.open { opacity: 1; }
.g-name .task-menu .icon-btn { width: 24px; height: 24px; }
.status-msg .took { margin: 0 3px; }
.status-msg .took.on { color: var(--rp-muted); text-decoration: none; }
@media (hover: none) { .task-menu { opacity: 1; } }
.menu.floating { position: fixed; top: 0; z-index: 60; }

/* Deadlines: filters, then every project as a row */
.dl-filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 14px; }
.dl-filters .field { margin: 0; }
.dl-filters .chips { margin-top: 0; }
.chip-btn.on { border-color: var(--accent); color: var(--accent); background: var(--rp-overlay); }
.chip-btn .st { margin-right: 6px; }
.chip-btn .muted { margin-left: 6px; }
.dl-table { width: 100%; }
.dl-table tr.click { cursor: pointer; }
.dl-table tr.click:hover td, .dl-table tr.picked td { background: var(--rp-overlay); }
.dl-table td:first-child, .dl-table th:first-child { width: 28px; }
.stand-label .stand-more { margin-left: 8px; font-weight: 400; color: var(--rp-muted); }
.stand-label .stand-more:hover { color: var(--accent); }
.aside > h2 { display: flex; align-items: center; gap: 8px; }
