:root {
  --bg: #12161C;
  --card: #1C232C;
  --card-blue: #1B2633;
  --line: #2C3642;
  --line-2: #3A4654;
  --text: #E8ECF1;
  --text-2: #C9D1DB;
  --muted: #A9B4C2;
  --accent: #F2A33A;
  --accent-bg: #262016;
  --blue: #8FC1FF;
  --green: #5FD39A;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: 'Barlow', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input { font-family: inherit; }
button { cursor: pointer; }

#app { height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.screen { flex: 1; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 24px) 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.screen.chat { padding: 0; overflow: hidden; gap: 0; }

.h-small { font-size: 14px; color: var(--muted); }
.h-big { font-family: 'Barlow Condensed', sans-serif; font-size: 34px; font-weight: 700; line-height: 1.1; margin: 0; }
.h-mid { font-family: 'Barlow Condensed', sans-serif; font-size: 30px; font-weight: 700; line-height: 1.05; margin: 0; }
.section { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--green); display: inline-block; }
.demo { font-size: 12px; color: var(--blue); background: var(--card-blue); border-radius: 8px; padding: 4px 8px; align-self: flex-start; }

.tl-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px 10px 10px 16px; }
.tl-row .info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.icon-btn { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent; display: flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; }
.icon-btn.solid { background: var(--accent); border: none; color: #12161C; }

.big-btn { text-align: left; min-height: 72px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; color: var(--text); display: flex; align-items: center; gap: 14px; }
.big-btn.primary { border: 2px solid var(--accent); }
.big-btn.blue { background: var(--card-blue); border-color: #2E4560; }
.mk { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #12161C; background: var(--accent); border-radius: 6px; padding: 2px 7px; margin-left: 4px; vertical-align: 2px; }
.mk.big { font-size: 15px; padding: 8px 0; margin: 0; width: 64px; text-align: center; flex-shrink: 0; vertical-align: 0; }
.link { background: none; border: none; padding: 4px 0; color: var(--muted); font-size: 14px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.big-btn.green { border: 2px solid #2F7A55; }
.toggle { text-align: left; min-height: 72px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toggle .t { font-size: 17px; font-weight: 700; display: block; }
.toggle .s { font-size: 14px; color: var(--muted); display: block; margin-top: 2px; }
.toggle .knob { width: 52px; height: 32px; border-radius: 16px; background: #3A4654; position: relative; flex-shrink: 0; transition: background .15s; }
.toggle .knob::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 12px; background: #E8ECF1; transition: left .15s; }
.toggle.on .knob { background: var(--green); }
.toggle.on .knob::after { left: 24px; }
.big-btn .t { font-size: 19px; font-weight: 700; display: block; }
.big-btn .s { font-size: 14px; color: var(--muted); display: block; margin-top: 2px; }

.status-card { background: var(--card-blue); border: 1px solid #2E4560; border-radius: 16px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.status-card .k { font-size: 13px; color: var(--blue); font-weight: 600; }
.status-card .v { font-size: 16px; font-weight: 600; }

.back { align-self: flex-start; min-height: 44px; background: transparent; border: none; color: var(--muted); font-size: 16px; display: flex; align-items: center; gap: 6px; padding: 0; }
.segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--card); border-radius: 14px; padding: 4px; }
.segment button { min-height: 44px; border: none; border-radius: 10px; background: transparent; color: var(--text-2); font-size: 15px; font-weight: 700; }
.segment button.on { background: var(--accent); color: #12161C; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 56px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 600; padding: 6px 10px; line-height: 1.2; }
.grid4 .chip { min-height: 48px; font-size: 16px; }
.chip.on { border-color: var(--accent); background: var(--accent-bg); }
.field { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 4px 16px; }
.field label { font-size: 15px; color: var(--muted); flex-shrink: 0; }
.field input { flex: 1; min-width: 0; min-height: 48px; border: none; background: transparent; color: var(--text); font-size: 18px; font-weight: 600; text-align: right; outline: none; }
.field input.huge { font-size: 28px; font-weight: 700; min-height: 52px; }
.field .unit { font-size: 18px; color: var(--muted); }
.text-input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); padding: 0 14px; font-size: 16px; outline: none; }
.lbl { font-size: 15px; color: var(--muted); margin-top: 4px; }
.hint { font-size: 13px; color: var(--muted); }
.send { min-height: 56px; border: none; border-radius: 14px; background: var(--accent); color: #12161C; font-size: 18px; font-weight: 700; margin-top: 4px; }
.send:disabled { background: #2C3642; color: var(--muted); font-size: 17px; cursor: default; }

.chat-head { padding: calc(env(safe-area-inset-top) + 20px) 20px 12px; border-bottom: 1px solid #232C37; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.bubble-me { align-self: flex-end; max-width: 82%; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.bubble-me .b { background: var(--accent); color: #12161C; border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 16px; font-weight: 500; }
.bubble-other { align-self: flex-start; max-width: 88%; display: flex; flex-direction: column; gap: 3px; }
.bubble-other .b { background: var(--card); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 16px; line-height: 1.4; display: flex; flex-direction: column; gap: 8px; }
.meta { font-size: 12px; color: var(--muted); }
.meta.who { color: var(--blue); font-weight: 600; }
.report { border: 2px solid var(--accent); background: var(--accent-bg); border-radius: 16px 16px 4px 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.report .k { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .06em; }
.report .v { font-size: 17px; font-weight: 700; }
.report .c { font-size: 14px; color: var(--text-2); }
.source { font-size: 13px; color: var(--blue); }
.resolved { font-size: 13px; color: var(--green); }
.act { min-height: 44px; border: none; border-radius: 10px; background: var(--accent); color: #12161C; font-size: 15px; font-weight: 700; }
.typing { align-self: flex-start; font-size: 14px; color: var(--muted); }
.composer { padding: 10px 20px 12px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #232C37; }
.suggest { text-align: left; min-height: 44px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 14px; color: var(--text); font-size: 15px; }
.outline { min-height: 48px; border: 2px solid var(--accent); border-radius: 12px; background: transparent; color: var(--text); font-size: 16px; font-weight: 700; }
.row { display: flex; gap: 8px; }
.row .text-input { flex: 1; border-radius: 24px; padding: 0 16px; }
.round { width: 48px; height: 48px; border-radius: 24px; border: none; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #12161C; flex-shrink: 0; }

nav { display: flex; border-top: 1px solid #232C37; background: #161B22; padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px); }
nav button { flex: 1; min-height: 52px; background: transparent; border: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; }
nav button.on { color: var(--accent); }
.sr { position: absolute; left: -9999px; }

/* Snabbval */
.qv-list { flex-shrink: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.qv-item { text-align: left; min-height: 60px; background: transparent; border: none; border-top: 1px solid var(--line); color: var(--text); font-size: 17px; font-weight: 600; line-height: 1.25; padding: 12px 14px 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qv-item:first-child { border-top: none; }
.qv-item svg { color: var(--muted); flex-shrink: 0; }
.tip { font-size: 15px; font-weight: 600; color: var(--accent); background: var(--accent-bg); border-radius: 12px; padding: 10px 14px; }
.field input[type=time], .field input[type=date] { color-scheme: dark; }

/* Laget */
.goal { flex-shrink: 0; background: var(--card-blue); border: 1px solid #2E4560; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.goal .k { font-size: 12px; color: var(--blue); font-weight: 700; letter-spacing: .06em; }
.goal .t { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 700; line-height: 1.1; }
.bar { height: 14px; border-radius: 7px; background: #26364A; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--green), var(--blue)); }
.goal-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-2); }
.tack, .tip-card { flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tack-head { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-2); }
.tack-head svg { color: #FF8A8A; flex-shrink: 0; margin-top: 1px; }
.tack-text { font-size: 16px; line-height: 1.35; }
.impact { flex-shrink: 0; display: flex; align-items: center; gap: 14px; background: #16261E; border: 1px solid #2F7A55; border-radius: 14px; padding: 12px 16px; font-size: 15px; }
.impact .n { font-family: 'Barlow Condensed', sans-serif; font-size: 40px; font-weight: 700; color: var(--green); line-height: 1; }
.ok { color: var(--green); font-weight: 600; }
.wait { color: var(--accent); font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.steps span { font-size: 12px; font-weight: 600; text-align: center; padding: 5px 0; border-radius: 8px; background: #26303B; color: var(--muted); }
.steps span.on { background: #1E3A2C; color: var(--green); }
.screen > .outline, .screen > .suggest { flex-shrink: 0; }
nav button { font-size: 12px; }
.goal-row span:last-child { white-space: nowrap; font-weight: 700; }
.suggest.on { border: 2px solid var(--accent); background: var(--accent-bg); }

/* Inloggning */
.code-input { font-size: 26px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: center; min-height: 60px; }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 10px 0 4px; flex-shrink: 0; }
.pin-dot { width: 18px; height: 18px; border-radius: 9px; border: 2px solid var(--line-2); }
.pin-dot.on { background: var(--accent); border-color: var(--accent); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; width: 100%; margin: 6px auto 0; flex-shrink: 0; }
.pin-key { min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 28px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pin-key:active { background: var(--accent-bg); border-color: var(--accent); }
.pass-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--muted); flex-shrink: 0; }
.screen > .grid2 { flex-shrink: 0; }

/* Språkval */
.lang { display: flex; gap: 4px; align-self: flex-start; background: var(--card); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.lang button { min-height: 36px; padding: 0 12px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.lang button.on { background: var(--accent); color: #12161C; }
.handled { color: var(--green); font-weight: 600; }

/* Viktiga snabbmeddelanden */
.viktigt { border: 2px solid #FF6B5E; background: #2A1715; border-radius: 16px 16px 16px 4px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.viktigt .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #FF8A80; }
.viktigt .v { font-size: 17px; font-weight: 700; line-height: 1.35; }
.viktigt-banner { flex-shrink: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; background: #2A1715; border: 2px solid #FF6B5E; border-radius: 16px; padding: 12px 16px; color: var(--text); font-size: 16px; font-weight: 600; }
.viktigt-banner .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #FF8A80; }

/* Snabbmeddelanden (transportledningen) */
.qm { background: var(--card); border: 2px solid var(--accent); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.qm .segment { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qm .segment button { font-size: 14px; min-height: 40px; }
.liten.vald { border-color: var(--accent); background: var(--accent-bg); }
.liten.mall { text-align: left; min-height: 34px; color: var(--text-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); line-height: 1.35; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.utskick { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }

/* Kundinstruktioner (transportledningen) */
.itext { min-height: 220px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-family: inherit; }
.panel h2 + .form, .form h2 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-size: 22px; }
mark { background: #4A3A12; color: var(--text); border-radius: 3px; padding: 0 2px; }
.fb-text { min-height: 160px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-family: inherit; flex-shrink: 0; }
.rad.fb-ny { border-left: 3px solid var(--accent); padding-left: 10px; }
.fil-knapp { display: inline-flex; align-items: center; cursor: pointer; }
.tel-import { border: 2px solid var(--accent); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.text-input.sok { min-height: 40px; font-size: 15px; margin-bottom: 8px; width: 100%; box-sizing: border-box; }
