[hidden] { display: none !important; }
:root {
  --bg: #f4f2ee; --panel: #ffffff; --ink: #16202e; --muted: #5c6675; --line: #dcd8d0;
  --accent: #1f3a5f; --accent-ink: #ffffff; --focus: #3b6ea5;
  --red: #a4262c; --red-bg: #fbeaea; --amber: #8a5a00; --amber-bg: #fdf3dc;
  --blue: #1d4f91; --blue-bg: #e7effa; --green: #2f6b3a; --green-bg: #e6f2e8;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161d; --panel: #18202a; --ink: #e6e9ee; --muted: #9aa4b2; --line: #2a3441;
    --accent: #8db4e2; --accent-ink: #0d1520; --focus: #8db4e2;
    --red: #f09a9a; --red-bg: #3a1c1f; --amber: #f1c46b; --amber-bg: #352a12;
    --blue: #9cc0f0; --blue-bg: #1a2a40; --green: #8fd19c; --green-bg: #17301d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
.muted { color: var(--muted); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; }
.login-card h1 { margin: 20px 0 4px; font-size: 22px; }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }

.brand { font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--accent); }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password] {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  font-size: 15px; font-weight: 400; color: var(--ink); width: 100%; }
button { cursor: pointer; border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; }
.error { color: var(--red); min-height: 1.2em; margin: 0; font-size: 14px; }

/* Layout */
header { background: var(--panel); border-bottom: 1px solid var(--line); }
.bar { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
nav { display: flex; gap: 4px; flex: 1; }
nav button { background: transparent; color: var(--muted); padding: 16px 12px; border-radius: 0;
  border-bottom: 2px solid transparent; }
nav button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
main.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
h2 { font-size: 18px; margin: 0 0 4px; }

/* Search form */
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.opts { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: end; margin-top: 18px; }
.checks { display: flex; gap: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.fuzzy { display: grid; gap: 4px; }
.fuzzy-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); }
.fuzzy-head output { font-family: var(--mono); color: var(--ink); }
.fuzzy input { width: 100%; accent-color: var(--accent); }
.fuzzy-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }

/* Listväljare */
.list-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
#listFilter { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); width: 100%; }
.list-items { max-height: 280px; overflow-y: auto; margin-top: 8px; display: grid; gap: 2px; }
.list-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 6px 4px; font-size: 14px; font-weight: 400; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }

/* Results */
.summary { margin: 24px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.summary strong { font-size: 17px; }
.clear { padding: 18px 20px; border-radius: var(--radius); background: var(--green-bg); color: var(--green); font-weight: 600; }
.hit { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px; }
.hit.SANCTION { border-left-color: var(--red); }
.hit.PEP { border-left-color: var(--amber); }
.hit.RCA { border-left-color: var(--blue); }
.hit-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hit-name { font-size: 17px; font-weight: 650; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.badge.SANCTION { background: var(--red-bg); color: var(--red); }
.badge.PEP { background: var(--amber-bg); color: var(--amber); }
.badge.RCA { background: var(--blue-bg); color: var(--blue); }
.score { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.meta { font-size: 13px; color: var(--muted); margin: 4px 0 8px; display: flex; gap: 16px; flex-wrap: wrap; }
.roles { margin: 0; padding-left: 18px; font-size: 14px; }
.roles li { margin: 2px 0; }
.tag { font-size: 12px; color: var(--muted); }

/* Full listpost */
.lists { margin: 4px 0 6px; font-size: 14px; }
.detail { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.detail summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); padding: 4px 0; }
.detail table { margin-top: 8px; }
.detail th { width: 32%; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); }
.detail td { font-size: 14px; word-break: break-word; }
.detail ul { margin: 0; padding-left: 18px; }

/* Tables / text */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.num { font-family: var(--mono); white-space: nowrap; }
.source { padding: 18px 0; border-bottom: 1px solid var(--line); }
.source:last-child { border-bottom: 0; }
.source h3 { margin: 0 0 4px; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.source h3 span { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--muted); }
.source p { margin: 4px 0; font-size: 14px; }
.note { background: var(--amber-bg); color: var(--ink); padding: 14px 16px; border-radius: 8px; font-size: 14px; margin-top: 16px; }
.loading { color: var(--muted); font-style: italic; }

@media (max-width: 720px) {
  .grid, .opts { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .bar { gap: 8px; }
  nav button { padding: 12px 8px; }
}

.decl { margin-top: 16px; }
select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  color: var(--ink); font-size: 15px; font-weight: 400; width: 100%; }
.warn { background: var(--red-bg); color: var(--ink); border-left: 4px solid var(--red); padding: 12px 16px; border-radius: 8px; margin-top: 10px; font-size: 14px; }
.note { margin-top: 10px; }

.adverse { margin-top: 28px; }
.adverse h2 { font-size: 18px; margin: 0 0 10px; }
.adverse .hit p { margin: 8px 0; }
details.weak { margin-top: 12px; }
details.weak summary { cursor: pointer; color: var(--muted); font-size: 14px; }

button.link { background: none; border: 0; color: var(--accent, #1d4ed8); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
