:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #20262d;
  --text2: #626b76;
  --border: #e3e6e9;
  --primary: #26323e;
  --success: #25704c;
  --success-bg: #edf7f0;
  --warning: #956018;
  --warning-bg: #fcf5e8;
  --danger: #b53d3d;
  --danger-bg: #fdf0ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
button, input, select, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid #476a83; }
.hidden { display: none !important; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.35px; text-decoration: none; white-space: nowrap; }
.brand img { width: 32px; height: 32px; flex: 0 0 32px; }
.app-header { height: 65px; background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1320px; height: 100%; margin: auto; padding: 0 32px; display: flex; align-items: center; gap: 24px; }
.header-context { border-left: 1px solid var(--border); padding-left: 24px; color: var(--text2); font-size: 13px; }
.header-spacer { flex: 1; }
.service-status { display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; color: var(--text2); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #8d949c; flex: 0 0 6px; }
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--danger); }
main { max-width: 1320px; margin: 0 auto; padding: 43px 32px 60px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; font-weight: 650; line-height: 1.2; letter-spacing: -.75px; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.45px; }
.page-description { color: var(--text2); margin-top: 8px; line-height: 1.5; }
/* Small feature panels act as filters, keeping the operational table central. */
.feature-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 25px 0 23px; }
.feature-panel { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 7px; padding: 14px 17px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: var(--text); }
.feature-panel:hover { border-color: #aeb9c2; background: #fcfdfe; }
.feature-panel.selected { border-color: #8c9ba7; box-shadow: inset 0 0 0 1px #8c9ba7; }
.feature-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text2); font-weight: 500; }
.feature-label .icon { color: #85919b; }
.feature-value { font-size: 25px; line-height: 28px; font-weight: 600; letter-spacing: -.6px; display: flex; align-items: baseline; gap: 7px; font-variant-numeric: tabular-nums; }
.feature-unit { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--text2); }
.feature-detail { font-size: 11px; color: var(--text2); line-height: 16px; }
.toolbar-title { font-size: 14px; font-weight: 550; letter-spacing: -.1px; margin-right: auto; white-space: nowrap; }
.btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 550; line-height: 20px; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #374553; border-color: #374553; }
.btn-secondary { background: var(--surface); border-color: #d7dce1; color: var(--text); box-shadow: 0 1px 2px #20262d05; }
.btn-secondary:hover { background: #f4f6f7; border-color: #bcc5cc; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover, .btn-icon:hover { background: #edf0f2; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #993333; }
.btn-full { width: 100%; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 5px; background: transparent; color: var(--text2); }
.btn-danger-icon:hover { color: var(--danger); background: var(--danger-bg); }
.table-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; gap: 16px; border-bottom: 1px solid var(--border); }
.search-container { display: flex; align-items: center; gap: 9px; width: 310px; max-width: 100%; position: relative; }
.search-container > .icon { position: absolute; left: 11px; color: #7c8690; pointer-events: none; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid #d7dce1; border-radius: 6px; background: var(--surface); color: var(--text); min-height: 39px; line-height: 20px; }
input::placeholder { color: #7b8590; }
input:hover, select:hover { border-color: #b9c3cc; }
input:focus, select:focus { border-color: #708897; }
#search-input { min-height: 36px; height: 36px; padding: 6px 10px 6px 34px; font-size: 13px; }
.toolbar-actions { display: flex; align-items: center; gap: 16px; }
.table-count { color: var(--text2); font-size: 12px; white-space: nowrap; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: 13px; }
.col-source { width: 24%; }.col-target { width: 28%; }.col-code { width: 9%; }.col-status { width: 13%; }.col-cert { width: 15%; }.col-actions { width: 11%; }
th { height: 38px; padding: 8px 18px; background: #fafbfc; color: var(--text2); font-size: 12px; font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { height: 60px; padding: 9px 18px; vertical-align: middle; border-bottom: 1px solid #edf0f2; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
.source-list { display: flex; flex-direction: column; gap: 4px; font-weight: 550; line-height: 18px; }
.source-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-domain + .source-domain { color: var(--text2); font-weight: 400; }
.target-cell { display: flex; align-items: center; gap: 10px; min-width: 0; color: #495561; }
.target-cell > .icon { width: 14px; height: 14px; flex-basis: 14px; color: #9ba4ac; }
.target-url { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 21px; }
.code-badge { display: inline-block; padding: 2px 6px; border: 1px solid #e3e7eb; border-radius: 4px; color: #59636d; font-size: 12px; line-height: 17px; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; line-height: 20px; white-space: nowrap; font-size: 12px; }
.status-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.ok { color: var(--success); }
.status-pill.partial, .status-pill.pending { color: var(--warning); }
.actions, .actions-heading { text-align: right; }
.actions { display: flex; justify-content: flex-end; gap: 2px; }
.certificate-details { position: relative; }
.certificate-details summary { display: inline-flex; align-items: center; gap: 3px; list-style: none; cursor: pointer; border-radius: 4px; white-space: nowrap; font-size: 12px; padding: 3px 0; }
.certificate-details summary::-webkit-details-marker { display: none; }
.cert-ok { color: var(--success); }.cert-warn, .cert-pending { color: var(--warning); }.cert-danger { color: var(--danger); }
.certificate-popover { position: absolute; top: 100%; right: 0; z-index: 5; width: 285px; padding: 14px; background: white; border: 1px solid var(--border); border-radius: 7px; box-shadow: 0 6px 20px #20262d16; color: var(--text); font-size: 12px; }
.certificate-popover strong { font-weight: 550; overflow-wrap: anywhere; display: block; }
.certificate-entry + .certificate-entry { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.certificate-entry span { display: block; color: var(--text2); line-height: 1.6; margin-top: 3px; }
.table-footer { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding: 11px 18px; font-size: 11px; color: var(--text2); }
.empty-state { padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text2); }
.empty-state strong { font-size: 15px; font-weight: 550; color: var(--text); }
.load-error { padding: 12px 18px; background: var(--danger-bg); color: var(--danger); font-size: 13px; border-bottom: 1px solid var(--border); }
.modal { width: calc(100% - 32px); max-width: 480px; max-height: calc(100dvh - 40px); margin: auto; padding: 26px; border: 1px solid #dce1e5; border-radius: 11px; background: white; color: var(--text); box-shadow: 0 16px 60px #20262d26; overflow: auto; }
.modal::backdrop { background: #202a3552; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-heading .btn-icon { margin: -4px -5px -4px 0; }
.modal-description { color: var(--text2); font-size: 13px; line-height: 1.6; margin: 8px 0 24px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 19px; }
.field label { font-size: 13px; font-weight: 550; }
.field-help { font-size: 12px; color: var(--text2); line-height: 1.6; }
.form-note { font-size: 12px; color: var(--text2); margin: 4px 0 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.confirm-modal { max-width: 410px; }
.confirm-modal .modal-description { margin-top: 15px; }
.dns-domain-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; overflow-wrap: anywhere; }
.dns-record + .dns-record { margin-top: 22px; }
.dns-fields { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.dns-row { display: grid; grid-template-columns: 85px 1fr auto; gap: 8px; align-items: center; min-height: 36px; padding: 4px 10px; font-size: 12px; }
.dns-row + .dns-row { border-top: 1px solid #edf0f2; }
.dns-label { color: var(--text2); }
.dns-value { overflow-wrap: anywhere; }
.dns-copy-icon { border: 0; background: transparent; padding: 4px 6px; color: var(--text2); font-size: 11px; border-radius: 4px; }
.dns-copy-icon:hover { background: #edf0f2; color: var(--text); }
.dns-copy-icon.copied { color: var(--success); }
.dns-note { margin: 18px 0; }
.dns-share { border: 1px solid var(--border); border-radius: 7px; background: var(--bg); padding: 14px; margin: 18px 0; }
.dns-share label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.dns-share-controls { display: flex; gap: 8px; margin-bottom: 9px; }
.dns-share-controls input { width: 100%; min-width: 0; font-size: 12px; }
.dns-preview { display: inline-block; font-size: 12px; color: var(--success); margin-top: 10px; text-underline-offset: 3px; }
.dns-modal-actions { flex-wrap: wrap; }
.shared-dns-page { max-width: 700px; padding: 48px 24px; margin: auto; }
.shared-dns-page > .brand { margin: 0 0 26px 2px; }
.shared-dns-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 30px; }
.shared-dns-heading { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.shared-dns-heading h1 { font-size: 26px; }
.shared-dns-heading .page-description { max-width: none; }
.shared-dns-intro { margin: 24px 0 18px; color: var(--text2); line-height: 1.6; font-size: 13px; }
.shared-domain { font-size: 15px; margin-bottom: 12px; overflow-wrap: anywhere; }
.shared-dns-state { padding: 28px 0 4px; line-height: 1.6; color: var(--text2); }
.shared-dns-footer { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 20px; }
.shared-copy-status { margin-top: 12px; color: var(--success); font-size: 12px; line-height: 1.5; }
.shared-copy-status:empty { display: none; }
.shared-copy-status.copy-error { color: var(--danger); }
.shared-dns-caption { margin: 18px 8px 0; color: var(--text2); text-align: center; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; z-index: 20; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 7px; border: 1px solid #c9dccc; background: var(--success-bg); color: var(--success); box-shadow: 0 4px 18px #20262d10; font-size: 13px; line-height: 1.5; }
/* Popovers keep feedback above the native dialog top layer. */
.toast[popover] { inset: auto auto 24px 50%; margin: 0; }
.toast.error { color: var(--danger); background: var(--danger-bg); border-color: #eed1ce; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; }
.login-container { width: 100%; max-width: 390px; }
.login-container > .brand { margin: 0 0 28px 4px; }
.login-card { border: 1px solid var(--border); border-radius: 10px; background: white; padding: 30px; }
.login-card h1 { font-size: 24px; }
.login-card .muted { font-size: 13px; line-height: 1.6; color: var(--text2); margin: 9px 0 27px; }
.login-card .btn { margin-top: 3px; }
.login-error { color: var(--danger); font-size: 12px; margin-top: 14px; line-height: 1.5; }
.login-error:empty { display: none; }
.login-support { display: block; margin: 22px auto 0; width: fit-content; text-decoration: none; color: var(--text2); font-size: 12px; }
.login-support:hover { text-decoration: underline; }
@media (max-width: 1100px) {
  .header-inner { padding: 0 24px; }
  main { padding: 34px 24px; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .col-source { width: 23%; }.col-target { width: 25%; }.col-code { width: 8%; }.col-status { width: 14%; }.col-cert { width: 17%; }.col-actions { width: 13%; }
}
@media (max-width: 760px) {
  .header-inner { padding: 0 16px; gap: 14px; }
  .header-context, .logout-button span { display: none; }
  .service-status { min-width: 0; white-space: normal; line-height: 1.4; }
  .logout-button { padding: 7px; }
  main { padding: 29px 16px 40px; }
  h1 { font-size: 25px; }
  .page-heading { align-items: flex-start; gap: 12px; }
  .page-description { max-width: 220px; font-size: 13px; }
  .feature-panels { gap: 8px; margin: 22px 0 18px; }
  .feature-panel { padding: 12px 10px; gap: 7px; }
  .feature-label { font-size: 11px; }
  .feature-label .icon { display: none; }
  .feature-value { font-size: 22px; flex-wrap: wrap; gap: 1px 5px; line-height: 24px; }
  .feature-unit, .feature-detail { font-size: 10px; line-height: 14px; }
  .toolbar-title { font-size: 13px; }
  .table-toolbar { padding: 12px; flex-wrap: wrap; gap: 10px; }
  .search-container { flex: 1; width: auto; min-width: 180px; order: 3; flex-basis: 100%; }
  .toolbar-actions { gap: 8px; }
  .table-count { display: none; }
  table, tbody { display: block; }
  thead, colgroup { display: none; }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px 10px; padding: 16px; border-bottom: 1px solid var(--border); }
  tbody tr:last-child { border-bottom: 0; }
  td { display: block; border: 0; padding: 0; height: auto; min-width: 0; }
  td[data-label="Source"] { grid-column: 1 / 3; grid-row: 1; align-self: center; }
  td[data-label="Actions"] { grid-column: 3; grid-row: 1; align-self: start; }
  td[data-label="Destination"] { grid-column: 1 / -1; grid-row: 2; padding-bottom: 1px; }
  td[data-label="Type"] { grid-column: 1; grid-row: 3; }
  td[data-label="DNS status"] { grid-column: 2; grid-row: 3; }
  td[data-label="Certificate"] { grid-column: 3; grid-row: 3; }
  td[data-label="Type"]::before, td[data-label="DNS status"]::before, td[data-label="Certificate"]::before { content: attr(data-label); display: block; color: var(--text2); font-size: 10px; margin-bottom: 4px; }
  td[colspan] { grid-column: 1 / -1; }
  .source-list { font-size: 13px; }
  .source-domain { white-space: normal; overflow-wrap: anywhere; }
  .source-domain + .source-domain { font-size: 12px; }
  .target-url { white-space: normal; overflow-wrap: anywhere; }
  .certificate-popover { width: min(280px, 75vw); }
  .table-footer { padding: 12px; font-size: 10px; flex-wrap: wrap; }
  .modal { padding: 22px; }
  .shared-dns-page { padding: 26px 16px; }
  .shared-dns-card { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
