:root {
  --ink: #17221d;
  --muted: #5f6e66;
  --line: #dce6df;
  --surface: #ffffff;
  --soft: #f2f7f3;
  --brand: #176b4c;
  --brand-dark: #0d4d35;
  --accent: #dff2e7;
  --danger: #a43737;
  --shadow: 0 20px 60px rgba(25, 59, 44, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7faf8;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 8% 0%, #e3f4e9 0, transparent 30%), linear-gradient(180deg, #fbfdfb 0, #f5f9f6 100%); }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
.site-header { min-height: 164px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 5vw; border-bottom: 1px solid rgba(23,107,76,.12); background: rgba(255,255,255,.82); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.instance-banner { padding: 10px 5vw; background: #fff1c7; color: #5e4200; border-bottom: 1px solid #e9c766; font-weight: 750; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 22px; font-size: clamp(28px, 3vw, 40px); font-weight: 820; color: var(--ink); text-decoration: none; letter-spacing: -.025em; }
.brand-logo { width: 138px; height: 138px; object-fit: contain; }
.admin-surface .site-header { min-height: 174px; justify-content: flex-start; padding-left: max(28px, 4vw); }
.admin-surface .brand { flex: 0 0 auto; gap: 22px; font-size: clamp(30px, 3vw, 42px); font-weight: 820; letter-spacing: -.025em; }
.admin-surface .brand-logo { width: 146px; height: 146px; }
.admin-surface .site-header > a:not(.brand) { margin-left: auto; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--brand); border-radius: 11px; font-size: 24px; line-height: 1; }
.page-shell { width: min(1180px, 92vw); margin: 48px auto 80px; }
.site-footer { padding: 24px 5vw 40px; text-align: center; color: var(--muted); font-size: 14px; }
.card { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 30px; }
.hero { max-width: 780px; margin: 10vh auto; padding: clamp(32px, 7vw, 72px); }
h1 { margin: 10px 0 16px; font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -.035em; }
h2 { margin: 0 0 18px; font-size: 24px; }
.lead { font-size: 20px; line-height: 1.6; color: var(--muted); }
.eyebrow { color: var(--brand); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.notice, .alert { border-radius: 14px; padding: 14px 16px; margin: 18px 0; }
.notice { background: var(--soft); }
.alert-error { background: #fff0f0; color: var(--danger); border: 1px solid #f2caca; }
.alert-success { background: var(--accent); color: var(--brand-dark); border: 1px solid #c1e4cf; }
.form-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(480px, 1.2fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.intro-panel { position: sticky; top: 116px; padding-top: 28px; }
.intro-panel h1 { font-size: clamp(36px, 5vw, 54px); }
.intro-panel p { color: var(--muted); font-size: 18px; line-height: 1.65; }
.steps { list-style: none; padding: 0; margin: 32px 0; display: grid; gap: 18px; }
.steps li { display: flex; align-items: center; gap: 12px; font-weight: 650; }
.steps span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--brand); background: var(--accent); }
.feedback-form { display: grid; gap: 24px; }
.form-section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 2px; }
.form-section-heading h2 { margin: 0 0 3px; font-size: 20px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.section-number { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--brand-dark); background: var(--accent); font-weight: 850; }
.form-divider { height: 1px; margin: 2px 0; background: var(--line); }
.feedback-form:has(input[name="kind"][value="idea"]:checked) [data-problem-only],
.feedback-form:has(input[name="kind"][value="thanks"]:checked) [data-problem-only],
.feedback-form:has(input[name="kind"][value="thanks"]:checked) [data-photo-field],
.feedback-form:has(input[name="anonymous"][value="true"]:checked) [data-name-field] {
  display: none;
}
fieldset { border: 0; padding: 0; margin: 0; }
legend, .field > label, form > label, .survey-card label { display: block; font-weight: 750; margin-bottom: 10px; }
.field { display: grid; gap: 8px; }
.field-help, .field-hint { color: var(--muted); font-size: 14px; }
.field-hint { text-align: right; }
input[type="text"], input[type="password"], input[type="search"], input:not([type]), select, textarea { width: 100%; border: 1px solid #cbd8d0; border-radius: 13px; background: white; color: var(--ink); padding: 13px 14px; outline: none; transition: border .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23,107,76,.12); }
textarea { min-height: 138px; resize: vertical; line-height: 1.5; }
.readonly-value { padding: 13px 14px; border-radius: 13px; background: var(--soft); }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice-grid-three { grid-template-columns: repeat(3, 1fr); }
.choice-card { position: relative; display: flex; min-height: 70px; cursor: pointer; }
.choice-card input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-card > span { width: 100%; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; transition: transform .18s ease, border .18s ease, background .18s ease, box-shadow .18s ease; }
.choice-card:hover > span { border-color: #a9c9b7; transform: translateY(-1px); }
.choice-card input:checked + span { border-color: var(--brand); background: var(--accent); box-shadow: inset 0 0 0 1px var(--brand); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(23,107,76,.2); outline-offset: 2px; }
.choice-card small { color: var(--muted); }
.consent-row { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 500 !important; color: var(--muted); line-height: 1.45; }
.consent-row input { margin-top: 4px; }
.consent-row a { font-weight: 750; }
.content-page { max-width: 880px; margin: 0 auto; }
.content-page-heading { margin: 22px 0 28px; }
.content-page-heading h1 { max-width: 760px; font-size: clamp(32px, 5vw, 48px); }
.back-link { display: inline-flex; font-size: 15px; }
.legal-section { margin: 16px 0; box-shadow: none; }
.legal-section h2 { margin-top: 0; font-size: 22px; }
.legal-section p, .legal-section li { line-height: 1.65; }
.legal-section ul { padding-left: 22px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; border: 0; border-radius: 13px; padding: 11px 18px; font-weight: 750; cursor: pointer; text-decoration: none; }
.button-primary { background: var(--brand); color: white; }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { background: var(--soft); color: var(--ink); }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover { background: #812929; }
.button-ghost { color: var(--brand); background: transparent; border: 1px solid var(--line); }
.button-wide { width: 100%; }
.button-row { display: flex; gap: 10px; margin-top: 12px; }
.secondary-form { margin-top: 12px; }
.preview-dialog { width: min(620px, 92vw); border: 0; border-radius: 24px; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.preview-dialog::backdrop { background: rgba(13,35,25,.55); backdrop-filter: blur(5px); }
.dialog-content { padding: 32px; }
.preview-list { display: grid; gap: 12px; }
.preview-list > div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.preview-list dt { color: var(--muted); font-size: 13px; }
.preview-list dd { margin: 4px 0 0; white-space: pre-wrap; }
.message-preview { min-height: 110px; max-height: 45vh; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.ticket-page { max-width: 820px; margin: 0 auto; }
.ticket-summary { margin: 22px 0; }
.ticket-summary dl { display: grid; grid-template-columns: minmax(130px, .45fr) minmax(0, 1fr); gap: 10px 22px; margin: 0; }
.ticket-summary dt { color: var(--muted); font-size: 13px; }
.ticket-summary dd { margin: 0; overflow-wrap: anywhere; }
.ticket-photos { margin: 22px 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-grid a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); aspect-ratio: 4 / 3; }
.photo-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-grid-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.selected-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-picker { display: flex !important; align-items: center; gap: 13px; min-height: 78px; margin: 0 !important; padding: 14px 16px; border: 1.5px dashed #a8c8b5; border-radius: 15px; color: var(--ink); background: var(--soft); cursor: pointer; transition: border .18s, background .18s; }
.photo-picker:hover { border-color: var(--brand); background: #eaf5ee; }
.photo-picker-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: white; background: var(--brand); font-size: 25px; font-weight: 400; }
.photo-picker span:last-child { display: grid; gap: 3px; }
.photo-picker small { color: var(--muted); font-weight: 500; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }
.visually-hidden-file:focus-visible + .field-help { outline: 2px solid var(--brand); }
.selected-photo { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.selected-photo img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: white; }
.selected-photo-details { display: grid; gap: 5px; padding: 10px; }
.selected-photo-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.selected-photo-details small { color: var(--muted); }
.photo-remove { justify-self: start; border: 0; padding: 0; color: var(--danger); background: transparent; cursor: pointer; text-decoration: underline; }
.conversation-heading { margin-top: 30px; }
.ticket-heading, .admin-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.ticket-heading h1, .admin-heading h1 { font-size: clamp(30px, 4vw, 44px); }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 750; white-space: nowrap; background: #edf2ef; }
.status-new { color: #805a00; background: #fff4cc; }
.status-assigned, .status-waiting_for_admin { color: #205c94; background: #e2f0ff; }
.status-waiting_for_user { color: #77488d; background: #f4e9fb; }
.status-resolved, .status-closed { color: var(--brand); background: var(--accent); }
.bind-card, .reply-card, .survey-card { margin: 22px 0; }
.bind-card-primary { border-color: #a9d8bb; background: linear-gradient(135deg, #fff, var(--accent)); }
.channel-connected { margin: 18px 0; color: var(--brand); font-weight: 700; }
.conversation { display: grid; gap: 12px; margin: 30px 0; }
.message { max-width: 84%; border-radius: 18px; padding: 14px 16px; background: white; border: 1px solid var(--line); }
.message-user { justify-self: end; background: var(--accent); border-color: #c6e5d2; }
.message-admin { justify-self: start; }
.message-system { justify-self: center; background: var(--soft); }
.message-meta { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.auth-card { max-width: 460px; margin: 8vh auto; }
.auth-card h1 { font-size: 38px; }
.auth-card form { display: grid; gap: 18px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.header-actions form { margin: 0; }
.header-actions a, .header-actions .link-button { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--brand-dark); background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 700; }
.header-actions a:hover, .header-actions .link-button:hover { border-color: #a9c9b7; background: var(--accent); }
.site-header > a:not(.brand) { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--brand-dark); background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 700; }
.link-button { border: 0; background: none; color: var(--brand); text-decoration: underline; cursor: pointer; }
.admin-page { width: 100%; }
.admin-section-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 28px; }
.admin-section-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 11px; min-height: 98px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); text-align: left; text-decoration: none; box-shadow: 0 8px 24px rgba(25,59,44,.045); cursor: pointer; transition: transform .18s, border .18s, background .18s; }
.admin-section-card:hover { transform: translateY(-2px); border-color: #a9c9b7; background: #fbfefc; }
.admin-section-card > span { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--brand); background: var(--accent); font-weight: 850; }
.admin-section-card strong { align-self: end; }
.admin-section-card small { align-self: start; color: var(--muted); line-height: 1.35; }
.admin-section-form { margin: 0; }
.admin-section-form .admin-section-card { width: 100%; font: inherit; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.help-card { position: relative; min-height: 190px; box-shadow: none; }
.help-card h2 { padding-right: 45px; }
.help-card p { color: var(--muted); line-height: 1.65; }
.help-step { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--brand); background: var(--accent); font-weight: 850; }
.help-section { margin-top: 20px; box-shadow: none; }
.help-definition-list { display: grid; gap: 0; margin: 0; }
.help-definition-list > div { display: grid; grid-template-columns: minmax(160px, .35fr) minmax(0, 1fr); gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.help-definition-list > div:last-child { border-bottom: 0; }
.help-definition-list dt { font-weight: 800; }
.help-definition-list dd { margin: 0; color: var(--muted); line-height: 1.55; }
.help-safety { margin-top: 20px; line-height: 1.6; }
.filter-form select { min-width: 190px; }
.ticket-table-wrap { padding: 0; overflow: hidden; }
.ticket-table { width: 100%; border-collapse: collapse; }
.ticket-table th, .ticket-table td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.ticket-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: var(--soft); }
.ticket-table tr:last-child td { border-bottom: 0; }
.empty-state { text-align: center !important; color: var(--muted); padding: 50px !important; }
.queue-summary { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.status-history { display: grid; gap: 10px; padding-left: 20px; }
.status-history li { padding-left: 4px; }
.status-history time, .status-history small { display: block; color: var(--muted); font-size: 12px; }
.audit-details { display: block; max-width: 360px; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-filter { display: grid; grid-template-columns: 1.2fr 1fr .8fr .7fr auto; gap: 12px; align-items: end; padding: 18px; box-shadow: none; }
.audit-filter label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.admin-grid { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(460px, 1.35fr); gap: 28px; align-items: start; }
.ticket-facts { position: sticky; top: 110px; }
.ticket-facts dl { display: grid; grid-template-columns: 1fr; gap: 5px; }
.ticket-facts dt { margin-top: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.ticket-facts dd { margin: 0; }
.admin-conversation { margin-top: 0; }
.dev-setup-card { margin: 22px 0; }
.registration-active-card { margin: 22px 0; border-color: #a9d8bb; }
.registration-active-card h2 { margin-top: 14px; }
.max-groups-table small { display: block; margin-top: 5px; }
.registration-ready { color: var(--brand); }
.registration-warning { color: var(--danger); }
.admin-create-card { margin-bottom: 24px; }
.admin-create-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
.admin-create-form label, .password-reset-form label, .password-field { display: grid; gap: 8px; font-weight: 700; }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 52px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; color: var(--brand-dark); background: transparent; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { background: var(--accent); }
.password-toggle:focus-visible { outline: 3px solid rgba(23,107,76,.2); }
.admin-user-list { display: grid; gap: 20px; }
.admin-user-card { box-shadow: none; }
.admin-user-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.admin-user-heading h2 { margin: 12px 0 4px; }
.admin-user-heading p { margin: 0; }
.admin-user-meta { display: grid; gap: 5px; text-align: right; color: var(--muted); font-size: 14px; }
.admin-user-actions, .channel-access-list { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 20px; }
.admin-user-actions form, .channel-access-list form { margin: 0; }
.channel-access-list form { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 11px; background: var(--soft); }
.password-reset-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.metric-card { display: grid; gap: 7px; min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 35px rgba(25, 59, 44, .06); }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { font-size: 30px; line-height: 1; }
.dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card-attention { border-color: #efd89d; background: #fffbef; }
.metric-card-danger { border-color: #efc2c2; background: #fff5f5; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.dashboard-grid-primary { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.dashboard-grid-operations { grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); }
.chart-card { padding: 22px; box-shadow: none; }
.chart-card h2 { margin-top: 6px; font-size: 22px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 12px; }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; }
.legend-created::before { background: #3278b8; }
.legend-resolved::before { background: var(--brand); }
.legend-assigned::before { background: #a16b24; }
.legend-replies::before { background: #7556b8; }
.flow-chart { display: grid; gap: 10px; max-height: 510px; margin-top: 18px; overflow: auto; }
.flow-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; }
.flow-label { color: var(--muted); font-size: 12px; }
.flow-series { display: grid; gap: 5px; }
.flow-series label { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 8px; align-items: center; }
.flow-series b { color: var(--muted); font-size: 12px; text-align: right; }
progress { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: #e8efeb; }
progress::-webkit-progress-bar { border-radius: 999px; background: #e8efeb; }
progress::-webkit-progress-value { border-radius: 999px; background: var(--brand); }
progress::-moz-progress-bar { border-radius: 999px; background: var(--brand); }
.progress-created::-webkit-progress-value { background: #3278b8; }
.progress-created::-moz-progress-bar { background: #3278b8; }
.progress-resolved::-webkit-progress-value { background: var(--brand); }
.progress-resolved::-moz-progress-bar { background: var(--brand); }
.progress-assigned::-webkit-progress-value { background: #a16b24; }
.progress-assigned::-moz-progress-bar { background: #a16b24; }
.progress-replies::-webkit-progress-value { background: #7556b8; }
.progress-replies::-moz-progress-bar { background: #7556b8; }
.progress-response::-webkit-progress-value { background: #b45e32; }
.progress-response::-moz-progress-bar { background: #b45e32; }
.progress-rating::-webkit-progress-value { background: #d5a72f; }
.progress-rating::-moz-progress-bar { background: #d5a72f; }
.progress-list { display: grid; gap: 15px; margin-top: 20px; }
.progress-item { display: grid; gap: 7px; }
.progress-item > div { display: flex; justify-content: space-between; gap: 14px; }
.progress-item span { overflow-wrap: anywhere; }
.service-card { display: grid; align-content: start; }
.service-time { display: grid; grid-template-columns: 1fr auto; gap: 5px 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.service-time strong { font-size: 24px; }
.service-time small { grid-column: 1 / -1; color: var(--muted); }
.satisfaction-score { display: flex; align-items: baseline; gap: 7px; margin-top: 24px; color: var(--brand); }
.satisfaction-score strong { font-size: 58px; line-height: 1; }
.satisfaction-score span { font-size: 20px; }
.chart-caption { color: var(--muted); font-size: 12px; }
.dashboard-note { margin-top: 20px; line-height: 1.6; }
.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; }
.statistics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.statistics-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.statistics-grid .card { padding: 22px; box-shadow: none; }
.statistics-grid h2 { font-size: 20px; }
.stat-row { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.integration-warning { color: var(--danger); background: #fff0f0; }
.integration-status-card, .admin-workload-card { margin-top: 20px; box-shadow: none; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.integration-list { display: grid; gap: 3px; }
.integration-row { display: grid; grid-template-columns: minmax(200px, 1fr) auto minmax(170px, .5fr); gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.integration-row:last-child { border-bottom: 0; }
.integration-row small { color: var(--muted); text-align: right; }
.privacy-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.privacy-check { display: flex; align-items: center; gap: 11px; min-height: 76px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.privacy-check > span { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; }
.privacy-check-ready > span { color: var(--brand); background: var(--accent); }
.privacy-check-warning { border-color: #f2caca; }
.privacy-check-warning > span { color: var(--danger); background: #fff0f0; }
.privacy-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.retention-card, .notice-version-card { margin-top: 20px; box-shadow: none; }
.dev-setup-card p { color: var(--muted); }
.dev-notification-list { display: grid; gap: 20px; }
.dev-notification { box-shadow: none; }
.dev-notification-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.dev-notification-heading small { color: var(--muted); }
.dev-ticket-facts { display: grid; grid-template-columns: minmax(90px, .3fr) minmax(0, 1fr); gap: 8px 18px; }
.dev-ticket-facts dt { color: var(--muted); }
.dev-ticket-facts dd { margin: 0; overflow-wrap: anywhere; }
.dev-messenger-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.dev-messenger-actions form { margin: 0; }
.dev-messenger-reply { display: grid; flex: 1 0 100%; gap: 10px; }
.dev-messenger-reply textarea { min-height: 90px; }
.alert-info { border-color: #b9d6e9; color: #184b68; background: #f1f9fd; }
.button-small { min-height: 38px; padding: 8px 13px; border-radius: 10px; font-size: 13px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.directory-page { max-width: 1180px; margin: 0 auto; }
.directory-create-card { margin-bottom: 22px; box-shadow: none; }
.directory-create-card h2 { margin: 5px 0 16px; }
.directory-create-card .field-hint { margin-bottom: 0; text-align: left; }
.directory-inline-form { display: grid; grid-template-columns: minmax(170px, .45fr) minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.directory-inline-form.compact { grid-template-columns: minmax(260px, 1fr) auto; margin-top: 12px; }
.directory-inline-form label, .stack-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.directory-list { display: grid; gap: 22px; }
.directory-department { box-shadow: none; }
.directory-department.is-inactive { border-style: dashed; background: #fafcfa; }
.directory-department-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.directory-department-header h2 { margin: 10px 0 5px; }
.directory-department-header p { margin: 0; color: var(--muted); }
.status-pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.status-pill.is-success { color: var(--brand); background: var(--accent); }
.status-pill.is-muted { color: #68746d; background: #edf1ee; }
.directory-editor { padding: 14px 0; border-bottom: 1px solid var(--line); }
.directory-editor summary, .directory-add-control summary, .directory-item details summary { color: var(--brand); font-weight: 750; cursor: pointer; }
.directory-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 22px; }
.section-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading-row h3 { margin: 0; font-size: 18px; }
.section-heading-row > span { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 10px; color: var(--brand); background: var(--accent); font-size: 12px; font-weight: 850; }
.directory-items { display: grid; gap: 9px; margin-top: 13px; }
.directory-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.directory-item.is-inactive { opacity: .65; background: var(--soft); }
.directory-item strong, .directory-item small, .qr-link-data a { display: block; }
.directory-item small { margin-top: 4px; color: var(--muted); }
.directory-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; }
.directory-item-actions form { margin: 0; }
.max-group-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.max-group-actions form { margin: 0; }
.max-group-actions details { max-width: 300px; }
.max-group-actions summary { color: var(--danger); font-weight: 750; cursor: pointer; }
.max-group-actions details[open] { flex-basis: 100%; }
.directory-item details[open] { flex-basis: 100%; min-width: min(300px, 70vw); }
.directory-item .stack-form { margin-top: 9px; }
.directory-add-control { margin-top: 12px; padding: 13px; border: 1px dashed #b7cec0; border-radius: 13px; background: #fbfdfc; }
.stack-form { display: grid; gap: 11px; margin-top: 13px; }
.stack-form .button { justify-self: start; }
.qr-link-data { min-width: 0; }
.qr-link-data a { margin-top: 5px; overflow: hidden; color: var(--brand); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.qr-directory-items .directory-item { align-items: center; }
.department-search { display: grid; gap: 8px; margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.department-search > label { margin: 0; font-weight: 750; }
.search-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 10px; }
.department-strips { display: grid; gap: 10px; margin: 18px 0 24px; }
.department-strip { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); text-decoration: none; box-shadow: 0 7px 22px rgba(25,59,44,.045); transition: transform .18s, border .18s; }
.department-strip:hover { transform: translateY(-1px); border-color: #a9c9b7; }
.department-strip.is-inactive { opacity: .68; border-style: dashed; }
.department-strip-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.department-strip-main strong { overflow: hidden; text-overflow: ellipsis; }
.department-strip-meta { display: flex; align-items: center; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 13px; }
.department-strip-meta b { color: var(--brand); font-size: 20px; }
.department-settings-card { margin-bottom: 22px; box-shadow: none; }
.qr-download-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.qr-download-actions form { margin: 0; }
.star-rating-field { margin-top: 12px; }
.star-rating { display: grid; grid-template-columns: repeat(10, minmax(34px, 1fr)); gap: 6px; }
.star-rating label { position: relative; display: grid; place-items: center; gap: 2px; min-height: 58px; margin: 0; border: 1px solid var(--line); border-radius: 11px; color: #b08a22; background: white; cursor: pointer; }
.star-rating input { position: absolute; opacity: 0; }
.star-rating span { font-size: 23px; line-height: 1; filter: grayscale(1); opacity: .42; }
.star-rating small { color: var(--muted); font-size: 11px; }
.star-rating label:has(input:checked) { border-color: #d5a72f; background: #fff8dc; box-shadow: 0 0 0 2px rgba(213,167,47,.18); }
.star-rating label:has(input:checked) span { filter: none; opacity: 1; }
.star-rating label:has(input:focus-visible) { outline: 3px solid rgba(23,107,76,.2); }
.collapsible-charts { display: grid; gap: 13px; margin: 22px 0; }
.chart-disclosure { padding: 0; overflow: hidden; box-shadow: none; }
.chart-disclosure > summary { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 19px 22px; cursor: pointer; list-style: none; }
.chart-disclosure > summary::-webkit-details-marker { display: none; }
.chart-disclosure > summary > span:nth-child(2) { display: grid; gap: 4px; }
.chart-disclosure > summary small { color: var(--muted); font-weight: 500; }
.chart-disclosure > summary > b { color: var(--muted); transition: transform .18s; }
.chart-disclosure[open] > summary > b { transform: rotate(180deg); }
.chart-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand); background: var(--accent); font-size: 20px; }
.chart-body { padding: 0 22px 22px; border-top: 1px solid var(--line); }
.chart-body > .chart-legend { margin-top: 18px; }
.vertical-chart { --vertical-bar-height: 210px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(82px, 1fr); align-items: end; gap: 14px; min-height: 294px; padding: 24px 4px 4px; overflow-x: auto; overflow-y: hidden; }
.vertical-chart-departments { grid-auto-columns: minmax(155px, 1fr); }
.vertical-chart-employees { grid-auto-columns: minmax(190px, 1fr); }
.vertical-group { display: grid; align-items: end; gap: 10px; min-width: 0; margin: 0; text-align: center; }
.vertical-bars { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: calc(var(--vertical-bar-height) + 28px); }
.vertical-column { display: grid; grid-template-rows: 24px var(--vertical-bar-height); align-items: end; justify-items: center; gap: 4px; min-width: 22px; }
.vertical-column > b { max-width: 84px; color: var(--muted); font-size: 11px; line-height: 1.1; white-space: nowrap; }
.vertical-progress { inline-size: var(--vertical-bar-height); block-size: 20px; width: 20px; height: var(--vertical-bar-height); border-radius: 7px 7px 3px 3px; writing-mode: vertical-lr; direction: rtl; }
.vertical-progress::-webkit-progress-bar { border-radius: 7px 7px 3px 3px; }
.vertical-progress::-webkit-progress-value { border-radius: 7px 7px 3px 3px; }
.vertical-progress::-moz-progress-bar { border-radius: 7px 7px 3px 3px; }
.vertical-group figcaption { display: grid; gap: 3px; min-height: 42px; color: var(--muted); font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.vertical-group figcaption strong { color: var(--ink); font-size: 12px; }
.vertical-group figcaption span, .vertical-group figcaption small { color: var(--muted); font-size: 10px; }
.flow-label-wide { width: 180px; }
.table-scroll { overflow-x: auto; }
.statistics-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.statistics-table th, .statistics-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.statistics-table th { color: var(--muted); font-size: 12px; }
.operations-disclosure { margin-top: 18px; }
.readiness-page { max-width: 1080px; margin: 0 auto; }
.readiness-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.readiness-list { display: grid; gap: 12px; }
.readiness-check { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; box-shadow: none; }
.readiness-check h2 { margin: 0 0 5px; font-size: 18px; }
.readiness-check p { margin: 0; color: var(--muted); line-height: 1.5; }
.readiness-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-size: 20px; font-weight: 900; }
.readiness-ready .readiness-icon { color: var(--brand); background: var(--accent); }
.readiness-warning { border-color: #efd89d; background: #fffcf3; }
.readiness-warning .readiness-icon { color: #805a00; background: #fff0bd; }
.readiness-manual .readiness-icon { color: #315d7a; background: #e8f3fa; }
.readiness-departments { margin-top: 22px; padding: 22px; box-shadow: none; }
.readiness-departments .ticket-table-wrap { margin: 16px -22px -22px; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }

@media (max-width: 860px) {
  .form-layout, .admin-grid { grid-template-columns: 1fr; }
  .intro-panel, .ticket-facts { position: static; }
  .choice-grid-three { grid-template-columns: 1fr; }
  .ticket-table-wrap { overflow-x: auto; }
  .site-header { padding: 0 4vw; }
  .metric-grid, .statistics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-kpis, .dashboard-grid, .dashboard-grid-primary, .dashboard-grid-operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy-check-grid, .privacy-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-create-form { grid-template-columns: 1fr; }
  .audit-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-columns { grid-template-columns: 1fr; }
  .directory-inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-inline-form .button { grid-column: 1 / -1; }
  .star-rating { grid-template-columns: repeat(5, minmax(42px, 1fr)); }
  .readiness-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .page-shell { width: min(94vw, 1180px); margin-top: 28px; }
  .card { padding: 20px; border-radius: 18px; }
  .intro-panel { padding-top: 0; }
  .intro-panel h1 { font-size: 34px; }
  .intro-panel p { font-size: 16px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 22px 0 8px; }
  .steps li { flex-direction: column; align-items: flex-start; gap: 7px; font-size: 12px; }
  .feedback-form { gap: 20px; }
  .form-section-heading p { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .ticket-heading, .admin-heading { flex-direction: column; }
  .message { max-width: 94%; }
  .ticket-summary dl { grid-template-columns: 1fr; gap: 4px; }
  .ticket-summary dd { margin-bottom: 10px; }
  .site-header { min-height: 108px; padding-top: 8px; padding-bottom: 8px; gap: 10px; }
  .brand { gap: 10px; font-size: 19px; }
  .brand-logo { width: 88px; height: 88px; }
  .admin-surface .site-header { min-height: 116px; padding-left: 3vw; gap: 8px; }
  .admin-surface .brand { gap: 9px; font-size: 19px; }
  .admin-surface .brand-logo { width: 96px; height: 96px; }
  .admin-surface .site-header > a:not(.brand) { min-height: 34px; padding: 6px 8px; font-size: 11px; }
  .header-actions { gap: 5px; }
  .header-actions a, .header-actions .link-button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
  .metric-grid, .statistics-grid { grid-template-columns: 1fr; }
  .dashboard-kpis, .dashboard-grid, .dashboard-grid-primary, .dashboard-grid-operations { grid-template-columns: 1fr; }
  .admin-section-grid, .help-grid { grid-template-columns: 1fr; }
  .help-definition-list > div { grid-template-columns: 1fr; gap: 5px; }
  .privacy-check-grid, .privacy-metrics { grid-template-columns: 1fr; }
  .admin-user-heading, .section-heading { flex-direction: column; }
  .admin-user-meta { text-align: left; }
  .password-reset-form, .integration-row { grid-template-columns: 1fr; }
  .audit-filter { grid-template-columns: 1fr; }
  .integration-row small { text-align: left; }
  .directory-inline-form, .directory-inline-form.compact { grid-template-columns: 1fr; }
  .directory-department-header, .directory-item { flex-direction: column; }
  .search-row { grid-template-columns: 1fr; }
  .department-strip, .department-strip-main, .department-strip-meta { align-items: flex-start; flex-direction: column; }
  .department-strip-meta { gap: 5px; }
  .star-rating { grid-template-columns: repeat(5, minmax(38px, 1fr)); }
  .directory-item-actions { justify-content: flex-start; }
  .readiness-summary { grid-template-columns: 1fr; }
  .readiness-check { grid-template-columns: 38px minmax(0, 1fr); }
  .readiness-check .button { grid-column: 1 / -1; }
  .vertical-chart { --vertical-bar-height: 170px; grid-auto-columns: minmax(76px, 1fr); min-height: 252px; }
  .vertical-chart-departments { grid-auto-columns: minmax(135px, 1fr); }
  .vertical-chart-employees { grid-auto-columns: minmax(170px, 1fr); }
}
