* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #201a2c;
  background: #f7f7fa;
  --surface: #fff;
  --line: #e9e6ef;
  --muted: #696477;
  --violet: #6737b5;
  --violet-dark: #522895;
  --violet-light: #f0e8fd;
  --night: #181426;
  --green: #217057;
  --radius: 16px;
}
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, a, input, select, textarea { touch-action: manipulation; }
button[disabled] { cursor: wait; opacity: .55; }
:focus-visible { outline: 3px solid #ad7dec; outline-offset: 3px; }
button:focus:not(:focus-visible) { outline: none; }
a { color: var(--violet-dark); text-underline-offset: .19em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem,4vw,2.65rem); font-weight: 750; letter-spacing: -.052em; line-height: 1.1; }
h2 { font-size: 1.16rem; letter-spacing: -.028em; }
h3 { font-size: 1rem; letter-spacing: -.015em; }
small { color: var(--muted); }
button { color: inherit; }
button svg, a.icon-box svg { pointer-events: none; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
.loading { padding: 30px; color: var(--muted); }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 242px minmax(0,1fr); }
.sidebar { background: var(--night); color: #f5eefc; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 24px 16px 18px; gap: 23px; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 7px; font-weight: 700; font-size: .94rem; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: #d8b6ff; color: #321852; border-radius: 9px; }
.brand-mark svg { width: 20px; height: 20px; }
.space-picker { display: flex; gap: 6px; align-items: center; border: 1px solid #ffffff25; border-radius: 11px; padding: 5px 7px; background: #ffffff09; }
.space-picker select { width: 100%; min-width: 0; padding: 5px 2px; color: #f4e9ff; background: #221a33; border: 0; font-size: .86rem; font-weight: 650; height: 30px; }
.space-picker button { padding: 6px; color: #dac8ef; }
.nav { display: grid; gap: 5px; }
.nav button { border: 0; text-align: left; background: transparent; padding: 10px 11px; display: flex; gap: 10px; align-items: center; border-radius: 8px; font-size: .91rem; font-weight: 550; color: #bcafcc; }
.nav button:hover { background: #ffffff0f; color: white; }
.nav button[aria-current="page"] { background: #382753; color: #f8f0ff; }
.nav button[aria-current="page"] svg { color: #d2a8ff; }
.nav-label { color: #a997bc; font-size: .75rem; margin: 2px 10px 4px; font-weight: 650; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 9px; min-width: 0; border-top: 1px solid #ffffff19; padding-top: 14px; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: .81rem; background: #3d2c55; color: #f1dfff; font-weight: 750; }
.sidebar-foot > span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .9rem; }
.sidebar-foot button { margin-left: auto; color: #c6b1d8; }
.main { min-width: 0; }
.topbar { height: 62px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 12px; }
.crumb { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb strong { color: #30283b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sep { color: #aaa2b3; }
.search-trigger { color: var(--muted); border: 1px solid var(--line); padding: 7px 9px; min-width: 152px; justify-content: flex-start; }
kbd { margin-left: auto; background: #f3f0f6; padding: 2px 5px; font-size: .73rem; border-radius: 4px; color: #595364; }
.content { max-width: 1460px; margin: 0 auto; padding: 32px; display: grid; gap: 20px; }
.page-head { display: flex; gap: 14px; align-items: end; justify-content: space-between; }
.page-sub { color: var(--muted); margin-top: 8px; line-height: 1.45; font-size: .92rem; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; border: 1px solid var(--line); background: white; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 630; font-size: .85rem; white-space: nowrap; min-height: 36px; }
.button:hover { background: #f7f4fb; }
.button.primary { border-color: var(--violet); background: var(--violet); color: white; }
.button.primary:hover { background: var(--violet-dark); }
.button.ghost { border: 0; background: transparent; }
.button.ghost:hover { background: #9f77c519; }
.button.small { font-size: .78rem; padding: 5px 8px; min-height: 28px; }
.select, input, textarea, select { border: 1px solid #dcd7e5; background: white; color: #21192d; border-radius: 8px; padding: 9px 10px; min-width: 0; }
.select { font-size: .85rem; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.label { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 4px 7px; font-weight: 650; font-size: .72rem; line-height: 1.2; color: #5f3a91; background: var(--violet-light); white-space: nowrap; }
.label.green { color: #1b624c; background: #e7f4ee; }
.label.neutral { color: #5f596b; background: #f1eff4; }
.label.amber { color: #774600; background: #fff3dc; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e6daf9; background: #f5effe; color: #4f3470; border-radius: 10px; padding: 11px 13px; font-size: .86rem; line-height: 1.4; }
.notice.error { border-color: #edc4c5; background: #fff0f1; color: #892433; }
.notice .button { flex: none; }
.kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.kpi { padding: 15px 17px 17px; min-height: 126px; position: relative; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.kpi-title { font-size: .84rem; color: #51495e; font-weight: 650; }
.kpi-value { display: block; margin: 9px 0 6px; font-size: clamp(1.35rem, 2.45vw, 2rem); letter-spacing: -.055em; font-weight: 750; white-space: nowrap; }
.kpi small { font-size: .76rem; }
.icon-box { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; background: var(--violet-light); color: var(--violet); flex: none; }
.icon-box.shop { background: #e5f4ed; color: var(--green); }
.charts, .bottom-grid, .integration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.chart-card, .panel { padding: 17px 19px; min-width: 0; }
.chart-head, .section-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.chart-head p, .section-head p { margin-top: 5px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.chart-body { min-height: 202px; position: relative; display: grid; align-items: center; margin-top: 7px; }
.chart { width: 100%; display: block; overflow: visible; }
.chart text { fill: #6b6178; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: #eae6ef; stroke-dasharray: 3 4; stroke-width: 1; }
.chart .line { stroke: #8052cb; stroke-width: 2.3; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart.shop .line { stroke: #31886d; }
.chart .area { fill: #efdefa; opacity: .64; }
.chart.shop .area { fill: #ddf2e9; }
.chart-point { fill: transparent; stroke: transparent; cursor: crosshair; }
.chart-point:hover, .chart-point:focus { fill: white; stroke: #8052cb; stroke-width: 2; }
.chart.shop .chart-point:hover, .chart.shop .chart-point:focus { stroke: #31886d; }
.chart-placeholder { min-height: 180px; display: grid; align-content: center; justify-items: center; gap: 9px; text-align: center; color: var(--muted); border-radius: 10px; border: 1px dashed #ded7e7; font-size: .86rem; }
.chart-value { min-height: 18px; color: var(--muted); font-size: .77rem; text-align: right; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .76rem; text-align: left; font-weight: 650; }
td.num, th.num { text-align: right; }
td:first-child { white-space: normal; min-width: 185px; }
tbody tr:last-child td { border-bottom: 0; }
.activity { display: grid; margin-top: 10px; }
.activity-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover strong { color: var(--violet); }
.activity-row > span:nth-child(2) { flex: 1; min-width: 0; }
.activity-row strong { display: block; font-size: .88rem; font-weight: 650; overflow-wrap: anywhere; }
.activity-row small { display: block; margin-top: 3px; font-size: .75rem; }
.activity-row > svg { color: var(--muted); }
.aside-links { display: grid; gap: 9px; margin-top: 12px; }
.link-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 0; text-decoration: none; font-size: .86rem; font-weight: 650; }
.link-row > span { flex: 1; overflow-wrap: anywhere; }
.wiki { display: grid; grid-template-columns: minmax(220px, .74fr) minmax(0,1.65fr); gap: 14px; align-items: start; }
.wiki-nav { padding: 12px; }
.wiki-nav input { width: 100%; margin-bottom: 8px; }
.wiki-nav button { display: flex; gap: 9px; align-items: center; width: 100%; border: 0; background: white; padding: 9px 8px; text-align: left; border-radius: 8px; font-size: .86rem; }
.wiki-nav button:hover, .wiki-nav button[aria-current="true"] { color: #53318a; background: var(--violet-light); }
.wiki-nav button span { min-width: 0; overflow-wrap: anywhere; }
.wiki-folder > summary { margin: 4px 0; padding: 8px 6px; border-radius: 8px; color: #493363; cursor: pointer; font-size: .86rem; font-weight: 670; overflow-wrap: anywhere; }
.wiki-folder > summary:hover { background: #f7f2fc; }
.wiki-children { margin-left: 7px; padding-left: 6px; border-left: 1px solid var(--line); }
.wiki-content { padding: 24px; min-height: 390px; }
.wiki-content .section-head { margin-bottom: 13px; }
.wiki-content h2 { font-size: clamp(1.2rem,3vw,1.65rem); margin-top: 9px; }
.wiki-body { line-height: 1.62; overflow-wrap: anywhere; }
.wiki-body p, .wiki-body ul { margin: 12px 0; color: #453b51; }
.wiki-body ul { padding-left: 22px; }
.wiki-body h3 { margin-top: 16px; }
.wiki-body h1, .wiki-body h2, .wiki-body h4 { margin-top: 24px; }
.wiki-body ol { padding-left: 24px; }
.wiki-body pre { padding: 13px; background: #f7f5fa; border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; }
.wiki-body pre code { color: inherit; }
.wiki-body table { display: block; max-width: 100%; overflow-x: auto; margin: 12px 0; }
.wiki-body td, .wiki-body th { white-space: normal; min-width: 105px; }
.wiki-body blockquote, .wiki-body .notion-callout { margin: 14px 0; padding: 9px 13px; border-left: 3px solid #c5a2e9; background: #f7f2fc; border-radius: 6px; }
.wiki-body figure { margin: 16px 0; }
.wiki-body figure img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.wiki-body figcaption { color: var(--muted); margin-top: 7px; font-size: .83rem; }
.wiki-body .notion-columns { display: flex; flex-wrap: wrap; gap: 16px; }
.wiki-body .notion-column { flex: 1 1 200px; min-width: 0; }
.wiki-footer { display: flex; flex-wrap: wrap; gap: 7px 11px; margin-top: 25px; border-top: 1px solid var(--line); padding-top: 13px; font-size: .82rem; }
.board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.column { background: #f0eef5; border: 1px solid #e9e5ef; border-radius: 12px; padding: 11px; }
.column h2 { display: flex; align-items: center; gap: 8px; padding: 6px 3px 13px; font-size: .92rem; }
.task { padding: 12px; margin-bottom: 9px; border-radius: 10px; }
.task:last-child { margin-bottom: 0; }
.task-title { display: block; width: 100%; border: 0; background: none; padding: 6px 0; font-size: .94rem; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.task-title:hover { color: var(--violet); }
.task p { color: var(--muted); font-size: .8rem; line-height: 1.4; margin-bottom: 10px; overflow-wrap: anywhere; }
.task select { font-size: .76rem; padding: 5px 6px; max-width: 100%; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.task-meta small { font-size: .72rem; }
.integration-card { display: grid; gap: 12px; padding: 18px; }
.integration-line { display: flex; align-items: center; gap: 10px; }
.integration-line > div { flex: 1; min-width: 0; }
.integration-line p { font-size: .8rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.integration-card .head-actions { align-items: stretch; }
.subpanels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.empty { padding: 20px 0; font-size: .87rem; color: var(--muted); line-height: 1.5; }
.empty-space { padding: 26px; }
.stack { display: grid; gap: 13px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; gap: 10px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row strong { display: block; font-size: .88rem; }
.row small { font-size: .78rem; }
dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 28px); border: 1px solid var(--line); border-radius: 15px; padding: 0; color: #21192d; box-shadow: 0 18px 64px #2513332b; }
dialog::backdrop { background: #1d132cb8; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 17px 19px 20px; display: grid; gap: 13px; }
.dialog-actions { display: flex; gap: 8px; justify-content: end; flex-wrap: wrap; }
form label { display: grid; gap: 5px; font-size: .85rem; font-weight: 650; }
form small, .dialog-help { font-size: .83rem; color: var(--muted); font-weight: 400; line-height: 1.45; }
textarea { min-height: 165px; resize: vertical; }
#toast { position: fixed; z-index: 4; bottom: 18px; right: 18px; padding: 10px 13px; border-radius: 9px; background: #251837; color: white; box-shadow: 0 8px 30px #1a112d30; font-size: .89rem; max-width: min(430px,calc(100% - 36px)); }
#toast:empty { display: none; }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 20px; background: #1e172c; }
.login-card { width: min(430px,100%); padding: 24px; border-radius: 16px; }
.login-card h1 { font-size: 1.85rem; margin-top: 14px; }
.login-card .page-sub { margin-bottom: 18px; }
.note { color: var(--muted); font-size: .83rem; line-height: 1.5; }
.history-version { border-top: 1px solid var(--line); padding: 9px 0; }
.history-version summary { cursor: pointer; font-size: .86rem; }
.full-code { width: 100%; min-height: 78px; font-family: ui-monospace, monospace; font-size: .8rem; }
@media (max-width: 1080px) {
  .shell { grid-template-columns: 205px minmax(0,1fr); }
  .content { padding: 25px; }
  .topbar { padding-inline: 25px; }
  .charts { gap: 10px; }
  .kpi { padding-inline: 12px; }
}
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; gap: 12px; padding: 13px 12px 9px; display: grid; grid-template-columns: 1fr auto; }
  .brand { padding-left: 0; }
  .space-picker { max-width: 162px; }
  .nav { display: flex; grid-column: 1 / -1; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .nav button { white-space: nowrap; padding: 7px 8px; font-size: .82rem; gap: 5px; }
  .nav button svg { width: 15px; height: 15px; }
  .nav-label, .sidebar-foot { display: none; }
  .topbar { height: 49px; padding-inline: 13px; }
  .search-trigger { min-width: unset; }
  .search-trigger kbd { display: none; }
  .content { padding: 19px 13px; gap: 14px; }
  .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .kpi { min-height: 108px; }
  .charts, .bottom-grid, .integration-grid, .subpanels { grid-template-columns: minmax(0,1fr); gap: 11px; }
}
@media (max-width: 530px) {
  .page-head { align-items: start; flex-direction: column; gap: 10px; }
  .wiki, .board { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .wiki-content { padding: 16px 13px; min-height: auto; }
  .panel, .chart-card { padding: 13px; }
  .notice { align-items: start; flex-direction: column; }
  .chart-body { min-height: 170px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
