/* Layout and components. Colors, fonts, radii, shadows come from theme.css only. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); }
.num, .stat__value, .kpi__value { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: var(--radius-sm); }

svg { flex: none; }
.tool svg, .icon-btn svg, .btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 32px;
  background: var(--bg-glass);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; white-space: nowrap; }
.brand__mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, var(--orb-glow), var(--orb-1) 55%, var(--orb-2));
  box-shadow: 0 0 0 4px var(--accent-2-soft);
}
.tabs {
  display: flex; gap: 2px; padding: 4px;
  background: var(--surface-sunken); border-radius: var(--radius-pill);
}
.tab {
  border: 0; background: transparent;
  padding: 7px 18px; border-radius: var(--radius-pill);
  color: var(--text-muted); font-weight: 560; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.topbar__meta { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: var(--fs-sm); color: var(--text-muted); }
.sync { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot--ok { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot--warn { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-soft); }

.banner {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 16px; background: var(--warn-soft); color: var(--warn-text);
  font-weight: 560; font-size: var(--fs-sm);
}

main { max-width: 1680px; margin: 0 auto; padding: 24px 32px 56px; }

/* ---------- Cards and common bits ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-width: 0;
}
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 640; letter-spacing: -0.01em; }
.card__sub { margin: 2px 0 0; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.tag--ok { background: var(--ok-soft); color: var(--ok-text); }
.tag--warn { background: var(--warn-soft); color: var(--warn-text); }
.tag--none { background: var(--muted-soft); color: var(--text-muted); }
.tag--accent { background: var(--accent-soft); color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--text-muted); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn[disabled] { opacity: .7; cursor: progress; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: var(--fs-sm); }
.linkish:hover { text-decoration: underline; }

.spin {
  width: 14px; height: 14px; flex: none; display: inline-block;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 6px 0 2px; }
.empty__title { margin: 0; font-weight: 600; }
.empty__hint { margin: 4px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }

.rich { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.rich a, .msg a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* Long texts fold to ~7 lines with a soft fade (works for headings and lists too). */
.clamp {
  max-height: 11.2em; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, var(--text) 62%, transparent);
  mask-image: linear-gradient(to bottom, var(--text) 62%, transparent);
}

/* Markdown from Claude and summaries (md.js): headings, lists, quotes, code — calm and readable. */
.md, .msg.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .65em; }
.md h3, .md h4 { font-family: var(--font-display); line-height: 1.3; margin: 1em 0 .3em; }
.md h3 { font-size: var(--fs-md); font-weight: 680; letter-spacing: -0.005em; }
.md h4 { font-size: var(--fs-sm); font-weight: 650; color: var(--text-muted); text-transform: none; }
.md ul, .md ol { margin: 0 0 .65em; padding-left: 1.25em; }
.md li { margin: .12em 0; padding-left: .15em; }
.md li::marker { color: var(--accent-2-text); }
.md blockquote { margin: 0 0 .65em; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent-2); color: var(--text-muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: .9em 0; }
.md code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-sunken); padding: .08em .35em; border-radius: 5px; }
.md pre { margin: 0 0 .65em; padding: 10px 12px; background: var(--surface-sunken); border-radius: var(--radius-sm); overflow-x: auto; white-space: pre; }
.md pre code { background: none; padding: 0; font-size: var(--fs-sm); }

/* ---------- Overview grid ---------- */
.ov-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 340px;
  gap: 20px; align-items: start;
}
.ov-left, .ov-main, .ov-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1280px) {
  .ov-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .ov-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}

/* ---------- Assistant ---------- */
.assistant { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.assistant__hello { text-align: left; }
.greeting { margin: 0; font-size: var(--fs-hero); line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; }
.date { margin: 6px 0 0; color: var(--text-muted); }
.orb-wrap { position: relative; align-self: center; width: 220px; height: 220px; margin: 4px 0 -4px; }
.orb { display: block; width: 100%; height: 100%; cursor: pointer; border-radius: 50%; touch-action: manipulation; }
.orb:focus-visible { box-shadow: 0 0 0 4px var(--focus-ring); }
.orb-state { margin: 0; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); min-height: 20px; }
.cam {
  position: absolute; right: -26px; bottom: 4px;
  width: 104px; height: 78px; border-radius: 14px; overflow: hidden;
  border: 3px solid var(--surface); background: var(--surface-sunken); box-shadow: var(--shadow-lg);
}
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam__dot { position: absolute; top: 7px; left: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger-text); box-shadow: 0 0 0 2px var(--surface); }

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; scroll-behavior: smooth; padding: 2px 2px 2px 0; }
.chat:empty { display: none; }
.msg {
  max-width: 90%; padding: 9px 13px; border-radius: 16px;
  line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg--me { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 5px; }
.msg--bot { align-self: flex-start; background: var(--surface-sunken); border-bottom-left-radius: 5px; }
.msg--status { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: var(--fs-sm); padding: 2px 4px; }
.msg--error { align-self: flex-start; background: var(--danger-soft); color: var(--danger-text); }
.msg--notice { align-self: flex-start; background: var(--warn-soft); color: var(--warn-text); }
.msg__imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.msg__imgs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.msg__voice { color: var(--text-muted); font-style: italic; }

.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-pill); padding: 5px 12px; font-size: var(--fs-sm); color: var(--text);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.attachments:empty { display: none; }
.att { position: relative; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att__x {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: var(--surface); color: var(--text); font-size: 13px; line-height: 20px; padding: 0;
  box-shadow: var(--shadow-sm);
}

.hint { margin: 0; font-size: var(--fs-sm); }
.hint--error { background: var(--danger-soft); color: var(--danger-text); padding: 8px 12px; border-radius: var(--radius); }

.composer {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px;
  padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.composer textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; resize: none;
  padding: 8px 0; max-height: 160px; line-height: 1.4; overflow: hidden;
}
.composer textarea::placeholder { color: var(--text-muted); }
.icon-btn {
  width: 38px; height: 38px; flex: none; border-radius: 13px; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted);
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text); }
.icon-btn.is-on { background: var(--accent-soft); color: var(--accent); }
.icon-btn--accent { background: var(--accent); color: var(--on-accent); }
.icon-btn--accent:hover { background: var(--accent-hover); color: var(--on-accent); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-size: var(--fs-sm); font-weight: 560;
}
.tool svg { width: 16px; height: 16px; }
.tool:hover { border-color: var(--border-strong); }
.tool[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tool--stop { border-color: var(--danger-soft); background: var(--danger-soft); color: var(--danger-text); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 560; cursor: pointer; padding: 4px 4px 4px 2px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  width: 34px; height: 20px; border-radius: var(--radius-pill); background: var(--border-strong);
  position: relative; transition: background .2s; flex: none;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------- Project list (overview) ---------- */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.plist li:first-child { border-top: 0; padding-top: 2px; }
.plist__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist__when { font-size: var(--fs-sm); color: var(--text-muted); }
.plist__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--border-strong)); flex: none; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; min-height: 150px; }
.stat__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-num); font-weight: 640; line-height: 1; letter-spacing: -0.025em; }
.stat__unit { font-size: var(--fs-md); font-weight: 500; color: var(--text-muted); letter-spacing: 0; margin-left: 4px; }
.stat__foot { margin-top: auto; font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; }
.stat .tag, .pcard p .tag { white-space: normal; line-height: 1.35; border-radius: var(--radius); max-width: 100%; }
.stat__row { display: flex; align-items: center; gap: 16px; }
.stat--silent .stat__value, .stat--silent .mrow__v { color: var(--text-muted); }
.mrows { display: flex; flex-direction: column; gap: 4px; }
.mrow { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.mrow__k { color: var(--text-muted); }
.mrow__v { font-weight: 640; font-variant-numeric: tabular-nums; }

/* ---------- Charts ---------- */
.ring text { font-family: var(--font-display); }
.chart-card { padding-bottom: 16px; }
.area-chart { position: relative; height: 290px; }
.area-chart svg, .mini svg { display: block; width: 100%; height: 100%; overflow: visible; }
.axis-label { fill: var(--axis); font-size: 12px; font-family: var(--font); }
.chart-empty { fill: var(--text-muted); font-size: 14px; font-family: var(--font); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.hbars { display: flex; align-items: flex-end; gap: 6px; }
.hbars--dense { gap: 3px; }
.hbars__slot { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; min-width: 0; }
.hbars__slot i { display: block; width: 100%; max-width: 26px; border-radius: 4px 4px 2px 2px; background: var(--accent-2); opacity: .8; }
.hbars--dense .hbars__slot i { max-width: none; border-radius: 3px 3px 1px 1px; }
.hbars__slot i.is-last { background: var(--accent); opacity: 1; }
.hbars__slot i.is-zero { background: var(--grid); opacity: 1; }
.hbars__slot:hover i:not(.is-zero) { opacity: 1; }
.hbars--trend .hbars__slot i { position: absolute; bottom: 0; max-width: 34px; opacity: 1; }
.hbars--trend .hbars__slot i.is-total { background: var(--surface-sunken); }
.hbars--trend .hbars__slot i.is-done { background: var(--accent); }
.hbars__axis { display: flex; gap: 6px; margin-top: 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.hbars__axis span { flex: 1; text-align: center; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tip {
  position: fixed; z-index: 70; pointer-events: none; min-width: 120px; max-width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: var(--fs-sm); line-height: 1.45;
}
.tip__title { font-weight: 650; margin-bottom: 4px; }
.tip__row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip__row span:first-child { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); }
.tip__row b { font-variant-numeric: tabular-nums; }
.tip__total { border-top: 1px solid var(--border); margin-top: 5px; padding-top: 5px; }

/* ---------- Tasks ---------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; padding-top: 2px; }
.task__body { flex: 1; min-width: 0; }
.task__text { overflow-wrap: anywhere; }
.task__meta { font-size: var(--fs-sm); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.task.is-done .task__text { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.overdue { color: var(--danger-text); font-weight: 600; }
.check {
  width: 22px; height: 22px; flex: none; margin-top: 1px; padding: 0;
  border-radius: 7px; border: 1.6px solid var(--border-strong); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, transform .15s;
}
.check:hover { border-color: var(--accent); }
.check svg { width: 14px; height: 14px; fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check.is-done { background: var(--accent); border-color: var(--accent); cursor: default; }
.check.is-done svg { opacity: 1; }
.check.is-busy { transform: scale(.9); }

/* ---------- Summary / analysis blocks ---------- */
.summary__period { font-size: var(--fs-sm); color: var(--text-muted); margin: 0 0 8px; }
.more { margin-top: 10px; }

/* ---------- Page heads (other sections) ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; }

/* ---------- Projects section ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 20px; align-items: start; }
.pcard { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; }
.pcard__top { display: flex; align-items: flex-start; gap: 12px; }
.pcard__title { margin: 0; font-size: var(--fs-lg); font-weight: 650; display: flex; align-items: center; gap: 10px; }
.pcard__desc { margin: 4px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.pcard__top .tag { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi__value { font-family: var(--font-display); font-size: 26px; font-weight: 640; line-height: 1.1; letter-spacing: -0.02em; }
.kpi__label { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }
.psec__title { margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 650; color: var(--text-muted); }
.pcols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.build { padding: 10px 0; border-top: 1px solid var(--border); }
.build:first-of-type { border-top: 0; padding-top: 0; }
.build__head { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.build__title { font-weight: 600; }
.progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.files { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.files li { display: flex; gap: 10px; padding: 5px 0; align-items: baseline; }
.files__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files__dir { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.files__when { color: var(--text-muted); white-space: nowrap; }
.analysis { background: var(--accent-2-soft); border-radius: var(--radius); padding: 14px 16px; }
.analysis__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.analysis__head h3 { margin: 0; font-size: var(--fs-md); font-weight: 650; }
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; }

/* ---------- Notes section ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin-bottom: 16px; padding: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--grow { flex: 1; min-width: 200px; }
.field__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.field select, .field input {
  height: 38px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  padding: 0 12px; outline: none; min-width: 180px;
}
.field select:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-sunken); border-radius: var(--radius-pill); }
.seg__btn { border: 0; background: transparent; padding: 6px 13px; border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 560; color: var(--text-muted); }
.seg__btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.check-line { display: inline-flex; align-items: center; gap: 8px; height: 38px; font-size: var(--fs-sm); font-weight: 560; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.notes-card { padding: 6px 22px 12px; }
.day { margin: 18px 0 2px; font-size: var(--fs-sm); font-weight: 650; color: var(--text-muted); }
.note { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.day + .note { border-top: 0; }
.note__icon { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: var(--muted-soft); color: var(--text-muted); font-size: 12px; margin-top: 1px; }
.note__body { flex: 1; min-width: 0; }
.note__items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.note__items li { display: flex; gap: 10px; align-items: flex-start; }
.note__items .check { width: 20px; height: 20px; border-radius: 6px; }
.note__items li.is-done span { color: var(--text-muted); text-decoration: line-through; }

/* ---------- Summaries section ---------- */
.sums { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.sum__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sum__head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 650; }
.sum__text { max-width: 72ch; }

/* ---------- Confirmations and toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 12px; width: min(400px, calc(100vw - 32px)); }
.confirm { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 16px 18px; animation: rise .25s ease-out; }
.confirm__label { font-size: var(--fs-xs); font-weight: 650; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.confirm__text { margin: 6px 0 14px; font-weight: 560; overflow-wrap: anywhere; }
.confirm__actions { display: flex; gap: 8px; }
.toast { background: var(--text); color: var(--surface); border-radius: var(--radius); padding: 11px 16px; font-size: var(--fs-sm); box-shadow: var(--shadow-lg); animation: rise .25s ease-out; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.drop { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 24px; }
.drop__box { background: var(--surface); border: 2px dashed var(--accent); border-radius: var(--radius-lg); padding: 40px 48px; font-size: var(--fs-lg); font-weight: 600; box-shadow: var(--shadow-lg); }

/* ---------- Login / expired pages ---------- */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate__card { max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 36px 36px 28px; }
.gate__card h1 { margin: 18px 0 8px; font-size: var(--fs-xl); line-height: 1.25; letter-spacing: -0.02em; }
.gate__card p { margin: 0 0 12px; }
.gate__orb { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, var(--orb-glow), var(--orb-1) 55%, var(--orb-2)); box-shadow: 0 0 0 8px var(--accent-2-soft); }
.gate__steps { margin: 4px 0 16px; padding-left: 22px; }
.gate__steps li { margin: 6px 0; }

/* ---------- One column: narrow screens and inside Telegram ---------- */
.one-col .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
.one-col .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
.one-col .tab { flex: 1; padding: 7px 10px; }
.one-col .topbar__meta { margin-left: auto; }
.one-col main { padding: 16px 16px 40px; }
.one-col .ov-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.one-col .ov-left, .one-col .ov-main { gap: 16px; }
.one-col .ov-right { grid-column: auto; display: flex; flex-direction: column; gap: 16px; }
.one-col .ov-main { order: 2; }
.one-col .ov-right { order: 3; }
.one-col .ov-left { display: contents; }
.one-col .assistant { order: 1; padding: 20px; }
.one-col .ov-left > section:not(.assistant) { order: 4; }
.one-col .orb-wrap { width: 176px; height: 176px; }
.one-col .greeting { font-size: var(--fs-xl); }
.one-col .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.one-col .stat { padding: 14px 16px; min-height: 140px; }
.one-col .stat__value { font-size: 34px; }
.one-col .area-chart { height: 230px; }
.one-col .pgrid { grid-template-columns: minmax(0, 1fr); }
.one-col .pcard { padding: 18px; }
.one-col .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.one-col .pcols { grid-template-columns: minmax(0, 1fr); }
.one-col .filters { padding: 14px 16px; }
.one-col .field select, .one-col .field input { min-width: 0; width: 100%; }
.one-col .field { width: 100%; }
.one-col .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
.one-col .card { padding: 16px 18px; }

@media (max-width: 420px) {
  .one-col .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .one-col .stat__row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
  .spin { animation: none; border-right-color: currentColor; opacity: .6; }
}
