:root { color-scheme: light; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #191b30; background: #f8f8fc; }
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(100% - 36px, 760px); margin: 0 auto; }
.header { display: flex; align-items: center; gap: 12px; padding-top: 38px; }
.mark { background: #34267f; color: white; font-size: 24px; font-weight: 800; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; letter-spacing: -2px; }
.mark span { font-size: 14px; align-self: start; margin: -40px 0 0 27px; color: #b6adff; }
.header strong { display: block; font-size: 20px; letter-spacing: -.45px; }
.header small { display: block; color: #74768c; }
.hero { padding: 65px 0 33px; }
.eyebrow { letter-spacing: 1.7px; font-weight: 800; font-size: 11px; color: #5e52b2; }
h1 { font-size: clamp(38px, 7vw, 64px); line-height: 1.08; letter-spacing: -2.7px; margin: 16px 0 18px; }
h1 em { color: #6653c3; font-style: normal; }
.hero p { color: #62667d; max-width: 580px; line-height: 1.65; font-size: 17px; }
.panel { background: white; border: 1px solid #e6e6ef; border-radius: 20px; padding: 30px; box-shadow: 0 20px 45px #21176a0a; }
h2 { font-size: 23px; margin: 0 0 8px; letter-spacing: -.5px; }
.panel p { color: #686c7f; line-height: 1.6; }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
button { cursor: pointer; border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 700; padding: 12px 20px; }
button:disabled { opacity: .6; cursor: wait; }
button.primary { color: white; background: #4c37a7; }
button.primary:hover { background: #372884; }
button.secondary { color: #443392; background: #f0eefb; }
button.secondary:hover { background: #e8e3fc; }
button.quiet { background: none; color: #6452a5; padding: 7px; }
button.danger { background: #b42318; color: #fff; }
button.danger:hover:not(:disabled) { background: #912018; }
button.wide { margin-top: 18px; width: 100%; }
.member-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.tag { display: inline-block; color: #347453; background: #eaf7ef; padding: 4px 8px; border-radius: 5px; font-size: 11px; font-weight: 800; margin-bottom: 9px; }
label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
input { width: 100%; background: #fff; border: 1px solid #cdd0dc; padding: 13px 12px; border-radius: 9px; font: inherit; outline: none; }
input:focus { border-color: #6b58bc; box-shadow: 0 0 0 3px #6b58bc24; }
.result { display: flex; gap: 10px; }
.result input { min-width: 0; }
#created { margin-top: 26px; padding-top: 20px; border-top: 1px solid #ededf3; }
#try-link { display: inline-block; font-size: 13px; margin-top: 12px; color: #513f9e; }
#status:not(:empty) { margin-bottom: 20px; border-radius: 10px; padding: 11px 13px; color: #4a3a7f; background: #f1eefc; line-height: 1.5; }
#status.error { background: #fff0ed; color: #9b3425; }
.fineprint { margin-bottom: 0; font-size: 12px; }
footer { color: #888a9d; text-align: center; font-size: 12px; padding: 30px 0 50px; }
[hidden] { display: none !important; }
@media (max-width: 520px) { .hero { padding-top: 48px; } .panel { padding: 21px; } }

select { width: 100%; border: 1px solid #cdd0dc; border-radius: 9px; padding: 12px; font: inherit; background: white; color: #191b30; }
select:focus { outline: 2px solid #6b58bc; outline-offset: 2px; }
.field-label { margin-top: 20px; }
.optional { font-weight: 400; color: #74768c; }
h3 { margin: 0; font-size: 16px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-grid > div { background: #f6f4fd; border: 1px solid #e9e4f7; border-radius: 12px; padding: 16px; }
.stats-grid strong { display: block; font-size: 28px; letter-spacing: -1px; color: #49379d; }
.stats-grid span { display: block; margin-top: 5px; color: #62667d; font-size: 12px; line-height: 1.5; }
#reset-date { margin: 10px 0 26px; }
.my-links { margin-top: 32px; padding-top: 28px; border-top: 1px solid #e6e6ef; }
#links-list { list-style: none; padding: 0; margin: 16px 0 0; }
.link-row { padding: 20px 0; border-bottom: 1px solid #ededf3; }
.link-row-heading { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.link-row a { color: #513f9e; font-weight: 700; overflow-wrap: anywhere; }
.link-row .destination { overflow-wrap: anywhere; font-size: 13px; margin: 7px 0; }
.link-row .link-meta { font-size: 12px; margin: 7px 0 16px; }
.campaign-editor { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.campaign-editor label { flex: 1; min-width: 180px; margin: 0; }
.campaign-editor select { margin-top: 6px; font-weight: 400; }
.campaign-editor input { flex: 1; min-width: 180px; }
.campaign-editor button { font-size: 13px; min-height: 45px; }
@media (max-width: 520px) { .stats-grid { gap: 6px; } .stats-grid > div { padding: 12px 8px; } .stats-grid strong { font-size: 23px; } .list-heading { align-items: start; } }

/* Separate creation workspace and spreadsheet-style link library. */
.wrap { width: min(100% - 40px, 1240px); }
.header, .hero, .creation-panel, .inactive-notice { max-width: 760px; margin-left: auto; margin-right: auto; }
.hero { padding-top: 40px; }
.hero h1 { font-size: clamp(36px, 5vw, 54px); }
.hero p { font-size: 15px; }
.field-spacer { height: 20px; }
.creation-panel { box-shadow: 0 8px 28px #21176a08; }
.library { margin-top: 42px; background: #fff; border: 1px solid #dcdfea; border-radius: 16px; padding: 26px; box-shadow: 0 12px 36px #21176a09; }
.library-heading h2 { font-size: 28px; margin-top: 7px; }
.library-heading p { color: #74768c; font-size: 14px; margin: 4px 0 26px; }
.library .stats-grid > div { padding: 15px 20px; }
.library #reset-date { margin-bottom: 24px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #eceef4; padding-top: 22px; margin-bottom: 16px; }
.view-tabs { display: flex; gap: 4px; background: #f0f2f7; padding: 4px; border-radius: 9px; }
.view-tabs button { background: transparent; color: #686c7f; padding: 8px 16px; font-size: 13px; border-radius: 6px; }
.view-tabs button[aria-pressed="true"] { background: white; color: #49379d; box-shadow: 0 1px 4px #191b3014; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid #dfe3ed; border-radius: 9px; }
.links-table { border-collapse: collapse; table-layout: fixed; width: 100%; min-width: 1040px; font-size: 13px; }
.links-table th { text-align: left; background: #f6f7fa; padding: 13px 14px; font-size: 11px; letter-spacing: .4px; color: #74788c; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid #dfe3ed; }
.links-table th:nth-child(1) { width: 29%; }
.links-table th:nth-child(2) { width: 20%; }
.links-table th:nth-child(3) { width: 16%; }
.links-table th:nth-child(4) { width: 6%; }
.links-table th:nth-child(5) { width: 10%; }
.links-table th:nth-child(6) { width: 9%; }
.links-table th:nth-child(7) { width: 10%; }
.links-table td { padding: 15px 12px; border-bottom: 1px solid #e8ebf2; border-right: 1px solid #f0f2f6; vertical-align: middle; height: 74px; }
.links-table tr:last-child td { border-bottom: none; }
.links-table tbody tr:hover { background: #faf9ff; }
.links-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.url-cell { display: flex; align-items: center; gap: 7px; min-width: 0; }
.url-text { min-width: 0; flex: 1; }
.result-title { display: block; color: #1a0dab; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.result-title:hover { text-decoration: underline; }
.url-breadcrumb { display: block; color: #6a6f7c; font-size: 11px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.short-label { color: #514197; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.short-label:hover { text-decoration: underline; }
.copy-cell { flex-shrink: 0; border: 1px solid #e2deef; width: 28px; height: 28px; padding: 0; color: #6452a5; background: #f4f1fc; border-radius: 5px; font-size: 19px; line-height: 24px; }
@media (hover: hover) { .copy-cell { opacity: 0; } .url-cell:hover .copy-cell, .url-cell:focus-within .copy-cell { opacity: 1; } }
.grid-select { font-size: 12px; padding: 7px 4px; border-color: transparent; background: transparent; border-radius: 5px; }
.grid-select:hover, .grid-select:focus { border-color: #d9d3ea; background: white; }
.date-cell { color: #74788c; font-size: 12px; font-variant-numeric: tabular-nums; }
.state { display: inline-block; padding: 4px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.state-active { background: #eaf7ef; color: #347453; }
.state-paused { background: #fff4dc; color: #936015; }
.state-archived { background: #efedf8; color: #70648f; }
.state-deleted { background: #fbeeed; color: #9b493f; }
#list-status:empty, #library-status:empty { display: none; }
#library-status { padding: 10px 12px; background: #f1eefc; color: #4a3a7f; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
#library-status.error { background: #fff0ed; color: #9b3425; }
.library > .fineprint { color: #85899a; line-height: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
dialog { border: 1px solid #e5e2f0; border-radius: 18px; padding: 28px; width: min(94vw, 480px); color: #191b30; box-shadow: 0 24px 80px #191b3033; }
dialog::backdrop { background: #191b3060; }
dialog p { color: #6b6e80; line-height: 1.65; font-size: 14px; }
#dialog-error { color: #9b3425; }
.inactive-notice { margin-top: 30px; padding: 28px; border: 1px solid #d8d0f3; border-radius: 18px; background: #f0ebff; }
.inactive-notice h2 { font-size: 26px; margin: 12px 0; }
.inactive-notice p { color: #655a7f; line-height: 1.7; }
@media (max-width: 600px) { .wrap { width: calc(100% - 24px); } .library { padding: 18px 12px; } .library .stats-grid > div { padding: 12px 8px; } .view-tabs button { padding: 8px 11px; } .table-toolbar { flex-wrap: wrap; } .library-heading h2 { font-size: 24px; } }

.grid-filters { display: grid; grid-template-columns: minmax(190px, 2fr) repeat(4, minmax(120px, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 18px; }
.grid-filters label { margin: 0; font-size: 11px; color: #686c7f; }
.grid-filters input, .grid-filters select { margin-top: 6px; padding: 9px 10px; font-size: 12px; min-height: 38px; }
.grid-filters button { font-size: 12px; min-height: 38px; }
#domain-note { color: #6b5b93; margin-top: 8px; }
@media (max-width: 1000px) { .grid-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .search-filter { grid-column: 1 / -1; } }

.main-menu { display:flex; gap:8px; margin:28px auto 0; max-width:760px; border-bottom:1px solid #ddd9ed; padding-bottom:10px; }
.main-menu a { text-decoration:none; color:#63558d; padding:12px 20px; border-radius:9px; font-weight:700; }
.main-menu a[aria-current="page"] { background:#4c37a7; color:white; }
.full-url { overflow-wrap:anywhere; user-select:text; max-height:40vh; overflow-y:auto; background:#f6f4fc; padding:16px; border-radius:8px; }
.button-link { display:inline-block; background:#4c37a7; color:white; padding:12px 20px; border-radius:10px; font-weight:700; text-decoration:none; }
#qr-canvas { display:block; max-width:100%; width:280px; height:auto; margin:20px auto; image-rendering:pixelated; }
.stats-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
.links-table { min-width:1220px; }
.links-table th:nth-child(1) { width:23%; }
.links-table th:nth-child(2) { width:17%; }
.links-table th:nth-child(3) { width:13%; }
.links-table th:nth-child(4), .links-table th:nth-child(5), .links-table th:nth-child(6) { width:7%; }
.links-table th:nth-child(7) { width:9%; }
.links-table th:nth-child(8) { width:7%; }
.links-table th:nth-child(9) { width:10%; }
@media(max-width:700px) { .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Brand colors are validated server-side and delivered from /theme.css. */
body { color:var(--brand-text,#191b30); }
button.primary,.button-link,.main-menu a[aria-current="page"],.mark { background:var(--brand-primary,#4c37a7); }
.hero h1 em,.eyebrow,.stats-grid strong,.short-label { color:var(--brand-secondary,#6653c3); }
#brand-logo { width:56px;height:56px;object-fit:contain; }
body[data-layout="compact"] .hero { padding:24px 0 20px; }
body[data-layout="compact"] .hero h1 { font-size:36px; }
body[data-layout="compact"] .panel { padding:22px; }
.admin-toolbar { display:flex; gap:16px; align-items:end; margin:24px 0;flex-wrap:wrap; }
.admin-toolbar label { flex:1;min-width:180px; }
.admin-toolbar button { margin-bottom:8px; }
.admin-layout { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;align-items:start; }
#admin-fields label { margin-top:16px; }
#admin-fields h3 { margin-top:24px; }
#admin-fields input,#admin-fields select,.admin-toolbar select { margin-top:8px; }
#admin-fields .admin-check { display:flex;align-items:center;gap:9px; font-weight:500; }
#admin-fields .admin-check input { width:auto;margin:0; }
#admin-preview { position:sticky;top:24px;min-height:250px; }
#admin-preview img { width:64px;height:64px;object-fit:contain;display:block;margin-bottom:16px; }
#admin-preview[data-layout="compact"] { padding:18px; }
#admin-status { padding:12px;background:#f1eefc;border-radius:8px; }
#admin-status.error { color:#9b3425;background:#fff0ed; }
@media(max-width:700px) { .admin-layout { grid-template-columns:1fr; } }

#brand-logo.brand-wordmark { width:280px; max-width:100%; height:auto; }
.header.has-wordmark { display:block; }
.header.has-wordmark #brand-byline { margin-left:16px; margin-top:-5px; font-size:12px; }

.allowed-domains {border:1px solid #dcdce8;border-radius:8px;padding:12px;margin:12px 0}.allowed-domains summary {cursor:pointer;font-weight:600}.allowed-domains .admin-check {margin-top:10px}.help-tip{position:relative;cursor:help;display:inline-block}.tooltip{display:none;position:absolute;bottom:130%;left:0;width:260px;padding:12px;background:#191b30;color:white;font-size:13px;font-weight:400;border-radius:8px;z-index:5}.help-tip:hover .tooltip,.help-tip:focus .tooltip{display:block}

.tracking-field{border:1px solid #dedee9;border-radius:12px;padding:16px;margin:22px 0}.tracking-field legend{font-weight:650;padding:0 6px}.tracking-presets{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px}.tracking-presets button{font-size:13px;padding:7px 10px;border:1px solid #dddde8;border-radius:20px;background:white;color:var(--brand-text,#191b30)}.tracking-presets button[aria-pressed="true"]{background:var(--brand-primary,#4c37a7);color:white;border-color:var(--brand-primary,#4c37a7)}.utm-toggle{display:flex;gap:10px;align-items:center;margin-top:22px}.utm-toggle input{width:auto;margin:0}.tracking-field .result{margin-top:8px}#utm-preview-panel{margin:14px 0}#utm-preview-panel summary{cursor:pointer}

.grid-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.links-table{min-width:1540px}.links-table th:nth-child(1){width:20%}.links-table th:nth-child(2){width:14%}.links-table th:nth-child(3),.links-table th:nth-child(4){width:9%}.links-table th:nth-child(5){width:12%}.links-table th:nth-child(6),.links-table th:nth-child(7),.links-table th:nth-child(8){width:6%}.links-table th:nth-child(9){width:7%}.links-table th:nth-child(10){width:5%}.links-table th:nth-child(11){width:6%}@media(max-width:700px){.grid-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}

.dashboard-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;align-items:end}.dashboard-filters label{margin:0}.dashboard-day{display:grid;grid-template-columns:100px minmax(100px,1fr) 70px;gap:12px;align-items:center;margin:8px 0}.dashboard-day meter{width:100%;height:22px}.dashboard-timeline{max-height:320px;overflow:auto}#dashboards-panel .fineprint{margin-top:12px}

#nameserver-heading{margin:0 0 20px;overflow-wrap:anywhere}#nameserver-details>p{margin:0 0 18px}.nameserver-list{list-style:none;padding:0;margin:22px 0;display:grid;gap:14px}.nameserver-list li{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 0;border-bottom:1px solid #ece9f3}.nameserver-list code{overflow-wrap:anywhere;min-width:0;font-size:14px;line-height:1.6}.nameserver-list button{flex-shrink:0;min-width:84px}.nameserver-copy-status:empty{display:none}#nameserver-close{margin-top:14px}#admin-domain-progress{margin-top:22px;line-height:1.7}.domain-actions{gap:16px;margin-top:20px}#admin-panel>p{line-height:1.7;margin-bottom:28px}

.admin-inline-field{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap}.admin-inline-field>label{flex:1;min-width:180px}.admin-inline-field>button{flex-shrink:0;margin-bottom:8px}

#staff-permissions-options .admin-check{display:flex;align-items:center;gap:12px;margin:18px 0}#staff-permissions-options input{width:auto;margin:0}
