:root {
  color-scheme: light;
  --bg: #f7f7f6;
  --paper: #fff;
  --ink: #18191a;
  --muted: #606366;
  --line: #e4e4e2;
  --soft: #eeeeec;
  --danger: #8c2831;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); }
h1,h2,h3,p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 1.11rem; font-weight: 780; line-height: 1.15; letter-spacing: -.045em; }
h2 { font-size: 1.4rem; line-height: 1.16; letter-spacing: -.04em; }
h3 { font-size: 1.06rem; line-height: 1.3; letter-spacing: -.025em; }
p, small { overflow-wrap: anywhere; }
small { color: var(--muted); }
.shell {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  max-width: 1190px;
  margin: 0 auto;
  padding: 38px clamp(22px, 4vw, 60px) 64px;
  gap: 42px;
}
.rail { min-width: 0; align-self: start; position: sticky; top: 38px; }
.masthead { display: flex; align-items: center; gap: 11px; padding: 0 0 26px; }
.masthead p { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.brand { flex: none; border-radius: 12px; box-shadow: 0 1px 2px #0001; }
.tabs { display: grid; gap: 4px; }
.tabs button {
  color: var(--muted);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 9px 12px;
  min-height: 46px;
}
.tabs button:hover { background: var(--soft); }
.tabs button[aria-current="page"] { color: var(--ink); background: #e9e9e7; font-weight: 750; }
.nav-icon {
  display: inline-block; position: relative; flex: none;
  width: 16px; height: 16px; color: currentColor;
}
.nav-icon::before,.nav-icon::after { position: absolute; content: ""; }
.nav-tasks { border: 1.5px solid currentColor; border-radius: 4px; }
.nav-tasks::before { inset: 4px 3px auto; height: 1.5px; background: currentColor; box-shadow: 0 4px currentColor; }
.nav-chats { border: 1.5px solid currentColor; height: 13px; border-radius: 5px; margin-bottom: 3px; }
.nav-chats::after { width: 4px; height: 4px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; bottom: -3px; left: 2px; transform: skewY(-29deg); background: inherit; }
.nav-integrations::before,.nav-integrations::after { width: 8px; height: 5px; border: 1.5px solid currentColor; border-radius: 8px; transform: rotate(-42deg); }
.nav-integrations::before { top: 2px; right: 0; }
.nav-integrations::after { bottom: 2px; left: 0; }
.nav-telegram { background: currentColor; clip-path: polygon(2% 45%, 98% 4%, 77% 96%, 54% 74%, 37% 90%, 29% 58%); }
.nav-telegram::after { width: 9px; height: 1.5px; top: 8px; left: 5px; background: var(--bg); transform: rotate(-39deg); }
.workspace,.panel,.item-content { min-width: 0; }
.page-head { margin-bottom: 21px; }
.page-head h2,.admin h1 { font-size: clamp(2.1rem, 6vw, 3.75rem); font-weight: 820; letter-spacing: -.072em; line-height: .99; }
.section-head,.row,.actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel > .muted { margin: 9px 0 16px; }
.feature {
  isolation: isolate; min-height: 206px; position: relative; display: grid; align-items: end; overflow: hidden;
  margin-bottom: 28px; padding: clamp(18px,4vw,34px); border-radius: 28px; border: 1px solid #dfdfdd;
  background: linear-gradient(115deg, #e7e7e5 0%, #f1f1ef 57%, #d4d4d2 100%);
}
.feature-art {
  position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(ellipse at 82% 38%, #ffffffbe, transparent 55%), url('/assets/feature.webp') right center / auto 113% no-repeat;
  animation: art-in .48s ease-out both;
}
.feature-info { width: min(385px, 67%); }
.feature-info > p:first-child { font-size: .88rem; color: #4d5052; font-weight: 690; margin-bottom: 6px; }
.feature-info h3 { font-size: clamp(1.65rem, 4.6vw, 2.76rem); letter-spacing: -.065em; line-height: 1; }
.feature-detail { margin-top: 9px; color: #55585b; font-size: .9rem; }
.list-heading { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; }
.list-heading span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.stack,.form { display: grid; gap: 9px; }
.card {
  display: grid; gap: 8px; padding: 15px 16px; border: 1px solid var(--line);
  background: var(--paper); border-radius: 18px;
}
.card.active { border-color: #a6a6a3; }
.task-card { grid-template-columns: 37px minmax(0,1fr); gap: 13px; }
.item-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: #edeeec; }
.item-content { display: grid; gap: 5px; }
.card .details { color: var(--muted); white-space: pre-wrap; font-size: .89rem; }
.card .actions { justify-content: flex-start; gap: 5px; margin-top: 5px; }
.pill { flex: none; background: var(--soft); color: #4e5153; border-radius: 100px; padding: 3px 9px; font-size: .73rem; font-weight: 650; }
.pill.live { color: var(--ink); }
.pill.live::before { content: ""; display: inline-block; width: 5px; height: 5px; vertical-align: .16em; margin-right: 6px; border-radius: 50%; background: currentColor; }
button,input,select,textarea { font: inherit; }
button { border: 0; border-radius: 100px; min-height: 40px; padding: 7px 14px; cursor: pointer; font-size: .89rem; font-weight: 680; color: #fff; background: #1d1e20; }
button:hover { filter: brightness(.93); }
button.primary { min-height: 46px; padding-inline: 19px; }
button.primary span { margin-right: 4px; font-size: 1.15em; }
button.secondary { background: var(--soft); color: var(--ink); }
.card button.secondary,.card button.danger { min-height: 34px; font-size: .8rem; padding: 5px 10px; }
button.danger { background: #f5eded; color: var(--danger); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid #5b6367; outline-offset: 3px; }
label { display: grid; gap: 5px; font-size: .9rem; color: var(--muted); }
input,select,textarea { width: 100%; min-width: 0; border: 1px solid #d7d7d4; border-radius: 12px; padding: 9px 11px; color: var(--ink); background: #fafaf9; }
textarea { resize: vertical; min-height: 96px; }
.form { gap: 13px; }
.inline-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; }
.alert { padding: 11px 14px; border: 1px solid var(--line); background: var(--paper); border-radius: 13px; margin-bottom: 14px; }
.error { color: var(--danger); font-size: .9rem; }
.muted { color: var(--muted); }
.empty { padding: 22px 16px; border: 1px dashed #d0d0ce; border-radius: 16px; }
dialog { width: min(530px, calc(100% - 24px)); max-height: 90dvh; border: 1px solid var(--line); border-radius: 25px; padding: 23px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px #0003; }
dialog[open] { animation: enter .21s ease-out; }
dialog::backdrop { background: #12141470; }
dialog .actions { margin-top: 17px; justify-content: flex-end; }
code { overflow-wrap: anywhere; }
.admin .shell { display: block; max-width: 835px; }
.admin .masthead { padding-bottom: 27px; }
.admin .masthead p { margin-top: 7px; }
.admin .panel { border: 1px solid var(--line); border-radius: 24px; background: var(--paper); padding: clamp(15px, 4vw, 28px); }
.admin .panel > :not(:first-child) { margin-top: 15px; }
.admin .form h2 { margin-bottom: 2px; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
@keyframes art-in { from { opacity: .55; transform: translateX(13px); } }
@media (max-width: 720px) {
  .shell { display: block; padding: 15px 17px calc(86px + env(safe-area-inset-bottom)); }
  .rail { position: static; }
  .masthead { padding-bottom: 28px; }
  .masthead .brand { width: 38px; height: 38px; border-radius: 10px; }
  .tabs {
    position: fixed; z-index: 2; bottom: 0; left: 0; right: 0;
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #f7f7f6fa; border-top: 1px solid var(--line);
  }
  .tabs button { flex-direction: column; justify-content: center; gap: 5px; min-height: 50px; font-size: .68rem; padding: 4px 1px; border-radius: 12px; }
  .feature { min-height: 172px; border-radius: 23px; margin-bottom: 22px; }
  .feature-art { background-size: auto, auto 105%; background-position: center, right -30px center; }
  .page-head { margin-bottom: 16px; }
  .page-head h2 { font-size: clamp(1.85rem, 8.3vw, 3rem); }
  .page-head button { font-size: .8rem; padding-inline: 12px; }
}
@media (max-width: 410px) {
  .task-card { grid-template-columns: 29px minmax(0,1fr); gap: 9px; padding: 12px; }
  .item-icon { width: 29px; height: 29px; border-radius: 8px; }
  .feature-detail { font-size: .8rem; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
