/* VOLNY.STUDIO · work — тёмная тема: чёрный, графит, серебро (как логотип) */
:root {
  --bg: #000000;
  --s1: #141516;          /* графит: карточки */
  --s2: #1f2022;          /* графит светлее: поля, нажатое */
  --s3: #2b2c2f;          /* линии и рамки */
  --ink: #e9eaec;         /* серебро: текст */
  --muted: #8b8e94;
  --dim: #5d6066;
  --silver: linear-gradient(180deg, #f4f4f5 0%, #a9abaf 100%);
  --ok: #5fbf8d;
  --warn: #e3b448;
  --hot: #f07c42;
  --late: #f2554f;
  --r: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); }
body {
  color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.amount, .stat .v, .big .v, .ring .c, .datechip { font-variant-numeric: tabular-nums; }
a.btn, a.chip { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid #c9cbcf; outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--late); }
.center { text-align: center; padding: 56px 0; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; display: block; }

/* шапка */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px; background: rgba(0,0,0,.86); backdrop-filter: blur(12px);
  max-width: 760px; margin: 0 auto;
}
.top img { height: 26px; width: auto; display: block; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--silver); color: #111; border: 0; padding: 0;
}
main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; }

/* заголовок экрана */
.screen-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.screen-title h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--s1); color: var(--ink);
  display: grid; place-items: center; padding: 0; cursor: pointer; flex: none;
}
.iconbtn.silver { background: var(--silver); color: #111; }
.iconbtn.sm { width: 34px; height: 34px; border-radius: 10px; }
.iconbtn.danger { color: var(--late); }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); padding: 6px 0; cursor: pointer; }
.back svg { transform: rotate(180deg); width: 18px; height: 18px; }

/* кнопки */
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 650; cursor: pointer;
  background: var(--silver); color: #111; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.ghost { background: var(--s2); color: var(--ink); font-weight: 550; }
.btn.block { width: 100%; }
.btn:disabled, .iconbtn:disabled { opacity: .45; }

/* поиск и фильтры */
.search { display: flex; align-items: center; gap: 8px; background: var(--s1); border-radius: 12px; padding: 0 12px; margin-bottom: 10px; }
.search svg { color: var(--dim); }
.search input { flex: 1; background: none; border: 0; padding: 11px 0; outline: none; min-width: 0; }
.seg { display: flex; gap: 4px; background: var(--s1); border-radius: 12px; padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.seg button {
  flex: 1; border: 0; background: none; color: var(--muted); padding: 8px 10px; border-radius: 9px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 550; font-size: 14px; cursor: pointer;
}
.seg button[aria-pressed=true] { background: var(--s3); color: var(--ink); }
.seg button svg { width: 18px; height: 18px; }

/* список проектов */
.group { margin-bottom: 14px; }
.group-head { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 6px; color: var(--muted); font-size: 13px; }
.group-head b { color: var(--ink); font-size: 15px; }
.group-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { background: var(--s1); border-radius: var(--r); overflow: hidden; }
.tile {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none;
  text-align: left; cursor: pointer;
}
.tile + .tile { border-top: 1px solid var(--s3); }
.tile:active { background: var(--s2); }
.tile .body { flex: 1; min-width: 0; }
.tile .t1 { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.tile .t2 { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .end { color: var(--dim); }
.tile .amount { font-weight: 650; white-space: nowrap; }
.typeic { color: var(--muted); width: 16px; height: 16px; }

/* кольцо срока: дуга — доля закрытых этапов, цвет — метка срока, в центре — дни */
.ring { position: relative; width: 46px; height: 46px; flex: none; }
.ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: var(--s3); }
.ring .arc { stroke-linecap: round; }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; font-weight: 700; font-size: 14px; line-height: 1; }
.ring .c small { display: block; font-size: 9px; font-weight: 600; color: var(--muted); margin-top: 1px; text-align: center; }
.ring .c svg.i { transform: none; width: 18px; height: 18px; }
.ring.lg { width: 64px; height: 64px; }
.ring.lg > svg { width: 64px; height: 64px; }
.ring.lg .c { font-size: 19px; }
.m-ok { color: var(--ok); stroke: var(--ok); }
.m-soon { color: var(--warn); stroke: var(--warn); }
.m-hot { color: var(--hot); stroke: var(--hot); }
.m-late { color: var(--late); stroke: var(--late); }
.m-done { color: var(--ok); stroke: var(--ok); }
.m-pause, .m-none { color: var(--muted); stroke: var(--muted); }

/* карточка проекта */
.hero { background: var(--s1); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.hero-top { display: flex; gap: 14px; align-items: center; }
.hero-top .body { flex: 1; min-width: 0; }
.hero h1 { font-size: 30px; line-height: 1.05; margin: 0; letter-spacing: -.02em;
  background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .who { color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 6px 10px;
  background: var(--s2); color: var(--ink); font-size: 13px; font-weight: 550; cursor: pointer;
}
.chip svg { width: 15px; height: 15px; }
.chip.static { cursor: default; color: var(--muted); }
.panel { background: var(--s1); border-radius: var(--r); padding: 4px 0; margin-bottom: 12px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; width: 100%; border: 0; background: none; text-align: left; }
button.row { cursor: pointer; }
button.row:active { background: var(--s2); }
.row + .row { border-top: 1px solid var(--s3); }
.row .body { flex: 1; min-width: 0; }
.row .t1 { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row .end { color: var(--muted); font-size: 13px; white-space: nowrap; text-align: right; }
.row .amount { font-weight: 650; color: var(--ink); font-size: 15px; white-space: nowrap; }
.row .ic { color: var(--muted); }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--s3); }
.dot svg { width: 13px; height: 13px; stroke-width: 2.6; }
.dot.done { background: var(--ok); border-color: var(--ok); color: #06140c; }
.dot.active { border-color: var(--ink); }
.dot.active::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.dot.waiting { border-color: var(--muted); color: var(--muted); }
.datechip { font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 8px; background: var(--s2); color: var(--muted); white-space: nowrap; }
.datechip.m-soon { background: rgba(227,180,72,.14); color: var(--warn); }
.datechip.m-hot { background: rgba(240,124,66,.16); color: var(--hot); }
.datechip.m-late { background: rgba(242,85,79,.16); color: var(--late); }
.datechip.m-ok { background: rgba(95,191,141,.12); color: var(--ok); }
.add { display: flex; align-items: center; gap: 10px; color: var(--muted); border: 0; border-top: 1px solid var(--s3); background: none; padding: 12px 16px; cursor: pointer; width: 100%; font-weight: 550; }
.add:first-child { border-top: 0; }
.add svg { width: 18px; height: 18px; }
details.fold + details.fold { border-top: 1px solid var(--s3); }
details.fold summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-weight: 600;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary .n { color: var(--muted); font-weight: 500; margin-left: auto; }
details.fold summary .chev { transition: transform .15s; color: var(--dim); }
details.fold[open] summary .chev { transform: rotate(90deg); }
details.fold summary svg:first-child { color: var(--muted); }
details.fold .row { padding-left: 46px; border-top: 1px solid var(--s3); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.stat { background: var(--s2); border-radius: 12px; padding: 10px 12px; }
.stat .l { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.stat .v.pos { color: var(--ok); }
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 8px 12px; padding: 12px 16px; }
.kv .k { color: var(--muted); }
.kv .v { overflow-wrap: anywhere; }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 0; }
.phead h2 { font-size: 13px; margin: 0; color: var(--muted); font-weight: 600; }
.contacts { display: flex; gap: 8px; padding: 0 16px 12px; }
.empty { color: var(--muted); text-align: center; padding: 22px 16px; }
.feed .row { align-items: flex-start; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--s2); color: var(--muted); margin: 4px 4px 0 0; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--late); }
.note { color: var(--muted); font-size: 13px; padding: 0 4px 12px; display: flex; gap: 8px; align-items: center; }

/* финансы */
.big { background: var(--s1); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.big .l { color: var(--muted); font-size: 13px; }
.big .v { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0 10px;
  background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bar { height: 6px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--silver); }
.bar.warn i { background: var(--warn); } .bar.bad i { background: var(--late); }
.monthnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.monthnav strong { text-transform: capitalize; }
select.mini { background: var(--s2); border: 0; border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--muted); margin-top: 6px; width: auto; max-width: 100%; }
.more { text-align: center; margin: 12px 0; }

/* нижние вкладки */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center;
  background: rgba(10,10,11,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--s2);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabs[hidden] { display: none; }
.tabs button {
  flex: 1; max-width: 140px; border: 0; background: none; color: var(--dim); display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 6px 4px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.tabs button svg { width: 23px; height: 23px; }
.tabs button[aria-current=page] { color: var(--ink); }

/* нижняя панель (sheet) */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); animation: fade .15s ease-out; }
.sheet {
  position: relative; background: var(--s1); border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); max-width: 760px; width: 100%; margin: 0 auto;
  animation: up .2s cubic-bezier(.2,.8,.2,1);
}
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--s3); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 19px; margin: 0; }
.sheet .panel { background: var(--s2); }
.sheet .row + .row { border-color: var(--s3); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg { animation: none; } }

/* формы */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea {
  background: var(--s2); border: 1px solid transparent; border-radius: 12px; padding: 11px 12px; width: 100%; min-width: 0; outline: none;
}
.sheet input, .sheet select, .sheet textarea { background: var(--bg); }
input:focus, select:focus, textarea:focus { border-color: #6b6e74; }
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: #c9cbcf; flex: none; padding: 0; }
input[type=date] { color-scheme: dark; }
.checks { display: grid; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.check + .check { border-top: 1px solid var(--s3); }
.check.done span { color: var(--muted); text-decoration: line-through; }
.statusbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; }
.statusbar button { border: 0; background: none; color: var(--muted); border-radius: 9px; padding: 8px 2px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; }
.statusbar button svg { width: 18px; height: 18px; }
.statusbar button[aria-pressed=true] { background: var(--s3); color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .grow { flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--s3); }
.steps i.on { background: var(--silver); }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 480px;
  background: #e9eaec; color: #111; padding: 12px 16px; border-radius: 12px; z-index: 30; font-weight: 550;
}
.copy { display: flex; gap: 8px; }
.copy input { font-size: 13px; }

/* вход */
.login { max-width: 360px; margin: 18vh auto 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
.login img { width: 240px; }

@media (max-width: 380px) { .two { grid-template-columns: 1fr; } .kv { grid-template-columns: 92px 1fr; } }
.top[hidden] { display: none; }

/* вкладки проекта: на узком экране у неактивных — только иконка */
.seg.compact button:not([aria-pressed=true]) .lbl { display: none; }
.seg.compact button { flex: 0 1 auto; padding: 8px 12px; }
.seg.compact button[aria-pressed=true] { flex: 1 0 auto; }
a.body { text-decoration: none; }
.steps { margin-top: 6px; }

.avatar { position: relative; overflow: hidden; flex: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
