@import url("./aha-tokens.css");

:root {
  --aha-bg: var(--aha-color-bg, #07080d);
  --aha-surface: var(--aha-color-surface, #11131b);
  --aha-surface-2: var(--aha-color-surface-raised, #181b25);
  --aha-border: var(--aha-color-line, rgba(151, 181, 220, .22));
  --aha-text: var(--aha-color-text, #f8fbff);
  --aha-muted: var(--aha-color-muted, #aebed2);
  --aha-accent: var(--aha-color-accent, #f4c84a);
  --aha-content-max: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--aha-bg);
  color: var(--aha-text);
}

.app-shell { min-height: 100dvh; padding: 18px; background: var(--aha-app-background, linear-gradient(180deg, #050608 0%, #0a0b10 48%, #050608 100%)); }
.chat-header, .chat-main, .composer-wrap > .row { width: 100%; max-width: var(--aha-content-max, 1180px); margin: 0 auto; }
.chat-header { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; background:transparent; border:0; border-radius:0; padding:8px 12px; margin-bottom:4px; box-shadow:none; }
.back-link { flex:0 0 auto; color: var(--aha-color-blue, #74adff); text-decoration:none; font-size:12px; white-space:nowrap; }
.chat-brand { display:flex; flex:0 0 auto; gap:8px; align-items:center; color: var(--aha-text); text-decoration:none; }
.chat-brand-mark { width:30px; height:30px; border-radius: 9px; display:grid; place-items:center; font-weight:700; color:#2b1b00; background: linear-gradient(145deg, var(--aha-color-accent, #f4c84a), var(--aha-color-coral, #ff987d)); }
.chat-brand-copy { display:flex; flex-direction:column; line-height:1.05; white-space:nowrap; }
.chat-brand-copy strong { font-size:13px; letter-spacing:.05em; }
.chat-brand-copy small { font-size:10px; color: var(--aha-muted); }
.chat-title-wrap { display:flex; align-items:baseline; gap:7px; min-width:0; flex:1 1 auto; }
.chat-title-wrap h1 { flex:0 0 auto; margin:0; font-size:17px; line-height:1.1; }
.chat-title-wrap p { min-width:0; margin:0; overflow:hidden; color: var(--aha-muted); font-size:11px; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
.status-pill { flex:0 0 auto; display:inline-block; padding:3px 8px; border-radius:999px; background:var(--aha-color-cyan-soft, rgba(88,217,199,.14)); color:var(--aha-color-cyan, #58d9c7); font-size:11px; border:1px solid rgba(88,217,199,.34); }
.chat-profile-card { display:flex; flex:0 1 226px; min-width:178px; align-items:center; gap:7px; border:1px solid var(--aha-border); border-radius:11px; padding:5px 8px; background:rgba(21,23,32,.90); }
.chat-profile-avatar { flex:0 0 auto; width:27px; height:27px; border-radius:8px; background:var(--aha-color-violet-soft, rgba(170,145,247,.14)); border:1px solid rgba(170,145,247,.34); color:var(--aha-color-violet, #aa91f7); display:grid; place-items:center; font-size:12px; font-weight:600; }
.chat-profile-copy { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:1px 6px; min-width:0; flex:1; font-size:10px; line-height:1.15; color:var(--aha-muted); }
.chat-profile-copy > strong { grid-column:1 / -1; overflow:hidden; color:var(--aha-text); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.chat-profile-copy > span:not(.chat-profile-id-row) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-profile-id-row { display:flex; min-width:0; gap:4px; align-items:center; }
.chat-profile-id-row em { flex:0 0 auto; font-style:normal; color:var(--aha-muted); }
.chat-profile-id-row strong { overflow:hidden; color:rgba(255,255,255,0.88); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.profile-indicator { flex:0 0 auto; color:var(--aha-text); text-decoration:none; font-size:11px; padding:5px 9px; border-radius:999px; border:1px solid var(--aha-border); white-space:nowrap; }
.back-link:hover, .chat-brand:hover, .profile-indicator:hover { color:var(--aha-accent); }
.back-link:focus-visible, .chat-brand:focus-visible, .profile-indicator:focus-visible { outline:2px solid var(--aha-color-blue, #74adff); outline-offset:3px; }

.chat-layout { display:grid; grid-template-columns: minmax(0, 1fr); gap: 14px; width:100%; max-width:var(--aha-content-max, 1180px); margin:0 auto; align-items:start; }
.chat-main { display:grid; gap:12px; }
.aha-module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: start; }

.composer-wrap { background:transparent; border:0; border-radius:0; padding:0; }
.module-card { background: var(--aha-panel-background, linear-gradient(145deg, rgba(25,27,37,.97), rgba(12,14,20,.97))); border:1px solid var(--aha-border); border-radius: var(--aha-radius-card, 16px); padding: 10px; }
.module-card { transition: all .2s ease; }
.module-card-toggle { width: 100%; min-height: var(--aha-control-min-height, 42px); display:flex; align-items:center; justify-content:space-between; border-radius: var(--aha-radius-control, 12px); background: rgba(116,173,255,.08); }
.module-card-toggle-hint { color: var(--aha-accent); font-size: 11px; }
.module-card-body { margin-top: 10px; }
.module-card-preview { margin: 8px 0 0; font-size: 12px; color: var(--aha-muted); }
.module-card:not(.is-expanded) .module-card-body { display: none; }
.aha-module-grid .module-card { min-height: 128px; }
.module-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.module-inline-action { font-size: 11px; padding: 6px 9px; border-radius: 999px; }
.module-card.is-expanded { border-color: rgba(170,145,247,.5); box-shadow: 0 0 0 1px rgba(170,145,247,.18) inset; }
.aha-module-grid .module-card.is-expanded { grid-column: 1 / -1; max-height: 55dvh; overflow: auto; }
.module-card.is-expanded .module-card-toggle-hint::before { content: "Lukk"; }
.module-card.is-expanded .module-card-toggle-hint { font-size: 0; }
.module-card.is-expanded .module-card-toggle-hint::before { font-size: 11px; }
.aha-ser-card #aha-auto-output { min-height: 120px; max-height: 42dvh; overflow: auto; }

label { display:block; font-size: 12px; color: var(--aha-muted); margin-bottom: 6px; }
textarea, select { width:100%; min-height:var(--aha-field-min-height, 44px); border-radius:var(--aha-radius-control, 12px); border:1px solid var(--aha-border); background:var(--aha-color-input, #151822); color:var(--aha-text); padding:10px 12px; font:inherit; outline:none; }
textarea:focus, select:focus { border-color:var(--aha-color-blue, #74adff); box-shadow:var(--aha-focus-ring, 0 0 0 3px rgba(116,173,255,.28)); }

.action-section { background: rgba(24,27,38,.88); border:1px solid var(--aha-border); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
.action-section h2 { margin: 0 0 8px; font-size: 14px; }
.action-groups { display:flex; gap:10px; overflow:auto; padding-bottom: 2px; }
.action-group-label { display: block; font-size: 11px; color: var(--aha-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.action-chip { border-radius: 999px; padding: 6px 10px; font-size: 12px; background: var(--aha-color-violet-soft, rgba(170,145,247,.14)); }
.action-chips-row .action-chip { padding: 5px 10px; font-size: 11px; }


.chat-log-shell { position: relative; }
.chat-log { min-height: 0; max-height: none; overflow: visible; padding: 2px 0; display:flex; flex-direction:column; gap:18px; }
.chat-line-row { position: relative; display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; width: 100%; }
.chat-line-row-user { justify-content: flex-end; }
.chat-line-row-aha { justify-content: flex-start; }
.chat-line { max-width: min(78ch, 88%); padding: 11px 15px; border-radius: 16px; font-size: 17px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.chat-line-sender { flex: 0 0 100%; font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--aha-muted); }
.chat-line-row-user .chat-line-sender { text-align: right; color: var(--aha-color-blue, #74adff); }
.chat-line-paste { background: rgba(99,132,255,0.1); border: 1px dashed rgba(136,164,255,0.55); }
.chat-line-paste > details > summary { cursor: pointer; font-size: 14px; color: #d7e3ff; }
.chat-line-paste-body { margin: 10px 0 0; font-size: 15px; line-height: 1.55; max-height: 38dvh; overflow: auto; white-space: pre-wrap; }
.message-category-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top: 6px; max-width: 85%; }
.message-category-chip { border-radius: 999px; padding: 4px 8px; font-size: 11px; background: var(--aha-color-violet-soft, rgba(170,145,247,.14)); border-color: rgba(170,145,247,.34); color: var(--aha-color-violet, #aa91f7); }
.chat-line-user { margin-left: auto; background: var(--aha-color-blue-soft, rgba(116,173,255,.15)); border: 1px solid rgba(116,173,255,.34); }
.chat-line-aha { margin-right: auto; background: rgba(18,20,29,.94); border: 1px solid var(--aha-border); }

.memory-transparency {
  flex: 0 0 100%;
  max-width: 85%;
  margin-top: 2px;
  margin-right: auto;
  color: var(--aha-muted);
  font-size: 11px;
  line-height: 1.35;
}
.memory-transparency summary {
  width: fit-content;
  cursor: pointer;
  color: rgba(176,206,255,0.82);
  list-style-position: inside;
  padding: 1px 0;
}
.memory-transparency summary:hover { color: var(--aha-accent); }
.memory-transparency-details {
  margin-top: 5px;
  padding: 7px 9px;
  border-left: 1px solid rgba(176,206,255,0.28);
  background: rgba(12,19,41,0.44);
  border-radius: 0 8px 8px 0;
}
.memory-transparency-meta { margin: 0; color: var(--aha-muted); }
dl.memory-transparency-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; }
.memory-transparency-meta dt { color: rgba(176,206,255,0.9); font-weight: 650; }
.memory-transparency-meta dd { margin: 0; min-width: 0; }
.memory-transparency-list-label { margin: 7px 0 4px; color: rgba(176,206,255,0.9); font-weight: 650; }
.memory-transparency-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.memory-transparency-insight strong { display: block; color: var(--aha-text); font-size: 11px; }
.memory-transparency-insight p { margin: 2px 0; color: var(--aha-muted); }
.memory-transparency-concepts { display: block; color: rgba(176,206,255,0.78); }
.memory-transparency-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.memory-transparency-action { border-radius: 999px; padding: 2px 7px; font-size: 10px; color: rgba(176,206,255,0.9); background: rgba(176,206,255,0.08); border: 1px solid rgba(176,206,255,0.24); }
.memory-transparency-action:hover:not(:disabled) { color: var(--aha-accent); border-color: rgba(255,211,71,0.48); }
.memory-transparency-exclude { color: rgba(255,211,71,0.88); border-color: rgba(255,211,71,0.28); }
.memory-transparency-action:disabled { cursor: default; opacity: 0.72; }
.memory-transparency-insight-excluded { opacity: 0.72; }
.memory-transparency-debug summary { color: rgba(255,211,71,0.72); }

.highlight-toggle-btn { flex: 0 0 auto; margin-top: 4px; width: 20px; height: 20px; border-radius: 999px; padding: 0; font-size: 12px; line-height: 1; color: rgba(255,211,71,0.72); background: transparent; border: 1px solid rgba(255,211,71,0.24); opacity: 0.65; }
.chat-line-row.is-highlighted .highlight-toggle-btn { background: rgba(255,211,71,0.24); opacity: 1; border-color: rgba(255,211,71,0.65); color: var(--aha-accent); }
.chat-line-row.is-highlighted .chat-line { box-shadow: 0 0 0 1px rgba(255,211,71,0.3) inset; }
.chat-highlights-rail { position: absolute; top: 6px; right: -10px; bottom: 6px; width: 10px; border-left: 2px solid rgba(255,211,71,0.7); background: linear-gradient(180deg, rgba(255,211,71,0.08), rgba(255,211,71,0.02)); border-radius: 999px; pointer-events: none; }
.chat-highlights-rail.is-empty { display: none; }
.highlight-rail-marker { position: absolute; left: 8px; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 999px; border: 1px solid #6e4d00; background: #ffd347; padding: 0; box-shadow: 0 0 0 2px rgba(255,211,71,0.22); pointer-events: auto; }

.insight-placeholder-card { background: linear-gradient(150deg, rgba(16,26,54,0.92), rgba(10,16,34,0.9)); border:1px solid var(--aha-border); border-radius: 14px; padding: 14px; }
.insight-placeholder-card h2 { margin:0 0 6px; font-size: 16px; }
.insight-placeholder-card p { margin:0 0 10px; color: var(--aha-muted); font-size: 13px; }
.insight-placeholder-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--aha-muted); font-size: 12px; }
.insight-placeholder-list strong { color: var(--aha-text); font-weight: 600; }
.insight-actions { display:flex; gap:8px; flex-wrap:wrap; }
.insight-inline-hint { margin: 0; color: var(--aha-muted); font-size: 12px; }
.utility-menu { margin-top: 10px; }
.utility-menu > summary { cursor: pointer; color: var(--aha-accent); font-size: 12px; }
.buttons { display:flex; flex-wrap:wrap; gap: 6px; margin: 12px 0; }
button { min-height:var(--aha-control-min-height, 42px); cursor:pointer; border-radius:var(--aha-radius-control, 12px); border:1px solid var(--aha-border); background:var(--aha-color-surface-raised, #181b25); color:var(--aha-text); padding:var(--aha-control-padding-y, 10px) var(--aha-control-padding-x, 14px); font:inherit; }
button:hover { background:var(--aha-color-blue-soft, rgba(116,173,255,.15)); border-color:rgba(116,173,255,.3); }

pre#out, #panel { margin-top: 8px; padding: 10px; border-radius: 8px; background: #02030a; border: 1px solid #222; font-size: 12px; }
pre#out { max-height: 22vh; overflow:auto; white-space: pre-wrap; }

.insight-panel h2 { margin: 0 0 8px; font-size: 14px; }
.insight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insight-card { background: #0c1329; border: 1px solid var(--aha-border); border-radius: 10px; padding: 10px 12px; }
.insight-card-title { display: block; font-size: 13px; margin-bottom: 4px; }
.insight-card-summary { margin: 0 0 8px; color: var(--aha-muted); font-size: 12px; line-height: 1.4; white-space: pre-wrap; }
.insight-section { margin-top: 6px; }
.insight-section-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--aha-muted); margin-bottom: 4px; }
.insight-layer-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.insight-chip { display: inline-block; background: #161b33; border: 1px solid var(--aha-border); border-radius: 999px; padding: 2px 8px; font-size: 11px; color: var(--aha-text); }
.insight-claims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.insight-claims li { font-size: 12px; font-style: italic; color: var(--aha-text); border-left: 2px solid var(--aha-border); padding-left: 8px; }
.insight-theory-links { display: grid; gap: 6px; }
.insight-theory-link { background: #0f1730; border: 1px solid var(--aha-border); border-radius: 8px; padding: 6px 8px; }
.insight-theory-link p { margin: 0; font-size: 11px; line-height: 1.35; color: var(--aha-muted); }
.insight-theory-link p + p { margin-top: 2px; }
.insight-theory-key { color: var(--aha-text); font-weight: 600; }

.emne-suggestion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.emne-suggestion { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; background: #0f1730; border: 1px solid var(--aha-border); border-radius: 8px; }
.emne-suggestion-label { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.emne-subject { color: var(--aha-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.emne-suggestion-actions { display: inline-flex; gap: 4px; }
.emne-confirm-btn, .emne-dismiss-btn { font-size: 11px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--aha-border); background: #161b33; color: var(--aha-text); cursor: pointer; }
.emne-confirm-btn:hover { background: #1d2a55; }
.emne-dismiss-btn:hover { background: #2a1d1d; }

.merge-suggestion-panel { background: #14193a; border: 1px solid var(--aha-border); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.merge-suggestion-panel h3 { margin: 0 0 4px; font-size: 13px; }
.merge-suggestion-hint { margin: 0 0 8px; color: var(--aha-muted); font-size: 11px; line-height: 1.4; }
.merge-suggestion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.merge-suggestion { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; background: #0f1730; border: 1px solid var(--aha-border); border-radius: 10px; padding: 8px 10px; }
.merge-suggestion-text { flex: 1 1 auto; font-size: 12px; color: var(--aha-text); }
.merge-suggestion-row { margin: 0; line-height: 1.4; }
.merge-suggestion-label { color: var(--aha-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 4px; }
.merge-suggestion-meta { display: block; margin-top: 4px; color: var(--aha-muted); font-size: 11px; }
.merge-suggestion-actions { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.merge-confirm-btn, .merge-dismiss-btn { font-size: 11px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--aha-border); background: #161b33; color: var(--aha-text); cursor: pointer; }
.merge-confirm-btn:hover { background: #1d2a55; }
.merge-dismiss-btn:hover { background: #2a1d1d; }

.meta-profile { display: flex; flex-direction: column; gap: 10px; }
.meta-profile h3 { margin: 0 0 4px; font-size: 14px; }
.meta-meta { margin: 0 0 8px; color: var(--aha-muted); font-size: 11px; }
.meta-empty { margin: 0; color: var(--aha-muted); font-size: 12px; }
.meta-section { background: #0f1730; border: 1px solid var(--aha-border); border-radius: 10px; padding: 8px 12px; }
.meta-section-label { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--aha-muted); font-weight: 600; }
.meta-section-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.meta-section-list li { font-size: 12px; line-height: 1.4; color: var(--aha-text); }
.meta-count { color: var(--aha-muted); font-size: 11px; margin-left: 4px; }
.meta-section-list em { font-style: italic; color: var(--aha-muted); }


.knowledge-map-block { background: #101a36; border: 1px solid var(--aha-border); border-radius: 10px; padding: 10px 12px; }
.knowledge-map-block h3 { margin: 0 0 8px; font-size: 13px; }
.knowledge-map-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.knowledge-card { background: #0f1730; border: 1px solid var(--aha-border); border-radius: 10px; padding: 8px 10px; }
.knowledge-card h4 { margin: 0 0 4px; font-size: 12px; }
.knowledge-mini-title { margin: 8px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--aha-muted); }
.knowledge-sub { margin: 2px 0; color: var(--aha-muted); font-size: 11px; line-height: 1.35; }
.knowledge-card ul { margin: 0; padding-left: 14px; display: grid; gap: 4px; }
.knowledge-card li { font-size: 11px; line-height: 1.35; }
.concept-network { margin-top: 4px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; background: rgba(6, 12, 28, 0.7); padding: 8px; }
.concept-network-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.concept-network-item { display: grid; gap: 5px; min-width: 0; }
.concept-node-badge { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; border-radius: 999px; padding: 2px 8px; font-size: 11px; line-height: 1.3; background: #152044; border: 1px solid var(--aha-border); color: var(--aha-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.concept-network-links { list-style: none; margin: 0 0 0 8px; padding: 0 0 0 10px; border-left: 1px solid rgba(255, 255, 255, 0.2); display: grid; gap: 5px; }
.concept-network-links li { position: relative; padding-left: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.concept-network-links li::before { content: ""; position: absolute; left: -10px; top: 50%; width: 10px; border-top: 1px solid rgba(255, 255, 255, 0.2); transform: translateY(-50%); }
.concept-link-line { width: 10px; height: 1px; background: rgba(255, 255, 255, 0.28); flex: 0 0 auto; }
.concept-network-empty { margin-left: 8px; }

.composer-row { background:var(--aha-panel-background); border:1px solid var(--aha-line); border-radius:var(--aha-radius-panel); padding:14px; box-shadow:var(--aha-shadow-soft); }
#msg { min-height:96px; max-height:32dvh; resize:vertical; font-size:16px; line-height:1.5; background:var(--aha-color-input); border-color:var(--aha-line); }
#msg:focus { border-color:var(--aha-color-blue); box-shadow:var(--aha-focus-ring); }
.composer-actions { display:flex; justify-content:flex-end; gap:8px; margin-top: 10px; }
.send-btn { background: var(--aha-accent); color: #1d1400; border-color: transparent; font-weight: 600; }
.secondary-action { background: transparent; border-color: rgba(255,211,71,0.5); color: var(--aha-accent); }
.chat-status-note { min-height: 16px; margin-top: 6px; font-size: 12px; color: var(--aha-muted); }

.aha-memory-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 211, 71, 0.22);
  border-radius: 12px;
  background: rgba(255, 211, 71, 0.07);
  color: var(--aha-muted);
  font-size: 11px;
  line-height: 1.35;
}
.aha-memory-status span { white-space: nowrap; }
.aha-memory-status strong { color: var(--aha-text); font-weight: 650; }

.aha-memory-controls { margin-top: 6px; font-size: 11px; color: var(--aha-muted); }
.aha-memory-controls-panel { border: 1px solid rgba(255, 211, 71, 0.18); border-radius: 10px; background: rgba(255, 255, 255, 0.025); padding: 6px 8px; }
.aha-memory-controls-panel summary { cursor: pointer; color: var(--aha-text); font-weight: 650; }
.aha-memory-controls-body { display: grid; gap: 5px; margin-top: 6px; }
.aha-memory-controls-body label { display: flex; align-items: center; gap: 6px; }
.aha-memory-controls-body input { accent-color: var(--aha-accent); }
.aha-memory-controls-status { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.aha-memory-controls-status strong { color: var(--aha-text); }
.aha-memory-exclusions { margin-top: 3px; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.aha-memory-exclusions summary { cursor: pointer; color: var(--aha-muted); font-weight: 600; }
.aha-memory-exclusions-body { display: grid; gap: 6px; margin-top: 6px; }
.aha-memory-exclusions-list { display: grid; gap: 6px; }
.aha-memory-exclusion-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.aha-memory-exclusion-copy { min-width: 0; }
.aha-memory-exclusion-title { color: var(--aha-text); font-weight: 650; line-height: 1.25; }
.aha-memory-exclusion-summary { margin-top: 2px; color: var(--aha-muted); line-height: 1.35; overflow-wrap: anywhere; }
.aha-memory-exclusion-meta { margin-top: 2px; color: rgba(245, 245, 245, 0.52); font-size: 10px; }
.aha-memory-exclusion-actions { flex: 0 0 auto; display: flex; justify-content: flex-end; }
.aha-memory-exclusion-btn { border-radius: 999px; padding: 4px 8px; font-size: 10px; border: 1px solid rgba(255,211,71,0.42); background: rgba(255,211,71,0.08); color: var(--aha-accent); cursor: pointer; white-space: nowrap; }
.aha-memory-exclusion-btn:hover:not(:disabled) { background: rgba(255,211,71,0.16); }
.aha-memory-exclusion-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.aha-memory-exclusion-reset { justify-self: start; }
.aha-memory-exclusions-empty { margin: 0; color: var(--aha-muted); line-height: 1.35; }

@media (max-width: 1024px) {
  .chat-header { gap:8px; padding:7px 10px; }
  .chat-brand-copy small, .chat-title-wrap p { display:none; }
  .chat-profile-card { flex-basis:190px; min-width:164px; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .insight-rail { position: static; max-height: none; }
  .chat-log { min-height: 0; max-height: none; }
  #msg { min-height: 96px; max-height: 34dvh; }
}

@media (max-width: 720px) {
  .app-shell { padding: 10px; }
  .chat-header { gap:6px; padding:6px 8px; border-radius:12px; overflow-x:auto; scrollbar-width:none; }
  .chat-header::-webkit-scrollbar { display:none; }
  .chat-main, .insight-rail { padding:12px; border-radius:14px; }
  .back-link-label, .chat-brand-copy, .chat-profile-avatar, .chat-profile-id-row em { display:none; }
  .back-link { font-size:15px; }
  .chat-brand-mark { width:27px; height:27px; border-radius:8px; font-size:12px; }
  .chat-title-wrap { flex:0 0 auto; }
  .chat-title-wrap h1 { font-size:14px; }
  .chat-profile-card { flex:0 0 142px; min-width:142px; padding:4px 6px; }
  .chat-profile-copy { gap:1px 4px; }
  .profile-indicator { padding:4px 7px; }
  .action-groups { flex-wrap: nowrap; }
  .chips { flex-wrap: nowrap; }
  .chat-line { max-width: 94%; font-size: 16px; }
  .memory-transparency { flex-basis: 100%; max-width: 94%; }
  .composer-actions { justify-content: stretch; }
  .composer-actions button { flex: 1 1 0; }
  #msg { min-height: 92px; max-height: 38dvh; }
  .module-card-body { margin-top: 8px; }
}

.subject-links { margin-top: 6px; max-width: 85%; }
.subject-links-label { display:block; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color: rgba(176,206,255,0.75); margin-bottom: 4px; }
.subject-link-chips { display:flex; flex-wrap:wrap; gap:6px; }
.subject-link-chip { border-radius: 999px; padding: 4px 8px; font-size: 11px; background: rgba(99,132,255,0.16); border:1px solid rgba(136,164,255,0.45); color: #d7e3ff; }


.action-group { min-width: max-content; }

.insight-rail { overflow: visible; }

.action-section-hint { margin: 0 0 8px; font-size: 12px; color: var(--aha-muted); }
.aha-auto-output { margin: 8px 0 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--aha-border); background: linear-gradient(150deg, rgba(16,26,54,0.68), rgba(10,16,34,0.7)); }
.auto-output-head h2 { margin: 0; font-size: 14px; }
.auto-output-head p { margin: 2px 0 10px; font-size: 12px; color: var(--aha-muted); }
.auto-output-group { margin-top: 10px; }
.auto-output-group h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--aha-accent); }
.auto-output-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.auto-card { border: 1px solid var(--aha-border); border-radius: 10px; background: rgba(9,15,31,0.8); padding: 8px 10px; font-size: 12px; }
.auto-card h4 { margin: 0 0 5px; font-size: 12px; }
.auto-card p { margin: 0 0 5px; color: var(--aha-muted); line-height: 1.35; }
.auto-card ul, .auto-card ol { margin: 0; padding-left: 16px; display: grid; gap: 4px; color: var(--aha-muted); }
.auto-card li { line-height: 1.35; }
.auto-card.is-focused { border-color: rgba(255,211,71,0.65); box-shadow: 0 0 0 1px rgba(255,211,71,0.25) inset; }
.auto-output-primary .auto-card-primary { border-color: rgba(255,211,71,0.55); box-shadow: 0 0 0 1px rgba(255,211,71,0.2) inset; background: linear-gradient(165deg, rgba(25,35,70,0.9), rgba(10,16,34,0.85)); }
.aha-ser-list { margin: 0; display: grid; gap: 7px; }
.aha-ser-list div { display: grid; gap: 2px; }
.aha-ser-list dt { color: var(--aha-accent); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.aha-ser-list dd { margin: 0; color: var(--aha-text); line-height: 1.4; }

.auto-output-actions { position: sticky; bottom: 0; margin-top: 10px; padding-top: 8px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--aha-border); background: linear-gradient(180deg, rgba(10,16,34,0.2), rgba(10,16,34,0.9)); }
.auto-output-actions button { font-size: 12px; }
.auto-output-save-status { margin: 0; font-size: 11px; color: var(--aha-muted); }

@media (max-width: 720px) {
  .auto-output-grid { grid-template-columns: 1fr; }
}

.saved-afterwork-panel { display: grid; gap: 10px; }
.saved-afterwork-panel h2 { margin: 0; font-size: 14px; }
.saved-afterwork-list { display: grid; gap: 8px; }
.saved-afterwork-card { background: linear-gradient(150deg, rgba(16,26,54,0.92), rgba(10,16,34,0.9)); border: 1px solid var(--aha-border); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.saved-afterwork-meta { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--aha-muted); font-size: 11px; }
.saved-afterwork-preview { margin: 0; font-size: 12px; line-height: 1.4; }
.saved-afterwork-concepts { display: flex; flex-wrap: wrap; gap: 6px; }
.saved-afterwork-section h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--aha-accent); }
.saved-afterwork-section p { margin: 0 0 4px; font-size: 12px; color: var(--aha-muted); }
.saved-afterwork-section ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.saved-afterwork-actions { display: flex; justify-content: flex-end; }
.saved-afterwork-actions button { font-size: 11px; padding: 4px 8px; }
.saved-afterwork-subjects ul { padding-left: 14px; }

.aha-processing-indicator {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.aha-processing-indicator[hidden] {
  display: none;
}

.aha-processing-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: aha-spin 0.8s linear infinite;
}

@keyframes aha-spin {
  to { transform: rotate(360deg); }
}

#btn-send:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Chat-first: samtalen er hovedflaten */
.chat-conversation {
  background: var(--aha-panel-background);
  border: 1px solid var(--aha-line);
  border-radius: var(--aha-radius-panel);
  padding: 12px;
  box-shadow: var(--aha-shadow-soft);
}
.chat-conversation .chat-log { min-height: 0; max-height: none; }

.answer-actions {
  display: none;
  background: rgba(15,24,49,0.45);
  border: 1px solid var(--aha-border);
  border-radius: 12px;
  padding: 8px 10px;
}
.answer-actions.has-aha-answer { display: block; }
.answer-actions-hint { margin: 0 0 8px; font-size: 12px; color: var(--aha-muted); }
.answer-actions-row { gap: 8px; }
.answer-actions-row .action-chip {
  background: transparent;
  border: 1px solid rgba(255,211,71,0.45);
  color: var(--aha-accent);
  padding: 7px 12px;
  font-size: 12px;
}
.answer-actions-row .action-chip:hover { background: rgba(255,211,71,0.12); }

.aha-explore {
  border: 1px solid var(--aha-border);
  border-radius: 14px;
  background: rgba(10,16,34,0.6);
  padding: 6px 12px;
}
.aha-explore > summary {
  cursor: pointer;
  color: var(--aha-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 4px;
  list-style: none;
}
.aha-explore > summary::-webkit-details-marker { display: none; }
.aha-explore > summary::before { content: "▸ "; color: var(--aha-accent); }
.aha-explore[open] > summary::before { content: "▾ "; }
.aha-explore .aha-module-grid { margin-top: 10px; }

.aha-mobile-nav { display: none; }
@media (max-width: 720px) {
  .app-shell { padding-bottom: 78px; }
  .aha-mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--aha-border);
    border-radius: 16px;
    background: rgba(5,8,20,0.94);
    backdrop-filter: blur(8px);
  }
  .aha-mobile-nav a {
    text-decoration: none;
    color: var(--aha-text);
    font-size: .76rem;
    text-align: center;
    padding: 7px 3px;
    border-radius: 10px;
  }
  .aha-mobile-nav a[aria-current="page"] { background: rgba(255,211,71,0.16); color: var(--aha-accent); }
}


/* Meta Insights AI-session (agent-flyt fra AHA Home) */
.meta-ai-session-box, .meta-ai-claims {
  border: 1px solid var(--aha-border);
  border-radius: 14px;
  background: rgba(255, 211, 71, 0.07);
  padding: 12px 14px;
  margin: 10px 0;
  font-size: .85rem;
}
.meta-ai-session-title, .meta-ai-claims-title { color: var(--aha-accent); font-weight: 700; margin-bottom: 6px; }
.meta-ai-session-row { color: var(--aha-text); opacity: .9; margin: 2px 0; }
.meta-ai-claim-card { border-top: 1px solid var(--aha-border); padding: 8px 0; }
.meta-ai-claim-text { font-weight: 600; margin-bottom: 4px; }
.meta-ai-claim-basis, .meta-ai-claim-confidence, .meta-ai-question, .meta-ai-next-step { opacity: .8; margin: 2px 0; }
.meta-ai-claim-status { color: var(--aha-accent); min-height: 1em; margin: 2px 0; }
.meta-ai-claim-feedback { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.meta-ai-feedback-btn {
  border: 1px solid var(--aha-border);
  border-radius: 999px;
  background: transparent;
  color: var(--aha-text);
  font-size: .76rem;
  padding: 4px 10px;
  cursor: pointer;
}
.meta-ai-feedback-btn:hover { border-color: var(--aha-accent); color: var(--aha-accent); }

/* ── Samlet AHA-analyseflate ─────────────────────────────────
   Alt AHA ser presenteres i synlige kort med ett kanonisk renderpunkt
   per datagruppe. */
.aha-explorer {
  border: 1px solid rgba(170,145,247,.24);
  border-radius: var(--aha-radius-panel);
  background:
    linear-gradient(145deg, rgba(170,145,247,.07), transparent 38%),
    var(--aha-color-panel);
  padding: 16px;
}
.explorer-head { margin-bottom: 14px; }
.explorer-head h2 { margin: 0 0 4px; font-size: 22px; }
.explorer-head p { margin: 0 0 12px; color: var(--aha-muted); font-size: 13px; }

.analysis-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.analysis-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  scroll-margin-top: 20px;
  border-radius: var(--aha-radius-card);
  padding: 14px 16px;
  background: var(--aha-color-panel);
  border: 1px solid var(--aha-line);
}
.analysis-card-wide,
.analysis-card-full { grid-column: 1 / -1; }
.analysis-card-primary {
  border-color: rgba(244,200,74,.36);
  background:
    linear-gradient(145deg, rgba(244,200,74,.07), transparent 42%),
    var(--aha-color-panel);
}
.analysis-card.is-targeted {
  border-color: var(--aha-accent);
  box-shadow: 0 0 0 2px rgba(255,211,71,0.18), 0 14px 40px rgba(0,0,0,0.22);
}
.analysis-card:focus { outline: none; }
.analysis-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.analysis-card-head h3 { margin:0; color:var(--aha-text); font-size:14px; }
.analysis-card-head [data-analysis-count] {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: var(--aha-radius-pill);
  text-align: center;
  color: var(--aha-color-blue);
  background: var(--aha-color-blue-soft);
  border: 1px solid rgba(116,173,255,.26);
  font-size: 11px;
}
.analysis-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.analysis-summary { display: grid; gap: 12px; }
.analysis-summary h4 { margin: 0; font-size: clamp(18px, 3vw, 26px); line-height: 1.2; }
.analysis-summary-fields { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.analysis-summary-fields div { padding: 10px; border-radius: 12px; background: rgba(5,8,20,.32); border: 1px solid rgba(255,255,255,.07); }
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; align-items: start; }

.exp-card {
  background: var(--aha-color-panel);
  border: 1px solid var(--aha-line);
  border-radius: var(--aha-radius-card);
  padding: 14px 16px;
}
.exp-card + .exp-card { margin-top: 10px; }
.exp-grid .exp-card + .exp-card { margin-top: 0; }
.exp-card h3 { margin: 0 0 8px; font-size: 14px; color: var(--aha-accent); }
.exp-card p { margin: 0 0 8px; line-height: 1.5; font-size: 14px; }
.exp-card p:last-child { margin-bottom: 0; }
.exp-card-primary { border-color: rgba(255,211,71,0.55); box-shadow: 0 0 0 1px rgba(255,211,71,0.2) inset; }
.exp-lede { font-size: 17px; line-height: 1.6; }

.exp-dl { margin: 0; display: grid; gap: 8px; }
.exp-dl div { display: grid; gap: 2px; }
.exp-dl dt { color: var(--aha-accent); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.exp-dl dd { margin: 0; color: var(--aha-text); line-height: 1.5; font-size: 14px; }

.exp-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; }
.exp-sort-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; }
.exp-sort-list strong { color: var(--aha-accent); font-weight: 650; }

.exp-kicker { margin: 6px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--aha-muted); font-weight: 650; }
.exp-empty { margin: 0; padding: 14px; border: 1px dashed var(--aha-border); border-radius: 12px; color: var(--aha-muted); font-size: 13px; line-height: 1.5; }

.exp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #141c3a;
  border: 1px solid var(--aha-border);
  color: var(--aha-text);
}
.exp-chip-meta { background: rgba(255,211,71,0.1); border-color: rgba(255,211,71,0.4); color: var(--aha-accent); }
.exp-chip-muted { color: var(--aha-muted); }
.exp-chip-btn { cursor: pointer; }
.exp-chip-btn:hover { border-color: rgba(255,211,71,0.55); color: var(--aha-accent); background: rgba(255,211,71,0.08); }

.exp-concept-detail { margin-top: 10px; }
.exp-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  border: 1px solid rgba(255,211,71,0.5);
  color: var(--aha-accent);
  text-decoration: none;
}
.exp-action-btn:hover { background: rgba(255,211,71,0.12); }

.exp-subject-card h3 { color: var(--aha-text); }
.exp-subject-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--aha-muted); font-size: 12px; }
.exp-subject-meta code { font-size: 11px; background: rgba(2,3,10,0.7); border: 1px solid #222; border-radius: 6px; padding: 1px 6px; }

.exp-insight-card h3 { color: var(--aha-text); font-size: 15px; }

.exp-acc {
  border: 1px solid var(--aha-line);
  border-radius: var(--aha-radius-control);
  background: rgba(255,255,255,.025);
  padding: 8px 12px;
}
.exp-acc > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--aha-muted); padding: 4px 0; }
.exp-acc > summary:hover { color: var(--aha-accent); }
.exp-acc[open] > summary { color: var(--aha-accent); }
.exp-acc-inline { margin-top: 10px; background: rgba(2,3,10,0.4); }

.exp-json {
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #02030a;
  border: 1px solid #222;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.exp-json-actions { display: flex; gap: 8px; margin-top: 8px; }
.exp-tools .utility-buttons { margin: 6px 0 0; }
.exp-acc .aha-auto-output { max-height: 55dvh; overflow: auto; }
.exp-acc #afterwork-panel, .exp-acc #meta-profile-panel, .exp-acc #panel { max-height: 55dvh; overflow: auto; }

@media (max-width: 720px) {
  .aha-explorer { padding: 12px; border-radius: 14px; }
  .analysis-card-grid { grid-template-columns: 1fr; }
  .analysis-card-wide, .analysis-card-full { grid-column: auto; }
  .analysis-card { padding: 12px; }
  .exp-grid { grid-template-columns: 1fr; }
  .exp-json { max-height: 240px; }
}

.aha-personal-context-panel {
  margin-top: 0.75rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.06);
  padding: 0.65rem 0.8rem;
}

.aha-personal-context-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d4ed8;
}

.aha-personal-context-status {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.45;
}

.aha-personal-context-status strong {
  color: #1e3a8a;
}

.aha-personal-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.aha-personal-context-actions a {
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.72);
  color: #1d4ed8;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.aha-personal-retrieval-results { display: grid; gap: 8px; margin-top: 10px; }
.aha-personal-retrieval-result { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; }
.aha-personal-retrieval-result span, .aha-personal-retrieval-result small { color: var(--aha-muted); }

/* Calm chat IA refresh */
.chat-hero .composer-row { padding: 18px; border-radius: var(--aha-radius-panel); }
.chat-hero-copy { margin-bottom: 14px; }
.eyebrow { margin: 0 0 6px; color: var(--aha-accent); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.chat-hero-copy h2 { margin:0 0 6px; font-size:clamp(24px, 3.2vw, 36px); line-height:1.08; letter-spacing:-.025em; }
.chat-hero-copy p:not(.eyebrow) { margin: 0; max-width: 64ch; color: var(--aha-muted); line-height: 1.55; }
.compact-status-line { display:flex; flex-wrap:wrap; gap:8px; margin-top: 10px; }
.compact-status-line .status-pill { background: rgba(127, 255, 184, .09); border-color: rgba(127, 255, 184, .28); color: #bdf8d2; }
.aha-now-card, .memory-card, .advanced-panel,
.aha-live-analysis, .aha-analysis-panel, .aha-now-panel, .aha-see-now, .aha-memory-panel {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  border: 1px solid var(--aha-line);
  border-radius: var(--aha-radius-card);
  background: var(--aha-color-panel);
  padding: 16px;
}

.aha-now-card { border-color: rgba(170,145,247,.24); }
.memory-card { border-color: rgba(126,226,168,.22); }
.advanced-panel { border-color: rgba(116,173,255,.18); }
.aha-analysis-shell, .aha-after-chat-shell, .aha-side-status-shell {
  width: 100%;
  max-width: var(--aha-content-max, 1180px);
  margin-inline: auto;
}
.aha-live-analysis-grid, .aha-now-grid, .aha-analysis-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.aha-now-card header { margin-bottom: 10px; }
.aha-now-card h2, .memory-card h2 { margin: 0; font-size: 22px; }
.aha-now-content .exp-empty, .aha-calm-empty { margin:0; padding: 14px; border: 1px dashed rgba(255,255,255,.14); border-radius: 14px; color: var(--aha-muted); background: rgba(255,255,255,.025); }
.aha-now-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.aha-now-list div { padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(15,24,49,.52); }
.aha-now-list dt { color: var(--aha-accent); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.aha-now-list dd { margin: 0; line-height: 1.45; }
.aha-snapshot-preview { display: grid; gap: 12px; }
.aha-snapshot-status { margin: 0; color: #bdf8d2; font-size: 12px; }
.aha-snapshot-summary { padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(15,24,49,.52); }
.aha-snapshot-summary h3, .aha-snapshot-group h3, .aha-snapshot-steps h3 { margin: 0 0 6px; font-size: 13px; color: var(--aha-accent); }
.aha-snapshot-summary p { margin: 0; color: var(--aha-muted); line-height: 1.5; }
.aha-snapshot-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.aha-snapshot-group, .aha-snapshot-steps { padding: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.025); }
.aha-snapshot-chip { display: inline-flex; margin: 3px 4px 3px 0; padding: 5px 8px; border-radius: 999px; background: rgba(127,255,184,.08); border: 1px solid rgba(127,255,184,.18); color: var(--aha-text); font-size: 12px; }
.memory-card { display:grid; gap: 10px; }
.memory-card .aha-memory-status { margin: 0; background: rgba(127,255,184,.06); border-color: rgba(127,255,184,.2); }
.memory-warning { color: #ffdca3; }
.more-tabs { position: relative; }
.more-tabs > summary { cursor: pointer; border-radius: 999px; padding: 8px 14px; font-size: 13px; background: rgba(15,24,49,0.65); border: 1px solid var(--aha-border); color: var(--aha-text); list-style: none; }
.more-tabs > summary::-webkit-details-marker { display:none; }
.more-tabs[open] { flex-basis: 100%; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.more-tabs[open] > summary { color: var(--aha-accent); border-color: rgba(255,211,71,.55); }
.advanced-panel { margin-top: 0; }
.advanced-panel > summary { cursor:pointer; color: var(--aha-accent); font-weight: 700; font-size: 15px; }
.advanced-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.aha-personal-context-panel { border:1px solid var(--aha-border); border-radius: 12px; padding: 10px 12px; background: rgba(5,8,20,.45); }
.aha-personal-context-panel > summary { cursor:pointer; color: var(--aha-text); font-weight: 650; }
.aha-personal-context-status { margin-top: 8px; color: var(--aha-muted); font-size: 12px; line-height: 1.45; }
.aha-personal-context-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top: 8px; }
.aha-personal-context-actions a { color: var(--aha-accent); font-size: 12px; }
@media (max-width: 720px) {
  .chat-conversation { order: 1; }
  .chat-hero { order: 0; }
  .aha-now-card { order: 2; }
  .aha-explorer { order: 3; }
  .memory-card, .advanced-panel, .answer-actions { order: 4; }
  .aha-now-list { grid-template-columns: 1fr; }
}
.aha-quality-status-preview { display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(127,255,184,.16); border-radius: 14px; background: rgba(127,255,184,.045); }
.aha-quality-status-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.aha-quality-status-head h3 { margin: 0; font-size: 13px; color: var(--aha-accent); }
.aha-quality-status-head span, .aha-quality-status-safety { margin: 0; color: #bdf8d2; font-size: 12px; }
.aha-quality-status-checks { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.aha-quality-status-checks div { padding: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(5,8,20,.25); }
.aha-quality-status-checks dt { color: var(--aha-muted); font-size: 11px; }
.aha-quality-status-checks dd { margin: 2px 0 0; font-size: 12px; font-weight: 700; }
.aha-quality-status-summary { margin: 0; padding-left: 18px; color: var(--aha-muted); font-size: 12px; line-height: 1.45; }


/* AHA Home/Chat polish V1: after a conversation starts, the composer behaves
   like an app composer rather than keeping the full landing-state introduction. */
body:has(#chat-log .chat-line) .chat-hero-copy {
  display: none;
}

body:has(#chat-log .chat-line) .chat-hero .composer-row {
  padding: 12px;
}

body:has(#chat-log .chat-line) #msg {
  min-height: 72px;
}


/* Analysis identity: color marks meaning while the surfaces stay black. */
.analysis-card[data-analysis-card="innsikter"] { border-color: rgba(170,145,247,.22); }
.analysis-card[data-analysis-card="innsikter"] .analysis-card-head h3 { color: var(--aha-color-violet); }
.analysis-card[data-analysis-card="begreper"] { border-color: rgba(88,217,199,.22); }
.analysis-card[data-analysis-card="begreper"] .analysis-card-head h3 { color: var(--aha-color-cyan); }
.analysis-card[data-analysis-card="kilder"] { border-color: rgba(116,173,255,.22); }
.analysis-card[data-analysis-card="kilder"] .analysis-card-head h3 { color: var(--aha-color-blue); }
.analysis-card[data-analysis-card="struktur"] { border-color: rgba(126,226,168,.2); }
.analysis-card[data-analysis-card="struktur"] .analysis-card-head h3 { color: var(--aha-color-green); }
.analysis-card[data-analysis-card="etterarbeid"] { border-color: rgba(255,152,125,.2); }
.analysis-card[data-analysis-card="etterarbeid"] .analysis-card-head h3 { color: var(--aha-color-coral); }
.analysis-card[data-analysis-card="kart"] { border-color: rgba(116,173,255,.18); }
.analysis-card[data-analysis-card="kart"] .analysis-card-head h3 { color: var(--aha-color-blue); }
