:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #192b25;
  --muted: #65736c;
  --border: #dfe6e1;
  --accent: #126344;
  --accent-hover: #0b5035;
  --accent-soft: #e8f3ed;
  --neg: #b42318;
  --neg-soft: #fff0ee;
  --radius-card: 14px;
  --radius-ctl: 9px;
  --shadow-card: 0 2px 5px rgb(24 48 35 / 3%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #27815a; outline-offset: 3px; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 1.5rem; }
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 200; padding: .75rem 1rem; background: var(--accent); color: white; border-radius: var(--radius-ctl); transform: translateY(-180%); }
.skip-link:focus { transform: none; color: white; }

.nav {
  position: relative; z-index: 50; width: 100%;
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.5rem;
  padding: .85rem max(1.5rem, calc((100% - 1320px) / 2 + 3rem)) .65rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.nav .brand { display: flex; flex-shrink: 0; gap: .7rem; align-items: center; font-size: 1.22rem; font-weight: 750; text-decoration: none; color: var(--text); letter-spacing: -.035em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 37px; width: 37px; height: 37px; border-radius: 11px; background: var(--accent); color: white; }
.brand-mark svg { width: 23px; height: 23px; }
.brand-copy { display: block; }
.brand-name { display: block; max-width: min(240px, 42vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { display: block; margin-top: .1rem; color: var(--muted); font-size: .66rem; font-weight: 500; letter-spacing: .015em; }
.nav a:not(.brand) { text-decoration: none; color: var(--muted); }
.nav form { margin: 0; }
.nav-links { display: flex; flex: 1 0 100%; min-width: 0; gap: 1.2rem; align-items: center; padding-top: .65rem; border-top: 1px solid var(--border); order: 4; }
.nav-primary { display: flex; flex: 1; justify-content: flex-start; gap: .3rem; min-width: 0; }
.nav .nav-project-switcher { margin-left: auto; width: min(440px, 55%); min-width: 0; }
.nav-project-switcher > label { display: block; margin: 0 0 .25rem; font-size: .73rem; font-weight: 600; color: var(--muted); }
.nav-project-controls { display: flex; gap: .5rem; align-items: center; min-width: 0; }
.nav-project-controls select { flex: 1; width: 0; min-width: 0; max-width: 100%; margin: 0; min-height: 44px; padding: .6rem 2rem .6rem .85rem; color: var(--text); background-color: #f8faf9; font-size: .9rem; text-overflow: ellipsis; }
.nav-project-controls .btn { flex: 0 0 auto; min-height: 44px; }
.nav-item { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .65rem .7rem; border-radius: var(--radius-ctl); font-size: .84rem; font-weight: 550; white-space: nowrap; }
.nav .nav-item:hover { color: var(--accent); background: #f3f7f4; }
.nav .nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-item-icon { display: inline-flex; flex: 0 0 19px; width: 19px; height: 19px; color: currentColor; }
.nav-item-icon svg { width: 100%; height: 100%; }
.nav-footer { display: flex; flex-shrink: 0; align-items: center; gap: .85rem; color: var(--muted); font-size: .76rem; }
.nav-footer .btn { white-space: nowrap; color: var(--muted); }
.nav-account { min-width: 0; max-width: 150px; text-align: right; }
.nav-account span { display: block; font-size: .69rem; }
.nav-account strong { display: block; margin-top: .1rem; font-size: .77rem; font-weight: 550; color: #43574b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius-ctl); background: var(--surface); color: var(--text);
  font: inherit; font-size: .88rem; cursor: pointer;
}
.nav-toggle[hidden], .nav-links[hidden] { display: none; }
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.nav-toggle-icon { position: relative; display: block; width: 20px; height: 16px; }
.nav-toggle-icon span { position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; border-radius: 1px; }
.nav-toggle-icon span:nth-child(1) { top: 0; }
.nav-toggle-icon span:nth-child(2) { top: 7px; }
.nav-toggle-icon span:nth-child(3) { top: 14px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 2.3rem clamp(1.3rem, 3vw, 3rem) 4rem; }
h1 { font-size: clamp(1.65rem, 2.3vw, 2rem); font-weight: 720; line-height: 1.22; margin: .2rem 0 .6rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-size: 1.06rem; font-weight: 670; line-height: 1.35; margin: 0 0 .9rem; letter-spacing: -.02em; }
h3 { letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 1.2rem; font-size: .88rem; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-card); }
.card.hero { border-color: #c8dbcf; }
.visitor-panel h3 { font-size: .95rem; margin: 1.2rem 0 .45rem; }
.visitor-panel .sub { margin-bottom: .3rem; }
.visitor-panel td:not(.num) { overflow-wrap: anywhere; max-width: 290px; }
.visitor-panel .table-wrap { margin-top: .65rem; }
.visitor-live { margin-top: 1.25rem; padding: 1.2rem; border: 1px solid #c3dece; background: #f5faf7; border-radius: var(--radius-card); }
.visitor-live-heading { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.visitor-live-heading .field-help { margin: 0 0 0 auto; }
.visitor-dot { width: 8px; height: 8px; border-radius: 50%; background: #228352; box-shadow: 0 0 0 4px #e0f0e6; flex-shrink: 0; }
.visitor-stale .visitor-dot { background: #a96b06; }
.visitor-stale .visitor-live { border-color: #a96b06; }
.visitor-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: .9rem 0; }
.visitor-metrics > div { border: 1px solid var(--border); border-radius: var(--radius-ctl); padding: 1rem; background: var(--surface); min-width: 0; }
.visitor-metrics span { display: block; color: var(--muted); font-size: .8rem; }
.visitor-metrics strong { display: block; font-size: 1.6rem; font-weight: 650; line-height: 1.3; margin-top: .2rem; overflow-wrap: anywhere; }
.visitor-metrics-live { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.visitor-metrics-period { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .visitor-metrics-period { grid-template-columns: repeat(2, minmax(0, 1fr)); } .visitor-metrics-period > div:last-child { grid-column: 1 / -1; } }
.visitor-metrics-live strong { color: var(--accent); }
.visitor-metrics [data-visitor-metric="avg_session_seconds"] { font-size: 1.25rem; }
.visitor-breakdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin: .8rem 0; }
.visitor-breakdown { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); overflow: hidden; }
.visitor-breakdown h4 { margin: 0; padding: .85rem .85rem 0; font-size: .9rem; }
.visitor-breakdown .table-wrap { max-height: 17rem; margin-top: .5rem; }
.visitor-panel .visitor-breakdown .table-wrap table { min-width: 0; width: 100%; font-size: .83rem; }
.visitor-breakdown th, .visitor-breakdown td { padding: .55rem .7rem; }
.visitor-breakdown th { position: sticky; top: 0; background: var(--bg); }
.visitor-breakdown th:first-child { white-space: normal; overflow-wrap: anywhere; }
.visitor-breakdown td.num, .visitor-breakdown th.num { width: 1%; }
.visitor-technology-help { margin-bottom: 1rem; }
.visitor-audience-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.visitor-audience-group { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .1rem .6rem; min-width: 0; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.visitor-audience-group > span:first-child { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.visitor-audience-group > strong { font-size: 1.6rem; font-weight: 650; overflow-wrap: anywhere; }
.visitor-audience-percent { font-size: .9rem; }
.visitor-audience-bar { display: flex; height: 12px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: .65rem; }
.visitor-audience-bar .visitor-audience-new { background: var(--accent); }
.visitor-audience-bar .visitor-audience-returning { background: var(--muted); }
.visitor-audience-group.visitor-audience-new { border-top: 3px solid var(--accent); }
.visitor-audience-group.visitor-audience-returning { border-top: 3px solid var(--muted); }
.visitor-scroll-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: .8rem 0; }
.visitor-scroll-threshold { display: grid; gap: .2rem; min-width: 0; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.visitor-scroll-threshold > span, .visitor-scroll-threshold > small { color: var(--muted); font-size: .8rem; }
.visitor-scroll-threshold > strong { font-size: 1.45rem; font-weight: 650; }
.visitor-scroll-threshold .visitor-bar-track { margin-top: .4rem; height: 7px; }
.visitor-measurement-note { display: block; margin-top: .15rem; color: var(--muted); font-size: .72rem; font-weight: 400; }
.visitor-scroll-table, .visitor-exit-table { max-height: 26rem; margin-bottom: .7rem; }
.visitor-scroll-table th, .visitor-exit-table th { position: sticky; top: 0; background: var(--bg); }
.visitor-panel .table-wrap.visitor-scroll-table table { min-width: 760px; }
.visitor-panel .table-wrap.visitor-exit-table table { min-width: 0; }
.visitor-exit-table td:first-child, .visitor-scroll-table td:first-child { overflow-wrap: anywhere; }
@media (max-width: 760px) { .visitor-scroll-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .visitor-audience-group { padding: .65rem; grid-template-columns: 1fr; } .visitor-audience-group > span:first-child { min-height: 2.6em; } }
.visitor-client { display: block; margin-top: .3rem; color: var(--muted); font-size: .76rem; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 760px) { .visitor-breakdowns { grid-template-columns: minmax(0, 1fr); } }
.visitor-details { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.visitor-details > summary, .visitor-help > summary { cursor: pointer; color: var(--accent); }
.visitor-help { font-size: .86rem; color: var(--muted); }
.visitor-help p { margin: .65rem 0; }
.visitor-journey { padding: .65rem; margin-top: .65rem; background: var(--bg); border-radius: var(--radius-ctl); }
.visitor-journey summary, .visitor-journey li { overflow-wrap: anywhere; }
.visitor-journey ol { font-size: .86rem; padding-left: 1.25rem; }
.visitor-bars { margin: .7rem 0 1rem; }
.visitor-bar { display: grid; grid-template-columns: minmax(90px, 1fr) 3fr 45px; gap: .65rem; align-items: center; margin: .35rem 0; font-size: .84rem; }
.visitor-bar > span { overflow-wrap: anywhere; }
.visitor-bar strong { text-align: right; }
.visitor-bar-track { height: 13px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.visitor-bar-track > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
@media (max-width: 600px) {
  .visitor-metrics, .visitor-metrics-live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visitor-live { padding: .7rem; }
  .visitor-live-heading .field-help { margin-left: 0; width: 100%; }
  .visitor-metrics strong { font-size: 1.35rem; }
  .visitor-panel .table-wrap table { min-width: 540px; }
}
.two { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
.two > .card { min-width: 0; }
@media (min-width: 1180px) { .two { grid-template-columns: 1fr 1fr; } }

.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #c3cfc7 transparent; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: .95rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f7f9f7; font-weight: 600; font-size: .76rem; }
th:first-child { border-radius: 7px 0 0 0; }
th:last-child { border-radius: 0 7px 0 0; }
tbody tr:hover { background: #f8fbf9; }
tbody tr:last-child td { border-bottom: 0; }
td > a { font-weight: 600; text-decoration: none; }
td > a:hover { text-decoration: underline; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 650; border-bottom: 0; border-top: 1px solid #bacdc0; background: #f7faf8; }
tr.total-row td { font-weight: 600; }
.pos { color: var(--accent); font-weight: 600; }
.neg { color: var(--neg); font-weight: 600; }
.muted { color: var(--muted); }
.big { font-size: 1rem; }
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 6px; font-size: .72rem; font-weight: 550; background: var(--accent-soft); color: var(--accent); }
.badge.refunded { background: var(--neg-soft); color: var(--neg); }
.badge.err { background: var(--neg-soft); color: var(--neg); }
.badge.neutral { background: #f0f4f1; color: var(--muted); }

label { display: block; font-size: .8rem; font-weight: 550; color: #43574b; margin-bottom: .45rem; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: .65rem .8rem; border: 1px solid #cfd9d2; border-radius: var(--radius-ctl);
  font: inherit; background: var(--surface); color: var(--text);
}
input::placeholder, textarea::placeholder { color: #7c8880; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #9eb6a7; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: #f1f4f2; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; }
input[type="date"] { min-width: 0; }
.ai-model-picker select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.ai-model-control { position: relative; min-width: 0; }
.ai-model-toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; min-height: 44px; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ai-model-toggle > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-model-toggle > svg { flex: 0 0 18px; }
.ai-model-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.ai-model-toggle:hover, .ai-model-toggle[aria-expanded="true"] { border-color: var(--accent); }
.ai-model-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-model-toggle[aria-invalid="true"] { border-color: var(--neg); }
.ai-model-panel { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; right: 0; display: flex; flex-direction: column; max-height: min(420px, 60vh); padding: .6rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); box-shadow: 0 12px 32px rgb(24 48 35 / 16%); }
.ai-model-panel[data-placement="above"] { top: auto; bottom: calc(100% + 6px); }
.ai-model-control[hidden], .ai-model-panel[hidden], .ai-model-empty[hidden], .ai-model-picker select[hidden] { display: none; }
.ai-model-search-wrap { position: relative; flex-shrink: 0; margin-bottom: .45rem; }
.ai-model-search-wrap > svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ai-model-search-wrap > input { padding-left: 2.5rem; }
.ai-model-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ai-model-option { display: flex; flex-direction: column; gap: .2rem; position: relative; min-height: 44px; padding: .65rem 2rem .65rem .7rem; border-radius: 7px; font-size: .88rem; cursor: pointer; overflow-wrap: anywhere; }
.ai-model-option > small { color: var(--muted); font-size: .75rem; }
.ai-model-option[aria-selected="true"]::after { content: '✓'; position: absolute; right: .7rem; top: .65rem; color: var(--accent); }
.ai-model-option:hover, .ai-model-option[data-active="true"] { color: var(--accent); background: var(--accent-soft); }
.ai-model-option[data-active="true"] { outline: 1px solid var(--accent); outline-offset: -1px; }
.ai-model-empty { padding: .8rem; margin: 0; color: var(--muted); font-size: .85rem; }
.ai-model-actions { display: flex; flex-wrap: wrap; margin-top: .6rem; }
@media (max-width: 600px) { .ai-model-search-wrap > input { font-size: 16px; } }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.utm-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 1rem; }
.utm-form > div { min-width: 0; }
.utm-form label { color: var(--text); font-size: .9rem; font-weight: 600; }
.utm-field { display: flex; flex-direction: column; }
.utm-field > input, .utm-field > select { margin-top: auto; min-width: 0; }
.source-combobox { position: relative; min-width: 0; margin-top: auto; }
.source-combobox-ready > input { padding-right: 3rem; }
.source-combobox-ready > input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(18 99 68 / 12%); }
.source-options-toggle { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-ctl); background: transparent; color: var(--muted); cursor: pointer; }
.source-options-toggle:hover { color: var(--accent); }
.source-combobox-open .source-options-toggle svg { transform: rotate(180deg); }
.source-options { position: absolute; z-index: 15; top: calc(100% + 8px); left: 0; right: 0; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 10px 28px rgb(24 48 35 / 12%); }
.source-options-heading { padding: .5rem .65rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.source-options-list { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.source-option { display: flex; align-items: center; min-height: 44px; padding: .6rem .7rem; border-radius: 7px; font-size: .9rem; cursor: pointer; overflow-wrap: anywhere; }
.source-option:hover, .source-option[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }
.source-options-hint { padding: .55rem .65rem; color: var(--muted); font-size: .75rem; }
.utm-field-heading { display: flex; align-items: flex-start; gap: .25rem; margin-bottom: .25rem; min-height: 32px; }
.utm-form .utm-field-heading label { flex: 1; align-self: center; min-width: 0; margin: 0; }
.utm-form .label-note { display: block; font-size: .8rem; font-weight: 400; }
.label-note { color: var(--muted); font-weight: 400; }
.form-wide { grid-column: 1 / -1; }
.field-help { color: var(--muted); font-size: .8rem; line-height: 1.6; margin: .4rem 0 0; }
small.field-help { display: block; }
.field-help code { font-size: inherit; }
.goal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 1rem; }
.goal-form > div { min-width: 0; }
.goal-form input, .goal-form select { min-width: 0; }
.goal-picker { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; background: #f6faf7; }
.goal-picker-launch { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.goal-picker-launch input { flex: 1 1 180px; width: auto; }
.goal-picker-launch .btn { flex: 0 1 auto; }
.goal-picker-status:empty { display: none; }
.goal-picker-status[data-state="error"] { color: #9f2e21; }
.goal-picker-status[data-state="success"] { color: var(--accent); }
.goal-presets { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; margin-top: .8rem; color: var(--muted); font-size: .8rem; }
.goal-preset { border: 1px solid #cbd9d0; border-radius: 999px; background: var(--surface); color: var(--accent); padding: .35rem .65rem; cursor: pointer; font: inherit; }
.goal-preset:hover { background: #e8f3ec; }
.goal-preset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .goal-picker-launch input, .goal-picker-launch .btn { flex-basis: 100%; width: 100%; } }
.goal-create > summary { font-weight: 600; color: var(--accent); cursor: pointer; }
.goal-list { margin-top: 1rem; }
.goal-rule { padding: 1rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.goal-rule .head > div:first-child { flex: 1 1 220px; min-width: 0; }
.goal-rule > details { margin-top: .5rem; }
.goal-recent { margin-top: 1rem; }
.goal-event-context { display: grid; gap: .4rem; margin: 1.2rem 0 1.5rem; padding: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; }
.goal-event-context span { color: var(--muted); font-size: .85rem; }
.goal-event-fields { display: grid; gap: 1.2rem; }
.goal-event-fields textarea { resize: vertical; }
.goal-event-note { margin: 1.2rem 0 .6rem; font-size: .85rem; }
.goal-event-item { display: flex; gap: 1.5rem; justify-content: space-between; padding: 1.35rem 0; border-top: 1px solid var(--border); scroll-margin-top: 6rem; }
.goal-event-item:target { background: var(--accent-soft); border-radius: 10px; padding: 1.35rem 1rem; }
.goal-event-item-main { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.goal-event-item h3 { margin: .3rem 0 .5rem; }
.goal-event-time { margin: 0; color: var(--muted); font-size: .8rem; }
.goal-event-source { margin: 0; font-size: .85rem; }
.goal-event-comment { white-space: pre-wrap; overflow-wrap: anywhere; margin: .8rem 0 0; border-left: 3px solid var(--border); padding-left: .8rem; font-size: .88rem; }
.goal-event-item-action { display: flex; align-items: flex-end; flex-direction: column; gap: .45rem; }
.goal-event-amount { font-size: 1.25rem; white-space: nowrap; }
.goal-event-pagination { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: center; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.goal-report-comment { max-width: 20rem; min-width: 10rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.goal-report-revenue { margin: .75rem 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 600px) {
  .goal-event-item { flex-direction: column; gap: .8rem; }
  .goal-event-item-action { align-items: flex-start; }
}
.tracking-snippet { width: 100%; min-height: 5.5rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); font: .84rem/1.5 monospace; resize: vertical; }
@media (max-width: 600px) { .goal-form { grid-template-columns: minmax(0, 1fr); } }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .65rem 1rem; border-radius: var(--radius-ctl);
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; text-align: center;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white; box-shadow: 0 2px 5px rgb(22 68 43 / 10%); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--surface); color: #345342; border-color: #cbd9d0; }
.btn.secondary:hover { background: #f0f6f2; border-color: #a4bcad; }
.btn.danger { background: var(--surface); color: var(--neg); border-color: #edc9c4; }
.btn.danger:hover { background: var(--neg-soft); border-color: #ce928b; }
.btn.small { padding: .5rem .75rem; font-size: .77rem; }
.btn svg { flex-shrink: 0; width: 17px; height: 17px; }

.flash { padding: .9rem 1.1rem; border-radius: var(--radius-ctl); margin-bottom: 1.25rem; border: 1px solid transparent; }
.flash.ok { background: var(--accent-soft); color: var(--accent); }
.flash.err { background: var(--neg-soft); color: var(--neg); }

.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; }
.pills a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .45rem .85rem; border: 1px solid transparent; border-radius: 7px;
  text-decoration: none; font-size: .79rem; font-weight: 550; color: var(--muted); background: transparent;
}
.pills a:hover { color: var(--accent); background: #f0f5f2; }
.pills a.active { background: var(--accent-soft); color: var(--accent); border-color: #d2e5d9; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
pre { background: #f1f5f2; border: 1px solid var(--border); padding: 1rem; border-radius: var(--radius-ctl); overflow-x: auto; margin: .75rem 0 1.25rem; }
code { background: #edf2ee; padding: .15rem .4rem; border-radius: 4px; overflow-wrap: anywhere; }
pre code { background: none; padding: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; font-size: .92rem; align-items: baseline; }
.narrow { max-width: 440px; margin: 3rem auto; }
.empty { color: var(--muted); padding: 1.5rem 0; font-size: .86rem; line-height: 1.75; }
.docs h2 { margin-top: 2rem; padding-top: .4rem; }
.docs p, .docs li { max-width: 72ch; }
.docs li { margin-bottom: .45rem; }
.docs details { margin: 1rem 0; }
.docs summary { cursor: pointer; color: var(--accent); }
.docs { min-width: 0; }
.docs-quick-links { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }
.docs-quick-links a { padding: .55rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); color: var(--accent); text-decoration: none; }
.docs-quick-links a:hover { background: var(--surface); }
.docs [id] { scroll-margin-top: 6rem; }
.docs > .card > h2:first-child { margin-top: 0; }
.docs-platform-guide { padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.docs-platform-guide > summary, .docs-credentials > summary { font-weight: 600; }
.docs-platform-guide .table-wrap { margin-top: 1rem; }
.docs-platform-guide table { min-width: 600px; }
.docs-platform-guide td { vertical-align: top; white-space: normal; }
.docs-platform-guide td:last-child { min-width: 18rem; }
.docs .card, .docs .table-wrap { min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
  .docs-platform-guide table, .docs-platform-guide tbody { display: block; min-width: 0; }
  .docs-platform-guide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .docs-platform-guide tr { display: grid; gap: .35rem; padding: .9rem 0; border-bottom: 1px solid var(--border); }
  .docs-platform-guide td, .docs-platform-guide td:last-child { padding: 0; min-width: 0; border: 0; }
  .docs-platform-guide td:first-child { font-weight: 700; }
}
.integration-credentials { display: grid; gap: .65rem; }
.credential-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .35rem .9rem; }
.credential-row > label { padding-top: .5rem; margin: 0; font-size: .92rem; }
.credential-value { min-width: 0; }
.integration-credentials input, .docs-credentials input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f5f8f6; }
@media (max-width: 600px) {
  .credential-row { grid-template-columns: minmax(0, 1fr); }
  .credential-row > label { padding-top: 0; }
}

/* Finansinių rezultatų grafikai: viena skalė visoms to paties grafiko eilutėms. */
.performance-chart { --chart-label: 180px; --chart-value: 146px; }
.chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.chart-heading h2, .source-matrix h2 { font-size: 1.08rem; margin-bottom: .35rem; }
.chart-heading .sub, .source-matrix > .sub { font-size: .84rem; margin-bottom: 1.4rem; }
.chart-currency { padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 6px; font-size: .74rem; color: var(--muted); }
.chart-currency-note { padding: .75rem 1rem; background: #e8edf6; border-radius: var(--radius-ctl); color: #30445f; }
.currency-report-note { font-size: .8rem; padding: .9rem 1.3rem; }
.currency-report-note p:first-child { margin-top: 0; }
.currency-report-note summary { cursor: pointer; color: var(--accent); }
.currency-report-note .table-wrap { max-height: 280px; overflow: auto; margin-top: .5rem; }
.chart-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.3rem; }
.chart-kpis > div { background: #f6f9f7; border: 1px solid #e8ede9; padding: 1rem; border-radius: var(--radius-ctl); min-width: 0; }
.chart-kpis > div > span { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .3rem; }
.chart-kpis strong { display: block; font-size: clamp(1.05rem, 2vw, 1.4rem); overflow-wrap: anywhere; line-height: 1.3; }
.chart-switch { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.chart-switch[hidden], [data-chart-panel][hidden] { display: none; }
.chart-switch button { min-height: 44px; padding: .55rem .95rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); color: var(--muted); background: var(--surface); font: inherit; font-size: .79rem; font-weight: 550; cursor: pointer; }
.chart-switch button:hover { color: var(--accent); border-color: #b9cfc1; }
.chart-switch button.active { color: var(--accent); background: var(--accent-soft); border-color: #c5dece; }
.chart-panel-title { font-size: .94rem; margin: .8rem 0 .5rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .78rem; color: var(--muted); margin-bottom: .8rem; }
.chart-legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: .65rem; height: .65rem; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.chart-legend i.positive, .chart-bar.positive { background: #16804c; }
.chart-legend i.negative, .chart-bar.negative { background: #c43d32; }
.chart-legend i.neutral, .chart-bar.neutral { background: #8b9690; }
.chart-legend i.spend, .chart-bar.spend { background: #5369b3; }
.chart-legend i.revenue, .chart-bar.revenue { background: #168d87; }
.chart-scroll { max-height: 38rem; overflow-y: auto; scrollbar-gutter: stable; }
.chart-row { display: grid; grid-template-columns: var(--chart-label) minmax(0, 1fr) var(--chart-value); gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid #e8ece8; }
.chart-row:last-child { border-bottom: 0; }
.chart-label { min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.chart-label > a, .chart-label > strong { font-weight: 600; }
.chart-label small { display: block; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.chart-value { text-align: right; font-size: .9rem; overflow-wrap: anywhere; }
.chart-value small { display: block; font-size: .73rem; color: var(--muted); margin-top: .2rem; }
.chart-value.positive { color: var(--accent); }
.chart-value.negative { color: var(--neg); }
.chart-value.neutral { color: var(--muted); }
.chart-plot { position: relative; height: 28px; background: #f2f4f2; border-radius: 3px; }
.chart-profit-plot { background: #f2f6f3; }
.chart-profit-plot::after { content: ''; position: absolute; width: 1px; left: 50%; top: -5px; bottom: -5px; background: #8b9690; }
.chart-bar { position: absolute; left: 0; top: 6px; height: 16px; border-radius: 2px; }
.chart-axis-row { display: grid; grid-template-columns: var(--chart-label) minmax(0, 1fr) var(--chart-value); gap: 1rem; padding-right: 16px; }
.chart-axis { grid-column: 2; display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; gap: .25rem; }
.chart-comparison-bars { grid-column: 2 / -1; min-width: 0; display: grid; gap: .35rem; }
.chart-comparison-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) 115px; gap: .6rem; align-items: center; font-size: .78rem; }
.chart-comparison-line > span { color: var(--muted); }
.chart-comparison-line > strong { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.chart-note { margin: 1rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.matrix-scroll { max-height: 40rem; }
.matrix-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.matrix-table { border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 100%; width: max-content; }
.matrix-table th { width: 180px; min-width: 180px; max-width: 180px; overflow-wrap: anywhere; }
.matrix-table thead th { padding: .6rem .8rem; vertical-align: bottom; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.matrix-table th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix-table thead th:first-child { z-index: 3; }
.matrix-table tbody th { color: var(--text); font-weight: 600; padding: .7rem .5rem; vertical-align: middle; }
.matrix-table th small { display: block; color: var(--muted); font-size: .73rem; font-weight: 400; margin-top: .25rem; }
.matrix-cell { padding: 0; min-width: 180px; text-align: center; border: 0; border-radius: 6px; vertical-align: middle; }
.matrix-cell > a { display: block; padding: .85rem .65rem; color: inherit; text-decoration: none; border-radius: 6px; }
.matrix-cell > a:hover { box-shadow: inset 0 0 0 1px currentColor; }
.matrix-cell.positive { color: #0e5d37; background: rgb(22 128 76 / var(--cell-alpha)); }
.matrix-cell.negative { color: #96251b; background: rgb(196 61 50 / var(--cell-alpha)); }
.matrix-cell.neutral { color: var(--muted); background: #f0f3f0; }
.matrix-cell strong { display: block; font-size: 1rem; }
.matrix-cell small { display: block; font-size: .73rem; margin-top: .2rem; }
.matrix-detail { display: block; color: var(--text); opacity: .85; font-size: .71rem; line-height: 1.5; margin-top: .55rem; }

/* Puslapio hierarchija, projektų suvestinė ir greitos užduotys. */
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.6rem; }
.page-heading > div:first-child { flex: 1 1 280px; min-width: 0; }
.page-heading .sub { margin: 0; max-width: 64ch; }
.eyebrow { display: block; margin: 0 0 .55rem; font-size: .69rem; color: var(--accent); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.breadcrumb { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; margin-bottom: .9rem; color: var(--muted); font-size: .79rem; text-decoration: none; }
.breadcrumb:hover { color: var(--accent); }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .65rem 0 0; color: var(--muted); font-size: .79rem; }
.page-meta > span { padding: .2rem .65rem; border-radius: 5px; background: #eaf0ec; }
.section-nav { position: sticky; top: .75rem; z-index: 20; display: flex; gap: .35rem; padding: .35rem; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); overflow-x: auto; scrollbar-width: thin; box-shadow: 0 3px 12px rgb(24 48 35 / 6%); }
#visitors, #source-performance, #goals, #goal-report, #links, #budgets, #conversions, #integration { scroll-margin-top: 6rem; }
.section-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; flex: 1 0 auto; padding: .6rem .85rem; border-radius: 7px; color: var(--muted); font-size: .79rem; font-weight: 550; text-decoration: none; white-space: nowrap; }
.section-nav a:hover, .section-nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }
.overview-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.overview-summary-with-average { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-stat { min-width: 0; padding: 1.3rem 1.35rem; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.summary-stat > span { display: block; color: var(--muted); font-size: .79rem; font-weight: 550; }
.summary-stat > strong { display: block; margin: .65rem 0 .45rem; color: var(--text); font-size: clamp(1.45rem, 2.5vw, 2rem); font-weight: 680; line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
.summary-stat > strong.pos { color: var(--accent); }
.summary-stat > strong.neg { color: var(--neg); }
.summary-stat > small { display: block; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.section-heading h2 { margin: 0; }
.section-heading .sub { margin: .4rem 0 0; }
.project-tools { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .65rem; margin-bottom: 1rem; }
.project-tools input { width: 220px; font-size: .8rem; }
.project-tools label { margin-bottom: .35rem; font-size: .72rem; }
.project-tools [role="status"] { color: var(--muted); font-size: .74rem; }
.project-name { display: flex; align-items: center; gap: .7rem; min-width: 185px; }
.site-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid #dbe7df; border-radius: 10px; background: #eef5f0; color: var(--accent); font-size: .9rem; font-weight: 700; text-transform: uppercase; }
.project-name-text { min-width: 0; }
.project-domain { display: block; color: var(--text); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.project-domain:hover { color: var(--accent); text-decoration: underline; }
.project-name-text .muted, .project-name-text small { display: block; margin-top: .2rem; font-size: .72rem; }
.project-summary .table-wrap { margin: 0 -.25rem; }
.project-summary .empty { padding: 2.3rem 1rem; }
.project-summary > .field-help, .project-summary > .muted { margin-bottom: 0; }
.table-note { padding-top: .8rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 2.8rem 1rem; text-align: center; }
.empty-state h3, .empty-state strong { margin: .6rem 0 .4rem; font-size: 1.04rem; color: var(--text); }
.empty-state p { max-width: 47ch; margin: 0 0 1.3rem; color: var(--muted); font-size: .85rem; }
.empty-state.compact { padding: 1.5rem 1rem; }
.empty-symbol { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 1.6rem; font-weight: 400; }
.period-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 1.5rem; padding: 1.1rem 1.3rem; }
.period-heading { flex: 1 1 100%; color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.period-presets { flex: 1 1 450px; margin: 0; }
.period-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .65rem; }
.period-form > div { min-width: 0; }
.period-form input { width: 145px; font-size: .79rem; }
.period-form label { font-size: .73rem; }
.period-form .btn { font-size: .79rem; }
.form-card.narrow { max-width: 720px; margin: 0; padding: 1.8rem; }
.form-intro { margin-bottom: 1.5rem; }
.form-intro h1, .form-intro h2 { margin-top: 0; }
.form-card .grid { gap: 1.2rem; }
.form-card > form > p { margin: 0 0 1.25rem; }
.form-card .actions { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.35rem 1.5rem; margin-top: 1.5rem; max-width: 720px; border: 1px solid #ead8d4; border-radius: var(--radius-card); background: #fffafa; }
.danger-zone h2 { font-size: .93rem; margin-bottom: .3rem; }
.danger-zone p { margin: 0; max-width: 55ch; color: var(--muted); font-size: .8rem; }

@media (max-width: 1100px) {
  .overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-summary-with-average > .summary-stat-average { grid-column: 1 / -1; }
  .performance-chart { --chart-label: 145px; --chart-value: 128px; }
  .period-presets { flex-basis: 100%; }
}
@media (max-width: 1200px) {
  .nav { flex-wrap: wrap; gap: .65rem; padding: .85rem 1.25rem; }
  .nav .brand { margin-right: auto; padding: 0; font-size: 1.16rem; }
  .nav-toggle { order: 2; }
  .nav .nav-project-switcher { order: 3; flex: 1 0 100%; width: 100%; margin: .2rem 0 0; }
  .brand-mark { flex-basis: 34px; width: 34px; height: 34px; border-radius: 9px; }
  .brand-copy small { font-size: .61rem; }
  .nav-links { flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: .75rem; padding-top: .8rem; border-top: 1px solid var(--border); }
  .nav-primary { flex-direction: column; gap: .25rem; }
  .nav-item { min-height: 46px; padding: .6rem .75rem; white-space: normal; }
  .nav-footer { justify-content: space-between; flex-wrap: wrap; padding: .8rem .75rem .2rem; border-top: 1px solid var(--border); }
  .nav-account { max-width: 100%; flex: 1 1 140px; text-align: left; }
  .nav-account strong { white-space: normal; overflow-wrap: anywhere; }
  .nav-footer .btn { min-height: 44px; }
  .wrap { padding: 1.8rem 1.25rem 3rem; }
  .card { padding: 1.25rem; }
}

@media (max-width: 760px) {
  .nav { padding: .85rem 1rem; }
  .wrap { width: 100%; margin-left: 0; padding: 1.6rem 1.1rem 3rem; }
  .page-heading { margin-bottom: 1.3rem; }
  .page-actions { width: 100%; }
  .page-heading > div:first-child { flex-basis: 100%; }
  .overview-summary { gap: .8rem; }
  .summary-stat { padding: 1.1rem; }
  .section-nav { margin-bottom: 1.2rem; }
  .section-nav a { flex-grow: 0; }
  .performance-chart { --chart-label: 130px; --chart-value: 115px; }
  .chart-row, .chart-axis-row { gap: .65rem; }
  .chart-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-comparison-line { grid-template-columns: 48px minmax(0, 1fr) 100px; gap: .4rem; }
}

@media (max-width: 600px) {
  .utm-form { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 1.3rem .85rem 2.5rem; }
  .card { padding: 1.1rem; margin-bottom: 1.1rem; }
  th, td { padding: .8rem .6rem; }
  h1 { font-size: 1.6rem; }
  .eyebrow { font-size: .64rem; }
  .page-actions .btn { flex: 1 1 auto; }
  .summary-stat { padding: .9rem; }
  .summary-stat > span { font-size: .72rem; }
  .summary-stat > strong { font-size: 1.55rem; }
  .summary-stat > small { font-size: .69rem; }
  .section-heading { gap: .9rem; }
  .project-tools, .project-search, .project-tools input { width: 100%; }
  input, select, textarea, .period-form input, .project-tools input, .link-copy-row input { font-size: 16px; }
  .period-bar { gap: .8rem; }
  .period-presets { gap: .3rem; }
  .pills a { min-height: 44px; padding: .45rem .65rem; font-size: .75rem; }
  .period-form { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .period-form > div:last-child { grid-column: 1 / -1; }
  .period-form input, .period-form .btn { width: 100%; }
  .form-card.narrow { padding: 1.25rem; }
  .danger-zone { padding: 1.15rem; }
  .two { gap: 0; }
  .chart-row { grid-template-columns: minmax(0, 1fr) 128px; gap: .5rem .75rem; }
  .chart-value { grid-column: 2; grid-row: 1; }
  .chart-profit-plot { grid-column: 1 / -1; grid-row: 2; margin: .3rem 0; }
  .chart-axis-row { display: block; }
  .chart-axis { font-size: .66rem; }
  .chart-comparison-row .chart-label, .chart-comparison-bars { grid-column: 1 / -1; }
  .chart-comparison-line { grid-template-columns: 48px minmax(0, 1fr) 96px; }
  .chart-kpis { gap: .5rem; }
  .chart-kpis > div { padding: .65rem; }
  .matrix-table th:first-child { width: 124px; min-width: 124px; max-width: 124px; }
}

/* Paaiškinimai prie rodiklių: pasiekiami pele, klaviatūra ir palietus. */
.help-trigger {
  display: inline-flex; align-items: center; justify-content: inherit; gap: .3rem;
  min-height: 32px; max-width: 100%; padding: .15rem 0; border: 0; border-radius: 3px;
  background: transparent; color: var(--accent); font: inherit; line-height: inherit;
  text-align: inherit; text-decoration: underline dotted; text-underline-offset: .2em;
  cursor: help;
}
.help-trigger:hover, .help-trigger[aria-expanded="true"] { color: #084f2e; }
.help-trigger-icon { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; justify-content: center; text-decoration: none; }
.help-trigger-icon:hover, .help-trigger-icon[aria-expanded="true"] { background: var(--accent-soft); }
.help-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 1.05em; height: 1.05em; border: 1px solid currentColor; border-radius: 50%;
  font-size: .8em; line-height: 1; font-weight: 600;
}
.help-tooltip {
  display: block; position: fixed; z-index: 1000; width: min(360px, calc(100vw - 24px));
  padding: .85rem 1rem; border: 1px solid var(--accent); border-radius: var(--radius-ctl);
  background: #fcfffc; color: var(--text); box-shadow: 0 6px 24px rgb(14 55 32 / 12%);
  font-size: .86rem; font-weight: 400; line-height: 1.55; text-align: left;
  white-space: normal; overflow-wrap: anywhere; overflow-y: auto;
}
.help-tooltip[hidden] { display: none; }
.help-tooltip-line { display: block; }
.help-tooltip-line + .help-tooltip-line { margin-top: .6rem; }

.generated-links { margin-top: 1rem; }
.generated-link { min-width: 0; padding: 1rem 0; border-top: 1px solid var(--border); }
.generated-link-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .7rem; }
.generated-link-heading > div { min-width: 0; overflow-wrap: anywhere; }
.generated-link-heading > form { flex-shrink: 0; }
.link-copy-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.link-copy-row input { flex: 1 1 16rem; width: auto; min-width: 0; font-size: .85rem; }
.link-copy-row .btn { flex: 0 0 auto; }
.full-link { margin-top: .7rem; }
.full-link summary { color: var(--accent); font-size: .85rem; }
.full-link .link-copy-row { margin-top: .6rem; }
.copy-feedback { display: block; color: var(--muted); font-size: .8rem; }
.copy-feedback:not(:empty) { margin-top: .6rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.margin-guide { margin-block: 1.4rem; }
.margin-examples { margin-block: 1rem; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: #fafcfb; }
.margin-examples > summary { padding: .85rem 1rem; color: var(--accent); font-weight: 600; cursor: pointer; }
.margin-examples ol { margin: 0; padding: 0 1.1rem 0 2.4rem; }
.margin-examples li { padding: .85rem 0; }
.margin-examples li + li { border-top: 1px solid var(--border); }
.margin-examples li > strong { display: block; }
.margin-examples li p { margin: .4rem 0 .7rem; }
.margin-examples > p { margin: .5rem 1rem 1rem; }
.margin-preview { padding: 1rem; background: var(--accent-soft); border: 1px solid #c8dfd1; border-radius: var(--radius-ctl); }
.margin-preview h2 { margin-bottom: .4rem; font-size: .9rem; }
.margin-preview > p { margin: .4rem 0; }
.margin-preview dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0 .3rem; }
.margin-preview dt { color: #43574b; font-size: .77rem; }
.margin-preview dd { margin: .25rem 0 0; font-size: 1.2rem; font-weight: 650; }
.margin-preview .field-help { margin-top: .9rem; }
.margin-scope { margin-bottom: 0; }
@media (max-width: 480px) {
  .margin-preview dl { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .margin-preview dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
  .margin-preview dd { flex-shrink: 0; margin: 0; }
}

.traffic-trend { display: flex; gap: .7rem; overflow-x: auto; padding: .8rem 0; }
.traffic-day { display: flex; flex: 1 0 82px; flex-direction: column; align-items: center; gap: .4rem; font-size: .73rem; }
.traffic-day-track { display: flex; align-items: flex-end; justify-content: center; height: 100px; width: 100%; border-bottom: 1px solid var(--border); }
.traffic-day-track span { display: block; width: min(34px, 80%); background: var(--accent); border-radius: 3px 3px 0 0; }
.traffic-trend[data-interval="hour"] { gap: .35rem; }
.traffic-trend[data-interval="hour"] .traffic-day { flex-basis: 40px; font-variant-numeric: tabular-nums; }
.traffic-trend:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Shared language menu, including public and signed-in layouts. */
.language-switcher { display: inline-flex; align-items: center; align-self: center; flex-shrink: 0; gap: 3px; padding: 3px; border: 1px solid #d5e1da; border-radius: 9px; }
.language-switcher a { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px; padding: 5px 9px; border-radius: 6px; color: #435b4e; text-decoration: none; font-size: .8rem; font-weight: 600; }
.language-switcher a:hover { background: #f0f6f2; }
.language-switcher a[aria-current] { color: #fff; background: #155e4a; }
.language-switcher a:focus-visible { outline: 2px solid #155e4a; outline-offset: 3px; }
@media (max-width: 1200px) { .language-switcher { align-self: flex-start; } .language-switcher a { min-height: 44px; min-width: 44px; } }

/* Administrative runtime error notice */
.runtime-errors-banner{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 22px;padding:16px 20px;border:1px solid color-mix(in srgb,#d48812 40%,var(--border,#e2e8f0));border-radius:10px;background:color-mix(in srgb,#e59b1e 9%,var(--surface,#fff));color:var(--text,#1e293b);font-size:13px;line-height:1.6}.runtime-errors-banner-copy{min-width:0}.runtime-errors-banner-copy strong{display:block;font-size:14px}.runtime-errors-banner-copy p{margin:4px 0 0}.runtime-errors-banner-actions{display:flex;align-items:center;gap:12px;flex:none}.runtime-errors-banner a{font-weight:650}@media(max-width:750px){.runtime-errors-banner{align-items:flex-start;flex-direction:column;gap:12px}}
