:root {
    --ink: #17221d;
    --muted: #68716c;
    --green: #173f32;
    --green-soft: #e7efe9;
    --orange: #ef7e50;
    --cream: #f5f2ea;
    --line: #dcd7cb;
    --white: #ffffff;
    --red: #a84038;
    --red-soft: #faeae7;
    --shadow: 0 18px 55px rgba(23, 34, 29, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; background: var(--cream); color: var(--ink); font: 15px/1.55 Arial, Helvetica, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }

.admin-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(220, 215, 203, .9); background: rgba(245, 242, 234, .94); backdrop-filter: blur(14px); }
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 40px)); min-height: 76px; margin: auto; gap: 24px; }
.admin-brand, .auth-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.admin-brand small { color: var(--muted); font-weight: 500; }
.admin-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 39px; height: 39px; border-radius: 12px; background: var(--green); color: var(--white); font-size: 20px; line-height: 1; }
.admin-brand-mark span { margin-left: 1px; color: var(--orange); line-height: 1; }
.admin-nav { display: flex; align-items: center; gap: 8px; }
.admin-nav a, .admin-nav button { padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: #425048; text-decoration: none; font-weight: 700; }
.admin-nav a:hover, .admin-nav button:hover { background: rgba(23, 63, 50, .07); color: var(--green); }
.admin-nav form { margin: 0; }
.admin-nav .is-active { background: var(--green); color: var(--white); }
.admin-nav .is-active:hover { background: #245843; color: var(--white); }

.admin-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 68px 0 80px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.page-heading h1 { margin: 8px 0; font: 500 clamp(38px, 6vw, 62px)/1.02 Georgia, 'Times New Roman', serif; letter-spacing: -.045em; }
.page-heading p { max-width: 620px; margin: 0; color: var(--muted); font-size: 17px; }
.narrow-heading { max-width: 780px; }
.kicker { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 18px; border: 0; border-radius: 10px; background: var(--green); color: var(--white); text-decoration: none; font-weight: 800; box-shadow: 0 8px 20px rgba(23, 63, 50, .13); }
.primary-button:hover { background: #245843; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 17px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.7); color: var(--green); text-decoration: none; font-weight: 800; }
.secondary-button:hover { border-color: #b9c3bc; background: var(--white); }
.full-button { width: 100%; margin-top: 4px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stats-grid article { padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.stats-grid span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.stats-grid strong { font: 500 34px/1 Georgia, serif; }
.stats-grid strong small { color: var(--muted); font: 700 14px Arial, sans-serif; }
.stats-grid article > small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.three-stat-grid { grid-template-columns: repeat(3, 1fr); }
.billing-product-grid { gap: 18px; margin: 26px; }
.billing-product-panel { margin-bottom: 24px; }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px 26px; border-bottom: 1px solid #ebe7de; }
.panel-heading h2 { margin: 0 0 4px; font: 500 24px/1.2 Georgia, serif; }
.panel-heading p { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; background: #faf9f5; color: #79817d; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 18px; border-top: 1px solid #eeebe4; vertical-align: middle; }
tbody tr:hover { background: #fcfbf8; }
.link-name { color: var(--green); text-decoration: none; font-weight: 800; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.destination-cell { max-width: 310px; }
.destination-cell a { display: block; overflow: hidden; color: #55625b; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: #9aa09d; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-registered { background: var(--green-soft); color: var(--green); }
.status-premium { background: #fff0df; color: #92521e; }
.status-blocked { background: var(--red-soft); color: var(--red); }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 5px; }
.row-actions form { margin: 0; }
.row-actions a, .row-actions button { padding: 7px 9px; border: 0; border-radius: 7px; background: #f1efe8; color: #3e4943; text-decoration: none; font-weight: 700; }
.links-table { table-layout: fixed; }
.links-table th:nth-child(1) { width: 21%; }
.links-table th:nth-child(2) { width: 10%; }
.links-table th:nth-child(3) { width: 23%; }
.links-table th:nth-child(4) { width: 13%; }
.links-table th:nth-child(5) { width: 7%; }
.links-table th:nth-child(6) { width: 8%; }
.links-table th:nth-child(7) { width: 18%; }
.links-table td { min-width: 0; }
.links-table .link-name, .links-owner-cell strong, .links-owner-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-table .row-actions { flex-wrap: wrap; }
.links-table .row-actions a, .links-table .row-actions button { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
.links-actions-cell { overflow: hidden; }
.empty-state { padding: 70px 24px; text-align: center; }
.empty-state h3 { margin: 0 0 7px; font: 500 28px Georgia, serif; }
.empty-state p { margin: 0 0 22px; color: var(--muted); }

.notice { margin: 0 0 22px; padding: 13px 16px; border-radius: 10px; font-weight: 700; }
.notice-success { background: var(--green-soft); color: var(--green); }
.notice-error { background: var(--red-soft); color: var(--red); }
.notice-warning { background: #fff4df; color: #87510e; }

.filter-panel { margin-bottom: 20px; }
.link-filters { display: grid; grid-template-columns: minmax(230px, 1.7fr) repeat(5, minmax(120px, 1fr)) auto; align-items: end; gap: 14px; padding: 22px 24px; }
.link-filters label { min-width: 0; }
.link-filters label > span { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; min-height: 46px; }
.filter-actions > a { color: var(--muted); font-size: 13px; font-weight: 800; }
.filter-actions .primary-button { min-height: 46px; }

.editor-grid { display: grid; gap: 20px; max-width: 900px; }
.form-panel { padding-bottom: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px; }
.form-grid.address-fields { grid-template-columns: 1.05fr .72fr 1.25fr; }
.form-grid.three-columns { grid-template-columns: 1fr 1fr 1fr; padding-bottom: 12px; }
.field-summary { align-self: stretch; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f5; }
.field-summary span, .field-summary strong, .field-summary small { display: block; }
.field-summary span { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.field-summary strong { color: var(--green); font-size: 17px; }
.field-summary small { margin-top: 4px; color: var(--muted); }
.lease-form-notice { margin: 20px 26px 0; }
label > span, .full-field > span { display: block; margin-bottom: 7px; font-weight: 800; }
label small { display: block; margin-top: 6px; color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid #cbc8bf; border-radius: 10px; outline: 0; background: var(--white); color: var(--ink); }
input::placeholder, textarea::placeholder { color: #aeb3b0; opacity: 1; }
input, select { height: 46px; padding: 0 13px; }
textarea { min-height: 110px; padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 63, 50, .1); }
.slug-input { display: grid; grid-template-columns: auto 1fr; overflow: hidden; border: 1px solid #cbc8bf; border-radius: 10px; }
.slug-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 63, 50, .1); }
.slug-input span { display: grid; place-items: center; padding: 0 12px; background: #f0eee8; color: var(--green); font-weight: 900; }
.slug-input input { border: 0; border-radius: 0; box-shadow: none; }
.slug-input input:focus { box-shadow: none; }
.address-preview { margin: 0 26px; padding: 16px 18px; border-radius: 11px; background: var(--green); color: var(--white); }
.address-preview span { display: block; color: #bed1c8; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.address-preview strong { font-size: 17px; }
.locked-address { margin: 26px; padding: 20px; border-radius: 12px; background: var(--green-soft); }
.locked-address span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.locked-address strong { color: var(--green); font-size: 19px; }
.full-field { display: block; padding: 26px 26px 0; }
.toggle-field { display: flex; align-items: flex-start; gap: 12px; margin: 12px 26px 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.toggle-field input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.toggle-field span { margin: 0; }
.toggle-field strong, .toggle-field small { display: block; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.form-actions > a { color: var(--muted); font-weight: 700; }

.prefix-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; gap: 20px; }
.prefix-form-panel { position: sticky; top: 98px; }
.prefix-form-panel .prefix-form { display: grid; gap: 20px; padding: 26px; }
.prefix-form-panel .prefix-form label { display: block; }
.prefix-form-panel .prefix-form .primary-button { justify-self: start; }
.prefix-token { display: inline-flex; min-width: 40px; justify-content: center; padding: 5px 9px; border-radius: 7px; background: #f0eee8; color: var(--green); font-family: Consolas, Monaco, monospace; font-size: 13px; font-weight: 800; }

.schedule-summary { display: grid; grid-template-columns: minmax(190px, .75fr) minmax(260px, 1.25fr); gap: 18px 34px; margin-bottom: 20px; padding: 24px 26px; border: 1px solid #cdd8d1; border-radius: 16px; background: var(--green-soft); }
.schedule-summary div { min-width: 0; }
.schedule-summary span { display: block; margin-bottom: 5px; color: #64736b; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.schedule-summary strong, .schedule-summary a { display: block; overflow: hidden; color: var(--green); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.schedule-summary p { grid-column: 1 / -1; margin: 0; padding-top: 17px; border-top: 1px solid rgba(23,63,50,.13); color: #52635a; }
.rule-name { color: var(--ink); }
.schedule-when { min-width: 190px; }
.schedule-when strong, .schedule-when small { display: block; }
.weekday-section { margin: 0; padding: 4px 26px 2px; border: 0; }
.weekday-section legend { margin-bottom: 9px; padding: 0; font-weight: 800; }
.weekday-section > small { display: block; margin-top: 8px; color: var(--muted); }
.weekday-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.weekday-option { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f5; cursor: pointer; }
.weekday-option:has(input:checked) { border-color: #9bb2a5; background: var(--green-soft); color: var(--green); }
.weekday-option input { width: 16px; height: 16px; margin: 0 7px 0 0; accent-color: var(--green); }
.weekday-option span { margin: 0; font-weight: 800; }
.schedule-time-grid { padding-bottom: 10px; }
.form-note { margin: 0 26px 8px; color: var(--muted); font-size: 13px; }
.routing-source-note { margin-top: -7px; padding-top: 0; }
.routing-source-note strong { color: var(--ink); }
.rule-conditions { min-width: 180px; max-width: 270px; }
.rule-conditions strong { color: #52635a; font-size: 13px; }

.detected-context { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; padding: 20px 22px; border: 1px solid #cdd8d1; border-radius: 16px; background: var(--green-soft); }
.detected-context div { min-width: 0; }
.detected-context span { display: block; margin-bottom: 4px; color: #64736b; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detected-context strong { display: block; overflow: hidden; color: var(--green); text-overflow: ellipsis; white-space: nowrap; }
.detected-context p { grid-column: 1 / -1; margin: 2px 0 0; padding-top: 14px; border-top: 1px solid rgba(23,63,50,.13); color: #52635a; font-size: 13px; }
.rule-test-panel { max-width: none; margin-bottom: 20px; }
.rule-test-form { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 18px; padding: 24px 26px 26px; }
.rule-test-action { display: flex; justify-content: flex-end; }
.test-winner { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 24px 26px; border: 1px solid #b8cbbb; border-radius: 18px; background: #edf5ee; box-shadow: var(--shadow); }
.test-winner.uses-fallback { border-color: #d9d1bd; background: #fff9e9; }
.test-winner.is-expired { border-color: #dcaaa3; background: #fff1ef; }
.test-winner.expectation-pass { border-color: #8caf9a; background: #edf5ee; }
.test-winner.expectation-fail { border-color: #dcaaa3; background: #fff1ef; }
.test-winner span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.test-winner h2 { margin: 0 0 5px; font: 500 28px/1.2 Georgia, serif; }
.test-winner a { display: block; overflow: hidden; max-width: 720px; color: #52635a; text-overflow: ellipsis; white-space: nowrap; }
.test-winner p { margin: 9px 0 0; color: var(--red); font-weight: 800; }
.test-winner > strong { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: var(--green); color: var(--white); font-size: 12px; }
.test-winner.uses-fallback > strong { background: #9a6b2d; }
.test-winner.is-expired > strong { background: var(--red); }
.test-winner.expectation-fail > strong { background: var(--red); }
.rule-debug-list { display: grid; gap: 16px; }
.rule-debug-card { overflow: hidden; }
.rule-debug-card.is-winner { border-color: #8caf9a; box-shadow: 0 18px 55px rgba(23, 63, 50, .13); }
.rule-debug-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 21px 24px; border-bottom: 1px solid #ebe7de; }
.rule-debug-heading > div { min-width: 0; }
.rule-debug-heading span { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.rule-debug-heading h3 { margin: 3px 0 5px; font: 500 23px/1.2 Georgia, serif; }
.rule-debug-heading a { display: block; overflow: hidden; max-width: 720px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.debug-result { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; font-size: 11px; }
.debug-winner, .debug-match { background: var(--green-soft); color: var(--green); }
.debug-fail { background: var(--red-soft); color: var(--red); }
.rule-check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.rule-check { display: flex; gap: 10px; min-width: 0; padding: 15px 17px; border-right: 1px solid #eeebe4; border-bottom: 1px solid #eeebe4; }
.rule-check > div { min-width: 0; }
.rule-check > span { display: grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 900; }
.rule-check strong, .rule-check small { display: block; }
.rule-check small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.check-pass > span { background: var(--green-soft); color: var(--green); }
.check-fail { background: #fffafa; }
.check-fail > span { background: var(--red-soft); color: var(--red); }

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 32px 20px; background: radial-gradient(circle at 20% 10%, #fff 0, transparent 32%), var(--cream); }
.auth-card { width: min(500px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--shadow); }
.compact-auth-card { width: min(460px, 100%); }
.auth-brand { margin-bottom: 38px; }
.auth-card h1 { margin: 8px 0 10px; font: 500 42px/1.05 Georgia, serif; letter-spacing: -.035em; }
.auth-intro { margin: 0 0 25px; color: var(--muted); }
.stacked-form { display: grid; gap: 17px; }
.auth-help { margin: 22px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.auth-help a { color: var(--green); font-weight: 800; }
.auth-two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-consent { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.auth-consent span { margin: 0; color: inherit; font-size: inherit; font-weight: 600; letter-spacing: 0; text-transform: none; }
.auth-consent a { color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.cf-turnstile { min-height: 65px; }

.customer-detail-panel { margin-top: 20px; }
.customer-delete-panel { border-color: #e5d1cc; }
.customer-delete-panel .panel-heading { background: #fffaf8; }
.customer-delete-panel .panel-heading h2 { color: var(--red); }
.customer-delete-body { padding: 24px 26px 26px; }
.customer-delete-body > label { display: block; margin-bottom: 7px; font-weight: 800; }
.customer-delete-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 20px; }
.customer-delete-body > small { display: block; margin-top: 6px; color: var(--muted); }
.customer-delete-button { height: 46px; border-color: #dfbbb5; background: var(--red-soft); color: var(--red); white-space: nowrap; }
.customer-delete-button:hover { border-color: #cb948c; background: #f7ddd8; }
.compact-empty-state { padding: 36px 24px; }
.compact-empty-state p { margin-bottom: 0; }
.activity-list { display: grid; }
.activity-list > div { display: grid; grid-template-columns: minmax(150px, .75fr) minmax(240px, 1.5fr) minmax(220px, 1fr); gap: 18px; padding: 16px 24px; border-top: 1px solid #eeebe4; }
.activity-list > div:first-child { border-top: 0; }
.activity-list span, .activity-list small { color: var(--muted); }
.activity-list small { text-align: right; }

.analytics-count-link { color: var(--green); font-weight: 900; text-decoration: underline; text-decoration-color: rgba(23,63,50,.25); text-underline-offset: 3px; }
.analytics-filter-panel { margin-bottom: 20px; }
.analytics-filters { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(145px,.7fr) minmax(145px,.7fr) minmax(250px,1.4fr) auto; align-items: end; gap: 16px; padding: 24px 26px 18px; }
.analytics-filters label { min-width: 0; }
.analytics-timezone select { width: 100%; }
.analytics-period-note { margin: 0; padding: 0 26px 22px; color: var(--muted); font-size: 13px; }
.analytics-stats article small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.analytics-trend-panel { margin-bottom: 20px; }
.analytics-bot-note { align-self: center; padding: 6px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; }
.analytics-chart { display: flex; align-items: stretch; gap: 5px; min-height: 275px; padding: 24px 22px 18px; overflow-x: auto; border-top: 1px solid #eeebe4; }
.analytics-day { display: grid; flex: 1 0 14px; grid-template-rows: 22px 210px 22px; align-items: end; min-width: 14px; text-align: center; }
.analytics-day strong { overflow: hidden; color: var(--green); font-size: 10px; font-weight: 900; }
.analytics-day > span { align-self: end; justify-self: center; width: min(72%, 18px); min-height: 0; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--orange), #d9653e); }
.analytics-day small { align-self: end; color: var(--muted); font-size: 9px; white-space: nowrap; transform: rotate(-45deg); transform-origin: center; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin-bottom: 20px; }
.analytics-breakdown { min-width: 0; }
.breakdown-list { display: grid; padding: 5px 24px 18px; }
.breakdown-list > div { display: grid; grid-template-columns: minmax(150px,1fr) minmax(90px,1.2fr) 44px; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid #eeebe4; }
.breakdown-list > div:first-child { border-top: 0; }
.breakdown-list span strong, .breakdown-list span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-list span small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.breakdown-list > div > div { height: 7px; overflow: hidden; border-radius: 999px; background: #eeece6; }
.breakdown-list i { display: block; height: 100%; border-radius: inherit; background: var(--orange); }
.breakdown-list b { color: var(--ink); text-align: right; }
.analytics-destination-panel, .analytics-recent-panel { margin-bottom: 20px; }
.analytics-destination-list { display: grid; padding: 4px 24px 18px; }
.analytics-destination-list > div { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 14px 0; border-top: 1px solid #eeebe4; }
.analytics-destination-list > div:first-child { border-top: 0; }
.analytics-destination-list span { min-width: 0; }
.analytics-destination-list strong, .analytics-destination-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-destination-list small { margin-top: 3px; color: var(--muted); }
.analytics-destination-list b { flex: 0 0 auto; display: grid; place-items: center; min-width: 38px; height: 32px; padding: 0 9px; border-radius: 9px; background: var(--green-soft); color: var(--green); }

.safety-panel { margin-bottom: 20px; }
.safety-stats-grid { grid-template-columns: repeat(5, 1fr); }
.safety-heading { gap: 20px; }
.compact-filter { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.compact-filter select { min-height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); }
.report-review-list { display: grid; }
.report-review-list > article { padding: 24px 26px; border-top: 1px solid #eeebe4; }
.report-review-list > article:first-child { border-top: 0; }
.report-review-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.report-review-top > div { display: flex; align-items: center; gap: 10px; }
.report-review-top time { color: var(--muted); font-size: 12px; }
.reported-link { display: inline-block; margin-top: 13px; color: var(--green); font-size: 18px; font-weight: 850; text-decoration: none; }
.report-review-list article > p { margin: 13px 0; color: #4e5a53; }
.report-meta { display: grid; gap: 3px; padding: 12px 14px; border-radius: 10px; background: #faf9f5; color: var(--muted); font-size: 12px; }
.report-meta b { overflow-wrap: anywhere; color: #4d5852; }
.destination-review-meta { margin-top: 14px; }
.destination-review-meta a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.destination-review-meta .status-badge { margin-left: 4px; }
.destination-review-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 14px; margin-top: 16px; }
.destination-review-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.destination-review-form input { min-height: 44px; }
.destination-review-form .safety-actions { margin: 0; }
.destination-review-form .primary-button { padding: 10px 14px; background: var(--green); color: var(--white); }
.safety-actions { justify-content: flex-start; margin-top: 13px; }
.review-decision-form { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(180px,.9fr) minmax(140px,.65fr) minmax(220px,1.35fr) auto; align-items: end; gap: 10px; margin-top: 16px; }
.review-decision-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.review-decision-form input, .review-decision-form select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); }
.review-decision-form .primary-button { white-space: nowrap; }
.row-actions .danger-action { background: var(--red-soft); color: var(--red); }
.safety-status-new, .safety-check-warning, .safety-check-pending { background: #fff0df; color: #92521e; }
.safety-status-reviewing { background: #e9effa; color: #385a8d; }
.safety-status-actioned, .safety-check-healthy { background: var(--green-soft); color: var(--green); }
.safety-status-dismissed { background: #efefec; color: #68716c; }
.safety-check-failed, .safety-check-blocked { background: var(--red-soft); color: var(--red); }
.safety-table { min-width: 940px; }
.safety-table td:last-child { width: 1%; }
.safety-table .row-actions { flex-wrap: wrap; }
.safety-table .destination-cell small { overflow: hidden; max-width: 370px; text-overflow: ellipsis; white-space: nowrap; }

.qr-explainer { grid-template-columns: 1fr 1fr; }
.qr-explainer strong { white-space: normal; overflow-wrap: anywhere; }
.qr-explainer p strong { display: inline; overflow: visible; color: inherit; }
.qr-placement-panel { margin-bottom: 20px; }
.qr-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 24px; }
.qr-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fcfbf8; }
.qr-card.is-paused { opacity: .78; }
.qr-preview { display: grid; place-items: center; padding: 18px; border-right: 1px solid #ebe7de; background: #f5f2ea; }
.qr-preview img { display: block; width: 100%; height: auto; border: 1px solid #e4dfd4; border-radius: 9px; background: #fff; }
.qr-card-body { display: grid; align-content: start; gap: 15px; min-width: 0; padding: 19px; }
.qr-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; }
.qr-card-heading > div { min-width: 0; }
.qr-card-heading > div > span { color: var(--orange); font: 800 11px/1.2 Consolas, Monaco, monospace; letter-spacing: .03em; }
.qr-card-heading h3 { margin: 4px 0 0; overflow: hidden; font: 500 24px/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.qr-url-field > span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.qr-url-field input { height: 40px; background: #fff; font: 12px Consolas, Monaco, monospace; }
.qr-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.qr-card-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.qr-card-meta i { display: inline-block; width: 17px; height: 17px; border: 1px solid #cfcac0; border-radius: 5px; }
.qr-card-meta strong { color: var(--green); text-align: right; }
.qr-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.qr-card-actions form { margin: 0; }
.qr-card-actions a, .qr-card-actions button { padding: 7px 9px; border: 0; border-radius: 7px; background: #eeece5; color: #3e4943; text-decoration: none; font-size: 12px; font-weight: 800; }
.qr-editor-grid { max-width: 920px; }
.qr-colour-grid input[type="color"] { padding: 5px; cursor: pointer; }
.locked-via-field { display: grid; grid-template-columns: auto 1fr; min-height: 46px; overflow: hidden; border: 1px solid #cbc8bf; border-radius: 10px; background: #f7f5ef; }
.locked-via-field span { display: grid; place-items: center; padding: 0 12px; background: #ece9e1; color: var(--green); font-weight: 900; }
.locked-via-field strong { display: flex; align-items: center; min-width: 0; padding: 0 13px; overflow: hidden; color: #53615a; font-family: Consolas, Monaco, monospace; text-overflow: ellipsis; white-space: nowrap; }
.qr-editor-preview { display: flex; align-items: center; gap: 20px; margin: 22px 26px 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f5; }
.qr-editor-preview img { width: 150px; height: 150px; border: 1px solid #e4dfd4; border-radius: 9px; }
.qr-editor-preview p { margin: 0; color: var(--muted); }
.account-links-table .row-actions { flex-wrap: wrap; }
.account-links-table .row-actions a, .account-links-table .row-actions button { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
.lease-detail { display: block; margin-top: 5px; color: #7a6352; line-height: 1.35; white-space: normal; }
.renewal-table { min-width: 1040px; }
.renewal-table td:last-child { width: 1%; }
.payment-form { display: grid; grid-template-columns: 100px minmax(155px,1fr) auto; align-items: end; gap: 8px; min-width: 390px; }
.payment-form label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.payment-form input { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.payment-form button { min-height: 38px; white-space: nowrap; }

.network-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.network-summary-grid article { padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.network-summary-grid span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.network-summary-grid strong { font: 500 34px/1 Georgia, serif; }
.network-list { display: grid; gap: 22px; }
.network-panel-heading { align-items: flex-start; }
.network-panel-heading h2 { margin-top: 9px; }
.network-panel-heading .link-name { display: inline-block; margin-top: 3px; }
.network-location-table { min-width: 1120px; }
.network-location-table th:nth-child(1) { width: 15%; }
.network-location-table th:nth-child(2) { width: 16%; }
.network-location-table th:nth-child(3) { width: 15%; }
.network-location-table th:nth-child(4) { width: 15%; }
.network-location-table th:nth-child(5) { width: 20%; }
.network-location-table th:nth-child(6) { width: 6%; }
.network-location-table th:nth-child(7) { width: 13%; }
.network-location-table td > strong { display: block; }
.network-location-table .status-badge { display: inline-flex; margin-top: 3px; }
.network-coordinate-grid { padding-top: 0; }
.network-location-editor textarea { min-height: 92px; }
.network-customer-panel { margin-bottom: 20px; }
.network-map-actions { display: flex; align-items: center; gap: 13px; margin: 0 26px 16px; }
.network-map-actions small { color: var(--muted); }
.network-map-actions .secondary-button:disabled { opacity: .5; cursor: not-allowed; }
.territory-map-is-open { overflow: hidden; }
.territory-map-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.territory-map-modal[hidden] { display: none; }
.territory-map-backdrop { position: absolute; inset: 0; background: rgba(15, 26, 21, .68); }
.territory-map-dialog { position: relative; overflow: hidden; width: min(860px, 100%); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: 0 30px 90px rgba(15, 26, 21, .28); }
.territory-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; }
.territory-map-heading h2 { margin: 4px 0 0; font: 500 26px/1.2 Georgia, serif; }
.territory-map-close { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #faf9f5; color: var(--ink); font-size: 27px; line-height: 1; }
.territory-map-close:hover { border-color: #b9c3bc; background: var(--white); }
.territory-map-canvas { position: relative; overflow: hidden; height: min(56vh, 500px); min-height: 320px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #e8ece8; }
.territory-map-tiles { position: absolute; inset: 0; overflow: hidden; }
.territory-map-tile { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.territory-map-radius { position: absolute; top: 50%; left: 50%; z-index: 2; border: 3px solid var(--green); border-radius: 50%; background: rgba(23, 63, 50, .14); box-shadow: 0 0 0 1px rgba(255,255,255,.65) inset; pointer-events: none; transform: translate(-50%, -50%); }
.territory-map-centre { position: absolute; top: 50%; left: 50%; z-index: 3; width: 13px; height: 13px; border: 2px solid var(--white); border-radius: 50%; background: var(--orange); box-shadow: 0 1px 5px rgba(23,34,29,.35); pointer-events: none; transform: translate(-50%, -50%); }
.territory-map-attribution { position: absolute; right: 5px; bottom: 4px; z-index: 4; padding: 2px 5px; background: rgba(255,255,255,.88); color: #53605a; font-size: 10px; line-height: 1.2; }
.territory-map-attribution a { color: inherit; }
.territory-map-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; }
.territory-map-footer strong, .territory-map-footer small { display: block; }
.territory-map-footer strong { color: var(--green); }
.territory-map-footer small { margin-top: 3px; color: var(--muted); }
.territory-map-footer .secondary-button { flex: 0 0 auto; }

.admin-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .safety-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .three-stat-grid { grid-template-columns: repeat(3, 1fr); }
    .form-grid.three-columns { grid-template-columns: 1fr; }
    .form-grid.address-fields { grid-template-columns: 1fr; }
    .prefix-layout { grid-template-columns: 1fr; }
    .prefix-form-panel { position: static; }
    .weekday-grid { grid-template-columns: repeat(4, 1fr); }
    .link-filters { grid-template-columns: repeat(2, 1fr); }
    .filter-search { grid-column: 1 / -1; }
    .detected-context { grid-template-columns: repeat(2, 1fr); }
    .rule-test-form, .rule-check-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-nav .view-site-link { display: none; }
    .activity-list > div { grid-template-columns: 1fr 1.5fr; }
    .activity-list small { grid-column: 1 / -1; text-align: left; }
    .analytics-filters { grid-template-columns: repeat(2,1fr); }
    .analytics-timezone { grid-column: 1 / -1; }
    .analytics-filters .primary-button { justify-self: start; }
    .links-table { width: 900px; table-layout: fixed; }
    .account-links-table { width: 940px; }
    .qr-card-grid { grid-template-columns: 1fr; }
    .review-decision-form { grid-template-columns: 1fr 1fr; }
    .network-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .admin-header-inner, .admin-main, .admin-footer { width: min(100% - 24px, 1180px); }
    .admin-header-inner { min-height: 68px; }
    .admin-brand > span:last-child { display: none; }
    .admin-nav { gap: 2px; }
    .admin-nav a, .admin-nav button { padding: 9px 8px; font-size: 13px; }
    .admin-main { padding-top: 45px; }
    .auth-two-fields { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .heading-actions { width: 100%; flex-wrap: wrap; }
    .page-heading h1 { font-size: 42px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .safety-stats-grid { grid-template-columns: 1fr 1fr; }
    .three-stat-grid { grid-template-columns: 1fr; }
    .stats-grid article { padding: 18px; }
    .billing-product-grid { gap: 12px; margin: 20px; }
    .form-grid { grid-template-columns: 1fr; padding: 20px; }
    .full-field { padding: 20px 20px 0; }
    .address-preview, .toggle-field { margin-left: 20px; margin-right: 20px; }
    .locked-address { margin: 20px; }
    .prefix-form-panel .prefix-form { padding: 20px; }
    .schedule-summary { grid-template-columns: 1fr; padding: 20px; }
    .schedule-summary p { grid-column: auto; }
    .weekday-section { padding: 4px 20px 2px; }
    .weekday-grid { grid-template-columns: repeat(2, 1fr); }
    .form-note { margin-left: 20px; margin-right: 20px; }
    .link-filters { grid-template-columns: 1fr; padding: 20px; }
    .filter-search { grid-column: auto; }
    .filter-actions { justify-content: space-between; }
    .detected-context, .rule-test-form, .rule-check-grid { grid-template-columns: 1fr; }
    .analytics-grid, .analytics-filters { grid-template-columns: 1fr; }
    .analytics-timezone { grid-column: auto; }
    .analytics-filters { padding: 20px; }
    .analytics-period-note { padding: 0 20px 20px; }
    .analytics-chart { padding-left: 14px; padding-right: 14px; }
    .breakdown-list { padding-left: 20px; padding-right: 20px; }
    .breakdown-list > div { grid-template-columns: minmax(125px,1fr) 70px 35px; gap: 9px; }
    .analytics-destination-list { padding-left: 20px; padding-right: 20px; }
    .qr-explainer { grid-template-columns: 1fr; }
    .qr-card-grid { padding: 16px; }
    .qr-card { grid-template-columns: 1fr; }
    .qr-preview { padding: 20px 26%; border-right: 0; border-bottom: 1px solid #ebe7de; }
    .qr-card-body { padding: 18px; }
    .qr-card-heading h3 { white-space: normal; }
    .qr-card-meta { align-items: flex-start; flex-direction: column; }
    .qr-card-meta strong { text-align: left; }
    .qr-editor-preview { align-items: flex-start; flex-direction: column; margin-left: 20px; margin-right: 20px; }
    .detected-context { padding: 20px; }
    .detected-context p { grid-column: auto; }
    .test-winner, .rule-debug-heading { align-items: flex-start; flex-direction: column; }
    .test-winner a, .rule-debug-heading a { max-width: 100%; }
    .rule-check { border-right: 0; }
    .auth-card { padding: 30px 24px; }
    .activity-list > div { grid-template-columns: 1fr; }
    .activity-list small { grid-column: auto; }
    .customer-delete-body { padding: 20px; }
    .customer-delete-controls { grid-template-columns: 1fr; }
    .customer-delete-button { width: 100%; }
    .review-decision-form { grid-template-columns: 1fr; }
    .destination-review-form { grid-template-columns: 1fr; }
    .destination-review-form .safety-actions { align-items: stretch; flex-direction: column; }
    .destination-review-form .safety-actions button { width: 100%; }
    .payment-form { grid-template-columns: 1fr; min-width: 240px; }
    .network-summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .network-summary-grid article { padding: 18px; }
    .network-panel-heading { align-items: flex-start; flex-direction: column; }
    .network-map-actions { align-items: flex-start; flex-direction: column; margin-left: 20px; margin-right: 20px; }
    .territory-map-modal { padding: 12px; }
    .territory-map-dialog { max-height: calc(100vh - 24px); }
    .territory-map-heading { padding: 17px 18px; }
    .territory-map-heading h2 { font-size: 22px; }
    .territory-map-canvas { height: 52vh; min-height: 280px; }
    .territory-map-footer { align-items: stretch; flex-direction: column; padding: 16px 18px; }
    .territory-map-footer .secondary-button { width: 100%; }
}
