/* app.css — app-specific styles */

/* ==================== app layout ==================== */
.app {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.app-body {
  flex: 1;
  padding: 40px 0 80px;
}

/* ==================== I DAG ==================== */
.today-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.today-greet {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 8px 0 10px;
}
.today-greet .it { font-style: italic; }
.today-greet .ac { color: var(--accent); }
.today-date { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.today-sub { font-size: 17px; color: var(--ink-3); margin: 16px 0 28px; max-width: 44ch; }

.today-empty {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.today-empty .copy h3 { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; }
.today-empty .copy p { margin: 0; color: var(--muted); font-size: 14px; }

.today-done {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 28px;
}
.today-done .h-eyebrow { margin-bottom: 12px; }
.today-scores { display: flex; gap: 32px; margin: 16px 0 24px; }
.today-scores .s { display: flex; flex-direction: column; gap: 2px; }
.today-scores .s .k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.today-scores .s .v { font-family: var(--mono); font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.today-scores .s .v small { font-size: 16px; color: var(--muted-2); margin-left: 2px; }
.today-fields { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--hair); padding-top: 18px; }
.today-fields .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.today-fields .v { font-size: 15px; line-height: 1.5; color: var(--ink-2); }

/* recent list on I dag */
.recent { margin-top: 16px; }
.recent-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.recent-h h3 { font-family: var(--sans); font-weight: 700; font-size: 22px; margin: 0; letter-spacing: -0.025em; }
.recent-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
  align-items: center;
}
.recent-row .d { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.recent-row .w { font-size: 14px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row .ss { display: flex; gap: 4px; font-family: var(--mono); font-size: 11px; }
.recent-row .ss span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; padding: 3px 6px;
  border: 1px solid var(--hair);
  border-radius: 4px;
}
.recent-row .ss span.hi { background: var(--highlight); color: var(--ink); border-color: var(--highlight); font-weight: 600; }

/* ==================== LOGG (kortstokk) ==================== */
.logg-h {
  display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; gap: 16px;
}
.logg-h h2 { font-family: var(--sans); font-weight: 800; font-size: 40px; margin: 0; letter-spacing: -0.035em; }
.logg-h .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 32px; }
.filter {
  background: transparent; border: 1px solid var(--hair); cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--sans); font-size: 13px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter:hover { background: rgba(0,0,0,.03); }
.filter.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter .ct { font-family: var(--mono); font-size: 11px; opacity: .7; }

.deck-stage {
  position: relative;
  min-height: 540px;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 0;
}
.deck {
  position: relative;
  width: 380px;
  height: 480px;
}
.deck-card {
  position: absolute; inset: 0;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), opacity .35s ease;
}
.deck-card.front { z-index: 5; }
.deck-card.behind-1 { transform: translate(10px, 8px) rotate(1.5deg); z-index: 3; opacity: .72; background: var(--paper); }
.deck-card.behind-2 { transform: translate(18px, 16px) rotate(3deg); z-index: 2; opacity: .45; background: var(--paper-2); }
.deck-card.prev { transform: translate(-12px, 6px) rotate(-2deg); z-index: 4; opacity: .8; background: var(--paper); }

.dc-h { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--hair); padding-bottom: 12px; }
.dc-date { font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.dc-no { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; }

.dc-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dc-score {
  border: 1px solid var(--hair); padding: 10px 12px; border-radius: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.dc-score .k { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dc-score .v { font-family: var(--mono); font-size: 24px; line-height: 1; }
.dc-score .v small { font-size: 11px; color: var(--muted-2); }

.dc-field { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.dc-field .lbl { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.dc-field.empty { color: var(--muted-2); font-style: italic; }

.dc-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

.deck-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.deck-nav.l { left: -56px; }
.deck-nav.r { right: -56px; }
.deck-nav button {
  width: 40px; height: 40px;
  border: 1px solid var(--hair);
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--mono); font-size: 16px; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.deck-nav button:hover { background: var(--paper-2); border-color: var(--ink); }
.deck-nav .key { font-family: var(--mono); font-size: 10px; color: var(--muted-2); margin-top: 2px; }

.deck-foot {
  display: flex; justify-content: center; gap: 4px;
  margin-top: 24px;
}
.deck-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hair); }
.deck-foot .dot.on { background: var(--ink); }

/* ==================== POSISJON ==================== */
.pos-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.pos-plot-wrap {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 32px 32px 24px;
  position: relative;
}
.pos-ax-y-label {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.pos-ax-x-label {
  position: absolute;
  bottom: 6px; right: 32px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.pos-plot {
  position: relative;
  aspect-ratio: 1 / 1;
  margin-left: 28px;
  margin-bottom: 28px;
  border-left: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.pos-plot::before, .pos-plot::after {
  content: '';
  position: absolute;
  background: var(--hair-2);
  pointer-events: none;
}
.pos-grid-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, var(--hair-2) 1px, transparent 1px) 0 0/calc(100%/6) 100%,
    linear-gradient(to bottom, var(--hair-2) 1px, transparent 1px) 0 0/100% calc(100%/6);
}
.pos-zone {
  position: absolute;
  border: 1px dashed var(--muted-2);
  border-radius: 12px;
  font-family: var(--sans); font-weight: 500; font-style: italic; font-size: 14px;
  color: var(--muted);
  display: flex; align-items: end; justify-content: end;
  padding: 8px 12px;
  background: rgba(255,255,255,.4);
  pointer-events: none;
}
.pos-dot {
  position: absolute;
  transform: translate(-50%, 50%);
  background: var(--ink-3);
  border-radius: 50%;
  border: 1px solid var(--surface);
  cursor: pointer;
  transition: transform .12s ease;
}
.pos-dot:hover { transform: translate(-50%, 50%) scale(1.4); z-index: 5; }
.pos-dot.recent { background: var(--ink); }
.pos-dot.today { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); z-index: 4; }
.pos-dot.sel { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); z-index: 6; }

.pos-axis-ticks-y, .pos-axis-ticks-x {
  position: absolute;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.pos-axis-ticks-y { left: -22px; top: 0; bottom: 0; display: flex; flex-direction: column-reverse; justify-content: space-between; align-items: end; padding: 2px 0; }
.pos-axis-ticks-x { left: 0; right: 0; bottom: -22px; display: flex; justify-content: space-between; padding: 0 2px; }

.pos-panel {
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 100px;
}
.pos-panel h4 { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.pos-detail {
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 20px;
}
.pos-detail .d { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.pos-detail .h { font-family: var(--sans); font-weight: 700; font-size: 20px; margin: 4px 0 12px; line-height: 1.2; letter-spacing: -0.025em; }
.pos-detail .ss { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.pos-detail .ss .v { font-family: var(--mono); font-size: 18px; }
.pos-detail .ss .k { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pos-detail .q { font-size: 14px; line-height: 1.5; padding-top: 10px; border-top: 1px solid var(--hair); color: var(--ink-2); }

.pos-controls {
  display: flex; gap: 8px; align-items: center; margin-bottom: 16px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--hair);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 14px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
}
.seg button.on { background: var(--ink); color: var(--paper); }

/* ==================== INNSIKT ==================== */
.ins-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 32px;
}
.ins-stat {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 22px;
}
.ins-stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ins-stat .v { font-family: var(--mono); font-size: 44px; line-height: 1; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.ins-stat .v small { font-size: 16px; color: var(--muted-2); margin-left: 2px; }
.ins-stat .d { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ins-stat .spk { margin-top: 14px; }

.ins-sec {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 16px;
}
.ins-sec h3 {
  font-family: var(--sans); font-weight: 700; font-size: 20px;
  margin: 0 0 6px; letter-spacing: -0.025em;
}
.ins-sec .sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 18px; }

.heat {
  display: grid;
  gap: 12px;
}
.heat-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; }
.heat-row .l { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.heat-cells {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 3px;
}
.heat-cells span {
  aspect-ratio: 1;
  background: var(--hair-2);
  border-radius: 2px;
}

.findings { display: flex; flex-direction: column; gap: 14px; }
.finding {
  display: grid; grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--hair);
  align-items: start;
}
.finding:first-of-type { border-top: 0; padding-top: 0; }
.finding .when { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; padding-top: 2px; }
.finding .text { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.finding .text em { font-style: italic; color: var(--accent); font-family: var(--sans); font-weight: 600; }
.finding .text strong { font-weight: 600; color: var(--ink); }

/* ==================== CHECKIN MODAL ==================== */
.check {
  display: flex; flex-direction: column;
  min-height: 320px;
}
.check-q {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 16px 0 8px;
}
.check-q .it { font-style: italic; color: var(--accent); }
.check-hint { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.scale-7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 20px 0 14px;
}
.scale-7 button {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 18px 0;
  font-family: var(--mono); font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  transition: all .12s ease;
}
.scale-7 button:hover { border-color: var(--ink); }
.scale-7 button.on {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.scale-anchors { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }

.check-text {
  width: 100%;
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--sans); font-size: 16px;
  background: var(--surface);
  resize: vertical;
  min-height: 80px;
  margin-top: 16px;
}
.check-text:focus { outline: none; border-color: var(--ink); }

.check-support {
  display: flex; gap: 8px; margin: 16px 0;
}
.check-support button {
  flex: 1; padding: 12px 14px;
  border: 1px solid var(--hair); background: var(--surface); border-radius: 6px;
  font-family: var(--sans); font-size: 14px; color: var(--ink-3);
  cursor: pointer;
}
.check-support button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.step-progress { display: flex; gap: 4px; }
.step-progress i {
  width: 24px; height: 3px;
  background: var(--hair); border-radius: 2px;
}
.step-progress i.on { background: var(--ink); }
.step-progress i.cur { background: var(--accent); }

/* tweaks panel — keep brand-ish */
.tweaks-only { display: none; }

/* footer link-buttons */
.link-btn {
  background: transparent; border: 0; padding: 0;
  color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }

/* responsive */
@media (max-width: 900px) {
  .today-grid { grid-template-columns: 1fr; gap: 32px; }
  .pos-grid { grid-template-columns: 1fr; }
  .pos-panel { position: static; }
  .ins-grid { grid-template-columns: 1fr; }
  .deck { width: 100%; max-width: 360px; }
  .deck-nav.l { left: -16px; }
  .deck-nav.r { right: -16px; }
}
