/* =========================================================================
   DETEKTÍVMŰHELY - TELJES FELÜLETI STÍLUS
   ========================================================================= */

html, body {
  background: #05070a !important;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  color: #d1d5db;
  font-family: "Courier New", Courier, monospace;
  user-select: none;
}

* { box-sizing: border-box; }
input, textarea, select, .selectable-text { user-select: text; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Admin elemek alapból rejtve vannak; csak sikeres Firebase admin login után jelennek meg. */
.admin-only { display: none !important; }
body.admin-mode .admin-only { display: revert !important; }
body.admin-mode .top-ui-controls .admin-only { display: inline-block !important; }
body.admin-mode .ai-edit-box.admin-only { display: flex !important; }

.hidden { display: none !important; }
.hidden-space { visibility: hidden; }
.visible-inline { display: inline-block !important; }

body {
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.top-ui-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 90000;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dev-skip-btn,
.email-toggle-btn,
.admin-toggle-btn {
  background: rgba(17, 24, 39, 0.9);
  color: #93c5fd;
  border: 1px solid #3b82f6;
  padding: 7px 10px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0,0,0,0.45);
}

.email-badge {
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.72rem;
  margin-left: 4px;
}

.detektiv-dashboard {
  display: flex;
  flex-direction: row;
  gap: 16px;
  width: 100%;
  max-width: 1240px;
  min-height: 76vh;
  background: #0c0f12;
  padding: 16px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  box-shadow: 0 10px 45px rgba(0,0,0,0.85);
  transition: all 0.35s ease;
}

.detektiv-dashboard.intro-mode {
  justify-content: center;
  align-items: stretch;
  max-width: 920px;
}

.detektiv-dashboard.intro-mode .main-terminal { display: none; }
.detektiv-dashboard.intro-mode .ai-panel { max-width: 560px; }

.ai-panel {
  flex: 0 0 310px;
  min-width: 260px;
  background: #111827;
  border: 1px solid #374151;
  padding: 16px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}

.ai-avatar-container {
  position: relative;
  width: 100%;
  max-width: 190px;
  aspect-ratio: 1 / 1;
  margin-bottom: 18px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #3b82f6;
}

.ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(15%) contrast(112%) brightness(95%);
}

.ai-status-pulse {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16,185,129,.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.ai-name {
  color: #3b82f6;
  font-size: 0.92rem;
  margin: 0 0 14px;
  letter-spacing: 1.5px;
  text-align: center;
}

.ai-speech-bubble {
  background: #070a0f;
  border: 1px solid #1f2937;
  padding: 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e5e7eb;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 12px rgba(0,0,0,.65);
}

.ai-speech-text-container { position: relative; min-height: 120px; }
.ai-text-ghost { visibility: hidden; margin: 0; }
.ai-text-visible { position: absolute; top: 0; left: 0; width: 100%; margin: 0; }
.typewriter-cursor { display: inline-block; width: 8px; height: 14px; background: #10b981; margin-left: 4px; vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.ai-hint-controls {
  margin-top: 15px;
  display: none;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed #1f2937;
  padding-top: 12px;
}

.hint-btn { border-color: #fbbf24 !important; color: #fbbf24 !important; }
.office-btn { border-color: #3b82f6 !important; color: #93c5fd !important; }
.ai-edit-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #1f2937; display: flex; justify-content: center; }

.main-terminal {
  flex: 1;
  background: #111827;
  border: 1px solid #374151;
  padding: 16px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 20px rgba(0,0,0,.35);
}

.terminal-title {
  color: #10b981;
  font-size: 1.03rem;
  margin: 0 0 10px;
  border-bottom: 1px solid #374151;
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.terminal-menu { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }

.content-box {
  background: #030712;
  border: 1px solid #1f2937;
  padding: 14px;
  flex: 1;
  border-radius: 4px;
  min-height: 390px;
  box-shadow: inset 0 0 15px rgba(0,0,0,.8);
  overflow-y: auto;
}

.det-btn {
  background: #1f2937;
  color: #9ca3af;
  border: 1px solid #4b5563;
  padding: 8px 13px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: bold;
  border-radius: 4px;
  transition: all .18s ease;
}

.det-btn:hover:not(:disabled) { background: #374151; color: #fff; border-color: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.22); }
.det-btn.active { background: #065f46; color: #34d399; border-color: #10b981; box-shadow: 0 0 12px rgba(16,185,129,.38); }
.back-btn { display: none; border-color: #3b82f6; color: #93c5fd; }
.danger-btn { border-color: #ef4444 !important; color: #f87171 !important; }
.save-btn { background: #fbbf24 !important; color: #05070a !important; border-color: #fbbf24 !important; }
.mini-btn { padding: 5px 8px; font-size: 0.75rem; }
.verdict-tab { border-color: #ef4444 !important; color: #f87171 !important; }
.admin-close-btn { border-color: #fbbf24; color: #fbbf24; }

.admin-tab-edit-btn {
  background: rgba(245,158,11,.05);
  color: #fbbf24;
  border: 1px dashed #f59e0b;
  padding: 9px 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.system-message { color: #6b7280; font-style: italic; line-height: 1.55; }
.case-card {
  background: #0c0f12;
  border: 1px solid #374151;
  border-left: 4px solid #3b82f6;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.case-card:hover { border-color: #3b82f6; box-shadow: 0 0 15px rgba(59,130,246,.2); }
.case-card h3 { color: #3b82f6; margin: 0 0 10px; }
.case-card p { color: #9ca3af; line-height: 1.45; }
.admin-inline-panel { margin-top: 22px; padding-top: 15px; border-top: 1px dashed #374151; }

.report-open-card,
.request-hint-card,
.progress-info,
.terminal-text-block {
  background: #0c0f12;
  border: 1px solid #374151;
  border-radius: 5px;
  padding: 14px;
  margin-bottom: 14px;
}
.report-open-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-left: 4px solid #10b981; }
.report-open-card h3 { color: #34d399; margin: 0 0 7px; }
.report-open-card p { color: #9ca3af; margin: 0; white-space: pre-line; font-size: .84rem; }
.terminal-text-block { color: #d1d5db; line-height: 1.65; white-space: normal; }
.request-hint-card { border-color: #fbbf24; color: #fef3c7; line-height: 1.55; }
.progress-info { color: #93c5fd; border-left: 3px solid #3b82f6; }

.evidence-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid #1f2937;
}
.evidence-thumbnail {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 2px solid #374151;
  border-radius: 4px;
  cursor: zoom-in;
  background: #0c0f12;
}
.evidence-thumbnail:hover { border-color: #10b981; transform: scale(1.03); }
.evidence-info h3 { color: #93c5fd; margin: 0 0 8px; }
.evidence-info p { color: #d1d5db; line-height: 1.48; }
.analysis-box { background: rgba(16,185,129,.06); border: 1px solid rgba(16,185,129,.35); padding: 10px; margin: 8px 0; border-radius: 4px; color: #bbf7d0; }

.witness-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #0c0f12;
  border: 1px solid #374151;
  border-left: 4px solid #fbbf24;
  border-radius: 5px;
  padding: 12px;
  margin-bottom: 12px;
}
.witness-card-photo { width: 82px; height: 82px; object-fit: cover; border-radius: 4px; border: 1px solid #6b7280; }
.witness-card h3 { margin: 0 0 4px; color: #fbbf24; }
.witness-card p { margin: 0 0 5px; color: #9ca3af; }
.statement-count { font-size: .78rem; }

/* E-mail */
.email-modal {
  display: none;
  position: fixed;
  z-index: 100003;
  inset: 0;
  background: rgba(5,7,10,.96);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.email-window {
  width: min(1120px, 96vw);
  height: min(760px, 90vh);
  background: #0c0f12;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.email-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #1f2937; background: #05070a; }
.email-header h3 { margin: 0 0 5px; color: #93c5fd; }
.email-layout { display: flex; flex: 1; min-height: 0; }
.email-sidebar { width: 310px; border-right: 1px solid #1f2937; display: flex; flex-direction: column; background: #070a0f; }
.email-tabs { display: flex; }
.email-tab { flex: 1; background: #111827; color: #9ca3af; border: 0; border-bottom: 1px solid #374151; padding: 10px; font-family: inherit; cursor: pointer; }
.email-tab.active { color: #34d399; background: #052e24; }
.email-list { overflow-y: auto; padding: 8px; }
.email-list-item { width: 100%; text-align: left; background: #111827; border: 1px solid #1f2937; color: #d1d5db; padding: 10px; margin-bottom: 8px; border-radius: 4px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 4px; }
.email-list-item.unread { border-color: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.15); }
.email-subject { color: #e5e7eb; font-weight: bold; }
.email-sender, .email-date { color: #6b7280; font-size: .77rem; }
.email-reading-view { flex: 1; padding: 18px; overflow-y: auto; }
.email-no-selection, .email-list-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: #6b7280; font-style: italic; text-align: center; padding: 20px; }
.email-read-card h3 { color: #93c5fd; margin: 0 0 10px; }
.email-read-meta { color: #6b7280; border-bottom: 1px solid #1f2937; padding-bottom: 10px; margin-bottom: 14px; font-size: .84rem; }
.email-read-content { color: #e5e7eb; line-height: 1.75; }
.email-read-actions { margin-top: 18px; }
.compose-box { background: #070a0f; border: 1px solid #1f2937; border-radius: 5px; padding: 16px; }
.compose-box h3 { color: #fbbf24; margin-top: 0; }
.outbound-preview { margin: 14px 0; min-height: 140px; background: #030712; border: 1px solid #1f2937; border-radius: 4px; padding: 14px; color: #d1d5db; line-height: 1.6; }
.compose-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Papír modal */
.witness-modal {
  display: none;
  position: fixed;
  z-index: 100004;
  inset: 0;
  background: rgba(5,7,10,.96);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  padding: 20px;
  cursor: pointer;
}
.witness-paper {
  background-color: #f5f1e6;
  color: #1a1917;
  width: min(760px, 94vw);
  max-height: 87vh;
  border-radius: 4px;
  border: 1px solid #d4cca7;
  font-family: "Courier New", Courier, monospace;
  padding: 38px 38px 38px 72px;
  position: relative;
  overflow-y: auto;
  background-image: linear-gradient(90deg, transparent 55px, #dfcaa9 55px, #dfcaa9 57px, transparent 57px);
  box-shadow: 0 15px 45px rgba(0,0,0,.75), inset 0 0 40px rgba(139,126,102,.18);
  cursor: default;
}
.witness-photo-frame {
  position: absolute;
  top: 28px;
  right: 30px;
  width: 132px;
  height: 168px;
  background: #fffaf0;
  border: 1px solid #8b7d61;
  padding: 7px;
  transform: rotate(1.4deg);
  box-shadow: 0 5px 12px rgba(0,0,0,.25);
}
.witness-photo-frame img { width: 100%; height: 100%; object-fit: cover; filter: sepia(18%) contrast(105%); }
.police-stamp {
  position: absolute;
  border: 4px double #b91c1c;
  color: #b91c1c;
  font-size: .76rem;
  font-weight: bold;
  padding: 5px 10px;
  text-transform: uppercase;
  transform: rotate(7deg);
  letter-spacing: 1.5px;
  opacity: .86;
  text-align: center;
  white-space: pre-line;
  user-select: none;
}
.photo-stamp { right: -18px; top: 126px; background: rgba(245,241,230,.76); }
#retro-paper-stamp { top: 30px; right: 40px; }
.witness-paper-header { border-bottom: 2px solid #2b2a27; padding-bottom: 15px; margin-bottom: 24px; padding-right: 170px; min-height: 150px; }
.retro-paper .witness-paper-header { padding-right: 150px; }
.paper-kicker { font-weight: bold; font-size: .78rem; margin-bottom: 8px; color: #5c5549; letter-spacing: 1px; }
.witness-paper-title { font-size: 1.28rem; font-weight: bold; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 1px; }
.witness-paper-meta { display: grid; grid-template-columns: max-content 1fr; gap: 5px 10px; font-size: .86rem; }
.paper-section-title { font-weight: bold; text-decoration: underline; margin-bottom: 14px; font-size: .9rem; color: #1a1917; }
.witness-paper-content { font-size: .95rem; line-height: 1.7; color: #242321; white-space: pre-wrap; background-image: linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px); background-size: 100% 1.7rem; padding-top: 5px; }
.statement-section { margin-bottom: 22px; }
.statement-section h5 { margin: 0 0 8px; font-size: .98rem; color: #111; text-transform: uppercase; }
.record-meta { white-space: pre-line; }

/* Bizonyíték nagyító */
.evidence-modal {
  display: none;
  position: fixed;
  z-index: 100005;
  inset: 0;
  background: rgba(5,7,10,.96);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
}
.modal-frame { position: relative; width: 86vw; height: 76vh; max-width: 1120px; border: 1px solid #3b82f6; background: #0c0f12; padding: 10px; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: auto; box-shadow: 0 0 40px rgba(59,130,246,.35); }
.modal-image { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; transition: transform .15s ease; }
.modal-caption { color: #3b82f6; margin-top: 14px; text-align: center; text-transform: uppercase; letter-spacing: 1px; }
.modal-zoom-controls { display: flex; gap: 8px; margin-top: 10px; }
.close-modal-btn { position: absolute; top: -40px; right: 0; background: none; border: 0; color: #9ca3af; font-family: inherit; font-size: 1.1rem; cursor: pointer; }
.close-modal-btn:hover { color: #ef4444; }

/* Ítélet */
.verdict-screen h2 { color: #f87171; margin-top: 0; }
.verdict-screen h3 { color: #fbbf24; border-bottom: 1px solid #374151; padding-bottom: 7px; }
.eliminated-title { margin-top: 28px; color: #9ca3af !important; }
.suspect-verdict-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0c0f12;
  border: 1px solid #374151;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
}
.suspect-verdict-card.selected { border-color: #10b981; box-shadow: 0 0 12px rgba(16,185,129,.25); }
.suspect-verdict-card.eliminated { opacity: .55; filter: grayscale(70%); }
.suspect-verdict-card.eliminated h4 { text-decoration: line-through; }
.suspect-verdict-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid #4b5563; }
.suspect-verdict-info { flex: 1; }
.suspect-verdict-info h4 { margin: 0 0 3px; color: #e5e7eb; }
.suspect-verdict-info p { margin: 0; color: #9ca3af; font-size: .84rem; }
.suspect-verdict-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.verdict-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.verdict-result { margin-top: 16px; border-radius: 5px; padding: 14px; line-height: 1.6; }
.verdict-result.success { background: rgba(16,185,129,.08); border: 1px solid #10b981; color: #bbf7d0; }
.verdict-result.error { background: rgba(239,68,68,.08); border: 1px solid #ef4444; color: #fecaca; }

/* Office / parafatábla */
.office-modal {
  display: none;
  position: fixed;
  z-index: 100002;
  inset: 0;
  background: rgba(0,0,0,.95);
  justify-content: center;
  align-items: center;
  padding: 14px;
}
.office-container { width: 100%; height: 100%; background: #111; border-radius: 8px; border: 2px solid #374151; box-shadow: 0 0 50px rgba(0,0,0,1); display: flex; flex-direction: column; overflow: hidden; }
.office-header { background: #05070a; border-bottom: 1px solid #1f2937; padding: 10px 18px; display: flex; justify-content: space-between; align-items: center; }
.office-header h3 { color: #93c5fd; margin: 0; font-size: 1.05rem; letter-spacing: 1px; }
.office-body { display: flex; flex: 1; overflow: hidden; }
.office-sidebar-left, .office-sidebar-right { width: 245px; background: #0c0f12; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; z-index: 10; }
.office-sidebar-left { border-right: 1px solid #1f2937; }
.office-sidebar-right { border-left: 1px solid #1f2937; }
.office-nancy-avatar { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; border: 2px solid #3b82f6; margin: 5px auto 0; }
.office-nancy-avatar img { width: 100%; height: 100%; object-fit: cover; }
.office-nancy-panel h4 { color: #3b82f6; text-align: center; margin: 0; }
.office-nancy-panel p, .office-mini-help { color: #9ca3af; font-size: .78rem; line-height: 1.5; background: #070a0f; border: 1px solid #1f2937; padding: 10px; border-radius: 4px; }
.tray-title { color: #fbbf24; font-weight: bold; text-align: center; border-bottom: 1px dashed #374151; padding-bottom: 8px; }
.office-tray-item { background: #111827; border: 1px solid #374151; border-radius: 4px; padding: 10px; cursor: pointer; transition: all .18s; text-align: center; font-family: inherit; }
.office-tray-item:hover { border-color: #3b82f6; background: #1f2937; }
.office-tray-img { width: 100%; height: 86px; object-fit: cover; border-radius: 3px; margin-bottom: 7px; pointer-events: none; background: #030712; }
.office-tray-img.placeholder { display: flex; align-items: center; justify-content: center; color: #6b7280; border: 1px dashed #374151; }
.office-tray-title { display: block; color: #93c5fd; font-weight: bold; font-size: .74rem; pointer-events: none; }
.office-tray-subtitle { display: block; color: #6b7280; font-size: .68rem; pointer-events: none; margin-top: 3px; }
.office-main-board { flex: 1; position: relative; overflow: auto; background-color: #8b5a2b; background-image: radial-gradient(#6b4226 15%, transparent 16%), radial-gradient(#6b4226 15%, transparent 16%); background-size: 20px 20px; background-position: 0 0, 10px 10px; box-shadow: inset 0 0 60px rgba(0,0,0,.8); }
#office-lines-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; z-index: 4; }
.red-thread { stroke: #991b1b; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); cursor: pointer; pointer-events: stroke; }
.board-item { position: absolute; border-radius: 3px; box-shadow: 3px 5px 15px rgba(0,0,0,.6); cursor: grab; z-index: 10; user-select: none; transform-origin: center center; }
.board-item:active { cursor: grabbing; }
.board-item.line-start { outline: 3px solid #ef4444; }
.board-item-evidence, .board-item-witness, .board-item-suspect { background: #fff; color: #111; padding: 9px 9px 12px; border: 1px solid #ddd; }
.board-item-witness { background: #f8fafc; }
.board-item-suspect { background: #fff7ed; }
.board-item img { width: 100%; height: 110px; object-fit: cover; pointer-events: none; border: 1px solid #ddd; }
.board-title { color: #111; font-weight: bold; font-size: .76rem; text-align: center; margin-top: 7px; pointer-events: none; }
.board-subtitle { color: #555; font-size: .66rem; text-align: center; margin-top: 4px; pointer-events: none; }
.board-img-placeholder { height: 110px; display: flex; align-items: center; justify-content: center; border: 1px dashed #aaa; color: #777; }
.board-item-note { background: #fde68a; color: #111827; padding: 0; border: 1px solid #d97706; min-width: 120px; min-height: 58px; cursor: default; }
.note-drag-handle { background: rgba(217,119,6,.25); color: #78350f; font-weight: bold; font-size: .65rem; padding: 4px 7px; cursor: grab; border-bottom: 1px solid rgba(217,119,6,.35); }
.board-note-text { min-width: 120px; min-height: 48px; max-width: 360px; max-height: 280px; background: transparent; color: #111827; border: 0; outline: 0; padding: 8px; font-family: "Courier New", Courier, monospace; font-weight: bold; font-size: .9rem; line-height: 1.25; resize: both; overflow: auto; display: block; }
.office-toolbar { background: #05070a; border-top: 1px solid #1f2937; padding: 10px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Login / admin */
.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(5,7,10,.96);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-modal-visible { display: flex; }
.auth-box, .admin-box {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
}
.auth-box { width: min(460px, 94vw); padding: 24px; }
.start-box { border-color: #3b82f6; }
.auth-title { margin: 0 0 15px; color: #93c5fd; text-align: center; }
.login-help-text { color: #9ca3af; line-height: 1.5; font-size: .88rem; text-align: center; }
.admin-input, .admin-textarea, .admin-select {
  width: 100%;
  background: #030712;
  border: 1px solid #374151;
  color: #e5e7eb;
  font-family: inherit;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.admin-textarea { min-height: 320px; resize: vertical; line-height: 1.45; }
.detective-name-input { text-align: center; border-color: #3b82f6; }
.start-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.login-submit-btn { border-color: #3b82f6; color: #93c5fd; width: 100%; }
.admin-login-open-btn { border-color: #fbbf24; color: #fbbf24; width: 100%; }
.firebase-login-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #374151; }
.admin-box { width: min(1050px, 96vw); height: min(820px, 92vh); display: flex; flex-direction: column; overflow: hidden; }
.admin-header, .admin-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: #05070a; border-bottom: 1px solid #1f2937; }
.admin-footer { border-bottom: 0; border-top: 1px solid #1f2937; justify-content: flex-end; flex-wrap: wrap; }
.admin-title { color: #fbbf24; margin: 0; }
.admin-body { padding: 16px; overflow-y: auto; }
.admin-section { background: #0c0f12; border: 1px solid #374151; border-radius: 5px; padding: 14px; margin-bottom: 14px; }
.admin-section-title { color: #93c5fd; margin: 0 0 10px; }
.admin-label { display: block; color: #9ca3af; font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.admin-small-card { background: #030712; border: 1px solid #1f2937; border-radius: 4px; padding: 10px; color: #d1d5db; font-size: .82rem; line-height: 1.45; }
.notif-container { position: fixed; bottom: 25px; right: 25px; z-index: 100010; display: flex; flex-direction: column; gap: 10px; }
.notif-toast { background: #111827; border-radius: 4px; padding: 12px 18px; font-size: .84rem; box-shadow: 0 4px 15px rgba(0,0,0,.5); display: flex; align-items: center; gap: 10px; animation: slideIn .25s ease; transition: opacity .25s ease; }
.notif-toast.success { border-left: 4px solid #10b981; color: #34d399; }
.notif-toast.error { border-left: 4px solid #ef4444; color: #f87171; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 900px) {
  body { align-items: flex-start; padding-top: 70px; }
  .detektiv-dashboard { flex-direction: column; }
  .ai-panel { flex: auto; max-width: none; width: 100%; }
  .email-layout { flex-direction: column; }
  .email-sidebar { width: 100%; max-height: 250px; border-right: 0; border-bottom: 1px solid #1f2937; }
  .office-body { flex-direction: column; }
  .office-sidebar-left, .office-sidebar-right { width: 100%; max-height: 180px; border: 0; border-bottom: 1px solid #1f2937; }
  .office-main-board { min-height: 420px; }
  .witness-paper-header { padding-right: 0; padding-top: 190px; }
  .witness-photo-frame { left: 72px; right: auto; }
}


/* ÚJ: achievement progresszió és nagyítható parafatábla */
.notif-toast.success span:first-child { font-size: 1rem; }
.board-resize-controls {
  position: absolute;
  right: 4px;
  top: 4px;
  display: flex;
  gap: 3px;
  z-index: 50;
  opacity: 0;
  transition: opacity .15s ease;
}
.board-item:hover .board-resize-controls { opacity: 1; }
.board-resize-controls button {
  width: 22px;
  height: 22px;
  border: 1px solid #111827;
  background: rgba(255,255,255,.92);
  color: #111827;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  line-height: 18px;
}
.board-resize-controls button:hover { background: #fbbf24; }
.office-board-wrap { flex: 1; overflow: auto; position: relative; background: #111827; }
.office-board-size-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.office-board-size-controls .det-btn { font-size: .72rem; padding: 7px 6px; }
#office-board {
  min-width: 900px;
  min-height: 600px;
}
.board-item img, .board-img-placeholder { transition: height .12s ease; }
.logout-btn { border-color: #ef4444 !important; color: #fca5a5 !important; }
.top-ui-controls .admin-only.hidden { display: none !important; }
body.admin-mode .top-ui-controls .admin-only:not(.hidden) { display: inline-block !important; }

@media (max-width: 900px) {
  .office-board-size-controls { grid-template-columns: 1fr; }
}
.paper-stamp {
  position: absolute;
  border: 4px double #b91c1c;
  color: #b91c1c;
  font-size: .76rem;
  font-weight: bold;
  padding: 5px 10px;
  transform: rotate(-8deg);
  text-align: center;
  white-space: pre-line;
  user-select: none;
}
.paper-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #7f1d1d;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  z-index: 5;
}
.paper-close:hover { color: #dc2626; }

/* =========================================================================
   ROUND 2 FINOMÍTÁS: papír, e-mail, admin szerkesztő, parafatábla zoom
   ========================================================================= */
.detektiv-dashboard.intro-mode {
  min-height: 82vh;
  align-items: center;
  justify-content: center;
}
.detektiv-dashboard.intro-mode .ai-panel {
  flex: 0 1 620px;
  min-height: 620px;
  max-width: 620px;
}
.detektiv-dashboard.intro-mode .ai-avatar-container { max-width: 230px; }
.detektiv-dashboard.intro-mode .ai-speech-bubble { min-height: 280px; }
.ai-panel { max-height: calc(100vh - 70px); }
.ai-speech-bubble {
  flex: 0 1 auto;
  min-height: 220px;
  max-height: 46vh;
  overflow: hidden;
}
.ai-speech-text-container {
  min-height: 145px;
  max-height: 34vh;
  overflow-y: auto;
  padding-right: 6px;
}
.ai-text-visible { position: relative; }
.ai-text-ghost { display: none; }

.email-window {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #cbd5e1;
}
.email-header {
  background: linear-gradient(#eff6ff, #dbeafe);
  color: #111827;
  border-bottom: 1px solid #bfdbfe;
}
.email-header h3 { color: #1d4ed8; }
.email-layout { background: #e5e7eb; }
.email-sidebar {
  background: #f8fafc;
  border-right: 1px solid #cbd5e1;
}
.email-tab {
  background: #e2e8f0;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
}
.email-tab.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: inset 0 -3px 0 #3b82f6;
}
.email-list-item {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
.email-list-item:hover { border-color: #3b82f6; background: #eff6ff; }
.email-list-item.unread { border-left: 5px solid #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,.16); }
.email-subject { color: #111827; }
.email-sender, .email-date { color: #64748b; }
.email-reading-view {
  background: #ffffff;
  color: #111827;
}
.email-read-card {
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(15,23,42,.08);
}
.email-read-card h3 { color: #1d4ed8; }
.email-read-meta { color: #64748b; border-bottom: 1px solid #e5e7eb; }
.email-read-content { color: #111827; }
.compose-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #111827;
  box-shadow: 0 2px 12px rgba(15,23,42,.08);
}
.compose-box h3 { color: #92400e; }
.outbound-preview {
  background: #f8fafc;
  border: 1px solid #d1d5db;
  color: #111827;
}

.witness-paper {
  background-color: #efe4c8;
  color: #17130d;
  border: 1px solid #bba77d;
  border-radius: 2px;
  background-image:
    linear-gradient(90deg, transparent 54px, rgba(156,78,47,.55) 55px, rgba(156,78,47,.55) 57px, transparent 58px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0, rgba(0,0,0,.025) 1px, transparent 1px, transparent 28px),
    radial-gradient(circle at 24% 18%, rgba(255,255,255,.38), transparent 28%),
    radial-gradient(circle at 70% 75%, rgba(120,75,20,.08), transparent 32%);
  box-shadow: 0 18px 60px rgba(0,0,0,.78), inset 0 0 55px rgba(94,62,22,.22);
}
.witness-paper::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(80,60,32,.18);
  pointer-events: none;
}
.witness-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.22), transparent 18%, transparent 78%, rgba(96,65,25,.12));
  pointer-events: none;
}
.witness-paper-header {
  border-bottom: 2px solid rgba(38,28,18,.75);
}
.paper-kicker { color: #6b4f2a; }
.witness-paper-content {
  color: #24170f;
  font-family: "Courier New", Courier, monospace;
  text-shadow: 0 0 .1px #000;
}
.paper-close {
  z-index: 4;
}
.paper-stamp, .photo-stamp, #retro-paper-stamp {
  mix-blend-mode: multiply;
  filter: contrast(1.05);
}

.evidence-time, .witness-date {
  color: #fbbf24;
  font-size: .78rem;
  margin: 2px 0 8px;
  letter-spacing: .4px;
}
.dossier-card { min-height: 118px; }

.newspaper-result {
  margin-top: 18px;
  background: #f4ecd8;
  color: #17130d;
  border: 1px solid #c2a66e;
  padding: 26px;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 12px 35px rgba(0,0,0,.45);
  column-count: 1;
}
.newspaper-kicker {
  font-family: "Courier New", monospace;
  letter-spacing: 1.5px;
  color: #7c2d12;
  border-bottom: 3px double #4b2e12;
  padding-bottom: 7px;
  margin-bottom: 12px;
  font-weight: bold;
}
.newspaper-result h3 {
  color: #111 !important;
  font-size: 1.6rem;
  border: 0 !important;
  margin: 0 0 12px;
}
.newspaper-result p { font-size: 1.02rem; line-height: 1.75; }

.notif-toast.achievement {
  border-left: 5px solid #fbbf24;
  color: #fef3c7;
  max-width: 360px;
  align-items: flex-start;
  background: linear-gradient(135deg, #111827, #1f2937);
}
.achievement-action {
  display: block;
  margin-top: 10px;
  background: #fbbf24;
  color: #111827;
  border: 0;
  border-radius: 3px;
  padding: 6px 9px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.office-board-wrap {
  flex: 1;
  overflow: hidden !important;
  position: relative;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
}
.office-main-board {
  flex: none;
  overflow: visible !important;
  transition: transform .16s ease;
  border: 12px solid #6b3f1f;
  outline: 1px solid rgba(255,255,255,.16);
}
.office-board-size-controls {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.office-board-size-controls .det-btn:nth-child(3) { grid-column: 1 / -1; }
.office-zoom-display {
  grid-column: 1 / -1;
  color: #fbbf24;
  text-align: center;
  font-weight: bold;
  font-size: .82rem;
  border: 1px solid #374151;
  background: #030712;
  padding: 6px;
  border-radius: 4px;
}
.board-resize-controls { opacity: 1; }
.board-resize-controls button { pointer-events: auto; }
.board-item img { height: auto; min-height: 60px; }

.admin-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  position: sticky;
  top: -16px;
  background: #111827;
  padding: 8px 0;
  z-index: 5;
}
.admin-tab-btn {
  background: #1f2937;
  color: #cbd5e1;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit;
  cursor: pointer;
}
.admin-tab-btn.active {
  background: #065f46;
  color: #d1fae5;
  border-color: #10b981;
}
.admin-friendly-panel .admin-section { border-left: 4px solid #3b82f6; }
.admin-textarea.short { min-height: 95px; }
.admin-textarea.medium { min-height: 150px; }
.admin-textarea.tall { min-height: 360px; }
.admin-edit-card, .admin-nested-card {
  background: #070a0f;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 0;
}
.admin-nested-card { background: #030712; }
.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #fbbf24;
  border-bottom: 1px dashed #374151;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.admin-card-head span { color: #6b7280; font-size: .78rem; }
.admin-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.admin-two-col label { color: #9ca3af; font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; }
.admin-action-row { display: flex; justify-content: flex-end; gap: 8px; }
.admin-evidence-preview img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border: 1px solid #374151;
  border-radius: 4px;
  background: #030712;
  margin-bottom: 10px;
}

/* =========================================================================
   ROUND 3: valóságérzet, postafiók, iratfal és tipográfiai csiszolás
   ========================================================================= */
:root {
  --dm-bg: #05070a;
  --dm-panel: #0d1118;
  --dm-panel-2: #111827;
  --dm-border: #253041;
  --dm-blue: #93c5fd;
  --dm-green: #34d399;
  --dm-gold: #fbbf24;
  --mail-blue: #2563eb;
  --mail-border: #d7dde8;
}

html, body {
  background:
    radial-gradient(circle at 12% 8%, rgba(59,130,246,.10), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(16,185,129,.06), transparent 28%),
    linear-gradient(180deg, #05070a 0%, #070b12 100%) !important;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: .45;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

.top-ui-controls { top: 16px; right: 18px; }
.email-toggle-btn,
.office-btn,
.admin-toggle-btn,
.dev-skip-btn {
  background: linear-gradient(180deg, rgba(22,31,45,.98), rgba(10,14,21,.98));
  border-color: #334155;
  color: #dbeafe;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 8px 12px;
}
.email-toggle-btn:hover,
.office-btn:hover,
.admin-toggle-btn:hover { border-color: var(--dm-blue); box-shadow: 0 0 0 1px rgba(147,197,253,.15), 0 10px 28px rgba(0,0,0,.35); }

.detektiv-dashboard {
  max-width: 1320px;
  background: linear-gradient(180deg, rgba(13,17,24,.96), rgba(8,12,18,.98));
  border-color: #283548;
  box-shadow: 0 18px 70px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.04);
}
.ai-panel {
  background: linear-gradient(180deg, #101827, #090e16);
  border-color: #2b3a50;
  max-height: calc(100vh - 96px);
}
.ai-avatar-container {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96,165,250,.08), 0 18px 28px rgba(0,0,0,.38);
}
.ai-name { color: #bfdbfe; }
.ai-speech-bubble {
  background: #060a11;
  border-color: #263345;
  border-radius: 10px;
  max-height: 42vh;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), inset 0 0 18px rgba(0,0,0,.7);
}
.ai-speech-text-container { max-height: 29vh; }
.main-terminal {
  background: linear-gradient(180deg, #101827, #0a0f18);
  border-color: #2b3a50;
}
.terminal-title {
  color: #9ae6b4;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.content-box {
  background: #050910;
  border-color: #1e293b;
}
.case-card {
  position: relative;
  background: linear-gradient(135deg, #0c111a, #121a26);
  border: 1px solid #2c3d54;
  border-left: 5px solid #60a5fa;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.case-card::after {
  content: "AKTA";
  position: absolute;
  right: 18px;
  top: 16px;
  color: rgba(147,197,253,.14);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.case-card h3 { color: #bfdbfe; letter-spacing: .04em; }
.det-btn {
  border-radius: 6px;
  letter-spacing: .045em;
  text-transform: uppercase;
}

/* Hivatali postafiók */
.email-modal {
  background: rgba(6,10,16,.78);
  backdrop-filter: blur(10px) saturate(120%);
}
.email-window {
  width: min(1180px, 96vw);
  height: min(780px, 91vh);
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-family: "Segoe UI", Arial, sans-serif;
  box-shadow: 0 24px 80px rgba(0,0,0,.62);
}
.email-header {
  min-height: 64px;
  background: linear-gradient(180deg, #ffffff, #edf4ff);
  border-bottom: 1px solid #cbd5e1;
  padding: 14px 18px;
}
.email-header h3 {
  color: #1e3a8a;
  margin: 0 0 3px;
  font-size: 1.14rem;
  letter-spacing: .01em;
}
.mail-subtitle {
  color: #64748b;
  font-size: .82rem;
}
.email-layout { background: #eef2f7; }
.email-sidebar {
  width: 345px;
  background: #f8fafc;
  border-right: 1px solid #d7dde8;
}
.email-tabs {
  background: #e9eef6;
  border-bottom: 1px solid #d7dde8;
  padding: 8px 8px 0;
  gap: 6px;
}
.email-tab {
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #475569;
  border: 1px solid transparent;
  border-bottom: 0;
  font-weight: 650;
}
.email-tab.active {
  background: #ffffff;
  color: #1d4ed8;
  border-color: #d7dde8;
  box-shadow: none;
}
.email-list { padding: 10px; }
.email-list-item {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #0f172a;
  padding: 11px 12px 11px 14px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.email-list-item.unread { border-left: 4px solid #2563eb; }
.email-list-item.read { opacity: .82; }
.email-list-item:hover { background: #f0f7ff; border-color: #93c5fd; }
.email-subject {
  color: #111827;
  font-size: .88rem;
  line-height: 1.25;
}
.email-sender { color: #334155; font-weight: 600; }
.email-date { color: #64748b; }
.email-reading-view {
  background: #ffffff;
  padding: 24px;
}
.email-no-selection,
.email-list-empty {
  color: #64748b;
  font-style: normal;
}
.email-read-card {
  max-width: 820px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px 28px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
.email-read-card h3 {
  color: #0f172a;
  font-size: 1.35rem;
  border-bottom: 0;
}
.email-read-meta {
  color: #64748b;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 0;
  margin: 12px 0 16px;
}
.email-read-content {
  color: #0f172a;
  font-size: .97rem;
  line-height: 1.72;
}
.email-read-actions { margin-top: 22px; }
.compose-box {
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d7dde8;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 14px 36px rgba(15,23,42,.10);
  overflow: hidden;
}
.compose-box h3 {
  margin: 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  color: #1e3a8a;
  border-bottom: 1px solid #d7dde8;
  font-size: 1.04rem;
}
.compose-box .admin-label,
.compose-box select,
.compose-box .outbound-preview,
.compose-box .compose-footer {
  margin-left: 20px;
  margin-right: 20px;
}
.compose-box .admin-label { margin-top: 18px; color: #475569; }
.compose-box .admin-input {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-family: "Segoe UI", Arial, sans-serif;
}
.outbound-preview {
  background: #fbfdff;
  border: 1px solid #d7dde8;
  border-radius: 8px;
  color: #0f172a;
  padding: 16px;
}
.mail-compose-field {
  padding: 7px 0;
  border-bottom: 1px solid #eef2f7;
  color: #334155;
}
.mail-compose-body {
  min-height: 145px;
  padding-top: 16px;
  line-height: 1.75;
  color: #0f172a;
}
.mail-status-note { color: #64748b; font-size: .84rem; }
.compose-footer {
  padding: 0 0 20px;
}
.compose-footer .save-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
}

/* Papírosabb iratok */
.witness-modal { backdrop-filter: blur(6px); }
.witness-paper {
  border-radius: 3px;
  background-color: #efe2bd;
  background-image:
    radial-gradient(circle at 22px 72px, rgba(86,54,23,.34) 0 5px, transparent 6px),
    radial-gradient(circle at 22px 142px, rgba(86,54,23,.28) 0 5px, transparent 6px),
    radial-gradient(circle at 22px 212px, rgba(86,54,23,.22) 0 5px, transparent 6px),
    linear-gradient(90deg, transparent 54px, rgba(145,54,36,.40) 55px, rgba(145,54,36,.40) 57px, transparent 58px),
    repeating-linear-gradient(0deg, rgba(64,42,20,.035) 0, rgba(64,42,20,.035) 1px, transparent 1px, transparent 28px),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.38), transparent 27%),
    radial-gradient(circle at 15% 82%, rgba(120,75,20,.10), transparent 30%);
  box-shadow: 0 26px 80px rgba(0,0,0,.78), inset 0 0 60px rgba(77,48,18,.23);
}
.witness-paper-title { letter-spacing: .04em; }
.witness-paper-content {
  font-size: .96rem;
  line-height: 1.78;
}
.witness-photo-frame {
  transform: rotate(1.2deg);
  box-shadow: 0 12px 24px rgba(63,37,12,.28);
}
.paper-stamp {
  opacity: .88;
}

/* Iratfal: középről nagyít, nem csúszik el */
.office-container {
  background: #0b111a;
  border-color: #2f3d52;
}
.office-header {
  min-height: 60px;
  background: linear-gradient(180deg, #0b111a, #05070a);
}
.office-header h3 { color: #bfdbfe; }
.office-sidebar-left,
.office-sidebar-right {
  width: 300px;
  background: #080d14;
}
.office-sidebar-left { border-right-color: #263345; }
.office-sidebar-right { border-left-color: #263345; }
.office-nancy-panel h4 { color: #bfdbfe; letter-spacing: .07em; }
.office-nancy-panel p,
.office-mini-help {
  background: #050910;
  border-color: #263345;
  color: #cbd5e1;
}
.office-board-wrap {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at center, rgba(30,41,59,.36), rgba(2,6,23,.92) 64%),
    #0f172a !important;
}
.office-main-board {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  flex: none !important;
  overflow: visible !important;
  transform-origin: center center !important;
  border: 16px solid #5a351b !important;
  border-radius: 3px;
  box-shadow: 0 20px 48px rgba(0,0,0,.55), inset 0 0 75px rgba(49,28,13,.55) !important;
  background-color: #8a5a2e !important;
  background-image:
    radial-gradient(rgba(58,34,17,.38) 17%, transparent 18%),
    radial-gradient(rgba(58,34,17,.24) 17%, transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,.05), transparent 38%, rgba(0,0,0,.10)) !important;
  background-size: 18px 18px, 18px 18px, 100% 100% !important;
  background-position: 0 0, 9px 9px, 0 0 !important;
}
.office-board-size-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.office-zoom-display {
  color: #fde68a;
  background: #050910;
  border-color: #263345;
}
.tray-title {
  color: #fde68a;
  letter-spacing: .08em;
}
.office-tray-item {
  background: linear-gradient(180deg, #111827, #090f18);
  border-color: #263345;
  border-radius: 8px;
}
.office-tray-item:hover { border-color: #60a5fa; }
.board-item-evidence,
.board-item-witness,
.board-item-suspect {
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 7px 18px rgba(0,0,0,.46);
}
.board-item-evidence::before,
.board-item-witness::before,
.board-item-suspect::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fecaca, #991b1b 68%);
  box-shadow: 0 2px 4px rgba(0,0,0,.45);
}
.board-title { font-size: .78rem; }
.red-thread { stroke: #b91c1c; stroke-width: 3.2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); }
.note-drag-handle { letter-spacing: .08em; }
.office-toolbar {
  background: #05070a;
  border-top-color: #263345;
}

.notif-toast.achievement {
  border-left-color: #60a5fa;
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #dbeafe;
}
.achievement-action {
  background: #2563eb;
  color: #fff;
}

/* Nancy szimulált chat */
.nancy-chat-top-btn { border-color: #10b981; color: #bbf7d0; }
.nancy-chat-modal {
  display: none;
  position: fixed;
  z-index: 100006;
  inset: 0;
  background: rgba(3, 7, 18, .94);
  backdrop-filter: blur(9px);
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.nancy-chat-window {
  width: min(900px, 96vw);
  height: min(760px, 90vh);
  background: #0b1118;
  border: 1px solid #1f3b35;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.85), inset 0 0 0 1px rgba(16,185,129,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.nancy-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #0f172a, #08111a);
  border-bottom: 1px solid #1f2937;
}
.nancy-chat-header h3 { margin: 0 0 6px; color: #bbf7d0; letter-spacing: .08em; text-transform: uppercase; font-size: .96rem; }
.nancy-chat-header span { color: #94a3b8; font-size: .82rem; line-height: 1.5; }
.nancy-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(16,185,129,.07), transparent 32%),
    linear-gradient(180deg, #05070a, #091016);
}
.nancy-chat-empty {
  color: #94a3b8;
  border: 1px dashed #334155;
  background: rgba(15,23,42,.55);
  border-radius: 8px;
  padding: 18px;
  line-height: 1.7;
}
.nancy-chat-line { display: flex; margin: 0 0 13px; }
.nancy-chat-line.user { justify-content: flex-end; }
.nancy-chat-line.nancy { justify-content: flex-start; }
.nancy-chat-bubble {
  max-width: min(680px, 82%);
  border: 1px solid #263241;
  background: #111827;
  border-radius: 12px;
  padding: 10px 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.nancy-chat-line.user .nancy-chat-bubble { background: #10231f; border-color: #14532d; }
.nancy-chat-role { display: block; font-size: .72rem; color: #93c5fd; margin-bottom: 5px; letter-spacing: .08em; text-transform: uppercase; }
.nancy-chat-line.user .nancy-chat-role { color: #86efac; }
.nancy-chat-bubble p { margin: 0; color: #e5e7eb; line-height: 1.55; white-space: pre-wrap; user-select: text; }
.nancy-typing {
  padding: 8px 18px;
  border-top: 1px solid #111827;
  color: #86efac;
  background: #07110f;
  font-size: .78rem;
  font-style: italic;
}
.nancy-chat-footer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 14px;
  border-top: 1px solid #1f2937;
  background: #0f172a;
}
.nancy-chat-input {
  flex: 1;
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  background: #030712;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  font-family: inherit;
  line-height: 1.5;
}
.nancy-chat-input:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.16); }
@media (max-width: 720px) {
  .nancy-chat-footer { flex-direction: column; align-items: stretch; }
  .nancy-chat-bubble { max-width: 96%; }
}
.ai-chat-launch { margin-top: 12px; display: flex; justify-content: center; }
.ai-chat-launch .det-btn { border-color: #10b981; color: #bbf7d0; }

/* =========================================================================
   V10 REALISZTIKUS IRATOS CSISZOLÁS
   ========================================================================= */
:root {
  --paper-base: #efe2bd;
  --paper-ink: #1f1b16;
  --paper-line: rgba(62,44,24,.13);
  --paper-red: #9f2f2f;
}

.ai-avatar-container {
  background: #e5e7eb;
}
.ai-avatar-img {
  filter: none !important;
  object-fit: cover;
}
.ai-speech-bubble {
  max-height: 420px;
  min-height: 260px;
}
.ai-speech-text-container {
  overflow-y: auto;
  padding-right: 4px;
}
.ai-chat-launch { margin-top: 12px; }

.case-card {
  border-left-color: #94a3b8;
  background: linear-gradient(180deg, #0e141d, #080d14);
}
.case-card h3 { color: #e5e7eb; }

/* Postafiók: kevésbé app, inkább hivatali levelező */
.email-window {
  background: #f8fafc !important;
  border: 1px solid #b8c4d6 !important;
  box-shadow: 0 24px 85px rgba(0,0,0,.72) !important;
}
.email-header {
  background: linear-gradient(180deg, #f8fafc, #e8eef7) !important;
  border-bottom: 1px solid #cbd5e1 !important;
  color: #111827;
}
.email-header h3 {
  color: #1e3a8a !important;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
}
.email-sidebar {
  background: #edf2f7 !important;
  border-right: 1px solid #cbd5e1 !important;
}
.email-tab {
  font-family: Arial, sans-serif;
  color: #334155 !important;
  background: #e2e8f0 !important;
}
.email-tab.active {
  background: #ffffff !important;
  color: #1d4ed8 !important;
  box-shadow: inset 0 -3px 0 #2563eb;
}
.email-list-item {
  font-family: Arial, sans-serif !important;
  background: #ffffff !important;
  border: 1px solid #d7dde8 !important;
  color: #0f172a !important;
  border-radius: 7px !important;
}
.email-list-item.unread { border-left: 5px solid #1d4ed8 !important; }
.email-subject { color: #0f172a !important; font-weight: 700; }
.email-sender { color: #334155 !important; }
.email-date { color: #64748b !important; }
.email-reading-view { background: #f8fafc !important; }
.email-read-card {
  font-family: Arial, sans-serif !important;
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 28px rgba(15,23,42,.08) !important;
}
.email-read-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 14px;
  margin-bottom: 12px;
}
.email-read-topline h3 { margin: 0; color: #0f172a !important; }
.email-read-date { color: #64748b; white-space: nowrap; font-size: .86rem; }
.email-read-meta {
  background: #f8fafc;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px;
  padding: 10px 12px !important;
  color: #475569 !important;
}
.email-read-content {
  font-size: .97rem;
  color: #111827 !important;
  line-height: 1.75 !important;
  padding-top: 8px;
}

/* Papírok: kompaktabb fejléc, valóságosabb iratforma */
.witness-paper,
.retro-paper {
  width: min(840px, 96vw) !important;
  max-height: 92vh !important;
  padding: 38px 48px 46px 74px !important;
  color: var(--paper-ink) !important;
  font-family: "Courier New", Courier, monospace !important;
  background-color: var(--paper-base) !important;
  background-image:
    radial-gradient(circle at 22px 64px, rgba(72,45,19,.34) 0 4px, transparent 5px),
    radial-gradient(circle at 22px 132px, rgba(72,45,19,.27) 0 4px, transparent 5px),
    linear-gradient(90deg, transparent 52px, rgba(150,48,48,.34) 53px, rgba(150,48,48,.34) 55px, transparent 56px),
    repeating-linear-gradient(0deg, var(--paper-line) 0, var(--paper-line) 1px, transparent 1px, transparent 26px),
    radial-gradient(circle at 86% 10%, rgba(255,255,255,.32), transparent 24%),
    radial-gradient(circle at 10% 88%, rgba(120,75,20,.13), transparent 34%) !important;
}
.witness-paper-header {
  border-bottom: 2px solid rgba(36,31,23,.82) !important;
  padding: 0 138px 13px 0 !important;
  margin-bottom: 18px !important;
  min-height: 0 !important;
}
.retro-paper .witness-paper-header { padding-right: 132px !important; }
.paper-kicker {
  color: #5c4a2e !important;
  letter-spacing: .12em;
  font-size: .75rem !important;
}
.witness-paper-title {
  font-size: 1.24rem !important;
  margin-bottom: 9px !important;
}
.witness-paper-meta,
#retro-paper-meta {
  display: grid !important;
  grid-template-columns: 150px 1fr;
  gap: 4px 12px;
  font-size: .83rem;
  line-height: 1.36;
  white-space: normal !important;
}
.paper-meta-row { display: contents; }
.paper-meta-row strong { color: #3f3324; }
.paper-meta-row span { color: #1f1b16; }
.paper-meta-row.full { display: block; grid-column: 1 / -1; }
.witness-photo-frame {
  position: absolute !important;
  top: 30px !important;
  right: 38px !important;
  width: 118px !important;
  height: 142px !important;
  background: #f8fafc !important;
  border: 1px solid rgba(43,35,24,.45) !important;
  padding: 5px !important;
  transform: rotate(.8deg) !important;
}
.witness-photo-frame img { filter: sepia(8%) contrast(102%) !important; }
.photo-stamp {
  transform: rotate(-5deg) scale(.72) !important;
  right: -18px !important;
  bottom: 5px !important;
}
#retro-paper-stamp,
.paper-stamp {
  border-color: var(--paper-red) !important;
  color: var(--paper-red) !important;
  font-size: .82rem !important;
  opacity: .82 !important;
}
.witness-paper-content {
  background-image: none !important;
  padding-top: 0 !important;
  font-size: .94rem !important;
  line-height: 1.58 !important;
}
.witness-paper-content p,
.statement-body p {
  margin: 0 0 16px !important;
  text-align: left;
}
.statement-section { margin-bottom: 14px !important; }
.statement-section h5 {
  margin: 0 0 14px !important;
  padding-top: 6px;
  font-size: .88rem !important;
  letter-spacing: .08em;
  color: #14110e !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(36,31,23,.55);
  padding-bottom: 7px;
}
.paper-close { color: #7f1d1d !important; }

/* Vallomáslista: semleges portrék és hivatali kártyák */
.witness-card {
  align-items: flex-start !important;
  border-left-color: #d1a71d !important;
  background: linear-gradient(180deg, #0c1118, #070b10) !important;
}
.witness-card-photo {
  width: 78px !important;
  height: 96px !important;
  object-fit: cover !important;
  background: #e5e7eb !important;
  filter: none !important;
}
.witness-card h3 { color: #facc15 !important; letter-spacing: .06em; }
.witness-date { color: #94a3b8 !important; }
.det-btn { letter-spacing: .04em; }

/* Tárgyi iratok */
.evidence-item {
  background: #0b1118;
  border: 1px solid #1f2937;
  border-left: 4px solid #94a3b8;
  border-radius: 6px;
  padding: 12px !important;
  margin-bottom: 12px;
}
.evidence-thumbnail {
  width: 126px !important;
  height: 92px !important;
  object-fit: cover !important;
  background: #111827;
}
.evidence-info h3 { color: #e5e7eb !important; }
.analysis-box { color: #dbeafe !important; border-color: rgba(147,197,253,.35) !important; background: rgba(59,130,246,.08) !important; }

/* Nancy chat */
.nancy-chat-window {
  border-color: #334155 !important;
  box-shadow: 0 24px 90px rgba(0,0,0,.78) !important;
}
.nancy-chat-header {
  background: linear-gradient(180deg, #0f172a, #060a11) !important;
}
.nancy-chat-bubble p { line-height: 1.62; }
.nancy-chat-line.nancy .nancy-chat-bubble {
  background: #111827 !important;
  border-color: #334155 !important;
}
.nancy-chat-line.user .nancy-chat-bubble {
  background: #052e20 !important;
  border-color: #0f766e !important;
}
.nancy-chat-input {
  font-family: Arial, sans-serif !important;
  line-height: 1.5;
}

/* Iratfal kezelőpult ikonokkal */
.office-toolbar .det-btn {
  min-width: 132px;
  font-weight: 700;
}
.office-tray-img,
.board-item img {
  filter: none !important;
}
.board-item {
  border-radius: 6px !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.36) !important;
}
.board-title { letter-spacing: .04em; }

@media (max-width: 780px) {
  .witness-paper-header { padding-right: 0 !important; padding-top: 150px !important; }
  .witness-photo-frame { left: 74px !important; right: auto !important; }
  .witness-paper-meta, #retro-paper-meta { grid-template-columns: 1fr !important; }
}

/* =========================================================================
   V11 – végső dokumentum- és felületfinomítás
   ========================================================================= */
:root {
  --paper-base-v11: #efe5c9;
  --paper-edge-v11: #c6a974;
  --paper-ink-v11: #15120e;
}
.ai-avatar-img { object-fit: cover !important; filter: grayscale(12%) contrast(108%) brightness(94%) !important; }

.witness-modal {
  align-items: flex-start !important;
  overflow-y: auto !important;
  padding: 20px 12px !important;
}
.witness-paper,
.retro-paper {
  position: relative !important;
  margin: 8px auto 30px !important;
  width: min(820px, calc(100vw - 28px)) !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 34px 44px 46px 78px !important;
  background-color: var(--paper-base-v11) !important;
  background-image:
    radial-gradient(circle at 20px 56px, rgba(67,45,21,.30) 0 4px, transparent 5px),
    radial-gradient(circle at 20px 126px, rgba(67,45,21,.22) 0 4px, transparent 5px),
    radial-gradient(circle at 20px 196px, rgba(67,45,21,.18) 0 4px, transparent 5px),
    linear-gradient(90deg, transparent 52px, rgba(138,45,37,.34) 53px, rgba(138,45,37,.34) 55px, transparent 56px),
    radial-gradient(circle at 74% 9%, rgba(255,255,255,.24), transparent 26%),
    radial-gradient(circle at 20% 84%, rgba(117,79,31,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(90,52,18,.045)) !important;
  border: 1px solid rgba(105,73,36,.45) !important;
  box-shadow: 0 28px 88px rgba(0,0,0,.78), inset 0 0 90px rgba(84,54,22,.17) !important;
}
.witness-paper::before,
.retro-paper::before {
  content: "";
  position: absolute;
  inset: 10px 10px 10px 58px;
  border: 1px solid rgba(107,75,36,.15);
  pointer-events: none;
}
.witness-paper-header {
  min-height: 0 !important;
  padding: 0 124px 11px 0 !important;
  margin: 0 0 16px !important;
  border-bottom: 1.5px solid rgba(30,27,22,.72) !important;
}
.retro-paper .witness-paper-header { padding-right: 132px !important; }
.paper-kicker { font-size: .72rem !important; letter-spacing: .13em !important; color: #6a583d !important; }
.witness-paper-title { font-size: 1.26rem !important; line-height: 1.18 !important; margin: 4px 0 10px !important; }
.witness-paper-meta,
#retro-paper-meta {
  grid-template-columns: 142px 1fr !important;
  gap: 3px 12px !important;
  font-size: .82rem !important;
  line-height: 1.45 !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.paper-meta-row strong,
.witness-paper-meta strong { color: #4a3a22 !important; }
.paper-meta-row span,
.witness-paper-meta span { color: #15120e !important; }
.witness-photo-frame {
  top: 26px !important;
  right: 34px !important;
  width: 108px !important;
  height: 138px !important;
  padding: 4px !important;
  background: #f3f4f6 !important;
  transform: rotate(.5deg) !important;
}
.witness-photo-frame img {
  filter: grayscale(15%) contrast(103%) brightness(96%) !important;
  object-fit: cover !important;
}
.photo-stamp { transform: rotate(-5deg) scale(.62) !important; right: -22px !important; bottom: -4px !important; }
.paper-stamp, #retro-paper-stamp {
  font-size: .74rem !important;
  line-height: 1.1 !important;
  padding: 7px 10px !important;
  background: rgba(239,229,201,.55) !important;
}
#retro-paper-stamp { top: 24px !important; right: 32px !important; }
.witness-paper-content {
  background: transparent !important;
  background-image: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  font-size: .93rem !important;
  line-height: 1.72 !important;
  color: var(--paper-ink-v11) !important;
  white-space: normal !important;
}
.witness-paper-content p,
.statement-body p {
  margin: 0 0 15px !important;
  padding: 0 !important;
  line-height: 1.72 !important;
  text-align: left !important;
}
.statement-section { margin: 0 0 12px !important; padding: 0 !important; }
.statement-section h5 {
  margin: 4px 0 16px !important;
  padding: 8px 0 7px !important;
  border-top: 0 !important;
  border-bottom: 1px solid rgba(28,25,20,.62) !important;
  text-transform: uppercase !important;
}
.paper-close { top: 10px !important; right: 14px !important; color: #7f1d1d !important; }

/* Alapakta: metaadatok tényleges fejrészként */
.retro-paper .witness-paper-title { font-size: 1.34rem !important; }
.retro-paper #retro-paper-meta {
  margin-top: 8px !important;
  padding: 8px 0 0 !important;
  border-top: 1px solid rgba(30,27,22,.20) !important;
}

/* Postafiók – hivatalos levelezés, nem rendszerüzenet */
.email-window { border-radius: 8px !important; background: #f8fafc !important; }
.email-header { background: linear-gradient(180deg,#f8fafc,#e8eef7) !important; border-bottom: 1px solid #cbd5e1 !important; }
.email-header h3 { color: #0f172a !important; }
.email-sidebar { background: #edf2f7 !important; }
.email-list-item { border-radius: 6px !important; background: #ffffff !important; border: 1px solid #d8e0ec !important; }
.email-list-item.unread { border-left: 5px solid #1d4ed8 !important; }
.email-read-card { box-shadow: 0 12px 30px rgba(15,23,42,.10) !important; }
.email-read-content { font-family: Arial, sans-serif !important; }

/* Iratfal gombok: egyértelmű piktogrammok */
.office-toolbar .det-btn { min-width: 130px; }
.office-toolbar .det-btn::first-letter { font-size: 1.05em; }

@media (max-width: 720px) {
  .witness-paper, .retro-paper { padding: 28px 22px 38px 54px !important; }
  .witness-paper-header { padding-right: 0 !important; padding-top: 148px !important; }
  .retro-paper .witness-paper-header { padding-right: 0 !important; padding-top: 0 !important; }
  .witness-photo-frame { left: 64px !important; right: auto !important; }
  .witness-paper-meta, #retro-paper-meta { grid-template-columns: 1fr !important; }
}
