/* ---------- Gemensamma byggstenar ---------- */
.view { flex: 1 1 auto; min-width: 0; }
.page, .home { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; letter-spacing: -.4px; }
.page-head .pill-btn { margin-left: auto; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.block.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.block-head h3 { font-size: 16px; display: flex; align-items: center; gap: 7px; }
.block-head h3 svg.i { width: 16px; height: 16px; color: #FFD60A; }
.block-head h3 .mini-ic svg.i, .shop-group h3 svg.i { color: inherit; }
.shop-group h3 > svg.i { color: var(--accent); }
.block-head .muted { font-size: 13px; }
.block-head .row-gap { margin-left: auto; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }
kbd { font-family: var(--font); font-size: 11px; color: inherit; opacity: .7; border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; }

.bar { height: 6px; background: var(--card-raised); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 6px; transition: width .4s; }

.pill-btn, .ghost-btn, .big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font: inherit; font-weight: 600; border: none; text-decoration: none; white-space: nowrap;
}
.pill-btn { height: 32px; padding: 0 13px; border-radius: 9px; font-size: 13px; background: var(--card-raised); color: var(--text); }
.pill-btn svg.i { width: 15px; height: 15px; }
.pill-btn:hover { filter: brightness(1.2); }
.pill-btn.primary { background: var(--accent); color: #fff; }
.pill-btn.green { background: var(--green); color: #000; }
.pill-btn.on { background: rgba(255,214,10,.16); color: #FFD60A; }
.pill-btn.running { background: var(--orange); color: #000; font-variant-numeric: tabular-nums; }
.pill-btn.danger { color: var(--red); }
.pill-btn:disabled { opacity: .6; cursor: progress; }
.ghost-btn { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; background: none; color: var(--text-2); }
.ghost-btn:hover { background: var(--card-raised); color: var(--text); }
.ghost-btn svg.i { width: 15px; height: 15px; }
.ghost-btn.tiny { height: 24px; padding: 0 8px; font-size: 12px; }
.ghost-btn.warn { color: var(--orange); }
.ghost-btn.danger { color: var(--red); }
.big-btn {
  height: 56px; padding: 0 26px; border-radius: 16px; font-size: 18px; letter-spacing: -.2px;
  background: linear-gradient(135deg, #FF6B3D, #FF3D7F); color: #fff;
  box-shadow: 0 10px 30px rgba(255,107,61,.35); transition: transform .15s, box-shadow .15s;
}
.big-btn svg.i { width: 20px; height: 20px; fill: currentColor; }
.big-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(255,107,61,.45); }
.big-btn.green { background: linear-gradient(135deg, #30D158, #28B04A); color: #000; box-shadow: 0 10px 30px rgba(48,209,88,.3); }
.big-btn.green svg.i { fill: none; stroke-width: 2.6; }

.chip {
  height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: none; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 10px; background: var(--card-raised); color: var(--text-2); }
.tag.warn { background: rgba(255,159,10,.15); color: var(--orange); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state svg.i { width: 40px; height: 40px; margin-bottom: 10px; }

/* ---------- Rader: märken ---------- */
.badges { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 5px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-3); background: none; border: none; font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.badge svg.i { width: 13px; height: 13px; }
.badge.week { color: #FFD60A; }
.badge.run { color: var(--orange); animation: pulse 1.4s infinite; }
.badge.steps { background: var(--card-raised); color: var(--text-2); cursor: pointer; }
.badge.steps:hover { color: var(--text); }
.badge.steps.all { color: var(--green); background: var(--green-soft); }
.checklist-item .item-open { opacity: 0; width: 26px; }
.checklist-item:hover .item-open { opacity: .7; }
.checklist-item .item-open:hover { opacity: 1; color: var(--accent); }
.category.flash-cat { animation: flashcat 1.6s ease; }
@keyframes flashcat { 0%, 50% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } }

/* ---------- Hem ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: center;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,107,61,.14), transparent 55%), var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; }
.hero-van { position: relative; cursor: pointer; }
.hero-pct { position: absolute; left: 4%; top: 2%; display: flex; flex-direction: column; }
.hero-pct b { font-size: 34px; letter-spacing: -1px; line-height: 1; }
.hero-pct span { font-size: 12px; color: var(--text-3); }
.hero-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hero-side h2 { font-size: 28px; letter-spacing: -.5px; }
.hero-side .muted { font-size: 15px; max-width: 380px; }
.hero-mini { display: flex; gap: 6px; flex-wrap: wrap; }

.wk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wk-card {
  display: flex; flex-direction: column; gap: 9px; min-height: 150px; padding: 14px;
  border-radius: 14px; background: var(--page); border: 1px solid var(--line-strong);
}
.wk-card.empty {
  align-items: center; justify-content: center; color: var(--text-3); cursor: pointer;
  border-style: dashed; background: none; font: inherit; font-weight: 600; gap: 6px;
}
.wk-card.empty:hover { color: var(--accent); border-color: var(--accent); }
.wk-card.empty svg.i { width: 22px; height: 22px; }
.wk-card.done { border-color: rgba(48,209,88,.4); background: rgba(48,209,88,.06); }
.wk-card.done .wk-text { color: var(--text-3); text-decoration: line-through; }
.wk-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.wk-cat { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-cat svg.i { width: 14px; height: 14px; color: var(--accent); }
.wk-top .icon-btn { opacity: .5; width: 24px; height: 24px; }
.wk-top .icon-btn:hover { opacity: 1; }
.wk-text { font-size: 16px; font-weight: 650; line-height: 1.3; cursor: pointer; }
.wk-text:hover { color: var(--accent); }
.wk-actions { margin-top: auto; display: flex; gap: 6px; align-items: center; }
.done-label { display: flex; align-items: center; gap: 4px; color: var(--green); font-weight: 700; font-size: 13px; }

.days { display: flex; gap: 8px; margin-bottom: 10px; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.day i {
  width: 100%; max-width: 46px; aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 700; font-size: 14px;
  background: rgba(48,209,88, calc(var(--n) * .11)); color: var(--text); border: 1px solid var(--line-strong);
}
.day.today i { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.day.future i { opacity: .35; }
.day span { font-size: 11px; color: var(--text-3); font-weight: 600; }

.mini-row { display: flex; align-items: center; gap: 10px; height: 40px; border-top: 1px solid var(--line); }
.mini-row:first-of-type { border-top: none; }
.mini-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-ic svg.i { width: 14px; height: 14px; }
.mini-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: 14px; }
.mini-text:hover { color: var(--accent); }

/* ---------- Van-bilden ---------- */
.van { width: 100%; height: auto; display: block; overflow: visible; }
.van-body { fill: #232326; stroke: var(--line-strong); stroke-width: 2; }
.van-in { fill: #121214; }
.van-glass { fill: rgba(100,210,255,.12); stroke: rgba(100,210,255,.25); }
.van-line { stroke: var(--line-strong); stroke-width: 2; fill: none; }
.van-light { fill: #FFD60A; opacity: .7; }
.wheel circle { fill: #0b0b0c; stroke: #3a3a3c; stroke-width: 3; }
.wheel .hub { fill: #2c2c2e; }
.zone > * { fill: #2a2a2d; stroke: #48484a; stroke-width: 1.5; transition: fill .5s, stroke .5s; }
.zone .z-line { fill: none; stroke-width: 4; stroke-linecap: round; }
.zone .z-mark { fill: none; stroke: #636366; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zone[data-cid] { cursor: pointer; }
.zone.some > * { fill: rgba(48,209,88, var(--p)); stroke: rgba(48,209,88,.8); }
.zone.full > * { fill: #30D158; stroke: #5ef083; }
.zone.some .z-line, .zone.full .z-line { fill: none; stroke: rgba(48,209,88, max(var(--p, 1), .5)); }
.zone.full .z-line { stroke: #30D158; }
.zone .z-mark { fill: none !important; }
.zone.some .z-mark, .zone.full .z-mark { stroke: #0b3d18; }
.zone.blocked > * { stroke-dasharray: 4 3; }
.zone.none > * { opacity: .35; }
.zone[data-cid]:hover > * { stroke: var(--accent); filter: brightness(1.25); }
.van.big { max-width: 820px; margin: 0 auto; }

.van-block { display: flex; flex-direction: column; gap: 14px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 18px; }
.leg {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 70px 38px; align-items: center; gap: 8px;
  height: 36px; padding: 0 6px; border-radius: 8px; border: none; background: none; color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer; text-align: left; position: relative;
}
.leg:hover { background: var(--card-raised); }
.leg-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.leg-ic svg.i { width: 14px; height: 14px; }
.leg.full .leg-ic { background: var(--green-soft); color: var(--green); }
.leg-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.leg-t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-t em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0; }
.leg-n { font-size: 12px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Byggordning ---------- */
.phases { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.phase { display: grid; grid-template-columns: 70px 1fr; gap: 12px; position: relative; }
.ph-label { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; padding-top: 12px; }
.ph-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ph-card { border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; background: var(--page); }
.ph-card.ready { border-color: rgba(255,107,61,.5); }
.ph-card.blocked { opacity: .72; border-style: dashed; }
.ph-card.done { border-color: rgba(48,209,88,.45); }
.ph-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ph-top .ph-deps { margin-left: auto; width: 24px; height: 24px; flex-shrink: 0; }
.ph-top b { font-size: 13.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-top b:hover { color: var(--accent); }
.ph-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.st { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st svg.i { width: 13px; height: 13px; }
.st.ready { color: var(--accent); }
.st.wait { color: var(--orange); }
.st.done { color: var(--green); }
.deps-pop { width: 300px; max-height: 70vh; overflow: auto; }
.dep-row { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 5px 2px; cursor: pointer; }
.dep-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.dep-row input:disabled + span { opacity: .4; }

/* ---------- Statistik ---------- */
.weeks { display: flex; align-items: flex-end; gap: 8px; height: 130px; }
.wk { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.wk i { width: 100%; max-width: 34px; min-height: 3px; background: linear-gradient(180deg, #30D158, #1f8f3b); border-radius: 6px 6px 3px 3px; }
.wk b { position: absolute; font-size: 11px; color: var(--text-2); bottom: calc(100% - 10px); }
.wk span { font-size: 10.5px; color: var(--text-3); }
.weeks .wk:last-child span { color: var(--accent); font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.stats > div { background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 20px; letter-spacing: -.3px; }
.stats span { font-size: 12px; color: var(--text-3); }

/* ---------- Fokusläge ---------- */
.focus {
  position: fixed; inset: 0; z-index: 400; overflow: auto;
  background: rgba(0,0,0,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; justify-content: center; align-items: flex-start; padding: max(30px, env(safe-area-inset-top)) 16px 40px;
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } }
body.focus-open { overflow: hidden; }
.f-wrap { width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 14px; }
.f-head { display: flex; align-items: center; justify-content: space-between; }
.f-head h3 { font-size: 15px; color: var(--text-2); }
.f-filters { display: flex; flex-direction: column; gap: 8px; }
.f-filters > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.f-filters > div > span { width: 82px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.f-card {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 22px; padding: 24px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: pop .25s cubic-bezier(.2,1.3,.4,1);
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.f-cat { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); font-weight: 600; flex-wrap: wrap; }
.f-cat svg.i { width: 16px; height: 16px; color: var(--accent); }
.f-cat .badge.week { color: #FFD60A; }
.f-text { font-size: 28px; letter-spacing: -.6px; line-height: 1.18; }
.f-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.f-steps { display: flex; flex-direction: column; gap: 2px; }
.f-steps .bar { margin-bottom: 8px; }
.f-step { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.f-step input { width: 20px; height: 20px; accent-color: var(--green); flex-shrink: 0; }
.f-step.done span { color: var(--text-3); text-decoration: line-through; }
.f-step.next { background: var(--accent-soft); font-weight: 650; }
.f-note { font-size: 14px; color: var(--text-2); white-space: pre-wrap; background: var(--page); border-radius: 10px; padding: 10px 12px; }
.f-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.f-actions .big-btn { flex: 1 1 200px; }
.f-actions .pill-btn { height: 44px; border-radius: 12px; font-size: 14px; }
.f-links { display: flex; gap: 4px; flex-wrap: wrap; }
.f-empty { background: var(--card); border-radius: 20px; padding: 40px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; font-size: 17px; }
.f-foot { text-align: center; }

/* ---------- Detaljpanel ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 350; width: min(440px, 100vw);
  background: var(--card); border-left: 1px solid var(--line-strong); box-shadow: -20px 0 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease;
  padding-top: env(safe-area-inset-top);
}
.drawer.in { transform: none; }
.d-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.d-cat { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.d-cat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-cat small { white-space: nowrap; }
.d-cat svg.i { width: 15px; height: 15px; color: var(--accent); }
.d-body { flex: 1; overflow: auto; padding: 16px 18px 30px; display: flex; flex-direction: column; gap: 14px; }
.d-title { display: flex; gap: 10px; align-items: flex-start; }
.d-check { margin-top: 5px; }
.d-check, .d-step input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; flex-shrink: 0; cursor: pointer;
  border: 1.75px solid var(--line-strong); border-radius: 50%; position: relative; background: none;
}
.d-step input[type="checkbox"] { width: 19px; height: 19px; border-radius: 6px; }
.d-check:checked, .d-step input[type="checkbox"]:checked { background: var(--green); border-color: var(--green); }
.d-check:checked::after, .d-step input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 6.5px; top: 3px; width: 5px; height: 10px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.d-step input[type="checkbox"]:checked::after { left: 5.5px; top: 2px; }
.d-text {
  flex: 1; resize: none; overflow: hidden; background: none; border: none; outline: none; color: var(--text);
  font: inherit; font-size: 21px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; padding: 0;
}
.d-text:focus { box-shadow: 0 1.5px 0 var(--accent); }
.d-warn { font-size: 13px; background: rgba(255,159,10,.12); color: #ffc46b; padding: 9px 11px; border-radius: 10px; }
.d-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.d-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.d-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); display: flex; gap: 6px; align-items: baseline; }
.d-sec h4 small { font-size: 12px; color: var(--text-2); }
.d-steps { display: flex; flex-direction: column; }
.d-step { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.d-step .icon-btn { opacity: 0; width: 24px; height: 24px; }
.d-step:hover .icon-btn { opacity: .7; }
.d-step-text { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font: inherit; font-size: 14px; padding: 6px 0; border-bottom: 1px solid transparent; }
.d-step-text:focus { border-bottom-color: var(--accent); }
.d-step.done .d-step-text { color: var(--text-3); text-decoration: line-through; }
.d-step-new { display: flex; gap: 6px; }
.d-step-add, .d-grid input, .d-note, .budget-form input, .pick-search, .in-dest {
  background: var(--page); color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px;
  font: inherit; font-size: 14px; outline: none; padding: 0 11px; height: 36px;
}
.d-step-add { flex: 1; min-width: 0; }
.d-step-add:focus, .d-grid input:focus, .d-note:focus, .budget-form input:focus, .pick-search:focus { border-color: var(--accent); }
.pill-btn.ai { background: linear-gradient(135deg, rgba(255,197,61,.25), rgba(255,107,61,.25)); }
.d-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.d-tags > span { width: 50px; font-size: 12px; color: var(--text-3); }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); position: relative; }
.d-grid label.wide { grid-column: 1 / -1; }
.d-grid em { position: absolute; right: 10px; bottom: 9px; font-style: normal; color: var(--text-3); font-size: 13px; }
.d-link { display: flex; align-items: center; gap: 8px; min-width: 0; }
.d-url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.d-note { height: auto; padding: 9px 11px; resize: none; line-height: 1.45; min-height: 70px; }
.d-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.d-photo { aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--page); cursor: pointer; padding: 0; }
.d-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-photo.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); font-size: 12px; font-weight: 600; border-style: dashed; }
.d-photo.add:hover { color: var(--accent); border-color: var(--accent); }
.d-photo.broken { opacity: .3; }
.d-meta { padding-top: 6px; }
.d-body > .ghost-btn.danger { align-self: flex-start; }

.photo-view { position: fixed; inset: 0; z-index: 450; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; padding: 50px 16px 16px; }
.photo-view img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.pv-bar { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; align-items: center; }

/* ---------- Timer ---------- */
.timer-pill {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 300;
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px; max-width: min(460px, calc(100vw - 100px));
  background: #2a1d05; border: 1px solid rgba(255,159,10,.5); color: var(--text); border-radius: 22px; cursor: pointer;
  font: inherit; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
body.timer-on .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); }
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: pulse 1.4s infinite; flex-shrink: 0; }
.timer-pill .t-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.timer-pill b { font-variant-numeric: tabular-nums; color: var(--orange); }
.timer-pill .t-stop { width: 30px; height: 30px; border-radius: 15px; background: var(--orange); color: #000; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timer-pill .t-stop svg.i { width: 13px; height: 13px; fill: currentColor; }
body.has-tabbar .timer-pill { bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ---------- Handla ---------- */
.budget .b-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.b-nums > div { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.b-nums span { font-size: 12px; color: var(--text-3); }
.b-nums b { font-size: 22px; letter-spacing: -.4px; }
.b-nums .green { color: var(--green); }
.b-nums .red { color: var(--red); }
.b-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--card-raised); margin-top: 14px; }
.b-bar i.spent, .b-legend i.spent { background: var(--green); }
.b-bar i.plan, .b-legend i.plan { background: rgba(255,107,61,.6); }
.b-legend { display: flex; gap: 14px; margin-top: 6px; }
.b-legend span { display: flex; align-items: center; gap: 5px; }
.b-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.budget.over { border-color: rgba(255,69,58,.4); }
.shop-group { padding-top: 12px; padding-bottom: 6px; }
.shop-row { display: flex; align-items: center; gap: 10px; min-height: 46px; border-top: 1px solid var(--line); padding: 4px 0; }
.shop-row .vcheck {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; cursor: pointer;
  border: 1.75px solid var(--line-strong); position: relative;
}
.shop-row .vcheck:checked { background: var(--green); border-color: var(--green); }
.shop-row .vcheck:checked::after { content: ''; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 10px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.shop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.shop-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.shop-text small { font-size: 11.5px; }
.shop-text:hover span { color: var(--accent); }
.shop-row.bought .shop-text span { color: var(--text-3); text-decoration: line-through; }
.money { position: relative; flex-shrink: 0; }
.money input { width: 82px; height: 32px; background: var(--page); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; padding: 0 24px 0 8px; text-align: right; outline: none; }
.money:first-of-type input { width: 58px; }
.money input:focus { border-color: var(--accent); }
.money em { position: absolute; right: 7px; top: 8px; font-style: normal; font-size: 11.5px; color: var(--text-3); pointer-events: none; }

/* ---------- Modal-tillägg ---------- */
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.pick-search { width: 100%; margin-bottom: 8px; }
.pick-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; margin-top: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 6px; border: none; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; border-radius: 8px; cursor: pointer; }
.pick-row:hover { background: var(--accent-soft); }
.pick-row.dim { opacity: .55; }
.pick-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-row .muted { white-space: nowrap; max-width: 34%; overflow: hidden; text-overflow: ellipsis; }
.pick-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); padding: 12px 6px 4px; font-weight: 700; }
.ai-tip { font-size: 13.5px; color: var(--text-2); background: var(--page); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ai-list { display: flex; flex-direction: column; gap: 2px; }
.ai-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; font-size: 14px; cursor: pointer; }
.ai-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.budget-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 700; }

/* ---------- Responsivt ---------- */
@media (max-width: 860px) {
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 280; border-radius: 0; border: none; border-top: 1px solid var(--line);
    background: rgba(18,18,20,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 6px 6px max(6px, env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .tabs button { flex-direction: column; height: 50px; gap: 3px; flex: 1; font-size: 10.5px; padding: 0; }
  .tabs button span { display: block; }
  .tabs button svg.i { width: 21px; height: 21px; }
  .tabs button.on { background: none; box-shadow: none; color: var(--accent); }
  .timer-pill { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
  body.timer-on .toasts { bottom: calc(132px + env(safe-area-inset-bottom)) !important; }
  .layout { padding-bottom: 150px; }
  .hero { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
  .hero-side { align-items: stretch; }
  .hero-side .big-btn { width: 100%; }
  .block.two { grid-template-columns: 1fr; gap: 20px; }
  .wk-grid { grid-template-columns: 1fr; }
  .wk-card { min-height: 0; }
  .budget .b-nums { grid-template-columns: 1fr 1fr; }
  .phase { grid-template-columns: 1fr; gap: 6px; }
  .ph-label { padding-top: 0; }
  .drawer { top: auto; height: 88vh; width: 100vw; border-left: none; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; transform: translateY(100%); padding-top: 0; }
  .drawer.in { transform: none; }
  .d-body { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
  .f-text { font-size: 24px; }
  .f-card { padding: 18px; }
}
@media (max-width: 560px) {
  .page-head h2 { font-size: 22px; }
  .shop-row { flex-wrap: wrap; }
  .shop-text { flex-basis: calc(100% - 40px); }
  .shop-row .link-chip { margin-left: 32px; }
  .shop-row .money:first-of-type { margin-left: auto; }
  .f-filters > div > span { width: 100%; }
  .hero-pct b { font-size: 26px; }
  .d-step .icon-btn { opacity: .5; }
}
@media (hover: none) {
  kbd { display: none; }
  .checklist-item .item-open { opacity: .5; }
  .d-step .icon-btn { opacity: .5; }
}
@media print {
  .tabs, .side, .quick, .add-btn, .overview, .sugg-row, .timer-pill, .drawer, .focus, .view, .badges .badge:not(.steps) { display: none !important; }
  #app { display: block !important; }
}

/* =========================================================
   Projekt: kort i stil med de bästa projektverktygen
   ========================================================= */
.cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cat-main .category-title { flex: none; }
.cat-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 0; font-size: 12px; }
.cat-meta:empty { display: none; }
.st { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.st svg.i { width: 12px; height: 12px; stroke-width: 2.6; }
.st.ready { color: var(--accent); }
.st.wait { color: var(--orange); }
.st.done { color: var(--green); }
.m-chip { display: inline-flex; align-items: center; gap: 3px; height: 19px; padding: 0 7px; border-radius: 10px; background: var(--card-raised); color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.m-chip svg.i { width: 11px; height: 11px; }
.m-chip.money { color: var(--green); background: var(--green-soft); }
.m-next { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 120px; }
.cat-ring {
  --sz: 34px; width: var(--sz); height: var(--sz); border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--card-raised) 0);
  display: flex; align-items: center; justify-content: center;
}
.cat-ring::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--card); }
.cat-ring span { position: relative; font-size: 9.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.cat-ring svg.i { width: 15px; height: 15px; color: var(--green); stroke-width: 2.8; }
.category { transition: border-color .2s, box-shadow .2s; }
.category:hover { border-color: var(--line-strong); }
.category-header { padding: 12px 14px; gap: 12px; }
.category.open .category-header { border-bottom-color: transparent; }
.category-body { padding: 0 14px 12px; }
.category.open .category-body { column-gap: 18px; }
.subcategory { background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 11px; padding: 2px 6px 6px; }
.sub-header { height: 34px; padding: 0 4px; }
.sub-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); }
.sub-label [data-edit] { overflow: hidden; text-overflow: ellipsis; }
.sub-count { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--card-raised); border-radius: 8px; padding: 1px 6px; letter-spacing: 0; text-transform: none; }
.sub-sum { font-size: 11px; font-weight: 600; color: var(--green); letter-spacing: 0; text-transform: none; }
.sub-shop { width: 20px; height: 20px; border-radius: 6px; border: none; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.sub-shop svg.i { width: 12px; height: 12px; stroke-width: 2.2; }
.checklist-item { border-top: none; border-radius: 8px; padding: 6px 4px; background: transparent; transition: background .12s; }
.checklist-item:hover { background: rgba(255,255,255,.045); }
.checklist-item + .checklist-item { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.checklist-item:hover + .checklist-item, .checklist-item:hover { box-shadow: none; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.add-item-row { margin-top: 2px; }
.add-item-input { background: transparent !important; border-color: transparent !important; }
.add-item-input:hover { background: rgba(255,255,255,.03) !important; }
.add-item-input:focus { background: var(--page) !important; border-color: var(--accent) !important; }
.badge.pin { background: none; border: none; cursor: pointer; color: var(--text-3); opacity: 0; padding: 0; width: 22px; }
.checklist-item:hover .badge.pin { opacity: .7; }
.badge.pin:hover { color: #FFD60A; opacity: 1 !important; }
.badge.pin.on { opacity: 1; color: #FFD60A; }
.add-category-btn { border-style: dashed; }

/* Förslag under kolumnerna */
.sugg-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 6px 4px 2px; }
.sugg-lbl { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-3); margin-right: 2px; }
.sugg-lbl svg.i { width: 12px; height: 12px; color: #FFC53D; }
.sugg-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 6px; border-radius: 12px; max-width: 100%;
  border: 1px dashed var(--line-strong); background: none; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sugg-chip svg.i { width: 12px; height: 12px; flex-shrink: 0; }
.sugg-chip:hover { border-style: solid; border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.sugg-chip.ghost { border-color: transparent; color: var(--text-3); }
.sugg-off { width: 22px; height: 22px; margin-left: auto; opacity: 0; }
.subcategory:hover .sugg-off { opacity: .6; }
.sugg-off svg.i { width: 12px; height: 12px; }

/* Översikten överst i Projekt */
.overview { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; padding: 4px 16px 12px; }
.ov-head { display: flex; align-items: baseline; gap: 12px; padding: 10px 0 6px; cursor: pointer; user-select: none; }
.ov-head h2 { font-size: 22px; letter-spacing: -.3px; }
.ov-tog { margin-left: auto; align-self: center; transition: transform .2s; }
.overview.open .ov-tog { transform: rotate(180deg); }
.ov-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px 24px; align-items: center; padding: 6px 0 10px; }
.ov-body .legend { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; }
.ov-body .leg { grid-template-columns: 26px minmax(0, 1fr) 36px 30px; height: 32px; }
.ov-note { grid-column: 1 / -1; }
.ov-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
@container (max-width: 760px) { .ov-body { grid-template-columns: 1fr; } }

/* =========================================================
   Plan: först det här, sedan det här
   ========================================================= */
.callout { display: flex; gap: 14px; align-items: flex-start; border-color: rgba(255,107,61,.4); background: linear-gradient(135deg, rgba(255,107,61,.1), transparent); }
.callout > svg.i { width: 26px; height: 26px; color: var(--accent); }
.callout p svg.i { width: 14px; height: 14px; vertical-align: -2px; }
.steps { list-style: none; display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
.step-rail { display: flex; flex-direction: column; align-items: center; }
.step-rail::after { content: ''; flex: 1; width: 3px; border-radius: 2px; background: var(--line-strong); margin: 6px 0; }
.step:last-child .step-rail::after { display: none; }
.step.done .step-rail::after { background: var(--green); }
.step-num { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; background: var(--card-raised); color: var(--text-2); flex-shrink: 0; }
.step-num svg.i { width: 20px; height: 20px; stroke-width: 3; }
.step.done .step-num { background: var(--green); color: #000; }
.step.now .step-num { background: var(--accent); color: #fff; box-shadow: 0 0 0 6px var(--accent-soft); }
.step-body { padding-bottom: 26px; min-width: 0; }
.step-head { display: flex; align-items: center; gap: 10px; min-height: 40px; margin-bottom: 8px; flex-wrap: wrap; }
.step-head b { font-size: 20px; letter-spacing: -.3px; }
.step.later .step-head b { color: var(--text-2); }
.step.done .step-head b { color: var(--text-3); }
.here { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 10px; }
.step-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.step.later .ph-card { opacity: .78; }
.step.done .ph-card { opacity: .6; }
.ph-card { background: var(--card); transition: border-color .15s, opacity .15s; }
.ph-card:hover { opacity: 1 !important; }
.ph-top, .ph-foot { cursor: pointer; }
.ph-card.open { grid-row: span 2; border-color: var(--accent); opacity: 1 !important; }
.ph-tasks { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.ph-task { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; border-radius: 7px; padding: 0 4px; cursor: pointer; }
.ph-task:hover { background: var(--card-raised); }
.ph-task span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-task .icon-btn { width: 24px; height: 24px; opacity: .5; }
.ph-task .icon-btn:hover { opacity: 1; color: #FFD60A; }
.ph-tasks .ghost-btn { align-self: flex-start; margin-top: 4px; }

/* =========================================================
   Hem: förslag
   ========================================================= */
.h-plain svg.i { color: #FFC53D !important; }
.sugg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sugg-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--page); border: 1px solid var(--line); }
.sugg-card p { font-size: 13.5px; line-height: 1.4; flex: 1; }
.sugg-card .pill-btn { align-self: flex-start; }
.sc-top { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); padding-right: 20px; }
.sc-ic { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--card-raised); color: var(--text-2); }
.sc-ic svg.i { width: 14px; height: 14px; }
.sugg-card.yellow .sc-ic { background: rgba(255,214,10,.15); color: #FFD60A; }
.sugg-card.green .sc-ic { background: var(--green-soft); color: var(--green); }
.sugg-card.blue .sc-ic { background: var(--accent-soft); color: var(--accent); }
.sugg-card.yellow .pill-btn { background: #FFD60A; color: #000; }
.sugg-card.green .pill-btn { background: var(--green); color: #000; }
.sugg-card.blue .pill-btn { background: var(--accent); color: #fff; }
.sugg-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; opacity: .45; }
.sugg-x:hover { opacity: 1; }
.sugg-x svg.i { width: 13px; height: 13px; }
.wk-card.buy { border-color: rgba(48,209,88,.35); }
.wk-buy { display: flex; align-items: center; gap: 6px; border: none; background: var(--green-soft); color: var(--green); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 9px; border-radius: 8px; cursor: pointer; text-align: left; }
.wk-buy svg.i { width: 13px; height: 13px; flex-shrink: 0; }
.app-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-row p { margin-top: 2px; }
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.seg-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.seg-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.seg-card small { font-size: 11.5px; }
.seg-card.blank { border-style: dashed; }
.pin-btn { width: 28px; height: 28px; }
.pin-btn.on, .pin-btn:hover { color: #FFD60A; }

/* =========================================================
   Tooltips och tangenter
   ========================================================= */
.tip {
  position: fixed; z-index: 900; pointer-events: none; max-width: 300px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.35; color: var(--text);
  background: #3a3a3c; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(-2px); transition: opacity .1s, transform .1s;
}
.tip.show { opacity: 1; transform: none; }
.tip-keys { display: inline-flex; gap: 3px; }
.tip kbd, .nav-kbd, .ai-keys kbd {
  font-family: var(--font); font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; opacity: 1;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-bottom-width: 2px; color: var(--text-2);
}

/* =========================================================
   AI-assistenten
   ========================================================= */
.ai-hello p { color: var(--text-2); font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.ai-starters { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ai-starters .sugg-chip { height: 30px; font-size: 13px; padding: 0 12px; }
.ai-msg { max-width: 92%; font-size: 14px; line-height: 1.5; border-radius: 14px; padding: 9px 13px; }
.ai-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.bot p + p, .ai-msg.bot ul + p, .ai-msg.bot p + ul { margin-top: 6px; }
.ai-msg.bot ul { padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.ai-msg.typing { display: flex; gap: 4px; padding: 13px; }
.ai-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: pulse 1s infinite; }
.ai-msg.typing i:nth-child(2) { animation-delay: .2s; } .ai-msg.typing i:nth-child(3) { animation-delay: .4s; }
.ai-acts { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ai-act { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto auto; column-gap: 8px; text-align: left; padding: 7px 9px; border-radius: 9px; border: 1px dashed var(--line-strong); background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ai-act svg.i { width: 15px; height: 15px; grid-row: span 2; align-self: center; color: var(--accent); }
.ai-act small { font-size: 11px; color: var(--text-3); }
.ai-act:hover:not(:disabled) { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.ai-act.added { opacity: .6; border-style: solid; } .ai-act.added svg.i { color: var(--green); }
.tiny-pill { height: 28px; align-self: flex-start; margin-top: 4px; }
.ai-setup { background: rgba(255,197,61,.1); border: 1px solid rgba(255,197,61,.35); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; }
.ai-setup ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ai-setup a { color: #FFD27A; }
.ai-setup code { font-size: 12px; background: rgba(0,0,0,.35); padding: 1px 5px; border-radius: 4px; }

/* =========================================================
   Sidomeny – smal, bara menyn
   ========================================================= */
:root { --side-w: 0px; --top-h: 56px; }
@media (min-width: 861px) { body { padding-left: var(--side-w); } }
.side {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 150; width: max-content;
  display: flex; flex-direction: column; gap: 4px; padding: max(12px, env(safe-area-inset-top)) 8px 10px;
  background: #0c0c0e; border-right: 1px solid var(--line);
}
.side-top { height: 36px; display: flex; align-items: center; padding: 0 8px; margin-bottom: 8px; }
.side-top .brand { font-size: 16px; font-weight: 700; letter-spacing: -.2px; gap: 9px; }
.tabs { display: flex; }
.tabs button { position: relative; display: flex; align-items: center; border: none; background: none; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); background: var(--card-raised); }
.side .tabs { flex-direction: column; gap: 2px; background: none; border: none; padding: 0; }
.side .tabs button { height: 36px; padding: 0 12px 0 10px; gap: 11px; font-size: 13.5px; justify-content: flex-start; border-radius: 9px; color: var(--text-2); }
.side .tabs button svg.i { width: 18px; height: 18px; }
.side .tabs button.on { background: var(--card-raised); color: var(--text); box-shadow: none; }
.side .tabs button.on svg.i { color: var(--accent); }
.side-foot { margin-top: auto; }
.side-toggle { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: none; border-radius: 9px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; cursor: pointer; }
.side-toggle:hover { background: var(--card); color: var(--text); }
.side-toggle svg.i { width: 17px; height: 17px; }
.side-toggle kbd { margin-left: auto; }
body.side-mini .side-txt, body.side-mini .side .tabs button span, body.side-mini .side-toggle span, body.side-mini .side-toggle kbd { display: none; }
body.side-mini .side .tabs button, body.side-mini .side-toggle { justify-content: center; padding: 0; width: 40px; }
body.side-mini .side-top { justify-content: center; padding: 0; }
body.side-mini .side-toggle svg { transform: scaleX(-1); }

/* =========================================================
   Topbar: projekt / sida · info – sökfältet i mitten
   ========================================================= */
.header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 620px) minmax(0, 1fr); align-items: center; gap: 16px; padding: 8px 18px; min-height: var(--top-h); }
.crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; }
.proj { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 9px 0 6px; border: none; border-radius: 9px; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; cursor: pointer; flex-shrink: 0; }
.proj:hover { background: var(--card); color: var(--text); }
.proj-ring { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p, 0) * 1%), var(--card-raised) 0); position: relative; }
.proj-ring::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #000; }
.crumb-sep { color: var(--line-strong); font-size: 18px; }
.page-ic svg.i { width: 18px; height: 18px; color: var(--accent); display: block; }
.page-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.page-txt h1 { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.page-txt span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.top-right .sync { flex: 0 1 auto; margin-right: 6px; overflow: hidden; }
@media (max-width: 1380px) { .top-right .sync span { display: none; } }
body:not([data-view="list"]) #hideDoneBtn { display: none; }

/* =========================================================
   Sökfältet – appens hjärta
   ========================================================= */
.omni { position: relative; }
.omni-field {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--line-strong); cursor: text; transition: border-color .15s, box-shadow .15s;
}
.omni-field:hover { border-color: #4a4a4e; }
.omni.open .omni-field { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.omni-field svg.i { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.omni-field input { flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: none; color: var(--text); font: inherit; font-size: 14.5px; }
.omni-field input::placeholder { color: var(--text-3); }
.omni.open .omni-field kbd { display: none; }
.omni-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 500; max-height: min(70vh, 640px); display: flex; flex-direction: column;
  background: #1d1d20; border: 1px solid var(--accent); border-top: none; border-radius: 0 0 14px 14px; box-shadow: 0 30px 80px rgba(0,0,0,.65); overflow: hidden;
}
.om-list { overflow-y: auto; padding: 6px; }
.om-sec { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.om-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 5px 10px; border: none; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.om-row.sel { background: var(--accent); color: #fff; }
.om-row.sel .om-hint, .om-row.sel .om-ic svg.i { color: rgba(255,255,255,.85); }
.om-row.subtle:not(.sel) { color: var(--text-2); }
.om-row.done .om-label { text-decoration: line-through; color: var(--text-3); }
.om-ic { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--card-raised); flex-shrink: 0; }
.om-row.sel .om-ic { background: rgba(255,255,255,.18); }
.om-ic svg.i { width: 14px; height: 14px; color: var(--text-2); }
.om-row.ai .om-ic { background: rgba(255,197,61,.18); } .om-row.ai .om-ic svg.i { color: #FFD27A; }
.om-row.ai.sel { background: #9B45D0; }
.om-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.om-label mark { background: rgba(255,214,10,.3); color: inherit; border-radius: 3px; }
.om-hint { font-size: 12px; color: var(--text-3); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.om-cat { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.08); }
.om-cat svg.i { width: 12px; height: 12px; }
.om-row kbd { flex-shrink: 0; }
.om-row .om-enter { display: none; }
.om-row.sel .om-enter { display: inline-flex; }
.om-row.sel kbd { border-color: rgba(255,255,255,.4); color: #fff; background: rgba(255,255,255,.12); }
.om-foot { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }
.om-foot span { display: inline-flex; align-items: center; gap: 4px; }
.om-foot kbd, .tip kbd, .om-row kbd, .side-toggle kbd, .dock kbd {
  font-family: var(--font); font-size: 10.5px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; opacity: 1;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 5px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-bottom-width: 2px; color: var(--text-2);
}
.om-flash { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; background: var(--green-soft); color: var(--text); }
.om-flash svg.i { color: var(--green); width: 15px; height: 15px; }
.om-link { border: none; background: none; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; margin-left: auto; }
.om-preset { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.om-preset svg.i { width: 15px; height: 15px; }
.om-x { margin-left: auto; width: 26px; height: 26px; border: none; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.om-x:hover { background: var(--card-raised); color: var(--text); }
.om-x svg.i { width: 14px; height: 14px; }
.om-empty { padding: 18px; color: var(--text-3); font-size: 13px; }
.om-chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.om-chat-head .om-x { margin-left: 0; transform: rotate(-90deg); }
.om-chat-head > svg.i { color: #FFC53D; width: 16px; height: 16px; }
.om-chat-head b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.om-chat-head .muted { flex: 1; }
.om-chat { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
body.omni-open .header { z-index: 450; }

/* =========================================================
   Projekt: tydliga typer och klickbara status-chips
   ========================================================= */
.sub-ic { width: 20px; height: 20px; border-radius: 6px; border: none; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sub-ic svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.sub-ic.task { background: var(--accent-soft); color: var(--accent); }
.sub-ic.buy { background: var(--green-soft); color: var(--green); cursor: pointer; }
.sub-ic.buy:hover { filter: brightness(1.3); }
button.st, button.m-chip, em[data-v="why"] { border: none; font: inherit; cursor: pointer; border-radius: 10px; }
button.st { height: 21px; padding: 0 8px; font-size: 11.5px; font-weight: 600; background: rgba(255,255,255,.05); }
button.st.wait { background: rgba(255,159,10,.14); }
button.st.ready { background: var(--accent-soft); }
button.st:hover, button.m-chip:hover { filter: brightness(1.35); text-decoration: underline; text-underline-offset: 2px; }
.st svg.i { width: 12px; height: 12px; }
.leg-t em { text-transform: none !important; letter-spacing: 0 !important; font-size: 11px !important; padding: 1px 7px; background: rgba(255,159,10,.14); }
.leg-t em:hover { text-decoration: underline; }
.badge.price { background: var(--green-soft); color: var(--green); font-weight: 600; padding: 0 6px; width: auto; }
.checklist-item { cursor: pointer; }
.checklist-item .item-text { cursor: pointer; }

.info-pop { width: 360px; }
.ip-text { font-size: 13px; line-height: 1.45; color: var(--text-2); }
.ip-group { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line-strong); }
.ip-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ip-head .muted { margin-left: auto; }
.ip-row { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; padding: 0 4px; border-radius: 6px; cursor: pointer; }
.ip-row:hover { background: var(--card); }
.vcheck.round { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; cursor: pointer; border: 1.6px solid var(--line-strong); margin: 0; }
.vcheck.round:hover { border-color: var(--green); }
.vcheck.round:checked { background: var(--green); border-color: var(--green); }

/* Byggordning på Hem */
.order .block-head .row-gap { margin-left: auto; }
.order .callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; border: 1px solid rgba(255,107,61,.4); background: linear-gradient(135deg, rgba(255,107,61,.1), transparent); }
.order .callout > svg.i { color: var(--accent); width: 22px; height: 22px; }
.order .step-head b { font-size: 17px; }
.order .step-num { width: 34px; height: 34px; font-size: 15px; }
.order .step { grid-template-columns: 38px minmax(0, 1fr); }
.order .step-body { padding-bottom: 18px; }
.days { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.days-txt { flex-basis: 100%; margin-top: 2px; }

/* =========================================================
   Detaljpanelen: samma panel för allt, olika innehåll per typ
   ========================================================= */
.type-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.type-pill svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.type-pill.task { background: var(--accent-soft); color: var(--accent); }
.type-pill.buy { background: var(--green-soft); color: var(--green); }
.d-head .d-cat { border: none; background: none; color: var(--text-2); font: inherit; cursor: pointer; border-radius: 7px; padding: 3px 6px; }
.d-head .d-cat:hover { background: var(--card-raised); color: var(--text); }
.d-status { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.d-status:empty { display: none; }
.d-sec h4 { display: flex; align-items: center; gap: 7px; }
.d-sec h4 svg.i { width: 15px; height: 15px; color: var(--text-3); }
.d-help { font-size: 12px; color: var(--text-3); margin-top: 8px; line-height: 1.4; }
.d-sum { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); justify-content: flex-end; }
.d-sum b { font-size: 18px; color: var(--text); }
.d-rel { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 3px 6px; border: none; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.d-rel:hover { background: var(--card-raised); }
.d-rel span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-rel small { color: var(--green); font-size: 12px; }
.d-rel > svg.i { width: 14px; height: 14px; color: var(--accent); }
.d-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   Verktygsrad i botten (Anteckningar och Whiteboard)
   ========================================================= */
.dock {
  position: fixed; left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom)); z-index: 200; display: flex; align-items: center; gap: 2px; padding: 5px;
  background: rgba(30,30,33,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.55);
}
.dock button { position: relative; min-width: 38px; height: 38px; padding: 0 9px; display: flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 10px; background: none; color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; }
.dock button svg.i { width: 18px; height: 18px; }
.dock button:hover { background: var(--card-raised); color: var(--text); }
.dock button.on { background: var(--accent); color: #fff; }
.dock button.wide span { font-size: 13px; font-weight: 600; }
.dock button kbd { position: absolute; right: 2px; bottom: 2px; min-width: 0; height: 12px; padding: 0 2px; font-size: 8.5px; border: none; background: none; opacity: .55; }
.dock button.on kbd { color: #fff; }
.dock-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }

/* =========================================================
   Anteckningar
   ========================================================= */
body[data-view="notes"] .layout, body[data-view="board"] .layout { padding: 0; }
.notes-view { height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
.notes-app { display: grid; grid-template-columns: 290px minmax(0, 1fr); height: 100%; }
.nl { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #0b0b0d; }
.nl-head { display: flex; gap: 6px; align-items: center; padding: 12px; }
.nl-search { flex: 1; display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); }
.nl-search svg.i { width: 14px; height: 14px; color: var(--text-3); }
.nl-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; color: var(--text); font: inherit; font-size: 13px; }
.nl-list { overflow-y: auto; padding: 0 8px 20px; }
.nl-sec { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); padding: 12px 8px 6px; }
.nl-sec svg.i { width: 12px; height: 12px; color: #FFC53D; }
.nl-sec small { font-weight: 600; letter-spacing: 0; }
.nl-row { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 9px 10px; border: none; border-radius: 9px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.nl-row:hover { background: var(--card); }
.nl-row.on { background: rgba(255,214,10,.16); }
.nl-row b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.nl-row b svg.i { width: 11px; height: 11px; color: #FFD60A; }
.nl-row span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl-row em { font-style: normal; color: var(--text-2); margin-right: 4px; }
.nl-empty { font-size: 12.5px; color: var(--text-3); padding: 4px 10px; }
.ne { overflow-y: auto; padding: 22px max(28px, calc((100% - 760px) / 2)) 120px; display: flex; flex-direction: column; }
.ne-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.ne-meta .ghost-btn:first-of-type { margin-left: auto; }
.ne-title { border: none; outline: none; background: none; color: var(--text); font: inherit; font-size: 30px; font-weight: 750; letter-spacing: -.6px; padding: 0; margin-bottom: 10px; }
.ne-title::placeholder { color: var(--text-3); }
.ne-body { flex: 1; outline: none; font-size: 16px; line-height: 1.65; color: var(--text); min-height: 50vh; }
.ne-body:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.ne-body h2 { font-size: 23px; letter-spacing: -.3px; margin: 18px 0 6px; line-height: 1.3; }
.ne-body h3 { font-size: 18px; margin: 14px 0 4px; }
.ne-body p { margin: 0 0 6px; }
.ne-body ul, .ne-body ol { padding-left: 24px; margin: 4px 0 8px; }
.ne-body ul.checks { list-style: none; padding-left: 4px; }
.ne-body ul.checks > li { position: relative; padding-left: 28px; }
.ne-body ul.checks > li::before { content: ''; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; border: 1.6px solid var(--line-strong); cursor: pointer; }
.ne-body ul.checks > li[data-done="1"] { color: var(--text-3); text-decoration: line-through; }
.ne-body ul.checks > li[data-done="1"]::before { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' stroke='black' stroke-width='3' fill='none'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--green); }
.ne-body blockquote { border-left: 3px solid #FFD60A; padding: 2px 0 2px 14px; color: var(--text-2); margin: 8px 0; }
.ne-body a { color: var(--accent); }
.ne-body hr { border: none; border-top: 1px solid var(--line-strong); margin: 16px 0; }
.ne-body code { background: var(--card); padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.ne-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-3); }
.ne-empty svg.i { width: 40px; height: 40px; }
.ne-title.static { font-size: 24px; }
.ne-chat { display: flex; flex-direction: column; gap: 10px; }
.notes-dock button.on { background: rgba(255,214,10,.2); color: #FFD60A; }

/* =========================================================
   Whiteboard – oändlig yta
   ========================================================= */
.board-view { position: fixed; left: var(--side-w); right: 0; top: var(--top-h); bottom: 0; }
.wb { position: absolute; inset: 0; overflow: hidden; background-color: #0e0e10; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.2px); outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.wb[data-tool="hand"], .wb.space { cursor: grab; }
.wb.panning { cursor: grabbing; }
.wb[data-tool="note"], .wb[data-tool="text"], .wb[data-tool="rect"], .wb[data-tool="ellipse"], .wb[data-tool="arrow"], .wb[data-tool="draw"] { cursor: crosshair; }
.wb.drop-on { box-shadow: inset 0 0 0 3px var(--accent); }
.wb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.wbi { position: absolute; box-sizing: border-box; }
.wb[data-tool="select"] .wbi { cursor: move; }
.k-note { border-radius: 4px; padding: 16px; box-shadow: 0 8px 22px rgba(0,0,0,.4); color: #1c1c1e; }
.n-yellow { background: #FFE58A; } .n-blue { background: #A9D3FF; } .n-green { background: #B5EFC0; } .n-pink { background: #FFC1D6; } .n-purple { background: #D9C6FF; } .n-gray { background: #DADADF; } .n-ink { background: #f2f2f7; }
.wbi-text { width: 100%; height: 100%; outline: none; font-size: 17px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; }
.wbi-text[contenteditable] { cursor: text; user-select: text; -webkit-user-select: text; overflow: auto; }
.wbi-text:empty::before { content: attr(data-ph); opacity: .45; }
.k-text .wbi-text { color: var(--c); font-size: 22px; font-weight: 600; overflow: visible; }
.k-rect, .k-ellipse { border: 3px solid var(--c); }
.k-ellipse { border-radius: 50%; }
.k-rect { border-radius: 6px; }
.wbi-text.center { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--c); padding: 8px; }
svg.wbi { overflow: visible; }
svg.wbi .hit { pointer-events: stroke; }
svg.wbi path:not(.hit) { pointer-events: none; }
.k-img { margin: 0; border-radius: 8px; overflow: hidden; background: var(--card); box-shadow: 0 8px 22px rgba(0,0,0,.4); }
.k-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.k-img figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.k-color { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: var(--card-raised); font-size: 13px; }
.k-color i { flex: 1; border-radius: 6px; }
.k-link { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--card-raised); border: 1px solid var(--line-strong); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.lk-media { position: relative; flex: 1; min-height: 0; background: #000; }
.lk-media img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.lk-play { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,0,0,.85); display: flex; align-items: center; justify-content: center; }
.lk-play svg.i { fill: #fff; stroke: none; width: 20px; height: 20px; }
.lk-ic { display: none; }
.k-link:not(:has(.lk-media)) { flex-direction: row; align-items: center; gap: 10px; padding: 0 12px; }
.k-link:not(:has(.lk-media)) .lk-ic { display: flex; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); align-items: center; justify-content: center; flex-shrink: 0; }
.lk-txt { display: flex; flex-direction: column; min-width: 0; padding: 8px 0; flex: 1; }
.k-link:has(.lk-media) .lk-txt { padding: 8px 12px; flex: none; }
.lk-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-txt small { font-size: 12px; color: var(--text-3); }
.lk-open { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.lk-open svg.i { width: 14px; height: 14px; }
.k-file { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--card-raised); border: 1px solid var(--line-strong); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.fl-bar { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 10px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.fl-bar svg.i { width: 14px; height: 14px; flex-shrink: 0; }
.fl-bar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-dl { width: 24px; height: 24px; border: none; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fl-dl:hover { background: var(--card); color: var(--text); }
.fl-body { flex: 1; min-height: 0; display: flex; }
.fl-body video, .fl-body iframe, .fl-body img { width: 100%; height: 100%; border: none; background: #000; object-fit: contain; display: block; }
.fl-body pre { margin: 0; padding: 10px 12px; font-size: 11.5px; line-height: 1.45; color: var(--text-2); overflow: auto; width: 100%; white-space: pre-wrap; user-select: text; }
.fl-audio { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; width: 100%; font-size: 13px; }
.fl-audio audio { width: 100%; }
.fl-card { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; text-align: center; font-size: 13px; }
.fl-card small { color: var(--text-3); }
.fl-ext { padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.fl-err { margin: auto; color: var(--text-3); font-size: 12px; }
.wb-selbox { position: absolute; border: calc(1.5px / var(--z, 1)) solid var(--accent); border-radius: 4px; pointer-events: none; }
.wb-h { position: absolute; right: calc(-6px / var(--z, 1)); bottom: calc(-6px / var(--z, 1)); width: calc(12px / var(--z, 1)); height: calc(12px / var(--z, 1)); background: #fff; border: calc(1.5px / var(--z, 1)) solid var(--accent); border-radius: 3px; pointer-events: auto; cursor: nwse-resize; }
.wb-marquee { position: absolute; border: calc(1px / var(--z, 1)) solid var(--accent); background: rgba(255,107,61,.1); }
.wb-draft { position: absolute; border: calc(2px / var(--z, 1)) dashed var(--accent); }
.wb-draft.k-ellipse { border-radius: 50%; }
#wbSel, #wbDraft { position: absolute; left: 0; top: 0; }
.wb-ctx { position: absolute; z-index: 20; display: flex; align-items: center; gap: 2px; padding: 4px; background: rgba(30,30,33,.95); border: 1px solid var(--line-strong); border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.wb-ctx button { height: 30px; min-width: 30px; padding: 0 7px; display: flex; align-items: center; justify-content: center; gap: 5px; border: none; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.wb-ctx button svg.i { width: 15px; height: 15px; }
.wb-ctx button:hover { background: var(--card-raised); color: var(--text); }
.wb-ctx button.danger:hover { color: var(--red); }
.wb-ctx .wb-dot { min-width: 0; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.wb-ctx .wb-dot.on { box-shadow: 0 0 0 2px #fff; }
.wb-ctx .wb-dot:hover { background: var(--c); transform: scale(1.12); }
.wb-zoom { position: absolute; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; padding: 4px; gap: 2px; background: rgba(30,30,33,.92); border: 1px solid var(--line-strong); border-radius: 11px; }
.wb-zoom button { height: 30px; min-width: 30px; padding: 0 6px; border: none; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.wb-zoom button:hover { background: var(--card-raised); color: var(--text); }
.wb-zoom svg.i { width: 15px; height: 15px; }
.wb-empty { position: absolute; inset: 0; margin: auto; width: min(440px, 80%); height: max-content; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--text-3); pointer-events: none; }
.wb-empty svg.i { width: 44px; height: 44px; }
.wb-empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.wb-empty p { font-size: 14px; line-height: 1.5; }
.board-view .dock { position: absolute; left: 50%; }

/* =========================================================
   Mobil
   ========================================================= */
@media (max-width: 860px) {
  .side { display: none; }
  .header { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'crumbs right' 'omni omni'; row-gap: 8px; padding: 8px 12px; }
  .crumbs { grid-area: crumbs; } .top-right { grid-area: right; } .omni { grid-area: omni; }
  .crumb-sep, .proj b, .page-txt span { display: none; }
  .omni.open { position: fixed; inset: 0; z-index: 600; background: #000; padding: max(10px, env(safe-area-inset-top)) 10px 0; display: flex; flex-direction: column; }
  .omni.open .omni-field { border-radius: 11px; box-shadow: none; }
  .omni.open .omni-panel { position: static; flex: 1; max-height: none; border: none; border-radius: 0; background: #000; box-shadow: none; margin-top: 6px; }
  :root { --top-h: 104px; }
  .notes-app { grid-template-columns: 1fr; }
  .nl { display: none; }
  .notes-view .nl:only-child, body.notes-list .nl { display: flex; }
  .ne { padding: 16px 16px 140px; }
  .dock { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 16px); overflow-x: auto; }
  .board-view { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .board-view .dock { bottom: 12px; }
  .wb-zoom { bottom: 70px; right: 10px; }
  .step-cards { grid-template-columns: 1fr; }
  .step { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .info-pop { width: calc(100vw - 16px); }
}
@media (hover: none) { .badge.pin { opacity: .45; } .sugg-off { opacity: .5; } }

.ne-body[contenteditable], .wbi-text[contenteditable] { box-shadow: none !important; }
.dock button.wide { white-space: nowrap; }
.link-pop input.vcheck.round, .info-pop .vcheck.round { width: 16px; height: 16px; padding: 0; border-radius: 50%; background: none; }
.link-pop input.vcheck.round:checked { background: var(--green); }
body[data-view="board"] .toasts, body[data-view="notes"] .toasts { bottom: 84px !important; }
@media (max-width: 860px) { body[data-view="board"] .toasts, body[data-view="notes"] .toasts { bottom: calc(140px + env(safe-area-inset-bottom)) !important; } }
@media (max-width: 860px) {
  .tabs button span { font-size: 0 !important; }
  .tabs button span::after { content: attr(data-short); font-size: 10.5px; }
}
body.omni-open .header { backdrop-filter: none; -webkit-backdrop-filter: none; }
.omni-cancel { display: none; }
@media (max-width: 860px) {
  .om-hint { max-width: 38%; }
  .om-foot, .om-row kbd { display: none !important; }
  .omni.open { flex-direction: column; }
  .omni.open .omni-cancel { display: block; position: absolute; right: 14px; top: max(14px, calc(env(safe-area-inset-top) + 4px)); height: 30px; border: none; background: none; color: var(--accent); font: inherit; font-size: 15px; z-index: 2; }
  .omni.open .omni-field { margin-right: 70px; }
}
@media (max-width: 860px) {
  .notes-app { grid-template-rows: auto minmax(0, 1fr); }
  .notes-app .nl { display: flex !important; max-height: 28vh; border-right: none; border-bottom: 1px solid var(--line); }
  .notes-view { height: calc(100dvh - var(--top-h) - 64px); }
}
.ph-foot .st { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 21px; }
.ph-foot .st svg.i { vertical-align: -2px; }

/* =========================================================
   Projekt: Lista / Tavla
   ========================================================= */
.seg-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--page); border: 1px solid var(--line); margin-left: auto; align-self: center; }
.seg-toggle button { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: none; border-radius: 7px; background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg-toggle button svg.i { width: 15px; height: 15px; }
.seg-toggle button:hover { color: var(--text); }
.seg-toggle button.on { background: var(--card-raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg-toggle + .ov-tog { margin-left: 4px; }

.kanban { display: flex; flex-direction: column; gap: 12px; }
.kb-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kb-filter { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 4px 0 10px; border-radius: 9px; background: var(--card); border: 1px solid var(--line-strong); }
.kb-filter svg.i { width: 14px; height: 14px; color: var(--text-3); }
.kb-filter select { border: none; background: none; color: var(--text); font: inherit; font-size: 13px; height: 30px; outline: none; cursor: pointer; }
.kb-cols { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.kb-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 170px); transition: border-color .15s, background .15s; }
.kb-col.over { border-color: var(--accent); background: #1a2230; }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; cursor: help; flex-wrap: wrap; }
.kb-head b { font-size: 14px; }
.kb-ic { width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.kb-ic svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.kb-wait .kb-ic { background: rgba(255,159,10,.15); color: var(--orange); }
.kb-ready .kb-ic { background: var(--accent-soft); color: var(--accent); }
.kb-doing .kb-ic { background: rgba(255,214,10,.15); color: #FFD60A; }
.kb-done .kb-ic { background: var(--green-soft); color: var(--green); }
.kb-n { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--card-raised); border-radius: 8px; padding: 1px 7px; }
.kb-week { margin-left: auto; }
.kb-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px; overflow-y: auto; }
.kb-card { background: var(--card-raised); border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 11px; display: flex; flex-direction: column; gap: 8px; cursor: grab; user-select: none; -webkit-user-select: none; transition: border-color .12s, transform .12s, opacity .12s; }
.kb-card:hover { border-color: #55555a; }
.kb-card.dragging { opacity: .35; }
.kb-card.armed { transform: scale(1.02); border-color: var(--accent); }
.kb-card.done .kb-text { color: var(--text-3); text-decoration: line-through; }
.kb-top { display: flex; align-items: flex-start; gap: 9px; }
.kb-top .vcheck { margin-top: 2px; }
.kb-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-star svg.i { width: 13px; height: 13px; color: #FFD60A; }
.kb-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kb-cat { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); background: var(--page); border-radius: 6px; padding: 2px 7px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-cat svg.i { width: 12px; height: 12px; flex-shrink: 0; }
.kb-why { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; border: none; border-radius: 8px; padding: 3px 8px; background: rgba(255,159,10,.14); color: var(--orange); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-why svg.i { width: 12px; height: 12px; flex-shrink: 0; }
.kb-why:hover { text-decoration: underline; }
.kb-empty { font-size: 12.5px; color: var(--text-3); padding: 14px 6px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; }
.kb-add { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: none; color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer; }
.kb-add:hover { color: var(--text); border-color: var(--text-3); }
.kb-add svg.i { width: 14px; height: 14px; }
.kb-ghost { position: fixed; left: 0; top: 0; z-index: 800; pointer-events: none; box-shadow: 0 20px 50px rgba(0,0,0,.6); border-color: var(--accent); opacity: .95; }
body.kb-dragging, body.kb-dragging * { cursor: grabbing !important; }
@media (max-width: 1200px) { .kb-cols { grid-template-columns: repeat(4, minmax(240px, 1fr)); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; } .kb-col { scroll-snap-align: start; } }
@media (max-width: 860px) {
  .kb-cols { grid-template-columns: repeat(4, 82vw); }
  .kb-col { max-height: none; }
  .seg-toggle button span { display: none; }
}
