:root {
  color-scheme: light;
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8f9fa;
  --ink: #16181c;
  --muted: #666d78;
  --line: #dfe2e7;
  --line-strong: #c8cdd4;
  --accent: #087a5b;
  --accent-dark: #066148;
  --accent-soft: #e4f3ee;
  --warning: #9a5b00;
  --danger: #b42318;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.app-header {
  min-height: 72px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: #1c2229;
  border-bottom: 3px solid var(--accent);
}
.brand-block, .sync-block, .toolbar-controls { display: flex; align-items: center; }
.brand-block { gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--accent); border-radius: 4px; font-size: 20px; font-weight: 800;
}
h1, h2, p { margin: 0; }
h1 { font-size: 19px; line-height: 1.2; }
.brand-block p { margin-top: 3px; color: #b9c0c9; font-size: 12px; }
.sync-block { gap: 14px; }
.sync-status { color: #cdd2d9; font-size: 12px; text-align: right; }
.sync-status[data-state="error"] { color: #ffb4ab; }
.sync-status[data-state="running"] { color: #9be3cf; }

.button { min-height: 36px; padding: 8px 13px; border-radius: var(--radius); font-weight: 650; }
.primary { color: #fff; background: var(--accent); border: 1px solid #20a57f; }
.primary:hover { background: var(--accent-dark); }
.secondary { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); }
.secondary:hover { background: var(--surface-subtle); }
.sync-icon { display: inline-block; margin-right: 5px; font-size: 17px; }
.is-loading .sync-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-main { padding: 20px 24px 32px; }
.summary-strip {
  display: flex; align-items: stretch; gap: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.summary-strip > div { min-width: 120px; padding: 13px 18px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.summary-strip strong { display: block; margin-top: 4px; font-size: 19px; }
.summary-strip .release-range { margin-left: auto; min-width: 260px; }
.summary-strip .release-range strong { font-size: 14px; line-height: 23px; }

.source-note {
  display: flex; gap: 9px; align-items: flex-start; margin: 12px 0;
  padding: 10px 12px; color: #4a515b; background: #edf3f6; border-left: 3px solid #52869b;
}
.source-note p { min-width: 0; line-height: 1.45; overflow-wrap: anywhere; }
.source-note a { color: #075e85; font-weight: 650; }
.info-icon {
  flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center;
  border: 1px solid #52869b; border-radius: 50%; color: #2d6b82; font-size: 12px; font-weight: 800;
}

.workspace {
  display: grid; grid-template-columns: 286px minmax(0, 1fr);
  min-height: 620px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters { padding: 18px; border-right: 1px solid var(--line); background: var(--surface-subtle); }
.filter-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
h2 { font-size: 16px; }
.text-button { padding: 2px; border: 0; color: var(--accent); background: transparent; font-weight: 650; }
.text-button:hover { text-decoration: underline; }

.field { min-width: 0; display: grid; gap: 6px; }
.field > span, legend, .inline-field > span { color: #424852; font-size: 12px; font-weight: 650; }
input, select {
  width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid rgba(8, 122, 91, 0.22); outline-offset: 1px; border-color: var(--accent); }
input:disabled { color: #9298a1; background: #eceef1; }
.input-with-icon { position: relative; }
.input-with-icon > span { position: absolute; left: 10px; top: 8px; color: var(--muted); font-size: 18px; }
.input-with-icon input { padding-left: 34px; }
fieldset { margin: 18px 0 0; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 8px; }
legend small { color: var(--muted); font-weight: 400; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.date-stack { display: grid; gap: 8px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); }
.segmented button {
  min-height: 34px; padding: 6px 8px; color: #444b54; background: var(--surface);
  border: 1px solid var(--line-strong); border-right: 0;
}
.segmented button:first-child { border-radius: 4px 0 0 4px; }
.segmented button:last-child { border-right: 1px solid var(--line-strong); border-radius: 0 4px 4px 0; }
.segmented button[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.field-help { display: block; margin-top: 7px; color: var(--muted); line-height: 1.35; }
[data-disabled="true"] legend { color: #8b919a; }

.results { min-width: 0; }
.results-toolbar {
  min-height: 74px; padding: 14px 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line);
}
.results-toolbar p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.toolbar-controls { gap: 10px; }
.inline-field { display: grid; grid-template-columns: auto minmax(160px, 220px); gap: 8px; align-items: center; }
.page-size { grid-template-columns: auto 74px; }

.table-wrap { min-height: 460px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { height: 45px; padding: 9px 12px; text-align: left; border-bottom: 1px solid #e8eaed; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; height: 40px; color: #555c66; background: #f2f4f6; font-size: 11px; text-transform: uppercase; }
th button { padding: 0; color: inherit; background: transparent; border: 0; font-weight: 700; text-transform: uppercase; }
tbody tr:hover { background: #f4faf8; }
.domain-name { color: #143c33; font-weight: 700; }
.tld-badge { display: inline-block; min-width: 33px; padding: 3px 6px; text-align: center; color: #38414b; background: #e9ecef; border-radius: 3px; font-size: 12px; font-weight: 650; }
.days { color: #40504a; }
.days.urgent { color: var(--warning); font-weight: 700; }
.muted { color: #9096a0; }
.empty-state { height: 180px; text-align: center; color: var(--muted); }
.empty-state.error { color: var(--danger); }
tbody[aria-busy="true"] { opacity: 0.5; }

.pagination {
  min-height: 62px; padding: 12px 16px; display: flex; align-items: center;
  justify-content: flex-end; gap: 14px; border-top: 1px solid var(--line);
}
.pagination span { min-width: 110px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .summary-strip { overflow-x: auto; }
  .summary-strip .release-range { margin-left: 0; }
  .workspace { grid-template-columns: 240px minmax(0, 1fr); }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { width: 100%; }
  .inline-field { flex: 1; }
}

@media (max-width: 720px) {
  .app-header, .app-main, .workspace, .filters, .results, .source-note {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }
  .app-header { padding: 10px 14px; align-items: flex-start; overflow: hidden; }
  .brand-block { min-width: 0; }
  .sync-block { flex: 0 0 auto; }
  .brand-block p, .sync-status { display: none; }
  .app-main { padding: 12px; }
  .summary-strip > div { min-width: 104px; padding: 11px 13px; }
  .summary-strip .release-range { min-width: 220px; }
  .source-note { font-size: 12px; }
  .workspace { display: block; max-width: 100%; }
  .filters { border-right: 0; border-bottom: 1px solid var(--line); }
  .toolbar-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .inline-field, .page-size { display: grid; grid-template-columns: 1fr; gap: 4px; }
  .table-wrap { width: 100%; max-width: calc(100vw - 24px); }
  .pagination { justify-content: center; }
  .pagination .button { flex: 1; }
}

@media (max-width: 420px) {
  h1 { font-size: 17px; }
  .brand-mark { width: 34px; height: 34px; }
  .sync-block .primary { width: 38px; padding: 6px; font-size: 0; }
  .sync-icon { margin-right: 0; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-loading .sync-icon { animation: none; }
}

[hidden] { display: none !important; }
