:root {
  --bg: #05070f;
  --fg: #e8edf2;
  --muted: #8b97a5;
  --accent: #e0b07e;
  --accent-contrast: #1a1004;
  --card: #14181d;
  --line: #232a32;
  --well: #0f1216;
  --calm: #7ee0a8;
  --warn: #e0b87e;
  --alert: #e0937e;
  --read: 46rem;
  --wide: 80rem;
  --bar-start: 0px;
  --bar-end: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar > .bar-inner { margin-left: var(--bar-start); margin-right: var(--bar-end); }
:root[data-window="mac-app"] { --bar-start: 4rem; }
@media (display-mode: window-controls-overlay) {
  :root { --bar-start: max(0px, calc(env(titlebar-area-x, 0px) - 1rem)); --bar-end: max(0px, calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) - 1rem)); }
  .bar { min-height: env(titlebar-area-height, 0px); -webkit-app-region: drag; app-region: drag; }
  .bar a, .bar button, .bar select, .bar input, .bar label { -webkit-app-region: no-drag; app-region: no-drag; }
}
.bar-inner { display: flex; align-items: center; gap: 1rem; }
.spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.4rem; margin-left: -0.4rem; border: 0; border-radius: 0.5rem; background: none; color: var(--fg); font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.brand:hover { background: var(--card); }
.brand::after { content: ""; width: 0.35rem; height: 0.35rem; margin: -0.2rem 0 0 0.1rem; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.mark { width: 0.9rem; height: 0.9rem; border-radius: 0.3rem; background: var(--accent); flex: none; }
.me { width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.me:hover { color: var(--fg); }
.me svg { width: 1.1rem; height: 1.1rem; }
.menu { position: fixed; inset: auto; top: 3.6rem; bottom: auto; width: max-content; height: auto; max-height: calc(100vh - 4.5rem); overflow-y: auto; margin: 0; min-width: 14rem; padding: 0.35rem; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 0.75rem; box-shadow: 0 12px 30px rgb(0 0 0 / 0.5); }
.menu:popover-open { display: grid; align-content: start; gap: 2px; }
.menu-start { left: calc(0.6rem + var(--bar-start)); }
.menu-end { right: calc(0.6rem + var(--bar-end)); }
.menu > a, .menu > button { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.5rem 0.7rem; border: 0; border-radius: 0.5rem; background: none; color: var(--fg); font: inherit; font-size: 0.92rem; text-align: left; text-decoration: none; cursor: pointer; }
.menu > a:hover, .menu > button:hover { background: var(--line); }
.menu > [aria-current] { font-weight: 600; }
.menu > a > i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); }
.menu hr { width: 100%; margin: 0.25rem 0; border: 0; border-top: 1px solid var(--line); }
.menu .to-sluice > i { background: #7ec4e0; }
.menu .to-scan > i { background: #b8a0e8; }
.menu .to-iris > i { background: #d0dc7e; }
.menu .to-streamline > i { background: #e0877e; }
.menu .to-exchange > i { background: #7ee0a8; }
.menu .to-cadence > i { background: #e0b07e; }
.menu .to-account > i { background: #e89ab8; }
.shell { flex: 1 0 auto; width: 100%; max-width: calc(var(--shell) + 14.5rem); margin: 0 auto; padding: 0 1.25rem; display: grid; grid-template-columns: 12.5rem minmax(0, 1fr) 12.5rem; gap: 2rem; }
.nav { position: sticky; top: 3.5rem; align-self: start; padding: 1.5rem 0; display: grid; gap: 0.15rem; }
.nav a, .nav button { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; border: 0; border-radius: 0.55rem; background: none; color: var(--muted); font: inherit; font-size: 0.93rem; text-align: left; text-decoration: none; cursor: pointer; }
.nav a:hover, .nav button:hover { color: var(--fg); background: var(--card); }
.nav [aria-current="page"], .nav [aria-pressed="true"] { color: var(--fg); background: var(--card); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { font-size: 0.75rem; color: var(--accent-contrast); background: var(--accent); border-radius: 999px; padding: 0 0.45rem; font-weight: 700; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 0.75rem 0.5rem; }
.tabbar { display: none; }
@media (max-width: 1100px) {
  .shell { max-width: var(--shell); grid-template-columns: minmax(0, 1fr); gap: 0; }
  .nav { display: none; }
  body:has(.tabbar:not([hidden])) { padding-bottom: 4.5rem; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); padding: 0.35rem env(safe-area-inset-right) calc(0.35rem + env(safe-area-inset-bottom)) env(safe-area-inset-left); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 0.1rem; padding: 0.3rem 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.7rem; text-decoration: none; position: relative; cursor: pointer; }
  .tabbar b { font-size: 1.05rem; font-weight: 400; }
  .tabbar [aria-current="page"], .tabbar [aria-pressed="true"] { color: var(--accent); }
  .tabbar .count { position: absolute; top: 0; left: 55%; font-size: 0.65rem; background: var(--accent); color: var(--accent-contrast); border-radius: 999px; padding: 0 0.35rem; font-weight: 700; }
}
img[data-turn="90"] { rotate: 90deg; }
img[data-turn="180"] { rotate: 180deg; }
img[data-turn="270"] { rotate: 270deg; }
.freshtoast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; max-width: calc(100vw - 2rem); padding: 0.55rem 1.1rem; background: var(--card); color: var(--fg); border: 1px solid var(--accent); border-radius: 999px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.45); font-size: 0.9rem; text-align: center; }
@media (max-width: 1100px) { .freshtoast { bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)); } }
:root {
  --danger: var(--alert);
  --shell: var(--wide);
}
html { height: 100%; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.bar { padding: 0.6rem 1rem; }
h1 { font-size: 1.05rem; margin: 0; letter-spacing: 0.02em; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
h3 { font-size: 1rem; margin: 0 0 0.4rem; }
main { padding: 1rem; flex: 1; }
main > section { margin-bottom: 1.75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.muted { color: var(--muted); font-size: 0.875rem; margin: 0 0 0.75rem; }
.muted:last-child { margin-bottom: 0; }
.notice { background: #1d2430; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.6rem 0.8rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.field input, .field select, .field textarea, .row input, .row select, textarea {
  font: inherit; color: var(--fg); background: #0f1216; border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.6rem; min-width: 0;
}
.row input[type="text"] { flex: 1 1 12rem; }
.check { display: flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; color: var(--muted); }
button, .file { font: inherit; border-radius: 8px; padding: 0.45rem 0.9rem; cursor: pointer; border: 1px solid var(--line); }
.primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 600; }
.ghost { background: none; color: var(--fg); }
.danger { background: none; color: var(--danger); border-color: var(--danger); }
button[disabled] { opacity: 0.5; cursor: default; }
.file { display: inline-block; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem; min-height: 6rem; }
.day.today { border-color: var(--accent); }
.day h3 { font-size: 0.85rem; color: var(--muted); display: flex; justify-content: space-between; }
.day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.block { border-left: 3px solid var(--accent); padding: 0.25rem 0.5rem; background: #0f1216; border-radius: 0 6px 6px 0; font-size: 0.85rem; cursor: pointer; overflow-wrap: anywhere; }
.block.pinned { border-left-style: double; }
.block.event { border-left-color: var(--muted); cursor: default; }
.block.late { border-left-color: var(--danger); }
.block .time { color: var(--muted); font-variant-numeric: tabular-nums; }
.board { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.board-head h3 { margin: 0; }
.board-head .meta { color: var(--muted); font-size: 0.8rem; }
.stage { margin: 0.5rem 0 0.75rem; }
.stage-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; color: var(--muted); padding: 0.2rem 0.25rem; border-bottom: 1px dashed var(--line); margin-bottom: 0.35rem; }
.stage-head .n { font-variant-numeric: tabular-nums; }
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; min-height: 2.75rem; border-radius: 8px; }
.stage-list.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.stage-list .empty { color: var(--muted); font-size: 0.8rem; padding: 0.5rem 0.25rem; }
.task { display: grid; grid-template-columns: auto auto 1fr auto; gap: 0.6rem; align-items: center; background: #0f1216; border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem 0.6rem; min-height: 2.75rem; position: relative; }
.task.drop-before::before, .task.drop-after::after { content: ''; position: absolute; left: 0.5rem; right: 0.5rem; height: 3px; background: var(--accent); border-radius: 2px; }
.task.drop-before::before { top: -0.25rem; }
.task.drop-after::after { bottom: -0.25rem; }
.task.lifted { opacity: 0.35; }
.grip { width: 2.75rem; height: 2.75rem; margin: -0.4rem 0 -0.4rem -0.6rem; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font-size: 1.1rem; letter-spacing: -0.1em; }
.grip:active { cursor: grabbing; }
.ghost-task { position: fixed; z-index: 50; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: var(--accent); width: min(36rem, 90vw); }
.preview { padding-left: 1.2rem; font-size: 0.9rem; }
.preview li { margin-bottom: 0.5rem; }
.preview ul { list-style: none; padding-left: 0.5rem; margin: 0.25rem 0; }
.preview ul li { margin: 0.15rem 0; display: flex; gap: 0.5rem; justify-content: space-between; }
.preview .muted { display: block; margin: 0; }
.stages-edit { border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0.6rem 0; }
.stages-edit legend { color: var(--muted); font-size: 0.8rem; padding: 0 0.3rem; }
.stages-edit ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.stages-edit li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 0.35rem; align-items: center; }
.stages-edit li button { padding: 0.35rem 0.6rem; }
body.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.task .name { cursor: pointer; }
.task.done .name { text-decoration: line-through; color: var(--muted); }
.task .meta { color: var(--muted); font-size: 0.8rem; }
.pri-asap { color: var(--danger); }
.pri-high { color: var(--accent); }
.facts { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.facts li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.facts li:last-child { border-bottom: none; }
.facts .act { cursor: pointer; color: var(--fg); }
.schedules { list-style: none; margin: 0; padding: 0; }
.schedule { margin-bottom: 1rem; }
.schedule .grid { margin: 0.5rem 0; }
.weekdays { border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 0.6rem; flex-wrap: wrap; font-size: 0.9rem; padding: 0.5rem 0.75rem; margin: 0.6rem 0; }
.weekdays legend { color: var(--muted); font-size: 0.8rem; padding: 0 0.3rem; }
.chips { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.8rem; }
.tier-label { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.4rem; }
.withheld { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.withheld li { margin-bottom: 0.4rem; }
dialog { background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; width: min(40rem, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
footer { padding: 1rem; border-top: 1px solid var(--line); }
a { color: var(--accent); }
footer a { color: var(--muted); }
code { font-size: 0.85em; }
@media (max-width: 40rem) {
  .task { grid-template-columns: auto auto 1fr; }
  .task .meta { grid-column: 3; }
}
.column { max-width: var(--shell); margin-left: auto; margin-right: auto; width: 100%; }

.feedback-link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.feedback-link:hover, .feedback-link:focus-visible { color: var(--fg); }
dialog.feedback { width: min(32rem, calc(100vw - 2rem)); background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; }
dialog.feedback::backdrop { background: rgb(0 0 0 / 0.6); }
.feedback-form h2 { margin: 0 0 0.5rem; font-size: 1.125rem; }
.feedback-note, .feedback-status { color: var(--muted); font-size: 0.875rem; margin: 0 0 0.75rem; }
.feedback-status:empty { display: none; }
.feedback-field { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; font-size: 0.875rem; }
.feedback-field textarea, .feedback-field select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; width: 100%; box-sizing: border-box; }
.feedback-field textarea { resize: vertical; }
.feedback-shared { border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.75rem 0.25rem; margin: 0 0 0.75rem; font-size: 0.875rem; }
.feedback-shared legend { padding: 0 0.25rem; }
.feedback-details { list-style: none; margin: 0; padding: 0; }
.feedback-details li { margin-bottom: 0.5rem; }
.feedback-details label { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.5rem; align-items: baseline; cursor: pointer; }
.feedback-details code { grid-column: 2; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.feedback-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.feedback-actions button { font: inherit; border-radius: 8px; padding: 0.45rem 0.9rem; cursor: pointer; }
.feedback-cancel { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.feedback-send { background: var(--accent); color: var(--accent-contrast); border: 1px solid var(--accent); font-weight: 600; }
.feedback-send:disabled { opacity: 0.45; cursor: not-allowed; }
.feedback-signin { display: flex; gap: 0.5rem; margin: 0 0 0.75rem; }
.feedback-signin[hidden] { display: none; }
.installbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.6rem 1rem; background: var(--card); border-bottom: 1px solid var(--accent); color: var(--fg); font-size: 0.875rem; }
.installbar-text { margin: 0; flex: 1 1 20rem; }
.installbar-actions { display: flex; gap: 0.5rem; }
.installbar-actions button { font: inherit; border-radius: 8px; padding: 0.35rem 0.8rem; cursor: pointer; }
.installbar-install { background: var(--accent); color: var(--accent-contrast); border: 1px solid var(--accent); font-weight: 600; }
.installbar-dismiss { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
