/* Argolit Tid – en smal mobilkolumn, flikrad längst ner, tumstocksstaplar för timmar. */
:root {
  --bg: #F2F4F3; --surface: #FFFFFF; --ink: #17211D; --muted: #5A6762; --line: #D7DEDA;
  --accent: #1F5C4A; --accent-ink: #FFFFFF; --soft: #E5EDE9; --field: #FFFFFF;
  --tum: #F2C230; --tum2: #E2AC12; --tum-mark: #6E5200; --tum-track: #E9ECEA;
  --danger: #B3261E; --warn: #9A6100; --ok: #2E7D4F;
  --f-display: "Bahnschrift SemiCondensed", "Bahnschrift", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1513; --surface: #18201D; --ink: #E5ECE8; --muted: #9AA8A2; --line: #2B3632;
    --accent: #62BF9C; --accent-ink: #0B1411; --soft: #1F2A26; --field: #121916;
    --tum: #DDB02B; --tum2: #C69816; --tum-mark: #FFE6A0; --tum-track: #232D29;
    --danger: #FF8A80; --warn: #F0B860; --ok: #7BD3A0; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
[hidden] { display: none !important; }
.app { max-width: 640px; margin: 0 auto; padding-block: 12px 120px; display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: 24px; line-height: 1; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 36px; height: 36px; flex: none; border-radius: 9px; background: #1F5C4A; display: grid; place-items: center; }
.logo img { width: 26px; height: 26px; object-fit: contain; display: block; }
.who { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; max-width: 60%; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.menu { position: absolute; right: 0; top: 48px; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.menu-head { display: flex; flex-direction: column; }
.banner { border: 1px solid var(--line); background: var(--soft); border-radius: var(--r); padding: 10px 14px; font-size: 15px; }
.banner.warn { border-color: var(--warn); }

/* cards & fields */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-family: var(--f-display); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
input[type=text], input[type=search], input[type=tel], input[type=date], input[type=month], input[type=number], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); }
textarea { min-height: 96px; resize: vertical; }
.pin { font-size: 28px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 180px; min-width: 0; }
.chip { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper input { text-align: center; font-size: 22px; font-weight: 700; }
.btn { min-height: 48px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 18px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.err { color: var(--danger); font-size: 15px; font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); }

/* tumstock: 10 en-timmessegment */
.rule { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--tum-track); }
.rule span { flex: 1; position: relative; border-right: 1px solid var(--bg); }
.rule span:last-child { border-right: 0; }
.rule span i { position: absolute; inset: 0 auto 0 0; background: var(--tum); }
.rule span:nth-child(even) i { background: var(--tum2); }
.rule span.eight { border-right: 2px solid var(--tum-mark); }
.rulelegend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* rader */
.list { display: flex; flex-direction: column; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry .proj { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.entry .h { font-family: var(--f-display); font-size: 22px; font-weight: 700; text-align: right; }
.entry .note { grid-column: 1 / -1; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.entry .acts { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 8px 0; }

/* vecka */
.weeknav { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; text-align: center; }
.weeknav .btn { padding: 0; font-size: 22px; }
.total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.total b { font-family: var(--f-display); font-size: 44px; line-height: 1; }
.day { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.dayhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dayhead .d { font-weight: 700; }
.tag { margin-left: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-ink); background: var(--accent); padding: 1px 6px; border-radius: 4px; vertical-align: 2px; }
.minientry { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 2px 0 2px 10px; border: 0; border-left: 3px solid var(--line);
  cursor: pointer; background: none; text-align: left; width: 100%; }
.minientry span:first-child { min-width: 0; overflow-wrap: anywhere; }
.minientry:hover { border-left-color: var(--accent); }

/* admin */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-display); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.note { min-width: 200px; color: var(--muted); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.on { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.off { color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-family: var(--f-display); font-size: 28px; line-height: 1.1; }
.adminrow { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.adminrow:first-child { border-top: 0; }
.adminrow .grow { flex: 1 1 200px; min-width: 0; }
.invite { border: 2px dashed var(--accent); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.invite code { display: block; padding: 8px 10px; background: var(--soft); border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.lockbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: var(--soft); }

/* flikar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.tabs .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 6px; }
.tabs button { flex: 1; min-height: 52px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font-family: var(--f-display); font-size: 18px; font-weight: 600; color: var(--muted); }
.tabs button[aria-current="page"] { background: var(--soft); color: var(--ink); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: up .2s ease-out; } @keyframes up { from { transform: translate(-50%, 8px); opacity: 0; } } }

/* inloggning */
.auth { max-width: 420px; margin: 8vh auto 0; width: 100%; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
.auth-logo img { width: min(260px, 70%); height: auto; display: block; }
.auth-logo span { font-family: var(--f-display); font-size: 20px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); padding-left: .3em; }
@media (prefers-color-scheme: dark) { .auth-logo img { filter: invert(1) brightness(.92); } }
.copy { text-align: center; font-size: 12px; color: var(--muted); padding-top: 8px; }

/* snabbval av senaste projekt */
.quick { display: flex; flex-direction: column; gap: 6px; }
.quick:empty { display: none; }
.qp { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; width: 100%; min-height: 52px;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); cursor: pointer; }
.qp b { font-weight: 700; overflow-wrap: anywhere; }
.qp span { font-size: 13px; color: var(--muted); }
.qp[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* projektväljare */
.search input { padding-left: 38px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23888' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.sub { font-family: var(--f-display); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.plist { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--field); }
.plist.scroll { max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pitem { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; min-height: 56px; }
.pitem:first-child { border-top: 0; }
.pitem b { display: block; font-size: 17px; overflow-wrap: anywhere; }
.pitem span { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.pitem.sel { background: var(--soft); box-shadow: inset 4px 0 0 var(--accent); }
details > summary { list-style: revert; }
