:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --panel: #f5f7f6;
  --panel-2: #edf1ef;
  --line: #e2e7e4;
  --line-strong: #c5cec9;
  --text: #17201b;
  --text-2: #36413b;
  --muted: #5a6660;
  --faint: #69756e;
  --accent: #1f7a4d;
  --accent-hover: #196641;
  --accent-press: #145535;
  --accent-soft: #e8f3ed;
  --accent-tint: #f3f8f5;
  --accent-line: #a8cfba;
  --ink: var(--accent);
  --ink-hover: var(--accent-hover);
  --ink-soft: var(--accent-soft);
  --danger: #b42318;
  --danger-soft: #fef1ef;
  --danger-line: #f3c6c0;
  --hit: #fff1b8;
  --ring: 0 0 0 3px rgba(31, 122, 77, 0.25);
  --shadow-sm: 0 1px 2px rgba(23, 32, 27, 0.06);
  --shadow: 0 1px 2px rgba(23, 32, 27, 0.05), 0 4px 12px rgba(23, 32, 27, 0.05);

  --r-sm: 6px;
  --radius: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 2.625rem;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --wrap: 74rem;
  --gutter: 24px;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --grid: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%231f7a4d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 10.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235a6660' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 7.5 4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-base)/1.55 var(--ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
main { display: block; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; margin: 0; color: var(--text); }
h1 { font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -0.022em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 1em; }
::selection { background: #cfe8da; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow > * { max-width: 40rem; }
.lead { font-size: var(--fs-md); line-height: 1.5; color: var(--muted); max-width: 60ch; margin: var(--sp-3) 0 0; }

input[type=text], input[type=search], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) var(--chevron) no-repeat right 12px center / 18px 18px;
}
textarea { resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: #9aa69f; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
::placeholder { color: var(--faint); opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  font: 600 var(--fs-base)/1.2 var(--ui); border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-hover); color: #ffffff; }
.btn-primary:active { background: var(--accent-press); }
.btn-quiet { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-quiet:hover { border-color: var(--text-2); color: var(--text); }
.btn-quiet:active { background: var(--panel); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.notice { color: var(--danger); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: var(--sp-6); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 1.0625rem; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; }
.topbar-nav { display: flex; gap: var(--sp-1); }
.topbar-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--radius); color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.topbar-nav a:hover { color: var(--text); background: var(--panel); }
.topbar-nav a[aria-current] { color: var(--accent); }
.topbar-search { position: relative; margin-left: auto; width: 21rem; }
.topbar-search input { min-height: 40px; padding-left: 38px; background: var(--panel); border-color: transparent; font-size: 0.9375rem; }
.topbar-search input:hover { border-color: var(--line-strong); }
.topbar-search input:focus { background: var(--surface); border-color: var(--accent); }
.search-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--faint); pointer-events: none; }
.topbar-search-link { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; border-radius: var(--radius); color: var(--text-2); }
.topbar-search-link:hover { background: var(--panel); color: var(--text); }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--sp-5) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--line-strong); }
.page-head { padding: var(--sp-3) 0 var(--sp-6); }
.page-head h1 { max-width: 30ch; }
.wrap > .page-head:first-child { padding-top: var(--sp-7); }

.home-head { padding: var(--sp-7) 0 var(--sp-6); }
.home-head h1 { font-size: var(--fs-3xl); max-width: 20ch; }
.home-filter { position: relative; max-width: 36rem; margin-top: var(--sp-5); }
.home-filter input { min-height: 52px; padding-left: 44px; font-size: 1.0625rem; border-radius: var(--r-lg); }
.home-filter .search-icon { left: 15px; width: 20px; height: 20px; margin-top: -10px; }
.jump { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; transition: border-color 150ms var(--ease), color 150ms var(--ease); }
.jump a:hover { border-color: var(--accent-line); color: var(--accent); }
.jump .jump-tools { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-weight: 600; }
.jump .jump-tools:hover { border-color: var(--accent-line); }
.filter-empty { padding: var(--sp-5) 0; color: var(--muted); }

.sect { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--sp-4) var(--sp-6); padding: var(--sp-6) 0 var(--sp-7); border-top: 1px solid var(--line); }
.sect-title, .sect-title h2 { font-size: var(--fs-lg); line-height: 1.3; }
.sect-title a { color: var(--text); text-decoration: none; }
.sect-title a:hover { color: var(--accent); text-decoration: underline; }
.sect-meta { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.cat-block { scroll-margin-top: 8px; }

.item-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--sp-6); }
.item-list li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.item-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 13px; text-decoration: none; color: var(--text); }
.item-name { font-weight: 600; transition: color 150ms var(--ease); }
.item-card { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.item-list a:hover .item-name { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.cat-tools .item-list { columns: 3; }

.tpl { display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); gap: var(--sp-6); align-items: start; margin-bottom: var(--sp-8); }
.tpl-form { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.btn-download { width: 100%; min-height: 52px; margin-top: var(--sp-1); font-size: 1.0625rem; }
.tpl-note { margin: -4px 0 0; font-size: var(--fs-xs); line-height: 1.45; color: var(--muted); text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tpl-preview { min-width: 0; }

.sheet-frame { overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); }
.sheet-bar { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.sheet-bar .file-icon { width: 18px; height: 18px; color: var(--accent); }
.sheet-file { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sheet-tabs { display: flex; overflow: hidden; padding: 0 var(--sp-2); background: var(--panel); border-top: 1px solid var(--line); }
.sheet-tab { flex: none; padding: 7px 14px 8px; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.sheet-tab.is-active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

.xs-preview { overflow: auto; max-height: 30rem; background: #ffffff; overscroll-behavior-x: contain; }
.xs-sheet { border-collapse: separate; border-spacing: 0; table-layout: fixed; font: 400 0.8125rem/1.3 var(--grid); color: #1b1f1d; }
.xs-sheet th, .xs-sheet td { height: 1.75rem; padding: 2px 5px; border-right: 1px solid #e4e7e5; border-bottom: 1px solid #e4e7e5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; vertical-align: middle; }
.xs-sheet thead th { position: sticky; top: 0; z-index: 2; height: 1.5rem; background: #f3f5f4; color: #5a6660; font: 400 0.75rem/1 var(--ui); text-align: center; border-color: #dde2df; }
.xs-sheet .xs-rh { position: sticky; left: 0; z-index: 1; background: #f3f5f4; color: #5a6660; font: 400 0.75rem/1 var(--ui); text-align: center; border-color: #dde2df; }
.xs-sheet thead .xs-corner { left: 0; z-index: 3; }
.xs-rh-col { width: 36px; }
.xs-title { font-size: 1.0625rem; font-weight: 700; color: #1f7a4d; }
.xs-subtitle { color: #475467; }
.xs-note { color: #667085; font-style: italic; font-size: 0.75rem; }
.xs-label { font-weight: 700; }
.xs-head, .xs-head_date, .xs-head_month { background: #eef1f5; font-weight: 700; text-align: center; white-space: normal; line-height: 1.15; }
.xs-cell, .xs-text, .xs-num, .xs-num1, .xs-num2, .xs-money, .xs-percent, .xs-date, .xs-datetime, .xs-time,
.xs-head, .xs-head_date, .xs-head_month, .xs-input, .xs-input_num, .xs-input_money, .xs-input_date,
.xs-total, .xs-total_money, .xs-total_num, .xs-accent { box-shadow: inset 1px 1px 0 #d0d5dd; }
.xs-sheet td[class] { border-right-color: #d0d5dd; border-bottom-color: #d0d5dd; }
.xs-sheet .xs-title, .xs-sheet .xs-subtitle, .xs-sheet .xs-note, .xs-sheet .xs-label { border-right-color: #e4e7e5; border-bottom-color: #e4e7e5; }
.xs-num, .xs-num1, .xs-num2, .xs-money, .xs-percent, .xs-input_num, .xs-input_money, .xs-total_money, .xs-total_num { text-align: right; font-variant-numeric: tabular-nums; }
.xs-date, .xs-datetime, .xs-time, .xs-input_date { text-align: center; font-variant-numeric: tabular-nums; }
.xs-input, .xs-input_num, .xs-input_money, .xs-input_date { background: #fff8e1; }
.xs-total, .xs-total_money, .xs-total_num { background: #f2f7f4; font-weight: 700; box-shadow: inset 1px 2px 0 #1f7a4d; }
.xs-accent { background: #1f7a4d; color: #ffffff; font-weight: 700; }
.xs-sheet .auto { color: #8a948f; font-style: italic; }
.xs-center, .xs-num_center, .xs-date_short, .xs-head_ddmm, .xs-input_center, .xs-input_percent, .xs-input_time, .xs-total_percent { box-shadow: inset 1px 1px 0 #d0d5dd; }
.xs-center, .xs-input_center { text-align: center; }
.xs-num_center, .xs-date_short, .xs-input_time { text-align: center; font-variant-numeric: tabular-nums; }
.xs-input_percent, .xs-total_percent { text-align: right; font-variant-numeric: tabular-nums; }
.xs-head_ddmm { background: #eef1f5; font-weight: 700; text-align: center; white-space: normal; line-height: 1.15; font-variant-numeric: tabular-nums; }
.xs-input_center, .xs-input_percent, .xs-input_time { background: #fff8e1; }
.xs-total_percent { background: #f2f7f4; font-weight: 700; box-shadow: inset 1px 2px 0 #1f7a4d; }
.xs-sheet .xs-m-weekend { background: #e4e7ec; color: #c4320a; }
.xs-sheet .xs-m-warn { background: #fef0c7; color: #b54708; }
.xs-sheet .xs-m-bad { background: #fee4e2; color: #b42318; font-weight: 700; }
.xs-sheet .xs-m-good { background: #dcfae6; color: #067647; }
.xs-sheet .xs-m-muted { color: #98a2b3; }
.xs-sheet .xs-m-hl { background: #1f7a4d; color: #ffffff; font-weight: 700; }
.xs-sheet .xs-m-strike { color: #98a2b3; text-decoration: line-through; }

.checks, .steps { list-style: none; margin: 0; padding: 0; max-width: 62ch; }
.checks li { position: relative; padding: 0 0 0 30px; margin-bottom: 10px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.15em; width: 20px; height: 20px; background: var(--check) no-repeat center / 20px 20px; }
.steps { counter-reset: step; }
.steps li { position: relative; min-height: 28px; padding: 2px 0 0 42px; margin-bottom: 14px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); font-weight: 700; }

.faq-list { max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { position: relative; display: block; padding: 14px 36px 14px 0; font-weight: 600; cursor: pointer; list-style: none; border-radius: 4px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 20px; height: 20px; margin-top: -10px; background: var(--chevron) no-repeat center / 20px 20px; transition: transform 200ms var(--ease); }
.faq summary:hover { color: var(--accent); }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { margin: 0 0 16px; color: var(--text-2); max-width: 62ch; }

.tool-widget { margin-bottom: var(--sp-8); }
.tabs .tool-widget { margin-bottom: 0; }
.tabs { margin-bottom: var(--sp-8); }
.tool-off { padding: var(--sp-4); background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: var(--r-lg); }
.tab-list { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: var(--sp-4); background: var(--panel-2); border-radius: 10px; }
.tab { min-height: 40px; padding: 8px 20px; font: 600 0.9375rem/1.2 var(--ui); color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.tab:hover { color: var(--text); }
.tab[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(23, 32, 27, 0.12), 0 0 0 1px rgba(23, 32, 27, 0.04); }
.tab:focus-visible { outline: none; box-shadow: var(--ring); }

.search-form { display: flex; gap: var(--sp-2); max-width: 40rem; margin-top: var(--sp-5); }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field input { padding-left: 38px; }
.result-count { font-size: var(--fs-sm); color: var(--muted); }
.page-search .item-list, .page-head + .item-list { border-top: 1px solid var(--line); }
.empty { color: var(--text-2); }
.message .page-head { padding-top: var(--sp-8); }
.message .search-form { margin-top: 0; }
.message-actions { margin-top: var(--sp-5); }

.footer { margin-top: var(--sp-7); border-top: 1px solid var(--line); padding: var(--sp-5) 0 var(--sp-6); font-size: var(--fs-xs); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sp-3) var(--sp-6); }
.footer-note { margin: 0; max-width: 62ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

.legal > * { max-width: 70ch; }
.legal h2 { font-size: var(--fs-md); margin: var(--sp-6) 0 var(--sp-2); }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 1.3em; }

.admin section { min-width: 0; margin-bottom: 40px; overflow-x: auto; }
.admin-table td { overflow-wrap: anywhere; }
.table-scroll .admin-table td { overflow-wrap: normal; white-space: nowrap; }
.admin h2 { font-size: var(--fs-md); margin: var(--sp-2) 0 var(--sp-3); }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }
.admin-head form { margin: 0; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-scroll .admin-table { border: 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface); font-variant-numeric: tabular-nums; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table th { position: sticky; top: 0; background: var(--panel); font-weight: 600; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.admin-table tbody tr:hover td { background: var(--accent-tint); }
.admin-table form { margin: 0; }
.admin-table .btn { min-height: 30px; padding: 4px 10px; font-size: var(--fs-xs); }
.admin-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-3); }
.admin-login { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 22rem; }
.admin-periods { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); font-size: var(--fs-sm); color: var(--muted); }
.admin-periods a[aria-current] { font-weight: 700; color: var(--text); text-decoration: none; }
.status { display: inline-block; padding: 3px 12px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm); background: var(--panel); margin-right: var(--sp-2); }
.status-traction { background: #dcf3e5; color: #14532d; }
.status-wait { background: #fff4d6; color: #6b4200; }
.status-no_traction { background: #fde2df; color: #8a1c12; }
.is-off { color: var(--danger); font-weight: 600; }

/* Отзыв под кнопками */
.fb { position: relative; padding: var(--sp-4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.fb[hidden] { display: none; }
.fb.is-in { animation: fb-in 240ms var(--ease); }
.fb-step { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
.fb-step[hidden] { display: none; }
.fb-q { margin: 0; font-weight: 600; }
.fb-q:focus { outline: none; }
.fb-row { display: flex; gap: var(--sp-2); }
.fb-answer { min-width: 6.5rem; }
.fb-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 6px; width: 100%; }
.fb-chip { min-height: 34px; padding: 5px 10px; text-align: left; font: 500 0.8125rem/1.2 var(--ui); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease); }
.fb-chip:hover { border-color: var(--text-2); }
.fb-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.fb-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.fb textarea { min-height: 60px; }
.fb-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer; transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.fb-close:hover { color: var(--text); background: var(--surface); }
.fb-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fb .fb-q { padding-right: 28px; }
@media (pointer: coarse) { .fb-chip { min-height: 40px; } }
.fb-link { padding: 0; font: inherit; color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; cursor: pointer; }
.fb-link:hover { color: var(--accent); }
.fb .fb-link { color: var(--accent); min-height: 24px; }
.fb-link[hidden] { display: none; }
.tool-fb { max-width: 40rem; margin: calc(var(--sp-4) - var(--sp-8)) 0 var(--sp-8); }
.tool-fb-note { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); line-height: 1.45; color: var(--muted); }
@keyframes fb-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1080px) {
  .sect { grid-template-columns: 12rem minmax(0, 1fr); }
  .cat-tools .item-list { columns: 2; }
}
@media (max-width: 900px) {
  .tpl { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .tpl-form { max-width: 28rem; }
  .sect { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); padding: var(--sp-6) 0 var(--sp-6); }
  .admin-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  h1, .home-head h1 { font-size: var(--fs-xl); letter-spacing: -0.018em; }
  .lead { font-size: var(--fs-base); margin-top: var(--sp-2); }
  .topbar-inner { gap: var(--sp-2); min-height: 56px; }
  .brand { font-size: var(--fs-base); }
  .topbar-nav { margin-left: auto; }
  .topbar-nav .nav-templates { display: none; }
  .topbar-search { display: none; }
  .topbar-search-link { display: inline-flex; margin-left: 0; }
  .crumbs { padding-top: var(--sp-4); }
  .crumbs a, .footer-links a { display: inline-block; padding: 10px 0; margin: -10px 0; }
  .footer-links { gap: var(--sp-4) var(--sp-5); }
  .jump a { min-height: 40px; }
  .page-head { padding: var(--sp-2) 0 var(--sp-5); }
  .wrap > .page-head:first-child { padding-top: var(--sp-6); }
  .home-head { padding: var(--sp-6) 0 var(--sp-5); }
  .jump { flex-wrap: nowrap; overflow-x: auto; margin: var(--sp-4) calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .jump::-webkit-scrollbar { display: none; }
  .item-list, .cat-tools .item-list { columns: 1; }
  .tpl-form { max-width: none; padding: var(--sp-4); }
  .tab-list { display: flex; }
  .tab { flex: 1; padding: 8px 10px; }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
