@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/golos-text-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/golos-text-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/golos-text-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens. The chrome stays achromatic so project colours carry the meaning. */
:root {
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --hover: #eceef1;
  --line: #e2e5ea;
  --line-2: #cdd2d9;
  --text: #16191d;
  --text-2: #48515e;
  --muted: #7a8391;
  --ink: #16191d;
  --on-ink: #ffffff;

  --now: #e03e3e;
  --focus: #2563eb;
  --ok: #18794e;
  --ok-bg: #e4f3ea;
  --warn: #ad5700;
  --warn-bg: #fcefdc;
  --bad: #c42b1c;
  --bad-bg: #fde7e4;
  --info: #1d5fbf;
  --info-bg: #e4edfb;

  --shadow-1: 0 1px 2px rgb(16 24 40 / 6%);
  --shadow-2: 0 8px 28px rgb(16 24 40 / 14%), 0 1px 3px rgb(16 24 40 / 8%);

  --r: 6px;
  --r-sm: 4px;
  --r-lg: 10px;

  --sidebar-w: 236px;
  --panel-w: 320px;
  --topbar-h: 48px;
  --hour-h: 52px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d0f12;
  --surface: #15181c;
  --surface-2: #1a1e23;
  --hover: #21262d;
  --line: #262b33;
  --line-2: #363d47;
  --text: #e7e9ec;
  --text-2: #b4bbc5;
  --muted: #7e8795;
  --ink: #e7e9ec;
  --on-ink: #111317;

  --now: #ff5c5c;
  --focus: #6ea8fe;
  --ok: #4cc38a;
  --ok-bg: #11271e;
  --warn: #f0a04b;
  --warn-bg: #2b1f10;
  --bad: #ff7b6e;
  --bad-bg: #2f1613;
  --info: #6ea8fe;
  --info-bg: #13233b;

  --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-2: 0 10px 32px rgb(0 0 0 / 55%), 0 1px 3px rgb(0 0 0 / 40%);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12;
    --surface: #15181c;
    --surface-2: #1a1e23;
    --hover: #21262d;
    --line: #262b33;
    --line-2: #363d47;
    --text: #e7e9ec;
    --text-2: #b4bbc5;
    --muted: #7e8795;
    --ink: #e7e9ec;
    --on-ink: #111317;
    --now: #ff5c5c;
    --focus: #6ea8fe;
    --ok: #4cc38a;
    --ok-bg: #11271e;
    --warn: #f0a04b;
    --warn-bg: #2b1f10;
    --bad: #ff7b6e;
    --bad-bg: #2f1613;
    --info: #6ea8fe;
    --info-bg: #13233b;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 10px 32px rgb(0 0 0 / 55%), 0 1px 3px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 13px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#main {
  height: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

::selection {
  background: color-mix(in srgb, var(--focus) 28%, transparent);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

svg.ic {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.ic.sm {
  width: 14px;
  height: 14px;
}

.muted {
  color: var(--muted);
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  font: 500 11px/1 var(--font);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 4px;
  background: var(--surface);
}

/* Shell */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
  height: 100%;
}

.app.sb-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) auto;
}

.app.sb-collapsed .sidebar {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px 8px 8px;
  gap: 2px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 10px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sb-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--on-ink);
  display: grid;
  place-items: center;
}

.sb-mark svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.sb-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 8px 0 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--text-2);
  text-align: left;
}

.sb-add:hover {
  border-color: var(--muted);
  color: var(--text);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text-2);
  width: 100%;
  text-align: left;
  font-weight: 500;
}

.sb-item:hover {
  background: var(--hover);
  color: var(--text);
}

.sb-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
}

.sb-item .count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.sb-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.sb-section {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sb-section .btn {
  margin-left: auto;
}

.sb-ws {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.sb-project {
  font-weight: 400;
  height: 28px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--c, var(--muted));
  flex: none;
}

.sb-foot {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  flex: none;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar .sub {
  color: var(--muted);
  white-space: nowrap;
}

.tb-spacer {
  flex: 1 1 auto;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.panel {
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.panel-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--topbar-h);
  flex: none;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--surface));
}

.btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--text-2);
}

.btn.ghost:hover {
  background: var(--hover);
  color: var(--text);
}

.btn.ghost.on {
  background: var(--hover);
  color: var(--text);
}

.btn.danger {
  color: var(--bad);
}

.btn.sm {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.btn.icon {
  width: 30px;
  padding: 0;
}

.btn.icon.sm {
  width: 26px;
}

.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r);
  background: var(--hover);
}

.seg button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.seg button:hover {
  color: var(--text);
}

.seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.input,
.select {
  height: 30px;
  width: 100%;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  outline: none;
}

textarea.input {
  height: auto;
  min-height: 72px;
  padding: 7px 9px;
  resize: vertical;
  line-height: 1.5;
}

.input:hover,
.select:hover {
  border-color: var(--muted);
}

.input:focus,
.select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.input::placeholder {
  color: var(--muted);
}

.input.bare {
  border-color: transparent;
  background: none;
  padding-left: 6px;
  padding-right: 6px;
}

.input.bare:hover {
  background: var(--hover);
}

.input.bare:focus {
  background: var(--surface);
  border-color: var(--focus);
}

.field {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.field > label {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.field .row-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.switch {
  position: relative;
  width: 30px;
  height: 18px;
  flex: none;
  border: 0;
  border-radius: 9px;
  background: var(--line-2);
  padding: 0;
  transition: background 0.12s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%);
  transition: transform 0.12s;
}

.switch.on {
  background: var(--ok);
}

.switch.on::after {
  transform: translateX(12px);
}

.check {
  width: 16px;
  height: 16px;
  flex: none;
  padding: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: none;
  display: grid;
  place-items: center;
  color: transparent;
}

.check:hover {
  border-color: var(--ok);
  color: var(--ok);
}

.check svg {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}

.check.done {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-sm);
  background: var(--hover);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  max-width: 100%;
}

button.chip {
  border: 0;
  cursor: pointer;
}

.chip.tint {
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  color: color-mix(in srgb, var(--c) 62%, var(--text));
}

.chip.line {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line-2);
}

/* Priority: four bars, filled by level. ASAP is a solid flag colour. */
.prio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--text-2);
}

.prio i {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
}

.prio i b {
  width: 3px;
  border-radius: 1px;
  background: var(--line-2);
}

.prio i b:nth-child(1) {
  height: 5px;
}

.prio i b:nth-child(2) {
  height: 8px;
}

.prio i b:nth-child(3) {
  height: 11px;
}

.prio.low i b:nth-child(-n + 1),
.prio.medium i b:nth-child(-n + 2),
.prio.high i b:nth-child(-n + 3) {
  background: var(--text-2);
}

.prio.asap {
  color: var(--bad);
  font-weight: 600;
}

.prio.asap i b {
  background: var(--bad);
}

/* Status marker: ring fill shows the status type. */
.st {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--c, var(--muted));
  background: none;
}

.st.started {
  background: conic-gradient(var(--c, var(--info)) 0 50%, transparent 0);
}

.st.done {
  background: var(--c, var(--ok));
}

.st.canceled {
  background: var(--line-2);
  border-color: var(--line-2);
}

.st.backlog {
  border-style: dashed;
}

.eta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.eta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.eta.ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.eta.ahead {
  color: var(--info);
  background: var(--info-bg);
}

.eta.risk,
.eta.late {
  color: var(--warn);
  background: var(--warn-bg);
}

.eta.missed,
.eta.nofit {
  color: var(--bad);
  background: var(--bad-bg);
}

.eta.none {
  color: var(--muted);
  background: var(--hover);
}

.eta.plain {
  background: none;
  padding: 0;
}

.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--hover);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--c, var(--ok));
}

/* Menus, popovers, modals */

.menu {
  position: absolute;
  z-index: 60;
  min-width: 180px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
}

.menu-item:hover,
.menu-item.hl {
  background: var(--hover);
}

.menu-item .tick {
  margin-left: auto;
  color: var(--muted);
}

.menu-sep {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.menu-label {
  padding: 6px 8px 2px;
  font-size: 12px;
  color: var(--muted);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 16px 16px;
  background: rgb(10 12 16 / 38%);
  overflow-y: auto;
}

.modal {
  width: min(920px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  max-height: 84vh;
}

.modal.narrow {
  width: min(560px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.modal-head h2 {
  font-size: 14px;
  font-weight: 600;
}

.modal-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  min-height: 0;
  flex: 1 1 auto;
}

.modal-main {
  padding: 16px 18px;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-side {
  padding: 12px 14px;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom-right-radius: var(--r-lg);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  flex: none;
}

.title-input {
  width: 100%;
  border: 0;
  outline: none;
  background: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.015em;
  padding: 0;
}

.title-input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.plan-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}

.plan-note.late {
  background: var(--warn-bg);
  border-color: transparent;
  color: var(--warn);
}

.plan-note.missed {
  background: var(--bad-bg);
  border-color: transparent;
  color: var(--bad);
}

.plan-note.ok svg {
  color: var(--ok);
}

.plan-note b {
  font-weight: 600;
  color: var(--text);
}

.plan-note.late b,
.plan-note.missed b {
  color: inherit;
}

.side-title {
  margin: 12px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.side-title:first-child {
  margin-top: 0;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 120;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, 92vw);
  padding: 9px 12px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  animation: toast-in 0.16s ease-out;
}

.toast.error {
  background: var(--bad);
  color: #fff;
}

.toast button {
  border: 0;
  background: none;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Quick add and command palette */

.palette {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  border-bottom: 1px solid var(--line);
}

.palette-input input {
  flex: 1;
  border: 0;
  outline: none;
  background: none;
  font-size: 15px;
}

.palette-list {
  max-height: 46vh;
  overflow-y: auto;
  padding: 6px;
}

.palette-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.palette-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-2);
}

/* Calendar */

.cal {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  --gutter: 52px;
}

.cal-head {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr));
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-right: var(--sbw, 0px);
}

.cal-tz {
  align-self: end;
  padding: 0 6px 6px 0;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

.cal-dayhead {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 8px 6px;
  border-left: 1px solid var(--line);
  color: var(--text-2);
  min-width: 0;
}

.cal-dayhead .dom {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.cal-dayhead.weekend .dow,
.cal-dayhead.weekend .dom {
  color: var(--muted);
}

.cal-dayhead.today .dom {
  background: var(--now);
  color: #fff;
  border-radius: 6px;
  padding: 0 6px;
  margin-left: -3px;
}

.cal-dayhead .load {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cal-allday {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr));
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-right: var(--sbw, 0px);
  min-height: 26px;
}

.cal-allday .lbl {
  padding: 5px 6px 0 0;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

.cal-allday .cell {
  border-left: 1px solid var(--line);
  padding: 3px 3px 3px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.allday-ev {
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--c, var(--muted)) 20%, var(--surface));
  color: color-mix(in srgb, var(--c, var(--muted)) 55%, var(--text));
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  position: relative;
}

.cal-grid {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr));
  height: calc(var(--hour-h) * 24);
  position: relative;
}

.cal-times {
  position: relative;
}

.cal-time {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
}

.cal-day {
  position: relative;
  border-left: 1px solid var(--line);
  background-image:
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size:
    100% var(--hour-h),
    100% calc(var(--hour-h) / 2);
  touch-action: pan-y;
}

/* Hours outside the default schedule are shaded, not hidden. */
.cal-off {
  position: absolute;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  pointer-events: none;
}

.cal-now {
  position: absolute;
  left: -1px;
  right: 0;
  height: 0;
  border-top: 2px solid var(--now);
  z-index: 6;
  pointer-events: none;
}

.cal-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--now);
}

.cal-nowlabel {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  z-index: 7;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--now);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.blk {
  position: absolute;
  left: calc(var(--col, 0) * (100% - 8px) / var(--cols, 1) + 2px);
  width: calc((100% - 8px) / var(--cols, 1) - 2px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 3px 6px 2px 7px;
  border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  text-align: left;
  font-size: 12px;
  line-height: 1.3;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: inset 3px 0 0 var(--c, var(--muted)), 0 0 0 1px var(--surface);
}

.blk .t {
  font-weight: 550;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.blk .t span {
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--lines, 2);
}

.blk .m {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0.78;
}

.blk.task {
  background: color-mix(in srgb, var(--c, var(--muted)) 11%, var(--surface));
  color: var(--text);
}

.blk.task .check {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  border-color: color-mix(in srgb, var(--c, var(--muted)) 70%, var(--text));
}

.blk.task .check svg {
  width: 8px;
  height: 8px;
}

.blk.event {
  background: color-mix(in srgb, var(--c, var(--muted)) 26%, var(--surface));
  color: color-mix(in srgb, var(--c, var(--muted)) 38%, var(--text));
}

.blk.free {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--c, var(--muted)) 14%, var(--surface)) 0 6px,
    var(--surface) 6px 12px
  );
}

.blk.short {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-top: 0;
  padding-bottom: 0;
  --lines: 1;
}

.blk.short .t {
  align-items: center;
  flex: 1 1 auto;
}

.blk.short .t span {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.blk.short .m {
  flex: none;
}

.blk.short .m .tm {
  display: none;
}

.blk.past {
  opacity: 0.55;
}

.blk.done .t span {
  text-decoration: line-through;
  color: var(--muted);
}

.blk.late {
  box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px var(--surface);
}

.blk.missed {
  box-shadow: inset 3px 0 0 var(--bad), 0 0 0 1px var(--surface);
}

.blk .flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.blk .flag svg {
  width: 11px;
  height: 11px;
}

.blk .flag.late {
  color: var(--warn);
}

.blk .flag.missed {
  color: var(--bad);
}

.blk:hover {
  z-index: 4;
  filter: brightness(0.97);
}

.blk.dragging {
  z-index: 8;
  cursor: grabbing;
  box-shadow: inset 3px 0 0 var(--c, var(--muted)), var(--shadow-2);
  opacity: 0.92;
}

.blk.ghost {
  background: color-mix(in srgb, var(--focus) 14%, var(--surface));
  box-shadow: inset 0 0 0 1.5px var(--focus);
  color: var(--focus);
  pointer-events: none;
  z-index: 7;
}

.blk .resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
}

.drag-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  cursor: grabbing;
}

.drag-layer.ns {
  cursor: ns-resize;
}

/* Agenda panel */

.agenda {
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ag-date {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.ag-sum {
  color: var(--muted);
  margin-bottom: 6px;
}

.ag-now {
  padding: 10px 11px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--c, var(--muted)) 10%, var(--surface));
  box-shadow: inset 3px 0 0 var(--c, var(--muted));
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.ag-now .lbl {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 6px;
}

.ag-now .ttl {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.ag-now .acts {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.ag-title {
  margin: 12px 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.ag-item {
  display: grid;
  grid-template-columns: 40px 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 6px;
  margin: 0 -6px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  width: calc(100% + 12px);
}

.ag-item:hover {
  background: var(--hover);
}

.ag-item .tm {
  font-size: 12px;
  color: var(--muted);
}

.ag-item .nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-item .du {
  font-size: 12px;
  color: var(--muted);
}

.ag-item.event .nm {
  color: var(--text-2);
}

.ag-item.past .nm,
.ag-item.past .tm {
  color: var(--muted);
}

.ag-bar {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--c, var(--muted));
  justify-self: center;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.empty b {
  display: block;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 2px;
}

/* Task list */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
}

.toolbar .lbl {
  color: var(--muted);
}

.list {
  --cols: 30px minmax(200px, 1fr) 140px 100px 76px 96px minmax(126px, 190px);
  min-width: 820px;
}

.list-head,
.row {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  column-gap: 10px;
  padding: 0 14px;
}

.list-head {
  height: 30px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.lg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: 100%;
  text-align: left;
}

.lg-head .cnt {
  font-weight: 400;
  color: var(--muted);
}

.lg-head .caret {
  transition: transform 0.12s;
  color: var(--muted);
}

.lg-head.closed .caret {
  transform: rotate(-90deg);
}

.row {
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  cursor: default;
}

.row:hover {
  background: var(--surface-2);
}

.row .name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 500;
}

.row .name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row.done .name span {
  color: var(--muted);
  text-decoration: line-through;
}

.row .cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}

.row .cell.late {
  color: var(--warn);
}

.row .cell.missed {
  color: var(--bad);
}

.row.add {
  color: var(--muted);
  grid-template-columns: 30px minmax(0, 1fr);
}

.row.add input {
  border: 0;
  outline: none;
  background: none;
  height: 34px;
  width: 100%;
}

.badge-lock {
  color: var(--muted);
  display: inline-flex;
}

/* Kanban */

.board {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  min-height: 100%;
  background: var(--surface-2);
}

.col {
  flex: 0 0 284px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 100%;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  font-weight: 600;
}

.col-head .cnt {
  font-weight: 400;
  color: var(--muted);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--r);
}

.cards.over {
  outline: 2px dashed var(--line-2);
  outline-offset: 3px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: grab;
  text-align: left;
}

.card:hover {
  border-color: var(--line-2);
}

.card.dragging {
  opacity: 0.4;
}

.card .ttl {
  font-weight: 550;
  line-height: 1.35;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.card .ttl .check {
  margin-top: 2px;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--text-2);
  font-size: 12px;
}

.card .meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Projects */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 14px;
}

.proj-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
}

.proj-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-1);
}

.proj-card .nm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.proj-card .ds {
  color: var(--text-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.9em;
}

.proj-card .ft {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.proj-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.proj-head .line1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.proj-head .sq {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--c);
  flex: none;
}

.proj-head h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.proj-head .facts {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  color: var(--text-2);
}

.proj-head .facts > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
  flex: 1 1 150px;
  max-width: 260px;
  padding: 7px 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
}

.stage.current {
  border-color: var(--c);
  box-shadow: inset 0 0 0 1px var(--c);
}

.stage .nm {
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
}

.stage .sm {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Gantt */

.gantt {
  --day-w: 34px;
  --row-h: 32px;
  --side-w: 280px;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100%;
}

.g-side {
  border-right: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 4;
}

.g-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

.g-head {
  height: 56px;
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: flex-end;
}

.g-side .g-head {
  padding: 0 14px 7px;
  color: var(--muted);
  font-size: 12px;
}

.g-days {
  display: flex;
  height: 100%;
}

.g-dayh {
  width: var(--day-w);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 5px;
  font-size: 11px;
  color: var(--muted);
  border-left: 1px solid transparent;
  position: relative;
}

.g-dayh b {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-2);
}

.g-dayh.weekend b {
  color: var(--muted);
}

.g-dayh.today b {
  color: #fff;
  background: var(--now);
  border-radius: 4px;
  padding: 0 4px;
}

.g-dayh .mon {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.g-row {
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: center;
}

.g-side .g-row {
  padding: 0 10px 0 14px;
  gap: 8px;
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: none;
  text-align: left;
}

.g-side .g-row:hover {
  background: var(--surface-2);
}

.g-side .g-row.group {
  font-weight: 600;
  background: var(--surface-2);
}

.g-side .g-row.sub {
  padding-left: 30px;
}

.g-body {
  position: relative;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: var(--day-w) 100%;
}

.g-body .g-row.group {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.g-weekend {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--day-w);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  pointer-events: none;
}

.g-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid var(--now);
  z-index: 3;
  pointer-events: none;
}

.g-bar {
  position: absolute;
  top: 7px;
  height: calc(var(--row-h) - 14px);
  min-width: 6px;
  border: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c, var(--muted)) 30%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--muted)) 55%, var(--surface));
  padding: 0;
  overflow: hidden;
}

.g-bar > i {
  display: block;
  height: 100%;
  background: color-mix(in srgb, var(--c, var(--muted)) 78%, var(--surface));
}

.g-bar.span {
  top: 12px;
  height: 8px;
  border-radius: 4px;
  background: var(--c, var(--muted));
  box-shadow: none;
}

.g-bar.late {
  box-shadow: inset 0 0 0 1.5px var(--warn);
}

.g-bar.missed {
  box-shadow: inset 0 0 0 1.5px var(--bad);
}

.g-due {
  position: absolute;
  top: 5px;
  width: 0;
  height: calc(var(--row-h) - 10px);
  border-left: 2px dashed var(--text-2);
  z-index: 2;
}

/* The project's own deadline: one line through every row. */
.g-deadline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed var(--text-2);
  z-index: 2;
  pointer-events: none;
}

.g-due.late {
  border-color: var(--bad);
}

.g-label {
  position: absolute;
  top: 0;
  height: var(--row-h);
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}

/* Dashboard */

.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  min-height: 100%;
  align-content: start;
}

.tile {
  grid-column: span 6;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.tile.w12 {
  grid-column: span 12;
}

.tile.w4 {
  grid-column: span 4;
}

.tile.w8 {
  grid-column: span 8;
}

.tile h3 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tile h3 .sub {
  font-weight: 400;
  color: var(--muted);
}

.stat {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 4px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats .cap {
  color: var(--muted);
  font-size: 12px;
}

.loadchart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  height: 150px;
}

.load-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  min-width: 0;
}

.load-bar {
  flex: 1 1 auto;
  width: 100%;
  max-width: 34px;
  border-radius: 4px;
  background: var(--hover);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
}

.load-bar .ev {
  background: color-mix(in srgb, var(--muted) 55%, var(--surface));
}

.load-bar .tk {
  background: var(--ink);
}

.load-bar.over .tk {
  background: var(--warn);
}

.load-day .v {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.load-day .d {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.load-day.today .d {
  color: var(--now);
  font-weight: 600;
}

.legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--c);
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 3px 6px;
  margin: 0 -6px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  width: calc(100% + 12px);
}

.mini-row:hover {
  background: var(--hover);
}

.mini-row .nm {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-row .nm span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief {
  color: var(--text-2);
  line-height: 1.6;
}

.brief p + p,
.brief ul,
.brief ol {
  margin-top: 6px;
}

.brief ul,
.brief ol {
  padding-left: 18px;
  margin-bottom: 0;
}

/* Assistant */

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 100%;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.msg.user {
  align-self: flex-end;
  max-width: 88%;
  padding: 7px 11px;
  border-radius: 10px 10px 2px 10px;
  background: var(--hover);
  white-space: pre-wrap;
}

.msg.ai p + p,
.msg.ai ul,
.msg.ai ol {
  margin-top: 6px;
}

.msg.ai ul,
.msg.ai ol {
  padding-left: 18px;
  margin-bottom: 0;
}

.msg.ai code {
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--hover);
}

.tool-call {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  width: fit-content;
  max-width: 100%;
}

.tool-call svg {
  color: var(--ok);
}

.tool-call.err svg {
  color: var(--bad);
}

.typing {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.chat-suggest {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 10px;
}

.chat-suggest button {
  text-align: left;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
}

.chat-suggest button:hover {
  border-color: var(--line-2);
  color: var(--text);
}

.chat-input {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.chat-input textarea {
  min-height: 36px;
  max-height: 140px;
  resize: none;
}

/* Settings */

.settings {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  min-height: 100%;
}

.set-nav {
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.set-body {
  padding: 18px 22px 40px;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.set-sec {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-sec > h2 {
  font-size: 15px;
  font-weight: 650;
}

.set-sec > p {
  color: var(--text-2);
  max-width: 64ch;
}

.box {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.box-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}

.box-row:last-child {
  border-bottom: 0;
}

.box-row .lbl {
  width: 120px;
  flex: none;
  font-weight: 500;
}

.box-row .lbl.off {
  color: var(--muted);
}

.time-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.time-range input {
  width: 74px;
  text-align: center;
  padding: 0 4px;
}

.swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.swatch {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--c);
}

.swatch.on {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c);
}

/* Login */

.login {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login form {
  width: min(340px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.login h1 {
  font-size: 19px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 9px;
}

.err {
  color: var(--bad);
}

/* Phone */

.tabbar {
  display: none;
}

.only-mobile {
  display: none;
}

@media (max-width: 1100px) {
  .panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    box-shadow: var(--shadow-2);
    width: min(var(--panel-w), 100vw);
  }

  .tile,
  .tile.w4,
  .tile.w8 {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-h: 46px;
    --hour-h: 56px;
  }

  body {
    font-size: 14px;
  }

  .app,
  .app.sb-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .sidebar {
    display: none;
  }

  .app.sb-open .sidebar {
    display: flex;
    position: fixed;
    inset: 0 18% 0 0;
    z-index: 70;
    box-shadow: var(--shadow-2);
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 0 6px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
  }

  .tabbar .active {
    color: var(--text);
  }

  .tabbar svg.ic {
    width: 20px;
    height: 20px;
  }

  .only-mobile {
    display: inline-flex;
  }

  .hide-mobile {
    display: none !important;
  }

  .panel {
    width: 100vw;
    border-left: 0;
  }

  .topbar {
    padding: 0 8px 0 10px;
    gap: 6px;
  }

  .overlay {
    padding: 0;
    align-items: stretch;
  }

  .modal,
  .modal.narrow {
    width: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }

  .modal-cols {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .modal-main,
  .modal-side {
    overflow: visible;
  }

  .modal-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
  }

  .palette {
    border-radius: 0;
    border: 0;
    width: 100%;
    height: fit-content;
  }

  .cal {
    --gutter: 42px;
  }

  .cal-dayhead {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 5px 2px;
  }

  .cal-dayhead .load {
    display: none;
  }

  .settings {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }

  .set-nav .sb-item {
    width: auto;
    white-space: nowrap;
  }

  .set-body {
    padding: 14px 12px 40px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fab {
    position: fixed;
    right: 14px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 30;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 16px;
    background: var(--ink);
    color: var(--on-ink);
    box-shadow: var(--shadow-2);
    display: grid;
    place-items: center;
  }

  .fab svg.ic {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 821px) {
  .fab {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Date and time fields */

.date-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}

.input.date {
  width: 110px;
  padding-left: 7px;
  padding-right: 24px;
  font-variant-numeric: tabular-nums;
}

.date-field > .btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: var(--muted);
}

.input.clock {
  width: 54px;
  flex: none;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.modal-side .row-inline {
  gap: 4px;
}

/* The browser's own date picker, kept only for its calendar popup. */
.native-date {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Task list on a phone: the title and where the task stands in the plan. */
@media (max-width: 820px) {
  .list {
    --cols: 26px minmax(0, 1fr) auto;
    min-width: 0;
  }

  .list-head > :not(:first-child, :nth-child(2), :last-child),
  .list .row > .cell:not(:last-child) {
    display: none;
  }

  .list .row > .cell:last-child {
    max-width: 44vw;
    justify-content: flex-end;
  }

  .list .row > .cell:last-child .muted.ellipsis {
    display: none;
  }

  .list-head > :last-child {
    text-align: right;
  }
}
