/* Karachi Ordre. Samme språk som nettsida: dyp varm svart, gull som signal,
   Anton til overskrifter, chili til det som skal trykkes. */

:root {
  --natt: #0a0b08; --kull: #14160e; --kull-2: #1c1f14; --kant: rgba(255,255,255,.1);
  --gronn: #35a054; --gronn-lys: #6ff094; --gronn-dyp: #0d2b18;
  --chili: #f2543f; --chili-dyp: #8f1f18;
  --gull: #e3b341; --gull-lys: #f7dc93;
  --kritt: #f6f3ea; --dis: #a49f92; --dis-svak: #8a857c;
  --rad: 14px;
  --nav-h: 66px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--natt); }
body {
  margin: 0; min-height: 100dvh; background: var(--natt); color: var(--kritt);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(900px 380px at 50% -140px, rgba(227,179,65,.10), transparent 70%);
}
[hidden] { display: none !important; }
h1, h2, h3 { font: 400 1.9rem/.95 Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .01em; margin: 0 0 .5em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.1rem; letter-spacing: .03em; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
.eyebrow { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3em; color: var(--gull); margin: 0 0 .9rem; }
.dis { color: var(--dis); }
.liten { font-size: .85rem; }

/* Truck-art-kant: tre fargede trekanter på rad */
.kant { display: block; height: 10px; margin: 0 0 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='10' viewBox='0 0 60 10'%3E%3Cpath d='M0 10 10 0 20 10z' fill='%23f2543f'/%3E%3Cpath d='M20 10 30 0 40 10z' fill='%23e3b341'/%3E%3Cpath d='M40 10 50 0 60 10z' fill='%2335a054'/%3E%3C/svg%3E") repeat-x 0 0 / 60px 10px; }

/* Innlogging */
.innlogging { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.innlogging__kort { width: min(100%, 380px); background: var(--kull); border: 1px solid var(--kant); border-radius: 20px; padding: 0 22px 26px; overflow: hidden; }
.innlogging__kort .kant { margin: 0 -22px 24px; }
.innlogging__logo { width: 190px; height: auto; background: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 20px; }

/* Ramme */
#app { max-width: 600px; margin: 0 auto; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.topp { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
.topp img { width: 108px; height: auto; background: #fff; border-radius: 9px; padding: 4px 8px; }
.topp__merke { font: 400 1rem Anton, Impact, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--gull); }
#visning { padding: 6px 16px 0; outline: none; }
#visning > h2:first-child { margin-top: 6px; }

.fane { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 600px; margin: 0 auto; background: rgba(16,18,12,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--kant);
  padding-bottom: env(safe-area-inset-bottom); }
.fane button { position: relative; min-height: var(--nav-h); background: none; border: 0; color: var(--dis-svak); display: grid; place-items: center; align-content: center; gap: 3px; cursor: pointer; font-size: .7rem; font-weight: 600; letter-spacing: .04em; }
.fane svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fane button[aria-current="page"] { color: var(--gull); }
.fane button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--gull); border-radius: 0 0 3px 3px; }
.fane b { position: absolute; top: 8px; left: calc(50% + 10px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--chili); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; }

/* Knapper */
.knapp { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 22px; border: 1.5px solid var(--kant); border-radius: 12px; background: var(--kull-2); color: var(--kritt); font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s, background .15s; }
.knapp:active { transform: scale(.98); }
.knapp--chili { background: var(--chili); border-color: var(--chili); color: #fff; }
.knapp--gronn { background: var(--gronn); border-color: var(--gronn); color: #04130a; }
.knapp--stor { width: 100%; min-height: 58px; font-size: 1.08rem; }
.knapp--liten { min-height: 38px; padding: 0 14px; font-size: .88rem; border-radius: 10px; }
.knapp--tekst { background: none; border-color: transparent; color: var(--gull); padding: 0 6px; min-height: 36px; }
.knapp--fare { color: #ff8a7a; }
.knapp[disabled] { opacity: .5; pointer-events: none; }
.rad { display: flex; gap: 10px; }
.rad > * { flex: 1; }
.rad--auto > * { flex: none; }

/* Skjemafelt */
.felt { display: block; margin: 0 0 14px; }
.felt > span, .etikett { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--gull); margin: 0 0 6px; }
.felt small { display: block; margin-top: 5px; color: var(--dis-svak); font-size: .8rem; }
input, textarea, select { width: 100%; min-height: 52px; padding: 12px 14px; background: var(--kull); border: 1.5px solid var(--kant); border-radius: 12px; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--gull); }
textarea { resize: vertical; min-height: 78px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #67635a; }
input[type="date"], input[type="time"] { min-height: 52px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gull) 50%), linear-gradient(135deg, var(--gull) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.feilmelding { min-height: 1.4em; margin: 0 0 12px; color: #ff8a7a; font-weight: 500; }

/* Kort og lister */
.kort { background: var(--kull); border: 1px solid var(--kant); border-radius: var(--rad); padding: 14px 16px; margin: 0 0 12px; }
.kort--trykk { width: 100%; text-align: left; cursor: pointer; display: block; }
.kort--trykk:active { background: var(--kull-2); }
.kort h3 { margin: 0 0 4px; }
.kort__topp { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kort__sum { font: 400 1.3rem/1 Anton, Impact, sans-serif; color: var(--gull-lys); white-space: nowrap; letter-spacing: .02em; }
.linje { display: flex; gap: 8px; align-items: baseline; margin: 2px 0; font-size: .93rem; color: var(--dis); }
.linje b { color: var(--kritt); font-weight: 500; }
.merke { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid currentColor; }
.merke--gull { color: var(--gull); } .merke--gronn { color: var(--gronn-lys); } .merke--chili { color: var(--chili); }
.tom { text-align: center; padding: 38px 10px; color: var(--dis); }
.tom b { display: block; font: 400 1.4rem Anton, Impact, sans-serif; text-transform: uppercase; color: var(--kritt); margin-bottom: 4px; }

/* Valgt bedrift og avtale */
.valgt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; background: var(--kull); border: 1.5px solid var(--kant); border-radius: var(--rad); cursor: pointer; margin-bottom: 14px; }
.valgt--tom { border-style: dashed; border-color: var(--gull); color: var(--gull-lys); min-height: 66px; font-weight: 600; font-size: 1.05rem; }
.valgt b { display: block; font-size: 1.08rem; }
.valgt small { color: var(--dis); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { min-height: 46px; padding: 0 16px; border-radius: 99px; background: var(--kull); border: 1.5px solid var(--kant); cursor: pointer; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--gull); border-color: var(--gull); color: #1a1405; font-weight: 600; }
.chip--ny { border-style: dashed; color: var(--gull); }

/* Antall */
.antall { display: grid; grid-template-columns: 62px 1fr 62px; gap: 10px; margin-bottom: 14px; }
.antall button { min-height: 64px; font-size: 1.8rem; border-radius: 14px; background: var(--kull-2); border: 1.5px solid var(--kant); cursor: pointer; color: var(--gull); }
.antall button:active { background: var(--gull); color: #000; }
.antall input { min-height: 64px; text-align: center; font: 400 2.2rem Anton, Impact, sans-serif; letter-spacing: .02em; }
.sumkort { background: linear-gradient(135deg, var(--gronn-dyp), #11361f); border: 1px solid rgba(111,240,148,.28); border-radius: var(--rad); padding: 14px 16px; margin-bottom: 14px; }
.sumkort__rad { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sumkort b { font: 400 2rem/1 Anton, Impact, sans-serif; color: var(--gronn-lys); letter-spacing: .02em; }
.sumkort p { margin: 4px 0 0; color: #b7d9c2; font-size: .88rem; }
.stikk { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); padding-top: 10px; background: linear-gradient(transparent, var(--natt) 28%); margin-top: 8px; z-index: 5; }

/* Ark (bunnpanel) */
.ark { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.66); display: flex; align-items: flex-end; justify-content: center; animation: inn .15s ease-out; }
.ark__panel { width: min(100%, 600px); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--natt); border: 1px solid var(--kant); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); animation: opp .22s cubic-bezier(.22,.61,.36,1); }
.ark__topp { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 16px 0 10px; margin-bottom: 6px; background: var(--natt); }
.ark__topp h2 { margin: 0; }
.ark__lukk { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--kant); background: var(--kull); color: var(--dis); font-size: 1.3rem; cursor: pointer; }
.ark--full .ark__panel { max-height: none; height: 100dvh; border-radius: 0; border: 0; display: flex; flex-direction: column; }
@keyframes opp { from { transform: translateY(40px); opacity: .4; } }
@keyframes inn { from { opacity: 0; } }

/* Avtalevalg */
.avtaler { display: grid; gap: 8px; margin-bottom: 14px; }
.avtale { text-align: left; padding: 12px 14px; background: var(--kull); border: 1.5px solid var(--kant); border-radius: 12px; cursor: pointer; }
.avtale b { display: block; font-weight: 600; }
.avtale small { color: var(--dis); }
.avtale[aria-pressed="true"] { border-color: var(--gull); background: #211e0e; }
.avtale[aria-pressed="true"] b { color: var(--gull-lys); }
details.mer { margin: 4px 0 14px; border: 1px solid var(--kant); border-radius: 12px; padding: 0 14px; }
details.mer summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; color: var(--gull); font-weight: 600; list-style: none; }
details.mer summary::-webkit-details-marker { display: none; }
details.mer[open] { padding-bottom: 4px; }
.forslag { display: grid; gap: 6px; margin: -6px 0 14px; }
.forslag button { text-align: left; padding: 10px 14px; background: var(--kull-2); border: 1.5px solid var(--kant); border-radius: 12px; cursor: pointer; }
.forslag small { display: block; color: var(--dis); }

/* Signatur */
.sign { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sign__flate { position: relative; flex: 1; min-height: 190px; max-height: 340px; background: #fffdf7; border-radius: 14px; border: 3px solid var(--gull); margin-bottom: 12px; touch-action: none; }
.sign__flate canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sign__tips { position: absolute; left: 16px; right: 16px; bottom: 34px; border-bottom: 1.5px solid #cfc7b0; pointer-events: none; }
.sign__tips::before { content: "×"; position: absolute; left: 0; bottom: 3px; color: #b0a78d; font-size: 1.4rem; }
.sign__hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #9a917a; font-size: .8rem; pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 80; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 12px; background: var(--gull); color: #1a1405; font-weight: 600; opacity: 0; pointer-events: none; transition: .22s; }
.toast.vis { opacity: 1; transform: translate(-50%, 0); }
.toast--feil { background: var(--chili); color: #fff; }

.maaned { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px; margin-bottom: 16px; }
.maaned button { min-height: 52px; border-radius: 12px; background: var(--kull-2); border: 1.5px solid var(--kant); font-size: 1.3rem; color: var(--gull); cursor: pointer; }
.maaned strong { text-align: center; font: 400 1.5rem Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.seksjon { margin: 22px 0 10px; }
@media (min-width: 700px) { body { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.signrad > :first-child { flex: 0 0 34%; }
.signrad > :last-child { flex: 1; white-space: nowrap; }

/* Retter på ordren */
.linjer { margin-bottom: 8px; }
.linjerad { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 8px; background: var(--kull); border: 1px solid var(--kant); border-radius: 12px; }
.linjerad__navn b { display: block; font-weight: 600; }
.linjerad__navn small { color: var(--dis); }
.mini { display: flex; align-items: center; gap: 4px; flex: none; }
.mini button { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--kant); background: var(--kull-2); color: var(--gull); font-size: 1.4rem; cursor: pointer; }
.mini button:active { background: var(--gull); color: #000; }
.mini span { min-width: 38px; text-align: center; font: 400 1.5rem Anton, Impact, sans-serif; }
.linje--retter { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.linje b { white-space: pre-line; }

/* Rettvelger */
.chips--rull { flex-wrap: nowrap; overflow-x: auto; margin: 12px -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
.chips--rull::-webkit-scrollbar { display: none; }
.chips--rull .chip { flex: none; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--kull); border: 1.5px solid var(--kant); border-radius: 14px; overflow: hidden; }
.tile--valgt { border-color: var(--gull); background: #211e0e; }
.tile__hoved { flex: 1; min-height: 88px; padding: 12px 14px; background: none; border: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.tile__hoved b { font-weight: 600; line-height: 1.25; }
.tile__hoved small { color: var(--gull-lys); }
.tile__hoved:active { background: rgba(227,179,65,.15); }
.tile__teller { position: absolute; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 2px; background: var(--gull); color: #1a1405; border-radius: 99px; padding: 2px; }
.tile__teller span { min-width: 26px; text-align: center; font: 400 1.15rem Anton, Impact, sans-serif; }
.tile__teller button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.14); color: #1a1405; font-size: 1.2rem; cursor: pointer; }
.stikk--ark { bottom: 0; background: linear-gradient(transparent, var(--natt) 30%); padding-bottom: 4px; }

/* Nettbrett og større skjermer */
.to-kol { display: block; }
@media (min-width: 900px) {
  #app { max-width: 1280px; }
  .fane { max-width: none; }
  #visning { padding: 6px 28px 0; }
  #visning[data-fane="bedrifter"], #visning[data-fane="rapport"] { max-width: 760px; margin: 0 auto; }
  .to-kol { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: start; }
  .to-kol > .side { position: sticky; top: 12px; max-height: calc(100dvh - var(--nav-h) - 40px); overflow-y: auto; padding-right: 4px; }
  .ark { align-items: center; }
  .ark__panel { width: min(100%, 860px); border-radius: 22px; border-bottom: 1px solid var(--kant); max-height: 90dvh; }
  .ark--full .ark__panel { height: auto; max-height: 90dvh; border-radius: 22px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .chips--rull { margin: 12px 0 14px; padding: 0 0 4px; flex-wrap: wrap; }
  .antall button, .chip, .knapp { min-height: 56px; }
  .sign__flate { max-height: 380px; }
}
@media (min-width: 600px) and (max-width: 899px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
