:root {
  color-scheme: dark;
  --canvas: #171c18;
  --rail: #181e19;
  --panel: #202720;
  --panel-hover: #252e24;
  --line: #354037;
  --soft: #9ca99c;
  --text: #f0f3ea;
  --lime: #d7ef7e;
  --mint: #b7c9a7;
  --warning: #f0b87b;
  --radius: 17px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 300px; background: var(--canvas); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: wait; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
[data-icon], .icon { display: inline-grid; place-items: center; flex: 0 0 auto; }
.icon svg, [data-icon] svg { width: 18px; height: 18px; }
.skip { position: fixed; z-index: 2; top: 12px; left: 12px; padding: 10px 16px; border-radius: 8px; background: var(--lime); color: var(--canvas); transform: translateY(-160%); }
.skip:focus { transform: none; }

.shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; height: 100vh; padding: 28px 16px 20px; background: var(--rail); border-right: 1px solid #303a31; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px; width: fit-content; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--lime); color: #222b15; flex-shrink: 0; }
.brand-icon svg { width: 29px; height: 29px; }
.brand strong { display: block; font-size: 13px; letter-spacing: .055em; }
.brand small { display: block; color: #a7b49f; font: 10px/1.5 var(--mono); letter-spacing: .07em; }
.nav-block { margin-top: 53px; }
.eyebrow { color: var(--soft); font: 600 11px/1.4 var(--mono); letter-spacing: .085em; }
.nav-title { padding-left: 11px; margin-bottom: 10px; font-size: 10px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 11px; color: #b9c3b6; border-radius: 9px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.nav-link + .nav-link { margin-top: 3px; }
.nav-link:hover { background: #262e25; color: var(--text); }
.nav-link.active { color: var(--lime); background: #2b3626; }
.nav-count { margin-left: auto; padding: 1px 6px; border-radius: 5px; background: #353f31; color: #dce3d5; font: 11px var(--mono); }
.rail-foot { margin-top: auto; }
.telegram-status { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; text-align: left; color: var(--text); background: #222b23; border: 1px solid var(--line); border-radius: 11px; }
.telegram-status:hover { background: #2b362b; }
.telegram-icon { display: grid; width: 32px; height: 32px; border-radius: 8px; place-items: center; color: #b0ccde; background: #2c3c3b; }
.telegram-status strong, .telegram-status small { display: block; }
.telegram-status strong { font-size: 13px; }
.telegram-status small { color: var(--soft); font-size: 10px; }
.status-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; flex: 0 0 auto; background: #859184; }
.status-dot.connected { background: var(--lime); box-shadow: 0 0 10px #d7ef7e66; }
.rail-foot > p { color: var(--soft); font-size: 11px; padding: 13px 2px 0; text-align: center; }
.rail-foot > p span { margin-right: 3px; }

.main { width: 100%; max-width: 1530px; padding: 24px clamp(24px, 3.1vw, 49px) 0; margin-inline: auto; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 35px; }
.crumb, .today-label { display: flex; align-items: center; gap: 8px; color: #aeb8ab; }
.crumb { font: 11px var(--mono); letter-spacing: .07em; }
.crumb-light { height: 7px; width: 7px; background: var(--lime); border-radius: 2px; box-shadow: 0 0 10px #d7ef7e42; }
.today-label { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; white-space: nowrap; }
.today-label svg { width: 15px; height: 15px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 28px 0 27px; }
h1 { font-size: clamp(42px, 5vw, 73px); font-weight: 720; line-height: 1; letter-spacing: -.072em; }
h1 span { color: var(--lime); }
.intro p { margin-top: 12px; color: #b5c1b3; font-size: 14px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 11px 15px; min-height: 43px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; line-height: 1.3; font-weight: 660; white-space: nowrap; }
.button.primary { color: #202914; background: var(--lime); }
.button.primary:not(:disabled):hover { background: #e8fb9c; }
.button.secondary { border-color: #424d41; background: #293328; color: #e3ebdc; }
.button.secondary:not(:disabled):hover { background: #354335; }
.button.danger { color: #2e1817; background: #f3a29a; }
.button.danger:not(:disabled):hover { background: #f8b2aa; }
.button.compact { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.button svg { width: 17px; height: 17px; }
.notice { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; padding: 10px 12px; background: #31291f; border: 1px solid #715837; border-radius: 10px; color: #f3d2a4; }
.notice p { flex: 1; font-size: 13px; }

.summary { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }
.focus, .brief { position: relative; border-radius: var(--radius); overflow: hidden; min-width: 0; min-height: 239px; }
.focus { display: flex; align-items: stretch; isolation: isolate; background: #313c25; border: 1px solid #4d5c3b; }
.focus-grid { position: absolute; z-index: -2; inset: 0; opacity: .3; background-image: linear-gradient(#647346 1px, transparent 1px), linear-gradient(90deg, #647346 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(90deg, transparent 10%, #000 100%); }
.radar { position: absolute; z-index: -1; width: min(71%, 440px); height: auto; right: -5%; top: 50%; transform: translateY(-50%); stroke: #b5d47b; stroke-width: 1; opacity: .27; pointer-events: none; }
.radar-scan, .radar-bird, .radar-dot { fill: #c1e486; }
.radar-scan { opacity: .21; }
.radar-bird { opacity: .54; }
.secondary-dot { opacity: .6; }
.focus-body { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 23px 25px; background: linear-gradient(90deg, #313c25 5%, #313c25c9 44%, #313c2516 100%); }
.focus-eyebrow { color: var(--lime); }
.focus-eyebrow span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--lime); vertical-align: 1px; }
.focus h2 { max-width: 480px; margin-top: 14px; font-size: clamp(24px, 2.8vw, 40px); line-height: 1.06; letter-spacing: -.046em; overflow-wrap: anywhere; }
.focus-description { max-width: 400px; margin: 8px 0 15px; color: #d1dbc6; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.focus-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.focus-time { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; color: #e0efbe; background: #23301e; border-radius: 7px; font: 12px var(--mono); }
.focus-time.overdue { color: #ffd6a9; background: #533d26; }
.focus-time svg { width: 14px; height: 14px; }
.brief { padding: 17px 18px; background: var(--panel); border: 1px solid var(--line); }
.brief-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 7px; }
.brief-head h2 { font-size: 17px; line-height: 1.2; letter-spacing: -.022em; }
.text-button { display: inline-flex; align-items: center; gap: 5px; color: var(--lime); background: transparent; padding: 2px 0; border: 0; font-size: 12px; font-weight: 620; white-space: nowrap; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-button svg { width: 14px; height: 14px; }
.brief-row { display: grid; width: 100%; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 45px; border: 0; border-top: 1px solid #364136; text-align: left; color: var(--text); background: transparent; padding: 6px 0; }
.brief-row:hover .brief-title { color: var(--lime); }
.brief-row .category-icon { width: 30px; height: 30px; border-radius: 7px; }
.brief-row .category-icon svg { width: 15px; height: 15px; }
.brief-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 630; }
.brief-date { text-align: right; color: var(--soft); font: 11px var(--mono); white-space: nowrap; }
.brief-date.overdue { color: var(--warning); }

.section { padding-top: 33px; scroll-margin-top: 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2 { margin-top: 4px; font-size: clamp(24px, 3.1vw, 35px); line-height: 1.16; letter-spacing: -.045em; }
.count-badge { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--soft); font: 11px var(--mono); white-space: nowrap; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.category-card { display: flex; flex-direction: column; min-width: 0; min-height: 178px; padding: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; transition: background .18s, border-color .18s; }
.category-card:hover, .category-card.selected { background: var(--panel-hover); border-color: #627454; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.category-icon { display: inline-grid; place-items: center; width: 35px; height: 35px; color: var(--category-ink, #d8e693); background: var(--category-bg, #36412a); border-radius: 9px; flex: 0 0 auto; }
.tone-violet { --category-ink: #d7c9fb; --category-bg: #3c344c; }
.tone-sky { --category-ink: #a9d9e9; --category-bg: #2d4347; }
.tone-rose { --category-ink: #f0bdc3; --category-bg: #4a343b; }
.tone-gold { --category-ink: #f1cf91; --category-bg: #493d2c; }
.tone-green { --category-ink: #b5e3b2; --category-bg: #2f4331; }
.tone-lilac { --category-ink: #c5caf9; --category-bg: #373a50; }
.tone-peach { --category-ink: #f1c5a9; --category-bg: #493a31; }
.card-count { color: var(--soft); font: 11px var(--mono); }
.category-card h3 { font-size: 15px; letter-spacing: -.013em; line-height: 1.25; }
.card-description { margin-top: 4px; color: #aeb9ab; font-size: 11.5px; line-height: 1.45; }
.card-footer { margin-top: auto; padding-top: 10px; }
.card-next { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; font-weight: 600; color: #cbd6c5; }
.card-link { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 5px; color: #dce7d1; font-size: 11px; white-space: nowrap; }
.card-link:hover { color: var(--lime); }
.card-link span:first-child { overflow: hidden; text-overflow: ellipsis; }
.card-link .overdue { color: var(--warning); }
.goal-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.goal-row button { color: var(--lime); border: 0; background: transparent; padding: 2px 0; font: 12px var(--mono); }
.goal-row button:hover { text-decoration: underline; }
.goal-row button svg { width: 11px; height: 11px; }
.goal-deadline { color: var(--soft); font-size: 10px; white-space: nowrap; }
.goal-meter { display: block; appearance: none; width: 100%; height: 4px; margin-bottom: 5px; border: 0; border-radius: 3px; background: #374236; }
.goal-meter::-webkit-progress-bar { background: #374236; border-radius: 3px; }
.goal-meter::-webkit-progress-value { background: var(--lime); border-radius: 3px; }
.goal-meter::-moz-progress-bar { background: var(--lime); border-radius: 3px; }

.agenda { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filters label { display: flex; align-items: center; gap: 7px; color: var(--soft); font-size: 12px; }
.filters select { padding: 7px 8px; max-width: min(70vw, 220px); font-size: 12px; }
.task-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 58px; border-top: 1px solid var(--line); }
.task-row-title { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 7px 0; text-align: left; border: 0; color: var(--text); background: transparent; }
.task-row-title:hover strong { color: var(--lime); }
.task-row-title strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.task-row-title small { display: block; color: var(--soft); font-size: 11px; overflow-wrap: anywhere; }
.task-row-time { color: #b4c2b0; font: 11px var(--mono); text-align: right; }
.task-row-time.overdue { color: var(--warning); }
.done-row strong { color: #9fac9b; text-decoration: line-through; }
.done-row .done-check { color: var(--lime); width: 28px; text-align: center; }
.check-button { display: grid; width: 29px; height: 29px; place-items: center; background: #263027; border: 1px solid #485646; border-radius: 8px; color: #9da997; }
.check-button svg { width: 14px; height: 14px; }
.check-button:hover { color: var(--lime); border-color: var(--lime); }
.empty-inline { padding: 15px 0; color: var(--soft); font-size: 13px; }

.connections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.report-list { display: grid; gap: 9px; }
.report-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; }
.report-card > .empty-inline { padding: 0 0 5px; }
.report-card summary { cursor: pointer; color: #dce7d5; }
.report-card summary:hover { color: var(--lime); }
.report-card summary span { display: inline-block; margin-left: 8px; color: var(--soft); font-size: 11px; }
.report-text { margin-top: 8px; color: #d6e1d1; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.connection-card { min-width: 0; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.connection-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 14px; }
.connection-card p { color: var(--soft); font-size: 12px; margin: 7px 0 9px; }
.connection-card a + a { margin-left: 8px; }
.connection-state { display: inline-flex; align-items: center; gap: 5px; color: #c6d3c1; border: 1px solid #485546; border-radius: 5px; padding: 2px 5px; font: 10px var(--mono); }
.connection-state.good { color: var(--lime); border-color: #687a47; }
.footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; padding: 18px 0 20px; border-top: 1px solid var(--line); color: var(--soft); font: 10px var(--mono); }
.footer div { display: flex; align-items: center; gap: 10px; }
.footer button { font: inherit; }
.footer a:hover { color: var(--lime); }

dialog { width: min(94vw, 540px); max-height: 88dvh; overflow: auto; padding: 23px; border: 1px solid #52614d; border-radius: 16px; background: #242d25; color: var(--text); box-shadow: 0 22px 72px #0b110dbb; }
dialog::backdrop { background: #0d120ddd; backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 15px; }
.dialog-head h2 { font-size: 22px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; min-width: 33px; height: 33px; color: #c6d2c3; background: #303b31; border: 1px solid #475447; border-radius: 8px; }
.icon-button:hover { color: var(--text); background: #3c493c; }
form { display: grid; gap: 12px; }
form label { display: block; color: #e1e9dc; font-size: 13px; font-weight: 600; }
form label small { color: var(--soft); font-size: 10px; margin-left: 3px; }
input, select, textarea { color: var(--text); background: #1b231c; border: 1px solid #465544; border-radius: 8px; }
form input, form select, form textarea { display: block; width: 100%; min-width: 0; margin-top: 5px; padding: 10px; font-size: 14px; }
input::placeholder, textarea::placeholder { color: #8e9c8b; }
textarea { resize: vertical; }
.form-hint { color: var(--soft); font-size: 12px; }
.form-error { color: #ffb5a9; font-size: 13px; margin: 5px 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.detail-description { white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0; color: #d6e1d1; }
.detail-badges, .share-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 13px; }
.detail-badges span { padding: 4px 7px; border-radius: 6px; background: #344135; color: #d7e2d0; font-size: 11px; }
.share-label { font-size: 13px; margin-top: 15px; color: var(--soft); }
.external-links { display: flex; flex-wrap: wrap; gap: 8px; }
.external-links a { color: var(--lime); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.pair-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.pair-code code { padding: 7px 8px; border-radius: 6px; color: var(--lime); background: #1b251b; overflow-wrap: anywhere; }
.telegram-copy { color: #c9d4c6; margin: 8px 0 14px; }
.toast { position: fixed; z-index: 2; right: 18px; bottom: 18px; max-width: calc(100% - 36px); padding: 11px 14px; border-radius: 9px; background: #d7ef7e; color: #202914; font-size: 13px; font-weight: 630; box-shadow: 0 7px 25px #0b110d99; }

.lock-screen { display: grid; place-items: center; min-height: 100dvh; padding: 18px; background: radial-gradient(ellipse at 75% 20%, #303e25, var(--canvas) 63%); }
.lock-card { width: min(100%, 420px); padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.lock-card .brand { margin: 0 0 24px; }
.lock-card h1 { font-size: 37px; margin-bottom: 10px; }
.lock-card p { color: #c0cbbb; font-size: 14px; margin-bottom: 15px; }
.lock-card .form-error { color: #ffb5a9; margin: 0; }

@media (max-width: 1250px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1030px) {
  .shell { grid-template-columns: 176px minmax(0, 1fr); }
  .rail { padding-inline: 10px; }
  .main { padding-inline: 22px; }
  .focus-body { padding-inline: 18px; }
  .brief { padding-inline: 13px; }
}
@media (max-width: 790px) {
  .shell { display: block; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px 7px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
  .brand { margin: 0; }
  .nav-block { grid-column: 1 / -1; grid-row: 2; margin-top: 2px; overflow-x: auto; }
  .nav-block nav { display: flex; width: max-content; min-width: 100%; }
  .nav-title, .rail-foot > p, .telegram-status small, .telegram-status .status-dot { display: none; }
  .nav-link { font-size: 12px; padding: 8px; }
  .nav-link + .nav-link { margin: 0; }
  .nav-link svg { width: 15px; height: 15px; }
  .telegram-status { padding: 4px 7px; }
  .telegram-status strong { font-size: 11px; }
  .telegram-icon { width: 23px; height: 23px; }
  .telegram-icon svg { width: 14px; height: 14px; }
  .rail-foot { margin: 0; }
  .main { padding: 14px 16px 0; }
  .intro { margin: 19px 0; }
  .connections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 550px) {
  .summary { grid-template-columns: minmax(0, 1fr); }
  .focus { min-height: 200px; }
  .brief { min-height: 0; }
  .focus-body { padding-block: 18px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .intro p { margin-top: 7px; }
  .intro .button { min-height: 38px; }
  .section { padding-top: 24px; }
  .category-card { padding: 10px; min-height: 160px; }
  .category-card h3 { font-size: 14px; }
  .task-row-title .category-icon { display: none; }
  .task-row-time { max-width: 78px; font-size: 10px; }
  .notice { flex-wrap: wrap; }
  .notice p { flex-basis: calc(100% - 33px); }
  .dialog-head h2 { font-size: 20px; }
}
@media (max-width: 360px) {
  .today-label { font-size: 10px; }
  .crumb { font-size: 9px; }
  .connections { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.report-link { color: var(--lime, #cef875); text-decoration: underline; text-underline-offset: 2px; }
