/* ONY Hub: интерфейс в духе Linear. Тема по системной настройке, вручную: data-theme="dark|light" на <html>. */
:root {
  color-scheme: dark;
  --bg: #101113; --sidebar: #0b0c0e; --panel: #15161a; --raised: #1b1c21; --hover: #1f2026; --active: #262830;
  --line: #24262c; --line-strong: #2f323a; --text: #e5e6ea; --muted: #8b8f99; --faint: #5e626c;
  --accent: #5e6ad2; --accent-soft: rgba(94,106,210,.16); --ok: #4cb782; --warn: #f2994a; --urgent: #eb5757;
  --review: #26b5ce; --shadow: 0 8px 32px rgba(0,0,0,.45); --radius: 8px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff; --sidebar: #f7f7f8; --panel: #ffffff; --raised: #ffffff; --hover: #f1f1f3; --active: #e9e9ee;
    --line: #ececef; --line-strong: #dedee3; --text: #1f2023; --muted: #6b6f76; --faint: #9a9ea6;
    --accent-soft: rgba(94,106,210,.10); --shadow: 0 8px 32px rgba(20,20,40,.14);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --sidebar: #f7f7f8; --panel: #ffffff; --raised: #ffffff; --hover: #f1f1f3; --active: #e9e9ee;
  --line: #ececef; --line-strong: #dedee3; --text: #1f2023; --muted: #6b6f76; --faint: #9a9ea6;
  --accent-soft: rgba(94,106,210,.10); --shadow: 0 8px 32px rgba(20,20,40,.14);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
kbd { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--muted); background: var(--raised); }

/* каркас */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 10px 8px; gap: 2px; overflow-y: auto; }
.workspace { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-weight: 600; font-size: 14px; }
.logo { width: 20px; height: 20px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), #9b6ad2);
  display: grid; place-items: center; font-size: 11px; color: #fff; font-weight: 700; }
.side-actions { display: flex; gap: 6px; padding: 0 4px 8px; }
.side-btn { flex: 1; display: flex; align-items: center; gap: 8px; justify-content: space-between; background: var(--raised);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--muted); cursor: pointer; }
.side-btn:hover { color: var(--text); border-color: var(--line-strong); }
.nav { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; color: var(--muted); }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--active); color: var(--text); }
.nav > span:not(.count):not(.pdot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .count { margin-left: auto; color: var(--faint); font-size: 12px; }
.side-title { color: var(--faint); font-size: 11px; font-weight: 600; padding: 14px 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
.pdot { width: 14px; height: 14px; border-radius: 4px; display: grid; place-items: center; font-size: 8px; font-weight: 700;
  color: #fff; flex: none; }
.side-foot { margin-top: auto; padding: 8px; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.side-foot form { margin-left: auto; }
.theme-btn { font-size: 14px; line-height: 1; }
.link-btn { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: 46px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px;
  border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--text); font-weight: 500; }
.crumbs .sep { color: var(--faint); }
.tabs { display: flex; gap: 2px; margin-left: 10px; }
.tab { padding: 4px 10px; border-radius: 6px; color: var(--muted); border: 1px solid transparent; }
.tab:hover { color: var(--text); background: var(--hover); }
.tab.on { color: var(--text); background: var(--raised); border-color: var(--line); }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--raised);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--text); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.content { flex: 1; overflow: auto; }

/* список задач */
.group-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); color: var(--text); font-weight: 500; cursor: pointer; user-select: none; }
.group-head .n { color: var(--faint); font-weight: 400; }
.group-head .add { margin-left: auto; color: var(--faint); background: none; border: 0; cursor: pointer; font-size: 16px; line-height: 1; }
.group-head .add:hover { color: var(--text); }
.group.collapsed .rows { display: none; }
.row { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--active); box-shadow: inset 2px 0 0 var(--accent); }
.row .key { color: var(--muted); width: 82px; flex: none; font-variant-numeric: tabular-nums; }
.row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { display: flex; align-items: center; gap: 8px; color: var(--faint); flex: none; }
.label { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); font-weight: 500; margin: 0 0 6px; }

/* иконки */
.ic { width: 14px; height: 14px; flex: none; display: inline-block; vertical-align: middle; }
.icbtn { background: none; border: 0; padding: 2px; border-radius: 4px; cursor: pointer; display: inline-flex; }
.icbtn:hover { background: var(--active); }
.avatar { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9px;
  font-weight: 600; color: #fff; flex: none; text-transform: uppercase; }
.avatar.none { border: 1px dashed var(--faint); background: none; }

/* доска */
.board { display: flex; gap: 12px; padding: 14px 18px; height: 100%; align-items: flex-start; overflow-x: auto; }
.bcol { width: 290px; flex: none; display: flex; flex-direction: column; gap: 8px; max-height: 100%; }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; font-weight: 500; }
.bcol-head .n { color: var(--faint); font-weight: 400; }
.bcol-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; padding-bottom: 8px; border-radius: var(--radius); }
.bcol-body.drop { background: var(--accent-soft); }
.bcard { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: grab;
  display: flex; flex-direction: column; gap: 6px; }
.bcard:hover { border-color: var(--line-strong); }
.bcard .top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.bcard .top .avatar { margin-left: auto; }
.bcard .t { color: var(--text); }
.bcard .bottom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* страница задачи */
.issue-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 270px; min-height: 100%; }
.issue-main { padding: 28px 44px 60px; max-width: 900px; width: 100%; min-width: 0; justify-self: center; }
.issue-side { border-left: 1px solid var(--line); padding: 18px 16px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.prop { display: grid; grid-template-columns: 96px 1fr; align-items: center; min-height: 32px; }
.prop .k { color: var(--muted); }
.pick { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px;
  background: none; cursor: pointer; text-align: left; color: var(--text); }
.pick:hover { background: var(--hover); border-color: var(--line); }
.issue-title { font-size: 24px; font-weight: 600; line-height: 1.3; outline: none; border-radius: 6px; padding: 2px 4px; margin: 0 -4px 14px; }
.issue-title:focus { background: var(--hover); }
.desc { min-height: 40px; border-radius: 6px; padding: 4px; margin: 0 -4px; cursor: text; }
.desc:hover { background: var(--hover); }
.desc.placeholder { color: var(--faint); }
.section-title { color: var(--muted); font-size: 12px; font-weight: 600; margin: 34px 0 10px; display: flex; gap: 8px; align-items: center; }
.sub { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.sub:hover { background: var(--hover); }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.ev { display: flex; gap: 10px; color: var(--muted); font-size: 12px; align-items: center; }
.cmt { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.cmt-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.cmt-head b { color: var(--text); font-weight: 500; }
.composer { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); padding: 8px 10px; }
.composer textarea { width: 100%; border: 0; background: none; resize: vertical; min-height: 56px; outline: none; }
.composer .bar { display: flex; justify-content: flex-end; gap: 8px; align-items: center; color: var(--faint); font-size: 12px; }
textarea.edit, input.edit { width: 100%; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; outline: none; }
textarea.edit { min-height: 180px; resize: vertical; }
textarea.edit:focus, input.edit:focus { border-color: var(--accent); }

/* markdown */
.md p { margin: 0 0 10px; } .md h1, .md h2, .md h3 { font-weight: 600; margin: 18px 0 8px; } .md h1 { font-size: 20px; } .md h2 { font-size: 16px; }
.md h3 { font-size: 14px; } .md ul, .md ol { padding-left: 20px; margin: 0 0 10px; } .md code { background: var(--active); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.md pre { background: var(--sidebar); border: 1px solid var(--line); padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
.md pre code { background: none; padding: 0; } .md a { color: var(--accent); }
.md table { border-collapse: collapse; margin: 0 0 10px; } .md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 2px solid var(--line-strong); color: var(--muted); }

/* обзор проекта, документы, проекты */
.page { padding: 26px 40px 60px; max-width: 1080px; }
.page h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.card .muted, .muted { color: var(--muted); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; }
.kv .k { color: var(--muted); }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; color: var(--faint); font-weight: 500; font-size: 12px; padding: 6px 18px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 9px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable td.wrap { white-space: normal; }
.ptable .opt-col { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .ptable .opt-col { display: none; } }
.ptable tr.prow { cursor: pointer; } .ptable tr.prow:hover td { background: var(--hover); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.feed .ev { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ev > span:last-child { white-space: nowrap; flex: none; }

/* всплывающие меню, модалки, палитра */
.menu { position: fixed; z-index: 50; min-width: 200px; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; }
.menu input { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 6px 8px 8px; outline: none; margin-bottom: 4px; }
.menu .opt { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.menu .opt.hl, .menu .opt:hover { background: var(--active); }
.menu .opt .kbd { margin-left: auto; color: var(--faint); font-size: 11px; }
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-start;
  justify-content: center; padding-top: 12vh; }
.modal { width: min(680px, calc(100vw - 32px)); background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; color: var(--muted); }
.modal-body { padding: 8px 16px; }
.modal-body .t { width: 100%; border: 0; background: none; font-size: 18px; font-weight: 500; outline: none; padding: 6px 0; }
.modal-body textarea { width: 100%; border: 0; background: none; min-height: 110px; resize: vertical; outline: none; color: var(--text); }
.modal-props { display: flex; gap: 6px; padding: 0 16px 12px; flex-wrap: wrap; }
.modal-props .pick { border-color: var(--line-strong); }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.palette { width: min(640px, calc(100vw - 32px)); background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 16px 18px; font-size: 15px; outline: none; }
.palette .list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette .opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.palette .opt.hl { background: var(--active); }
.palette .opt .sub2 { color: var(--faint); margin-left: auto; font-size: 12px; white-space: nowrap; }
.palette .sect { color: var(--faint); font-size: 11px; padding: 8px 10px 4px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 8px 14px; box-shadow: var(--shadow); z-index: 60; }
.toast.err { border-color: var(--urgent); }
.hidden { display: none !important; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(380px, 100%); text-align: center; }
.login .logo { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; margin: 0 auto 18px; }
.login h1 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.login input { width: 100%; margin: 18px 0 10px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 8px; outline: none; }
.login input:focus { border-color: var(--accent); }
.login .btn { width: 100%; justify-content: center; padding: 9px; }
.err { color: var(--urgent); }

  .menu-toggle { display: none; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .menu-toggle { display: block; }
  body.side-open .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 45; box-shadow: var(--shadow); }
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar .long { display: none; }
  .tabs { overflow-x: auto; margin-left: 0; }
  .crumbs b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .issue-wrap { grid-template-columns: 1fr; }
  .issue-side { border-left: 0; border-top: 1px solid var(--line); }
  .issue-main, .page { padding: 18px 16px 40px; }
  .row .meta .label { display: none; }
  .tabs .tab { padding: 4px 6px; }
}

/* скиллы */
.skill-filter { width: 220px; height: 30px; padding: 4px 10px; }
.skill-card { display: block; transition: border-color .12s; }
.skill-card:hover { border-color: var(--line-strong); }
.skill-card code, .issue-title code { font: 600 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.install-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--sidebar); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 10px; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.small { font-size: 12px; margin: 6px 0 0; }
.date-pick { background: none; border: 0; color: var(--text); font: inherit; padding: 4px 6px; border-radius: 6px; color-scheme: inherit; }
.date-pick:hover { background: var(--hover); }
a.ext { color: var(--accent); }
