:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #142b36;
  background: #eef3f4;
  --ink: #142b36;
  --muted: #536a73;
  --accent: #0b675b;
  --accent-dark: #074f46;
  --line: #dbe5e6;
  --surface: #fff;
  --danger: #a22939;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
a { color: var(--accent-dark); }
h1, h2, p { margin: 0; }
:focus-visible { outline: 3px solid #08786b; outline-offset: 3px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1184px;
  min-height: 72px;
  margin: auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #153b43;
  color: #e0f8f1;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .06em;
}

.brand small { display: block; color: var(--muted); }
nav { display: flex; align-items: center; gap: 6px; }
nav a {
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: .9rem;
  font-weight: 650;
}
nav a:hover, nav [aria-current="page"] {
  background: #e6f3ef;
  color: var(--accent-dark);
}

.layout {
  width: min(100% - 56px, 1128px);
  margin: 36px auto 56px;
  display: grid;
  gap: 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 20px;
  padding: clamp(28px, 6vw, 64px);
  color: #fff;
  background: linear-gradient(106deg, #102a38 15%, #143943 66%, #195954);
}

.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 0 0 0 48%;
  opacity: .5;
  background:
    radial-gradient(ellipse at 76% 56%, #79e2c12b, transparent 66%),
    repeating-linear-gradient(124deg, transparent 0 27px, #9de9d52e 28px 29px, transparent 30px 47px),
    repeating-linear-gradient(34deg, transparent 0 28px, #9de9d527 29px 30px, transparent 31px 52px);
  mask-image: linear-gradient(to right, transparent, #000 62%);
}

.eyebrow {
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero .eyebrow { color: #a1e6d2; }
.hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  font-weight: 730;
  letter-spacing: -.045em;
  line-height: 1.1;
}
.hero > p:last-child { color: #d4e7e9; line-height: 1.55; }

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 3px 12px #183c4410;
}

.panel-heading, .dashboard-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { margin-top: 3px; }
h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); letter-spacing: -.02em; }

.count, .badge {
  display: inline-block;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 8px;
  background: #eaf3f1;
  color: var(--accent-dark);
  font-size: .8rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.options { display: flex; flex-wrap: wrap; gap: 9px; }
.option {
  display: inline-flex;
  max-width: 100%;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.option:has(input:checked), .option:has(input:indeterminate) {
  background: #e9f6f1;
  border-color: #b4d9cf;
}
.option-all { font-weight: 700; }
.option:has(input:disabled) { cursor: default; }
.option input { flex: 0 0 auto; margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.field-note { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.filters .field-note, #add-link-note { margin-top: 10px; }

.empty {
  border: 1px dashed #cddcde;
  border-radius: 12px;
  padding: 28px 18px;
  background: #f6f9f9;
  text-align: center;
  color: var(--muted);
  line-height: 1.55;
}
.empty strong { color: var(--ink); font-size: 1rem; }
.empty p:not(:empty) { margin-top: 4px; }
.empty button { margin-top: 12px; }

.records { list-style: none; padding: 0; margin: 0; }
.record {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.record:last-child { padding-bottom: 0; }
.record-content { min-width: 0; flex: 1 1 230px; overflow-wrap: anywhere; }
.record-title { display: inline-block; font-weight: 700; }
a.record-title { text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.record-title:hover { color: #113741; }
.external-arrow { display: inline-block; margin-inline-start: 6px; }
.record-url { margin-top: 4px; font-size: .85rem; color: var(--muted); }
.record-content .badge { margin-top: 8px; }
.record-actions, .dialog-actions { display: flex; gap: 8px; }

.button {
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
  font-size: .9rem;
}
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: var(--ink); background: #f8fbfb; border-color: var(--line); }
.button-secondary:hover { background: #eaf3f3; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover { background: #7e1d2a; }
.button-danger-outline { color: var(--danger); background: #fff; border-color: #efd8dc; }
.button-danger-outline:hover { background: #fff0f2; }
.button:disabled { opacity: .55; cursor: default; }

#dashboard, #lookup-content { display: grid; gap: 20px; min-width: 0; }
.dashboard-bar { color: var(--muted); font-size: .9rem; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.notice {
  border-left: 4px solid #84baac;
  border-radius: 5px;
  padding: 10px 14px;
  color: var(--ink);
  background: #e0efea;
}
#admin-retry, #retry-session { justify-self: start; }
.login-panel { width: min(100%, 430px); }
.login-panel form, .form-fields { display: grid; gap: 9px; }
.login-panel button { justify-self: start; margin-top: 4px; }
form label { font-weight: 650; }
form input, form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b9c9cc;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
.error-text { color: var(--danger); font-weight: 600; line-height: 1.5; }

dialog {
  width: min(100% - 32px, 480px);
  max-height: calc(100% - 32px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 12px 48px #112c3a3d;
}
dialog::backdrop { background: #10263080; }
dialog form { display: grid; gap: 16px; }
.dialog-actions { justify-content: flex-end; }

@media (max-width: 520px) {
  .layout { width: calc(100% - 28px); margin-top: 20px; gap: 14px; }
  .header-inner { padding-inline: 14px; }
  .brand { gap: 8px; }
  .brand small { font-size: .69rem; }
  .brand strong { font-size: .88rem; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  nav { gap: 2px; }
  nav a { padding-inline: 8px; font-size: .81rem; }
}
