:root {
  --ink: #18201d;
  --muted: #69736f;
  --line: #dfe5e1;
  --soft: #f4f6f4;
  --paper: #fff;
  --accent: #176b50;
  --accent-dark: #0e503b;
  --accent-soft: #e8f4ef;
  --danger: #aa3d3d;
  --shadow: 0 10px 30px rgba(23, 39, 32, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f8f7;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f7f8f7; color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: #12241e; color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #55b991; color: #0d2e23; font-weight: 850; }
.main-nav { margin-top: 42px; display: grid; gap: 7px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; color: #eaf4f0; background: rgba(255,255,255,.08); }
.nav-icon { color: #6fd0a9; font-size: 19px; }
.sidebar-footer { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255,255,255,.13); }
.user-name { font-size: 14px; font-weight: 650; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.link-button { padding: 0; border: 0; background: none; color: #9eb2aa; cursor: pointer; }
.main-area { min-width: 0; padding: 44px clamp(28px, 5vw, 72px) 72px; }
.page-header, .site-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; }
.page-header.compact { align-items: flex-start; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin-bottom: 5px; font-size: 19px; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted, .panel-title p, .form-section > p { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-weight: 680; cursor: pointer; }
.button:hover { border-color: #b7c2bd; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.quiet { background: var(--soft); }
.button.danger { color: var(--danger); border-color: #edcaca; background: #fff8f8; }
.button.wide { width: 100%; }
.website-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.website-card { min-height: 225px; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.website-card:hover { transform: translateY(-2px); border-color: #afc5bb; }
.card-heading { display: flex; justify-content: space-between; align-items: center; }
.site-avatar { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 850; }
.website-card h2 { margin: 23px 0 8px; font-size: 22px; }
.website-card code { color: var(--muted); word-break: break-all; }
.card-stats { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.card-stats strong { color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 6px; color: #827f73; font-size: 12px; font-weight: 750; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #a8aaa5; }
.status.active { color: var(--accent); }
.status.active::before { background: #39a779; }
.empty-state { padding: 80px 24px; border: 1px dashed #cbd4cf; border-radius: 16px; text-align: center; background: var(--paper); }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.site-header { display: block; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.site-identity { display: flex; justify-content: space-between; align-items: flex-end; }
.site-identity h1 { display: inline-block; margin-right: 12px; font-size: 34px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 28px; margin-top: 29px; overflow-x: auto; }
.tabs a { padding: 12px 1px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 650; white-space: nowrap; }
.tabs a.selected { color: var(--accent); border-bottom-color: var(--accent); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric { padding: 19px 21px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 24px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; margin-bottom: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 21px; }
.panel-title p { margin: 0; font-size: 13px; }
.copy-row { display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-example { display: flex; gap: 20px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.request-example code { color: var(--ink); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.export-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.export-buttons > span { margin-right: 3px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.export-buttons .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.token-state { display: grid; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.token-state span { color: var(--muted); font-size: 13px; font-weight: 750; }
.token-state.enabled { border-color: #b9daca; background: var(--accent-soft); }
.token-state.enabled span { color: var(--accent-dark); }
.token-state .token-value { display: block; width: 100%; max-width: none; padding: 12px 14px; border-radius: 7px; background: #10251e; color: #f1fff9; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; user-select: all; }
.token-controls { display: grid; justify-items: start; gap: 9px; }
.token-action-button { min-width: 190px; }
.custom-token-editor { width: 100%; display: grid; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.custom-token-editor input { margin-top: 0; }
.custom-token-editor .button { justify-self: start; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.secret-output, .json-view { padding: 15px; border-radius: 9px; background: #12241e; color: #d9f4e9; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.error-text { color: var(--danger); }
.table-panel { margin-top: 18px; }
.table-wrap { overflow-x: auto; margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--muted); font-size: 11px; text-align: left; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; text-align: right; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.empty-inline { padding: 28px; color: var(--muted); text-align: center; }
.settings-form { max-width: 920px; }
.danger-zone { max-width: 920px; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 18px; border-color: #edcaca; }
.danger-zone p { margin-bottom: 0; color: var(--muted); }
.delete-confirmation { max-width: 680px; border-color: #edcaca; }
.danger-text { color: var(--danger); }
.deletion-summary { margin: 18px 0 24px; padding-left: 22px; color: var(--muted); line-height: 1.8; }
.delete-form { display: grid; gap: 12px; margin-top: 20px; }
.delete-form .button-row { margin-top: 8px; }
.form-section { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; padding: 9px 0 30px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.form-section > p { font-size: 13px; }
.form-section > .field-grid, .form-section > .token-input-row, .form-section > .check-row { grid-column: 2; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field-grid .full { grid-column: 1 / -1; }
label { display: block; color: #48514e; font-size: 13px; font-weight: 700; }
input[type=text], input[type=url], input[type=password], input[type=number], select { width: 100%; height: 42px; margin-top: 7px; padding: 8px 11px; border: 1px solid #cdd5d1; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(23,107,80,.12); border-color: var(--accent); }
label small { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; line-height: 1.35; }
.errorlist { margin: 6px 0 0; padding-left: 18px; color: var(--danger); font-weight: 500; }
.token-input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.token-input-row .button { margin-top: 26px; }
.check-row { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; }
.check-row input { margin-top: 4px; }
.check-row small { margin-top: 3px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.form-banner, .message { padding: 12px 15px; border: 1px solid #c6ddd3; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); }
.messages { margin-bottom: 18px; }
.field-list { display: grid; gap: 12px; }
.origin-list { display: grid; gap: 12px; }
.origin-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) auto auto; gap: 14px; align-items: end; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.compact-check { display: flex; align-items: center; gap: 6px; min-height: 42px; white-space: nowrap; }
.field-card { display: flex; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.field-number { flex: 0 0 30px; color: #9aa39f; font-weight: 800; }
.field-controls { flex: 1; min-width: 0; }
.fields-editor { grid-template-columns: 1fr 1.2fr 1fr 90px; }
.fields-editor .full { grid-column: 1 / -1; }
.inline-checks { display: flex; gap: 22px; margin-top: 13px; }
.inline-checks label { display: flex; align-items: center; gap: 6px; }
.delete-check { color: var(--danger); }
.pagination { display: flex; justify-content: center; gap: 22px; padding-top: 22px; color: var(--muted); }
.detail-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 18px; }
.detail-heading h2 { font-size: 27px; }
.detail-heading time { color: var(--muted); }
.submission-fields-panel { margin-bottom: 18px; }
.subsection-title { margin: 23px 0 10px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.subsection-title:first-child { margin-top: 0; }
.received-value { max-width: 340px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
small.received-value { display: block; margin-top: 5px; }
.schema-status { display: inline-block; padding: 4px 8px; border-radius: 20px; font-size: 11px; font-weight: 750; }
.schema-status.configured { color: var(--accent); background: var(--accent-soft); }
.schema-status.rejected { color: var(--danger); background: #fff0f0; }
.suggested-fields-form { margin-top: 25px; padding-top: 1px; border-top: 1px solid var(--line); }
.suggestion-table input[type=text], .suggestion-table select { min-width: 135px; margin-top: 0; }
.suggestion-table input[type=checkbox] { width: 17px; height: 17px; }
.suggestion-table .errorlist { min-width: 150px; }
.suggested-fields-form .form-actions { margin-top: 20px; }
.schema-complete { margin-top: 20px; padding: 15px; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); }
.detail-columns { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr); }
.meta-panel dl { margin: 20px 0 0; }
.meta-panel dt { margin-top: 18px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.meta-panel dd { margin: 5px 0 0; word-break: break-word; }
.metric small { display: block; margin-top: 5px; color: var(--muted); }
.metric .metric-text { font-size: 17px; }
.rejection-json { color: #ffd8d8; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef3f0; }
.login-card { width: min(100%, 420px); padding: 38px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 38px; color: var(--ink); }
.login-card h1 { font-size: 31px; }
.stack-form { display: grid; gap: 17px; margin-top: 28px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px 20px; flex-direction: row; align-items: center; gap: 20px; }
  .main-nav { margin: 0; }
  .sidebar-footer { margin: 0 0 0 auto; padding: 0; border: 0; }
  .user-name { display: none; }
  .main-area { padding: 28px 20px 55px; }
  .two-column, .detail-columns { grid-template-columns: 1fr; }
  .fields-editor { grid-template-columns: 1fr 1fr; }
  .origin-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .brand > span:last-child { display: none; }
  .page-header { align-items: flex-start; }
  .metric-grid { grid-template-columns: 1fr; }
  .form-section { display: block; }
  .form-section > p { margin-bottom: 20px; }
  .field-grid, .fields-editor, .token-input-row { grid-template-columns: 1fr; }
  .origin-row { grid-template-columns: 1fr; }
  .field-grid .full { grid-column: auto; }
  .token-input-row .button { margin-top: 0; }
  .site-identity { display: block; }
}
