:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --text: #e8eaed;
  --text-dim: #9aa1ad;
  --accent: #6ea8fe;
  --warn: #f0a23a;
  --danger: #e5484d;
  --ok: #3fb950;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --f-xs: 13px;
  --f-sm: 15px;
  --f-base: 17px;
  --f-lg: 21px;
  --f-xl: 26px;
  --f-2xl: 33px;
  --r: 14px;
  --r-sm: 10px;
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #d1d5db;
    --text: #1c1f23;
    --text-dim: #5c6470;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  font-size: var(--f-base);
  line-height: 1.5;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  max-width: 560px;
  margin: 0 auto;
}

h1 {
  font-size: var(--f-xl);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--s2);
  overflow-wrap: break-word;
}

section[data-screen] {
  display: none;
}

section[data-screen].active {
  display: block;
  padding: var(--s3) var(--s2);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s2);
  margin-bottom: var(--s2);
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s2);
  margin-bottom: var(--s1);
  cursor: pointer;
  min-height: 72px;
  width: 100%;
  box-sizing: border-box;
}

.person-card:active {
  background: var(--surface-2);
}

.person-name {
  font-size: var(--f-lg);
  font-weight: 600;
  color: var(--text);
}

.person-meta {
  font-size: var(--f-sm);
  color: var(--text-dim);
  margin-top: 4px;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #0f1115;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease;
}

button:active {
  transform: scale(0.96);
}

.btn-large {
  min-height: 56px;
  font-size: 19px;
}

.btn-back {
  background: transparent;
  color: var(--text-dim);
  width: auto;
  justify-content: flex-start;
  min-height: auto;
  font-size: var(--f-sm);
}

.link-cancel {
  background: transparent;
  border: none;
  color: var(--text-dim);
  text-decoration: none;
  width: auto;
  min-height: auto;
  font-size: var(--f-sm);
  cursor: pointer;
}

input, textarea, select {
  width: 100%;
  font-size: 17px;
  min-height: 48px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 10px var(--s2);
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.kotta-hero {
  font-size: var(--f-lg);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--s3);
}

.kotta-now {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: var(--s2);
}

.msg-box {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: var(--s2);
  user-select: text;
  -webkit-user-select: text;
  color: var(--text);
}

.msg-box.risk {
  border: 1px solid var(--warn);
}

.msg-box.risk .side-effect {
  color: var(--warn);
  font-size: var(--f-sm);
  display: block;
  margin-top: var(--s1);
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s2);
}

.tabs button.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: var(--s2) 0;
  font-size: var(--f-sm);
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.tabs button.tab.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}

.radio-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  min-height: 56px;
  width: 100%;
  padding: var(--s2);
  margin-bottom: var(--s2);
  color: var(--text);
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  padding: var(--s2);
  margin-bottom: var(--s2);
  background: var(--surface);
  color: var(--text);
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.error {
  color: var(--danger);
  font-size: var(--f-sm);
}

.subtitle {
  color: var(--text-dim);
  font-size: var(--f-sm);
}

.dont-list {
  list-style: none;
}

.dont-list li {
  padding: var(--s1) 0;
}

.dont-list li::before {
  content: '•';
  color: var(--danger);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.confidence-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--f-sm);
  color: var(--text-dim);
  margin-bottom: var(--s1);
}

.bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: var(--s2);
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-sm);
  transition: width 200ms ease;
}

details {
  border-bottom: 1px solid var(--border);
}

summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  cursor: pointer;
  font-size: var(--f-base);
  color: var(--text);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '▾';
  color: var(--text-dim);
  transition: transform 200ms ease;
  font-size: var(--f-sm);
}

details[open] summary::after {
  transform: rotate(180deg);
}

.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + var(--s3));
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s2) var(--s3);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
  z-index: 1000;
  font-size: var(--f-sm);
  max-width: 90%;
  text-align: center;
  color: var(--text);
}

.toast.show {
  opacity: 1;
  visibility: visible;
}

.step {
  display: flex;
  align-items: center;
  font-size: var(--f-sm);
  color: var(--text-dim);
  padding: var(--s1) 0;
}

.step::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: var(--s2);
  background: var(--border);
}

.step.done::before {
  content: '✓';
  background: transparent;
  color: var(--ok);
  font-size: var(--f-sm);
  line-height: 1;
}

.step.active {
  color: var(--text);
}

.step.active::before {
  background: var(--accent);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 168, 254, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(110, 168, 254, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 168, 254, 0); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* --- KOTTA MEGJELENÍTÉS --- */
.kotta-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s2);
  font-size: var(--f-sm);
}
.kotta-confidence {
  font-weight: 600;
  color: var(--ok);
}
.kotta-confidence.low {
  color: var(--warn);
}
.kotta-arc {
  color: var(--text-dim);
}
.kotta-h {
  font-size: var(--f-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: var(--s3);
  margin-bottom: var(--s1);
}
.kotta-situation {
  font-size: var(--f-lg);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.kotta-now {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  padding: var(--s2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-weight: 600;
}
.msg-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s2);
  color: var(--text);
  user-select: text;
  margin-bottom: var(--s1);
}
.msg-box.risk {
  border-color: var(--warn);
}
.side-effect {
  color: var(--warn);
  font-size: var(--f-xs);
  margin-top: 8px;
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  min-height: 36px;
  width: auto;
  border-radius: var(--r-sm);
  margin-top: 8px;
  padding: 0 14px;
}
.dont-list {
  list-style: none;
  padding-left: 0;
}
.dont-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text);
}
.dont-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--danger);
}
.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s2);
  margin-bottom: var(--s1);
}
.fact-q {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.fact-verdict {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-sm);
  font-size: var(--f-xs);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bg);
}
.v-igaz {
  background: var(--ok);
}
.v-reszben {
  background: var(--warn);
}
.v-hamis {
  background: var(--danger);
}
.v-nem {
  background: var(--text-dim);
}
.fact-explain {
  color: var(--text-dim);
  font-size: var(--f-sm);
  margin-top: 8px;
}
.fact-source {
  color: var(--accent);
  font-size: var(--f-xs);
  margin-top: 6px;
  display: block;
}
.owner-note {
  background: var(--surface);
  border-left: 3px solid var(--warn);
  padding: var(--s2);
  border-radius: var(--r-sm);
  color: var(--text);
  margin-top: var(--s3);
}
.gate-notes {
  color: var(--text-dim);
  font-size: var(--f-xs);
  margin-top: var(--s3);
}
.crisis-card {
  background: var(--surface);
  border: 2px solid var(--danger);
  padding: var(--s3);
  border-radius: var(--r);
  text-align: center;
  color: var(--text);
}
.feedback-section {
  margin-top: var(--s3);
  border-top: 1px solid var(--border);
  padding-top: var(--s2);
}
.fb-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  margin-bottom: var(--s1);
}
.msg-group {
  margin-bottom: var(--s2);
}
.loader {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: kotta-spin 800ms linear infinite;
}
@keyframes kotta-spin {
  to {
    transform: rotate(360deg);
  }
}
/* --- FELTÖLTÉS: RÁDIÓGOMB-KÁRTYÁK --- */
input[type=radio],
input[type=checkbox] {
  width: 22px;
  height: 22px;
  min-height: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  appearance: auto;
  flex-shrink: 0;
  accent-color: var(--accent);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--s2) 0;
}

legend {
  padding: 0;
  font-size: var(--f-sm);
  color: var(--text-dim);
  margin-bottom: var(--s1);
}

.radio-card {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2);
  min-height: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: var(--s1);
  cursor: pointer;
  color: var(--text);
  font-size: var(--f-base);
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
}

.radio-card:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  cursor: pointer;
  padding: var(--s2);
  text-align: center;
}

.file-label input[type=file] {
  display: none;
}

label {
  display: block;
  font-size: var(--f-sm);
  color: var(--text-dim);
  margin-bottom: 6px;
  margin-top: var(--s2);
}
