:root {
  color-scheme: light;
  --ink: #152238;
  --muted: #667085;
  --line: #e4e9f0;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --brand: #14213d;
  --accent: #e36b2c;
  --accent-soft: #fff2eb;
  --danger: #b42318;
  --success: #087a55;
  --shadow: 0 16px 36px rgba(20, 33, 61, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: #255ea8; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.75rem, 3vw, 2.55rem); letter-spacing: -.045em; }
h2 { margin-bottom: .35rem; font-size: 1.2rem; letter-spacing: -.02em; }
h3 { margin-bottom: .35rem; }
p { color: var(--muted); line-height: 1.6; }
small { color: var(--muted); }
code { overflow-wrap: anywhere; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 28px 20px 20px; color: white; background: linear-gradient(165deg, #111c35, #182a4a 60%, #0f1a31); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { color: inherit; }
.brand small { margin-left: auto; color: #aebbd0; font-size: .68rem; font-weight: 600; }
.brand-mark, .public-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; border-radius: 11px; background: var(--accent); box-shadow: 0 8px 24px rgba(227, 107, 44, .3); }
.side-nav { display: grid; gap: 7px; margin-top: 42px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #bbc6d8; border-radius: 11px; font-size: .92rem; font-weight: 650; }
.side-nav a span { width: 22px; color: #8898b3; font-size: 1.2rem; text-align: center; }
.side-nav a:hover, .side-nav a.active { color: #fff; background: rgba(255,255,255,.09); }
.side-nav a.active { box-shadow: inset 3px 0 var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { display: flex; gap: 10px; align-items: center; min-width: 0; }
.user-chip > span { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: #172340; background: #f8d8c5; font-weight: 800; }
.user-chip div { display: grid; min-width: 0; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: #9eabc0; }
.link-button { padding: 8px 0 0 46px; color: #b9c5d8; border: 0; background: none; cursor: pointer; font-size: .8rem; }
.main-column { min-width: 0; }
.mobile-top { display: none; }
.mobile-top nav { display: flex; align-items: center; gap: 14px; }
.mobile-top nav > a:not(.button) { color: #fff; font-size: 1.2rem; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 38px clamp(24px, 4vw, 56px) 70px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.page-head.compact { align-items: center; }
.page-head p:last-child { margin-bottom: 0; }
.kicker { margin: 0 0 7px; color: var(--accent); font-size: .72rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.head-actions, .danger-actions, .download-grid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-actions form, .danger-actions form, .row-actions form { margin: 0; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: .9rem; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin-bottom: 0; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; line-height: 1.2; transition: transform .15s, box-shadow .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); color: inherit; }
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 8px 20px rgba(227,107,44,.18); }
.button.primary:hover { color: #fff; box-shadow: 0 10px 26px rgba(227,107,44,.28); }
.button.secondary { color: var(--brand); border-color: #d3dae5; background: #fff; }
.button.ghost { color: var(--muted); border-color: transparent; background: #f4f6f9; }
.button.danger { color: var(--danger); border-color: #f1c8c5; background: #fff7f6; }
.button.small { min-height: 34px; padding: 7px 11px; font-size: .82rem; }
.button.large { min-height: 50px; padding: 13px 21px; }

.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 16px rgba(20,33,61,.035); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { display: flex; align-items: center; gap: 15px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; color: var(--accent); border-radius: 12px; background: var(--accent-soft); font-size: 1.2rem; }
.metric div:last-child { display: grid; min-width: 0; }
.metric span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.metric strong { margin: 2px 0; overflow: hidden; font-size: 1.45rem; text-overflow: ellipsis; }
.metric small { font-size: .7rem; }
.compact-metrics { grid-template-columns: repeat(3, 1fr); }

.filter-panel { margin-bottom: 16px; padding: 14px; }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(7, minmax(105px, 1fr)) auto; gap: 9px; }
.search-field { position: relative; }
.search-field span { position: absolute; top: 11px; left: 12px; color: var(--muted); }
.search-field input { padding-left: 34px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); border: 1px solid #d8dee8; border-radius: 9px; outline: 0; background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #7f9bc4; box-shadow: 0 0 0 3px rgba(44,91,153,.11); }
input[type="color"] { padding: 4px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 16px; min-height: 16px; accent-color: var(--accent); }

.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
th { color: #738096; background: #fafbfc; font-size: .7rem; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
td small { display: block; margin-top: 4px; }
.select-cell { width: 38px; }
.number { text-align: right; }
.code-name { color: var(--ink); font-weight: 800; }
.content-snippet { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-line { display: flex; align-items: center; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.folder-path { color: #566176; white-space: nowrap; }
.folder-path b { padding: 0 5px; color: #b3bbc7; }
.short-link-actions { display: flex; align-items: center; gap: 5px; }
.copy-link { display: block; max-width: 250px; padding: 0; overflow: hidden; color: #36679f; border: 0; background: transparent; cursor: pointer; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; color: #59677d; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--brand); border-color: var(--line); background: #fff; }
.icon-button.danger:hover { color: var(--danger); }
.status-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 9px; color: #606b7d; border: 1px solid #d9dee6; border-radius: 99px; background: #fff; cursor: pointer; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.status-toggle > span { position: relative; width: 26px; height: 15px; border-radius: 99px; background: #c7cdd6; transition: .18s; }
.status-toggle > span::after { position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); content: ""; transition: .18s; }
.status-toggle.is-active { color: var(--success); border-color: #bce5d5; background: #f0fbf7; }
.status-toggle.is-active > span { background: #17a673; }
.status-toggle.is-active > span::after { transform: translateX(11px); }
.large-toggle { min-height: 42px; padding: 8px 13px; font-size: .82rem; }
.bulk-bar { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 9px 15px; border-bottom: 1px solid var(--line); }
.bulk-bar label { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.bulk-bar select { width: auto; min-width: 160px; }
.bulk-bar > span { margin-left: auto; color: var(--muted); font-size: .8rem; }
.bulk-editor { width: min(920px, calc(100vw - 32px)); height: min(860px, calc(100vh - 32px)); height: min(860px, calc(100dvh - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; color: var(--ink); border: 0; border-radius: 18px; background: #fff; box-shadow: 0 30px 90px rgba(13,25,47,.28); }
.bulk-editor[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.bulk-editor::backdrop { background: rgba(10,20,38,.58); backdrop-filter: blur(3px); }
.bulk-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.bulk-editor-head h2 { margin-bottom: 5px; }
.bulk-editor-head p:last-child { max-width: 680px; margin-bottom: 0; font-size: .83rem; }
.dialog-close { flex: 0 0 auto; width: 36px; height: 36px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 1.35rem; line-height: 1; }
.bulk-editor-body { display: grid; min-height: 0; gap: 22px; padding: 20px 24px 28px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.bulk-editor-body section { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.bulk-editor-body section:last-child { padding-bottom: 0; border-bottom: 0; }
.bulk-editor-body section > p { margin: 0 0 13px; font-size: .8rem; }
.bulk-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.bulk-edit-field { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.bulk-edit-field.wide { grid-column: 1 / -1; }
.bulk-apply { display: flex; align-items: center; gap: 7px; min-height: 19px; color: #3d4a5e; font-size: .76rem; font-weight: 800; }
.bulk-date-grid, .bulk-tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bulk-date-grid label { display: grid; gap: 4px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.bulk-tag-grid { grid-template-columns: 150px minmax(0, 1fr); }
.bulk-edit-field > small { line-height: 1.4; }
.bulk-editor-actions { position: relative; z-index: 2; display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 24px rgba(13,25,47,.06); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: .8rem; }
.button.disabled { opacity: .45; pointer-events: none; }
.empty-state { padding: 55px 20px; text-align: center; }
.empty-state > div { color: var(--accent); font-size: 2.4rem; }
.empty-state p { margin-bottom: 18px; }

.pill { display: inline-flex; align-items: center; padding: 4px 8px; color: #536177; border-radius: 99px; background: #eef1f5; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.pill.success { color: #086b4c; background: #e4f6ef; }
.pill.danger { color: #a22a21; background: #fde9e7; }
.pill.info { color: #285f9a; background: #e9f2fd; }
.pill.tag { color: #74513f; background: #fff1e8; }
.pill.soft { color: #35516f; background: #edf3f9; }
.pill.neutral, .pill.muted { color: #606b7d; background: #eff1f4; }
.muted { color: var(--muted); }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: calc(100% - 338px); margin: 0 0 16px; }
.editor-steps button { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 12px; color: #697589; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; font-weight: 750; }
.editor-steps button > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #eef1f5; font-size: .75rem; }
.editor-steps button.active { color: var(--brand); border-color: #b9c8dc; box-shadow: 0 4px 15px rgba(20,33,61,.07); }
.editor-steps button.active > span { color: #fff; background: var(--accent); }
.editor-steps button.complete > span { color: #fff; background: var(--success); }
.editor-main { display: grid; gap: 16px; min-width: 0; }
.form-card { padding: 22px; }
.form-title { display: flex; gap: 13px; margin-bottom: 20px; }
.form-title > span { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; color: #fff; border-radius: 50%; background: var(--brand); font-weight: 800; font-size: .8rem; }
.form-title p, .panel-head p { margin-bottom: 0; font-size: .86rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; margin-bottom: 14px; }
.form-grid .field { margin-bottom: 0; }
.field.wide, .form-grid .wide { grid-column: 1 / -1; }
.field > span { color: #3d4a5e; font-size: .78rem; font-weight: 750; }
.field small { line-height: 1.45; }
.field-note { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }
.readonly-value { min-height: 42px; padding: 10px 11px; color: #596579; border: 1px solid #e1e5eb; border-radius: 9px; background: #f4f6f9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.check { display: flex; align-items: center; gap: 8px; color: #4b586b; font-size: .85rem; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 4px; border-radius: 10px; background: #f0f2f5; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px; border-radius: 7px; text-align: center; font-size: .82rem; font-weight: 750; }
.segmented input:checked + span { color: var(--brand); background: #fff; box-shadow: 0 2px 8px rgba(20,33,61,.08); }
.type-fields { margin-top: 15px; }
.step-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.step-actions .primary { margin-left: auto; }
.mini-checklist { display: grid; gap: 7px; padding-left: 22px; color: var(--muted); font-size: .84rem; }
.inline-create { padding: 12px; border: 1px dashed #c5d1e1; border-radius: 10px; background: #f8fbff; }
.image-current { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.image-current > img:not(.logo-preview) { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.editor-side, .editor-aside { position: sticky; top: 20px; }
.preview-card { padding: 22px; text-align: center; }
.sticky-card { padding: 22px; }
.mode-card { margin: 15px 0; padding: 14px; border-radius: 11px; background: #f6f7f9; }
.mode-card p { margin: 5px 0 0; font-size: .8rem; line-height: 1.5; }
.wide-button { width: 100%; margin-top: 9px; }
.preview-qr { display: grid; place-items: center; width: 188px; height: 188px; margin: 20px auto; color: #9aa4b2; border: 12px solid #fff; outline: 1px solid var(--line); background: repeating-conic-gradient(#172541 0 25%, #fff 0 50%) 50% / 18px 18px; font-weight: 800; }
.mode-summary { margin: 15px 0; padding: 12px; color: #49576b; border-radius: 10px; background: #f6f7f9; font-size: .8rem; line-height: 1.5; }
.editor-side .button { width: 100%; margin-top: 8px; }
.logo-preview { max-width: 130px; max-height: 70px; object-fit: contain; }
.info-icon { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 5px; color: #fff; border-radius: 50%; background: #718096; font-size: .65rem; font-style: normal; cursor: help; }
.tooltip { position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 9px); width: 260px; padding: 10px 12px; color: #fff; border-radius: 8px; background: #1e2b42; box-shadow: var(--shadow); font-size: .75rem; font-weight: 500; line-height: 1.45; opacity: 0; pointer-events: none; transform: translate(-50%, 5px); transition: .15s; }
.info-icon:hover .tooltip, .info-icon:focus .tooltip { opacity: 1; transform: translate(-50%, 0); }

.notice { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 11px; line-height: 1.55; }
.notice.info { color: #285a8e; border-color: #c9dcf2; background: #eef6ff; }
.notice.success { color: #087050; border-color: #bce5d5; background: #ecfaf5; }
.notice.danger { color: #9b2c23; border-color: #f0c2be; background: #fff1ef; }
.notice.warning { color: #81520a; border-color: #f2d293; background: #fff8e8; }
.static-notice { position: relative; z-index: 0; clear: both; overflow: hidden; }
.pre-line { white-space: pre-line; }

.detail-grid { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.qr-card, .info-card { padding: 22px; }
.qr-card > img { display: block; width: min(100%, 320px); margin: 0 auto 18px; }
.download-grid { justify-content: center; }
.info-card h2 { margin-bottom: 14px; }
.url-box { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.url-box code { flex: 1; color: #255d9e; }
.url-box button { color: var(--accent); border: 0; background: transparent; cursor: pointer; font-weight: 750; }
.url-link-value { flex: 1; min-width: 0; }
.url-link-value code { display: block; }
.payload-box { display: block; max-height: 180px; padding: 14px; overflow: auto; white-space: pre-wrap; border-radius: 10px; background: #f7f8fa; }
.stored-content { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.stored-content h3 { font-size: .95rem; }
.content-overview { margin: 8px 0 0; }
.content-overview dd { overflow-wrap: anywhere; white-space: pre-wrap; }
dl { margin: 20px 0; }
dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: .8rem; }
dd { margin: 0; }
.danger-actions { margin-top: 20px; }
.analytics-panel, .history-panel { margin-bottom: 18px; padding: 22px; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.panel-head.sub { align-items: center; margin-top: 28px; }
.range-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.range-form label { display: grid; gap: 4px; color: var(--muted); font-size: .7rem; }
.range-form input { min-height: 36px; }
.range-form .check { display: flex; padding-bottom: 9px; }
.analytics-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.history-limit label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.history-limit select { width: auto; min-height: 36px; }
.analytics-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr); gap: 28px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 36px; gap: 10px; align-items: center; font-size: .75rem; }
.bar-row time { color: var(--muted); }
.bar-row > div { height: 9px; overflow: hidden; border-radius: 99px; background: #eef1f5; }
.bar-row > div span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #f2a476); }
.device-list, .history-list, .resource-list { margin: 0; padding: 0; list-style: none; }
.device-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.history-list > li { display: block; padding: 15px 0; border-bottom: 1px solid var(--line); }
.version-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.version-head > div { display: grid; gap: 3px; }
.history-list span { color: var(--muted); font-size: .8rem; }
.version-details { margin-top: 12px; }
.version-details summary { color: #315f96; cursor: pointer; font-size: .82rem; font-weight: 750; }
.change-list { display: grid; gap: 8px; margin-top: 10px; }
.change-list > div { display: grid; grid-template-columns: 130px minmax(0,1fr) 20px minmax(0,1fr); gap: 8px; align-items: start; padding: 9px 10px; border-radius: 9px; background: #f8fafc; font-size: .78rem; }
.change-list del { color: #8d3e37; text-decoration: none; overflow-wrap: anywhere; }
.change-list ins { color: #087050; text-decoration: none; overflow-wrap: anywhere; }
.change-list > div > span { text-align: center; }
.history-color { display: inline-flex; align-items: center; gap: 7px; padding: 3px 6px; color: inherit; border: 1px solid currentColor; border-radius: 7px; background: rgba(255,255,255,.75); cursor: pointer; }
.history-color > .history-swatch { width: 22px; height: 16px; border: 1px solid rgba(20,33,61,.2); border-radius: 4px; }
.history-color > em { width: 0; overflow: hidden; opacity: 0; color: var(--success); font-size: .68rem; font-style: normal; font-weight: 800; transition: width .16s, opacity .16s; white-space: nowrap; }
.history-color.is-copied > em { width: 48px; opacity: 1; }
.history-color.is-copied, .copy-chip.is-copied { outline: 2px solid var(--success); outline-offset: 2px; }
.history-created { margin: 9px 0 0; }
.empty-mini { padding: 35px; color: var(--muted); border: 1px dashed #d7dde6; border-radius: 10px; text-align: center; }

.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.manage-card { padding: 22px; }
.compact-form { display: grid; gap: 12px; margin-bottom: 24px; }
.compact-form .field { margin: 0; }
.compact-form > .button { justify-self: start; }
.resource-list { border-top: 1px solid var(--line); }
.resource-list li { display: flex; align-items: center; gap: 11px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.resource-list li > div { display: grid; min-width: 0; }
.resource-list li > a, .resource-list li > .pill { margin-left: auto; }
.editable-list > li { align-items: flex-start; flex-wrap: wrap; }
.resource-summary { flex: 1 1 180px; padding-top: 5px; }
.resource-editor { flex: 0 0 auto; }
.resource-editor summary { padding: 7px 10px; color: #536177; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .8rem; font-weight: 750; list-style: none; }
.resource-editor[open] { flex: 1 0 100%; order: 5; padding: 14px; border-radius: 11px; background: #f8fafc; }
.resource-editor[open] summary { display: inline-block; margin-bottom: 12px; }
.resource-editor form { display: grid; gap: 10px; }
.resource-delete { margin: 0; }
.resource-actions { display: flex !important; align-items: center; gap: 8px; margin-left: auto; }
.resource-more { margin-top: 10px; }
.resource-more > summary { padding: 10px 12px; color: #315f96; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; cursor: pointer; font-size: .82rem; font-weight: 750; }
.resource-more[open] > summary { margin-bottom: 8px; }
.domain-help { margin-top: 18px; padding: 24px; scroll-margin-top: 20px; }
.domain-help ol { display: grid; gap: 10px; padding-left: 22px; color: #48566a; line-height: 1.5; }
.domain-help p:last-child { margin-bottom: 0; }
.detected-ips { display: flex; align-items: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.detected-ips small { flex-basis: 100%; }
.copy-chip { padding: 8px 11px; color: #285f9a; border: 1px solid #c9dcf2; border-radius: 9px; background: #eef6ff; cursor: pointer; }
.backup-panel { overflow: hidden; }
.backup-summary { display: flex; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.color-dot { width: 13px; height: 13px; border-radius: 50%; }
.template-swatch { width: 30px; height: 30px; border: 6px solid var(--bg); border-radius: 7px; outline: 1px solid var(--line); background: var(--fg); }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }

.public-shell { display: grid; min-height: 100vh; place-items: center; padding: 22px; background: radial-gradient(circle at top, #fff 0, #edf1f6 70%); }
.login-card, .public-card { width: min(520px, 100%); padding: clamp(28px, 6vw, 55px); border: 1px solid rgba(20,33,61,.08); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); text-align: center; }
.hero-brand { justify-content: center; margin-bottom: 32px; color: var(--brand); }
.login-card .lead { margin-bottom: 28px; }
.login-form { display: grid; gap: 14px; margin-bottom: 16px; text-align: left; }
.login-form .button { width: 100%; }
.public-card { --accent: #e36b2c; color: #26354d; }
.public-card h1 { margin-top: 22px; color: #14213d; }
.public-card .public-mark { margin: 0 auto; }
.public-logo { max-width: 160px; max-height: 80px; object-fit: contain; }
.public-card small { display: block; margin-top: 28px; }
.legal-page { width: min(780px, 100%); margin: 30px auto; padding: clamp(24px, 5vw, 54px); border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.legal-page h2 { margin-top: 28px; }
.legal-page p { color: #46546a; }
.legal-page footer { display: flex; gap: 9px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .82rem; }

.vcard-page { width: min(520px, 100%); overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 24px 70px rgba(20,33,61,.16); }
.vcard-hero { position: relative; padding: 42px 28px 30px; color: #fff; background: linear-gradient(145deg, var(--brand), #31405c); text-align: center; }
.vcard-hero::after { position: absolute; right: -45px; bottom: -65px; width: 180px; height: 180px; border: 30px solid rgba(255,255,255,.07); border-radius: 50%; content: ""; }
.vcard-hero .kicker { color: #ffd8c5; }
.vcard-hero h1 { margin: 16px 0 5px; color: #fff; }
.vcard-hero .job, .vcard-hero .company { margin-bottom: 2px; color: #dce3ee; }
.vcard-avatar, .vcard-initials { position: relative; z-index: 1; width: 104px; height: 104px; margin: 0 auto; border: 4px solid rgba(255,255,255,.8); border-radius: 50%; object-fit: cover; background: #fff; }
.vcard-initials { display: grid; place-items: center; color: var(--brand); font-size: 2rem; font-weight: 850; }
.save-contact { position: relative; z-index: 1; display: inline-flex; margin-top: 20px; padding: 11px 17px; color: var(--brand); border-radius: 10px; background: #fff; font-weight: 800; }
.save-contact:hover { color: var(--accent); }
.save-hint { position: relative; z-index: 1; display: block; margin-top: 9px; color: #dce3ee; font-size: .7rem; }
.contact-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 20px; }
.contact-action { display: grid; gap: 7px; padding: 13px 6px; color: var(--brand); border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: .72rem; font-weight: 750; }
.contact-action span { color: var(--accent); font-size: 1.15rem; }
.vcard-section { margin: 0 20px 14px; padding: 18px; border-radius: 14px; background: #f7f8fa; }
.vcard-section h2 { font-size: .95rem; }
.vcard-section p { margin-bottom: 0; }
.vcard-page footer { padding: 15px 20px 25px; color: #929baa; font-size: .7rem; line-height: 1.6; text-align: center; }
.vcard-page footer a { color: #65748b; }

@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(4, 1fr); }
  .search-field { grid-column: span 2; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-top { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; color: #fff; background: var(--brand); }
  .mobile-top .brand-mark { width: 30px; height: 30px; }
  .content { padding: 25px 16px 55px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .editor-layout, .detail-grid, .management-grid, .two-column, .analytics-layout { grid-template-columns: 1fr; }
  .editor-steps { max-width: none; }
  .editor-side, .editor-aside { position: static; }
  .preview-card { display: none; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .metrics-grid, .compact-metrics, .form-grid { grid-template-columns: 1fr; }
  .field.wide, .form-grid .wide { grid-column: auto; }
  .filters { grid-template-columns: 1fr; }
  .filters .search-field { grid-column: auto; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-bar select { width: 100%; }
  .bulk-bar > span { margin-left: 0; }
  .bulk-editor { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .bulk-editor-head, .bulk-editor-body, .bulk-editor-actions { padding-right: 16px; padding-left: 16px; }
  .bulk-edit-grid, .bulk-date-grid, .bulk-tag-grid { grid-template-columns: 1fr; }
  .bulk-edit-field.wide { grid-column: auto; }
  .bulk-editor-actions { align-items: stretch; flex-direction: column-reverse; }
  .bulk-editor-actions .button { width: 100%; }
  .range-form { align-items: stretch; flex-direction: column; }
  .range-form .check { padding: 6px 0; }
  .analytics-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .analytics-actions form, .analytics-actions .button { width: 100%; }
  dl > div { grid-template-columns: 1fr; gap: 5px; }
  .contact-actions { grid-template-columns: repeat(2, 1fr); }
  .editor-steps { position: sticky; z-index: 20; top: 66px; gap: 5px; padding: 7px 0; background: var(--canvas); }
  .editor-steps button { justify-content: center; min-width: 0; padding: 7px 4px; font-size: 0; }
  .editor-steps button > span { font-size: .75rem; }
  .form-card { padding: 17px; }
  .step-actions { align-items: stretch; flex-direction: column-reverse; }
  .step-actions .button { width: 100%; margin: 0; }
  .version-head { align-items: flex-start; flex-direction: column; }
  .change-list > div { grid-template-columns: 1fr; }
  .change-list > div > span { text-align: left; }

  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { padding: 8px 12px; }
  .responsive-table tr { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .responsive-table tbody tr:hover { background: #fff; }
  .responsive-table td { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border: 0; text-align: left; white-space: normal; }
  .responsive-table td::before { color: #7a8596; content: attr(data-label); font-size: .65rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .responsive-table td[colspan] { display: block; }
  .responsive-table td[colspan]::before { content: none; }
  .responsive-table .select-cell { width: 100%; }
  .responsive-table .row-actions { display: flex; justify-content: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
  .responsive-table .row-actions::before { display: none; }
  .responsive-table .copy-link { max-width: 100%; }
  .responsive-table .content-snippet { max-width: 100%; white-space: normal; }
  .responsive-table .folder-path { white-space: normal; }
  .stats-table td { grid-template-columns: 80px minmax(0,1fr); }
  .scan-time { white-space: nowrap; }
  .table-wrap { overflow-x: visible; }
  .backup-table td:last-child a { width: 100%; }
}
