/* PRODOC – värit ja isot kosketuskohteet (väh. 48 px) */
:root {
  --o: #1a858f; --o-d: #116770; --o-l: #e5f2f3; --o-b: #a9d3d7; /* petrooli: pääväri */
  --navy: #0f242e;                                               /* tumma ylätunniste */
  --bg: #f7f5f5; --card: #fff; --tx: #1c1d1c; --mut: #6b6f70; --line: #dcd9d4;
  --red: #d32f2f; --green: #2e7d32; --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Rubik, Roboto, "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--tx); font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
a { color: var(--o-d); }
h3 { margin: 0 0 10px; font-size: 17px; }
.muted { color: var(--mut); }
.small { font-size: 13px; }
.empty { padding: 40px 16px; text-align: center; color: var(--mut); }

/* Yläpalkki */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px;
  background: var(--navy); color: #fff; min-height: 68px; border-bottom: 3px solid var(--o); padding: env(safe-area-inset-top) 12px 0;
}
.topbar h1 { flex: 1; font-size: 18px; margin: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .icon-btn { color: #fff; font-size: 26px; text-decoration: none; display: grid; place-items: center; min-width: 48px; min-height: 48px; }
/* Paluupainike: iso osuma-alue ja näkyvä tausta */
.topbar #btnBack { font-size: 44px; line-height: 1; min-width: 60px; min-height: 56px; padding: 0 0 6px; margin-right: 2px; border-radius: 12px; background: rgba(255,255,255,.1); }
.topbar #btnBack:hover, .topbar #btnBack:focus-visible { background: rgba(255,255,255,.22); }
.top-home { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-height: 44px; padding: 0 12px 0 4px; margin-right: 4px; border-right: 1px solid rgba(255,255,255,.18); }
.top-home[hidden], .top-proj[hidden] { display: none; }
.top-home .th-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--o); display: grid; place-items: center; }
.top-home .th-ico .ic { width: 20px; height: 20px; }
.top-home .th-brand { font-weight: 700; letter-spacing: .08em; font-size: 15px; }
.top-home:hover .th-ico { background: #21a0ac; }
.top-proj { display: flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.12); border-radius: 99px; padding: 6px 12px; max-width: 220px; white-space: nowrap; }
.top-proj span { overflow: hidden; text-overflow: ellipsis; }
.top-proj .ic { width: 16px; height: 16px; flex: none; }
.top-proj:hover { background: rgba(255,255,255,.22); }
@media (max-width: 700px) { .top-home .th-brand { display: none; } .top-home { padding-right: 6px; } .top-proj { max-width: 110px; } }
.memo-chip { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--o); color: #fff; text-decoration: none; border-radius: 99px; padding: 11px 18px; display: flex; gap: 8px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-chip .ic { width: 18px; height: 18px; flex: none; }
.auth-brand { margin: 8px 0 4px; } .auth-brand b { display: block; font-size: 22px; letter-spacing: .1em; color: var(--navy); } .auth-brand span { color: var(--mut); font-size: 14px; }
.net { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.2); }
.net.off { background: #7a1c1c; }

main { max-width: 920px; margin: 0 auto; padding: 22px 12px 40px; }
.memo-ed { padding-bottom: 90px; }

/* Painikkeet */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--o-b);
  background: #fff; color: var(--tx); font: inherit; font-size: 16px; cursor: pointer; text-decoration: none;
  user-select: none; -webkit-user-select: none;
}
.btn:active { filter: brightness(.94); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--o); border-color: var(--o); color: #fff; font-weight: 600; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-o { color: var(--red); border-color: #f0c4c4; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.big { min-height: 64px; font-size: 17px; font-weight: 600; flex: 1; padding: 0 8px; }
.btn.wide { width: 100%; margin: 6px 0 12px; }
.btn.sel { background: var(--o-l); border-color: var(--o); }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 8px; color: inherit; }
.icon-btn:disabled { opacity: .3; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Kortit ja listat */
.card { background: var(--card); border-radius: var(--r); padding: 14px; margin: 0 0 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card-head { all: unset; display: flex; width: 100%; align-items: center; justify-content: space-between; cursor: pointer; min-height: 48px; }
.card-head small, .list-row small, .proj-head small { display: block; color: var(--mut); font-size: 13px; margin-top: 2px; }
.card-body { margin-top: 10px; }
.banner { background: var(--o-l); border: 1px solid var(--o-b); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.banner .btn { margin-left: 8px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 10px; padding: 10px 12px; min-height: 56px; }
.list-row.link, a.link { text-decoration: none; color: inherit; justify-content: space-between; }
.list.small { font-size: 13px; color: var(--mut); gap: 2px; }
.h-sec { margin: 18px 4px 8px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: #eceef1; color: var(--mut); white-space: nowrap; font-weight: 600; }
.tag.ok { background: #e3f3e5; color: var(--green); }
.star { border: 0; background: none; font-size: 26px; color: #c4c7cc; min-width: 44px; min-height: 44px; cursor: pointer; }
.star.on { color: var(--o); }
.pager { text-align: center; margin: 10px; }
.memo-item { background: #fff; border-radius: 10px; padding-bottom: 2px; }
.memo-item .sm-actions { padding: 0 10px; margin-top: 0; }

/* Hallintapaneeli */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { background: #fff; border-radius: 20px; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--tx); font-weight: 600; border: 1px solid var(--o-b); }
.tile .ti { font-size: 30px; }

/* Lomakkeet */
.form { display: flex; flex-direction: column; gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--mut); }
.fld input, .fld select, .fld textarea, input.search, select.sort, .att input, .afile input, .sec-title, textarea {
  font: inherit; font-size: 16px; color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 48px; background: #fff; width: 100%;
}
.fld textarea, textarea { min-height: 0; resize: vertical; }
.ro-val { min-height: 48px; padding: 12px 10px; background: #f6f6f7; border-radius: 8px; color: var(--tx); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.chk { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.chk input { width: 24px; height: 24px; accent-color: var(--o); flex: none; }
.chk.sm { min-height: 40px; font-size: 15px; }
.chk.light { color: #fff; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.sub { padding-left: 34px; }
.sub-title { margin-top: 8px; font-weight: 600; }

.embed-warn { background: #fff4d6; border-bottom: 1px solid #f0d58a; padding: 10px 14px; font-size: 15px; text-align: center; }
.embed-warn a { font-weight: 600; margin-left: 6px; }

/* Kirjautuminen */
.auth-wrap { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; padding: 24px 20px; border: 1px solid var(--o-b); }
.auth-card h2 { margin: 6px 0 12px; font-size: 22px; }
.auth-logo { width: 64px; height: 64px; display: block; }
.auth-err { color: var(--red); background: #fdecec; border-radius: 8px; padding: 10px 12px; margin: 0; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.linkbtn { border: 0; background: none; color: var(--o-d); font: inherit; font-size: 15px; cursor: pointer; min-height: 44px; padding: 0; text-decoration: underline; }
.pw { display: flex; gap: 4px; }
.pw input { flex: 1; }
.auth-card .btn.big { flex: none; width: 100%; }

/* Projekti */
.proj-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 10px; }
.tabs a { padding: 12px 14px; border-radius: 10px 10px 0 0; text-decoration: none; color: var(--mut); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--o-d); border-bottom-color: var(--o); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.plan-card { background: #fff; border-radius: var(--r); padding: 8px; }
.plan-thumb { all: unset; display: block; cursor: pointer; width: 100%; aspect-ratio: 4/3; background: #f4f4f4; border-radius: 8px; overflow: hidden; }
.plan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gal { position: relative; background: #fff; border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--tx); }
.gal img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gal small { display: block; padding: 4px 6px; font-size: 12px; }
.logo-box, .sig-box { min-height: 80px; display: flex; align-items: center; padding: 8px; background: #f6f6f7; border-radius: 8px; }
.logo-box img { max-height: 80px; max-width: 260px; }
.sig-box img { max-height: 90px; }

/* Muistion muokkaus */
.memo-proj-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.memo-proj-row .memo-proj { flex: 1; margin-bottom: 0; min-width: 0; }
.memo-docs { flex: none; }
@media (max-width: 560px) { .memo-proj-row { flex-direction: column; } }
.memo-proj { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tx); background: var(--o-l); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; min-height: 52px; }
.memo-proj .lbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--o); border-radius: 6px; padding: 3px 8px; }
.memo-proj b { font-size: 17px; }
.visit { display: grid; grid-template-columns: 2fr 0.6fr 1.3fr; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.visit.times { grid-template-columns: 1fr 1fr; border-top: 0; padding-top: 0; margin-top: 0; }
.visit .fld > span { color: var(--tx); font-weight: 500; }
.visit input { font: inherit; font-size: 16px; color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 48px; background: #fff; width: 100%; cursor: pointer; }
.visit input:focus { border-color: var(--o); outline: none; box-shadow: 0 0 0 2px var(--o-l); }
.visit .tm { display: flex; gap: 6px; }
.visit .tm input { flex: 1; min-width: 0; }
.visit input:not([type]) { cursor: text; }
@media (max-width: 640px) { .visit { grid-template-columns: 0.7fr 1.3fr; } .visit .vtitle { grid-column: 1 / -1; } }
.memo-proj small { display: block; color: var(--mut); font-size: 13px; }
.chev { font-size: 20px; color: var(--mut); padding: 0 6px; }
.att { display: grid; grid-template-columns: 32px 1fr 1fr 1.2fr 44px; gap: 6px; align-items: center; margin-bottom: 6px; }
.att input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--o); }
@media (max-width: 760px) { .att { grid-template-columns: 32px 1fr 44px; } .att input[data-af=company], .att input[data-af=email] { grid-column: 2; } }
.afile { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.afile input[data-atf=name] { flex: 1; min-width: 160px; }
.anum { font-weight: 600; font-size: 14px; color: var(--mut); }
.section { border-left: 4px solid var(--o); }
.section.drag { outline: 3px dashed var(--o); }
.sec-head { display: flex; gap: 4px; align-items: center; }
.sec-title { font-weight: 700; font-size: 17px !important; }
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 4px; }
.toolbar button { min-height: 40px; min-width: 40px; border: 1px solid var(--line); background: #fafafa; border-radius: 8px; font: inherit; font-size: 15px; cursor: pointer; padding: 0 10px; }
.section + .section { margin-top: 22px; } /* asiakohtien väliin tilaa */
.editor { min-height: 180px; line-height: 1.5; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; background: #fff; font-size: 16px; }
.editor:focus { border-color: var(--o); box-shadow: 0 0 0 2px var(--o-l); }
.editor:empty::before { content: attr(data-placeholder); color: #a0a4ab; }
.editor ul, .editor ol { margin: 4px 0; padding-left: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { border: 1px solid var(--o-b); background: var(--o-l); color: var(--o-d); border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; text-align: left; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.photo { display: flex; flex-direction: column; gap: 4px; }
.photo.excluded { opacity: .5; }
.ph-img { all: unset; position: relative; cursor: pointer; display: block; border-radius: 8px; overflow: hidden; background: #eee; aspect-ratio: 4/3; }
.ph-img img, .gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-num { position: absolute; top: 6px; left: 6px; background: var(--red); color: #fff; font-weight: 700; border-radius: 99px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: 14px; padding: 0 6px; border: 2px solid #fff; }
.ph-pin { position: absolute; top: 6px; right: 6px; font-size: 20px; }
.photo textarea { font-size: 14px; padding: 8px; }
textarea.hl { border-color: var(--o); box-shadow: 0 0 0 3px var(--o-l); }
.dictrow { display: flex; align-items: center; gap: 8px; background: #f6f6f7; border-radius: 8px; padding: 4px 8px; margin: 4px 0; }
.dictrow audio { flex: 1; height: 40px; min-width: 0; }
.sec-actions { display: flex; gap: 8px; margin-top: 10px; }
.sm-actions { margin: 6px 0 0; flex-wrap: wrap; }
.drop-hint { font-size: 13px; }
@media (pointer: coarse) { .drop-hint { display: none; } }
.btn.dict { touch-action: none; -webkit-touch-callout: none; background: var(--o-l); border-color: var(--o-b); }
.btn.dict.rec { background: var(--red); color: #fff; border-color: var(--red); transform: scale(1.03); }
.btn.dict.locked { animation: pulse 1.2s infinite; }
.diag { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.diag td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.diag td:first-child { color: var(--mut); width: 45%; }
.diag-out { min-height: 60px; background: #f6f6f7; border-radius: 8px; padding: 12px; font-size: 17px; }
.grid-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.ph-preview img { width: 100%; max-height: 50vh; object-fit: contain; background: #111; border-radius: 8px; }
.phrase-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; margin: 10px 0; }
.phrase { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 12px; font: inherit; cursor: pointer; min-height: 48px; }

/* Kiinteä toimintopalkki */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.status { flex: 1; font-size: 13px; font-weight: 600; }
.status.saved { color: var(--green); }
.status.saving { color: var(--o-d); }
.status.error { color: var(--red); }

/* Sanelukupla */
.dict-bubble { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); width: min(92vw, 520px); z-index: 60; background: #222; color: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.35); pointer-events: none; }
.dict-bubble.cancel { background: #555; }
.dict-bubble.warm { background: #7a4a00; }
.dict-bubble.warm .dict-dot { background: #ffb020; }
.dict-bubble.warm .dict-level { visibility: hidden; }
.dict-state { font-size: 16px; }
.dict-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.btn.dict.warm { background: #ffb020; border-color: #ffb020; color: #1c1d1c; }
.dict-top { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.dict-dot { width: 14px; height: 14px; border-radius: 50%; background: #ff3b30; animation: pulse 1s infinite; }
.dict-bubble.cancel .dict-dot, .dict-bubble.proc .dict-dot { animation: none; background: #999; }
.dict-level { flex: 0 0 60px; height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
.dict-level i { display: block; height: 100%; width: 0; background: #4cd964; transition: width .08s; }
.dict-text { margin: 10px 0 6px; font-size: 17px; min-height: 24px; max-height: 30vh; overflow: hidden; }
.dict-hint { font-size: 12px; opacity: .7; }
@keyframes pulse { 50% { opacity: .3; } }

/* Ilmoitus ja dialogit */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90; background: #2b2f36; color: #fff; padding: 12px 18px; border-radius: 10px; max-width: 92vw; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
.modal-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
.modal.wide { max-width: 860px; }
.modal h2 { margin: 0 0 12px; font-size: 19px; }
@media (min-width: 700px) { .modal-wrap { align-items: center; } .modal { border-radius: 16px; } }
.dlg-msg { font-size: 17px; }
.plan-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-tile { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.plan-tile img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #f4f4f4; }
.anno-tools { flex-wrap: wrap; }
.anno-wrap canvas { width: 100%; max-height: 62vh; object-fit: contain; touch-action: none; background: #111; display: block; }
.sig-wrap canvas { width: 100%; aspect-ratio: 45/16; border: 2px dashed var(--line); border-radius: 8px; touch-action: none; background: #fff; }

/* Pikakuvatila */
.cam-ov { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
.cam-ov video { flex: 1; width: 100%; min-height: 0; object-fit: contain; }
.cam-ov.flash video { opacity: .3; }
.cam-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); color: #fff; }
.cam-count { min-width: 90px; }
.cam-shutter { width: 78px; height: 78px; border-radius: 50%; border: 6px solid #fff; background: #ff3b30; cursor: pointer; }

/* Pohjakuvan katselu */
.plan-ov { position: fixed; inset: 0; z-index: 50; background: #2a2a2a; display: flex; flex-direction: column; }
.plan-bar { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; background: var(--navy); color: #fff; }
.plan-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-hint { background: #000c; color: #fff; text-align: center; padding: 8px; font-size: 15px; }
.plan-vp { flex: 1; position: relative; overflow: hidden; touch-action: none; }
.plan-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; }
.plan-stage img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; background: #fff; }
.plan-mk { position: absolute; inset: 0; }
.mk { position: absolute; transform: translate(-50%, -50%) scale(var(--inv)); width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; border: 3px solid #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.4); cursor: pointer; }
.mk.other { background: #8a8f98; opacity: .85; }
.mk.temp { background: var(--o); animation: pulse 1s infinite; }
.mk.hl { box-shadow: 0 0 0 5px #ffd54f; }
.plan-sheet { background: #fff; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; }
.sheet-row { display: flex; gap: 10px; align-items: flex-start; }
.sheet-row img { width: 110px; height: 82px; object-fit: cover; border-radius: 8px; background: #eee; }
.sheet-row p { margin: 4px 0; font-size: 14px; }

/* Kuvakkeet */
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.btn .ic { width: 19px; height: 19px; }
.btn.big .ic { width: 22px; height: 22px; }
.icon-btn .ic { width: 22px; height: 22px; }
.tile .ti .ic { width: 34px; height: 34px; color: var(--o); }
.tile .ti .ic, .ptile .ti .ic { stroke-width: 1.75; }
.mobile-only { }
@media (pointer: fine) { .mobile-only { display: none !important; } }
@media (pointer: coarse) { .drop-hint { display: none; } }
.btn.o { color: var(--o-d); border-color: var(--o); background: #fff; }
.btn.danger.sm { min-width: 40px; }

/* Tallennuspaikan tila yläpalkissa */
.net.sync { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: #fff; }
.net.sync.busy { background: #8a6d00; }
.net.sync.error { background: #7a1c1c; }
.ws-line { background: var(--o-l); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.ws-line .linkbtn { min-height: 0; font-size: 14px; margin-left: 6px; }

/* Ponnahdusvalikko */
.pop-menu { position: fixed; z-index: 95; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 6px; min-width: 220px; max-width: 92vw; }
.pop-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--tx); min-height: 44px; }
.pop-menu button:hover { background: var(--o-l); }
.pop-menu button:disabled { opacity: .4; cursor: default; background: none; }
.pop-menu button.danger { color: var(--red); }
.pop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Kuvan katselu */
.lightbox { position: fixed; inset: 0; z-index: 96; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; }
.lightbox .lb-cap { color: #fff; margin-top: 10px; text-align: center; }
.lightbox .lb-x { position: absolute; top: 10px; right: 10px; color: #fff; }

/* Kuvat muistiossa */
.chk.xs { min-height: 30px; font-size: 13px; gap: 6px; }
.chk.xs input { width: 18px; height: 18px; }
.ph-img { position: relative; display: block; border-radius: 8px; overflow: hidden; background: #eee; aspect-ratio: 4/3; }
.ph-img img { cursor: zoom-in; }
.ph-more { position: absolute; top: 6px; left: 6px; border: 0; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; width: 38px; height: 30px; display: grid; place-items: center; cursor: pointer; }
.ph-img .ph-num { left: auto; right: 6px; top: 6px; }
.ph-pin { position: absolute; right: 6px; bottom: 6px; top: auto; width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid var(--o); background: #fff; color: var(--o); display: grid; place-items: center; cursor: pointer; font-size: 0; }
.ph-pin .ic { width: 22px; height: 22px; }
.ph-hidden { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 4px 8px; display: flex; gap: 6px; align-items: center; }
.ph-hidden .ic { width: 16px; height: 16px; }

/* Liitetaulukko */
.att-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.att-row { display: grid; grid-template-columns: minmax(160px, 2fr) 90px auto auto auto auto auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: #f7f7f7; }
.att-row.head { background: none; font-weight: 600; font-size: 13px; color: var(--tx); padding: 0 10px; }
.att-name a { color: var(--o-d); text-decoration: none; display: flex; gap: 6px; align-items: flex-start; word-break: break-word; }
.att-name small { display: block; color: var(--mut); font-size: 12px; }
.toggle { border: 1px solid var(--line); border-radius: 8px; min-height: 36px; padding: 0 14px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: var(--mut); }
.toggle.on { background: var(--o); border-color: var(--o); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--o); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--o-d); width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--o); }
.seg button:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) {
  .att-row.head { display: none; }
  .att-row { grid-template-columns: 1fr auto; }
  .att-row .att-name { grid-column: 1 / -1; }
  .att-row .att-date::before { content: 'Lisätty '; color: var(--mut); }
}

/* Projektit */
.seg-tabs { display: inline-flex; border: 1px solid var(--o-b); border-radius: 999px; overflow: hidden; }
.seg-tabs button { border: 0; background: #fff; font: inherit; padding: 0 14px; min-height: 46px; cursor: pointer; display: flex; gap: 6px; align-items: center; color: var(--mut); font-weight: 600; }
.seg-tabs button.on { background: var(--o); color: #fff; }
select.jump { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 48px; background: #fff; }
.proj-switch { font: inherit; font-size: 18px; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; max-width: 100%; min-height: 46px; }
.proj-head small { margin-top: 6px; }
.doc-group h3 { display: flex; gap: 8px; align-items: center; }
.doc a { color: var(--o-d); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; word-break: break-word; }
.font-list { max-height: 55vh; overflow: auto; }

/* Kuvanmuokkain */
.ied { position: fixed; inset: 0; z-index: 85; background: #f2f2f2; display: flex; flex-direction: column; }
.ied-top { display: flex; align-items: center; gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; background: var(--navy); color: #fff; }
.ied-top .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.ied-top .icon-btn { color: #fff; }
.ied-title { margin-left: 6px; }
.ied-main { flex: 1; display: flex; min-height: 0; }
.ied-modes { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #fff; border-right: 1px solid var(--line); }
.ied-modes button { width: 86px; min-height: 76px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--tx); }
.ied-modes button.on { background: #d9d9d9; border-color: #bbb; }
.ied-stage { flex: 1; position: relative; overflow: hidden; touch-action: none; background: #fff; }
.ied-stage canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.ied-bottom { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.ied-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.ied-tools button { display: flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 99px; padding: 8px 12px; font: inherit; font-size: 15px; cursor: pointer; min-height: 42px; color: var(--tx); }
.ied-tools button.on { background: #ddd; }
.ied-colors { display: flex; gap: 8px; }
.ied-colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #ccc; cursor: pointer; }
.ied-colors button.on { outline: 3px solid var(--o); outline-offset: 2px; }
.ied-hint { color: var(--mut); }
.ied-slider { display: flex; align-items: center; gap: 8px; }
.ied-slider input { width: 180px; accent-color: var(--o); }
@media (max-width: 640px) {
  .ied-main { flex-direction: column; }
  .ied-modes { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; overflow-x: auto; }
  .ied-modes button { width: auto; min-width: 72px; min-height: 52px; flex-direction: row; padding: 0 10px; }
  .ied-tools button span { display: none; }
  .ied-title { display: none; }
}

/* Leveät näkymät: etusivu ja projekti kolmella palstalla */
main:has(.home), main:has(.proj-layout), main:has(.mat-wrap) { max-width: 1560px; }
/* Hankinnan lomaketyö koko leveydellä */
main:has(.tp-frame) { max-width: none; padding-left: 8px; padding-right: 8px; }
.home, .proj-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.home-left, .home-right, .proj-left, .proj-right { position: sticky; top: 92px; }
@media (max-width: 1200px) {
  .home, .proj-layout { grid-template-columns: minmax(0, 1fr); }
  .home-left, .home-right, .proj-left, .proj-right { position: static; }
  .home-left, .proj-left { order: 2; } .home-right, .proj-right { order: 3; }
}
.hero { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--o-b); }
.hero h2 { margin: 0 0 2px; font-size: 22px; }
.hero p { margin: 0; }
.proj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.proj-chip { display: inline-flex; gap: 6px; align-items: center; background: #fff; border-radius: 99px; padding: 8px 14px; text-decoration: none; color: var(--tx); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.proj-chip .ic { color: var(--o); }
.pno { color: var(--o-d); font-weight: 600; }
.tag.warn { background: #fff4d6; color: #8a6d00; }
.tag.bad { background: #fde5e5; color: var(--red); }

/* Ilmoitustaulu */
.board h3 { display: flex; gap: 8px; align-items: center; }
.board-new { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.board-new textarea { font-size: 14px; }
.board-new .btn { align-self: flex-end; }
.board-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.board-msg { background: #f7f7f7; border-radius: 10px; padding: 8px 10px; border-left: 3px solid var(--o-b); }
.board-msg.pinned { background: var(--o-l); border-left-color: var(--o); }
.bm-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.bm-head small { color: var(--mut); flex: 1; }
.bm-head .icon-btn { min-width: 32px; min-height: 32px; }
.board-msg p { margin: 4px 0 0; font-size: 14px; white-space: normal; }

/* Kalenteri */
.cal h3, .sched h3 { display: flex; gap: 8px; align-items: center; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 6px 0 10px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--mut); text-transform: uppercase; }
.cal-day { border: 0; background: #f6f6f7; border-radius: 6px; aspect-ratio: 1; font: inherit; font-size: 13px; cursor: pointer; position: relative; }
.cal-day.today { outline: 2px solid var(--o); }
.cal-day.has { background: var(--o); color: #fff; font-weight: 600; }
.cal-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cal-ev { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: #f7f7f7; cursor: pointer; color: inherit; text-decoration: none; }
.cal-ev small { display: block; color: var(--mut); font-size: 12px; }
.cal-date { font-size: 12px; font-weight: 600; color: var(--o-d); min-width: 64px; }
.sched-thumb { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 0; cursor: zoom-in; width: 100%; display: block; overflow: hidden; }
.sched-thumb canvas { width: 100%; display: block; }

/* Projektin dokumentit */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 10px 0; }
.doc-card { position: relative; border: 0; border-radius: 12px; min-height: 150px; padding: 14px; text-align: left; cursor: pointer; font: inherit; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.doc-card:hover { filter: brightness(.98); }
.dc-title { font-size: 18px; font-weight: 500; padding-right: 40px; }
.dc-ico { position: absolute; top: 12px; right: 12px; }
.dc-ico .ic { width: 30px; height: 30px; }
.dc-stats { margin-top: auto; display: flex; gap: 18px; }
.dc-stats span { display: flex; flex-direction: column; }
.dc-stats small { font-size: 11px; color: var(--tx); }
.dc-stats b { font-size: 20px; font-weight: 400; }

/* Dokumenttipaneeli muistion rinnalla */
.doc-panel { position: fixed; z-index: 40; top: 71px; right: 0; bottom: 0; width: 46vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -6px 0 20px rgba(0,0,0,.1); display: flex; flex-direction: column; }
body.doc-split main { margin-right: 46vw; max-width: none; }
body.doc-split .actionbar { right: 46vw; }
@media (max-width: 999px) { .doc-panel { width: 100vw; top: 0; z-index: 60; } }
.dp-head { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--o-l); }
.dp-body { overflow: auto; padding: 10px; }
.dp-view { flex: 1; min-height: 0; display: flex; }
.dp-view iframe { flex: 1; border: 0; width: 100%; }
.dp-view img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
.pv { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pv-tools { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.pv-zoom { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; }
.pv-scroll { flex: 1; overflow: auto; background: #525659; cursor: grab; touch-action: none; user-select: none; }
.pv-scroll.drag { cursor: grabbing; }
.pv-pages { display: inline-flex; flex-direction: column; gap: 12px; padding: 12px; min-width: 100%; box-sizing: border-box; align-items: flex-start; }
.pv-pages canvas { display: block; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.pv-pages .muted { color: #ddd; }
.dp-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.doc-chip { position: fixed; z-index: 45; right: 14px; bottom: 84px; border: 0; border-radius: 99px; background: var(--navy); color: #fff; padding: 10px 16px; font: inherit; display: flex; gap: 8px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }

/* Materiaalien hyväksyttäminen */
.mat-tabs { margin-bottom: 10px; flex-wrap: wrap; }
.mat-top { align-items: flex-start; }
.mat-top .mat-tabs { margin-bottom: 0; }
[data-secadd] { color: var(--o) !important; }
table.mat select.person { min-width: 150px; }
.mat-head h3 { font-size: 16px; }
.mat-sum { display: flex; gap: 8px; margin-top: 8px; }
.mat-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); margin-bottom: 10px; }
table.mat { border-collapse: collapse; min-width: 1500px; font-size: 13px; }
table.mat th { background: #2f6fa7; color: #fff; padding: 6px 4px; font-weight: 600; border: 1px solid #295f8f; position: sticky; top: 0; }
table.mat tr.grp th { background: #3a7fbf; }
table.mat td { border: 1px solid var(--line); padding: 2px; vertical-align: top; background: #fffdf3; }
table.mat td input, table.mat td select, table.mat td textarea { width: 100%; border: 0; background: transparent; font: inherit; font-size: 13px; padding: 6px 4px; min-height: 36px; resize: vertical; }
table.mat td input.num { width: 44px; text-align: center; }
table.mat td textarea { min-width: 150px; }
table.mat td input[type=date] { min-width: 130px; }
table.mat td select { min-width: 150px; }
/* Materiaalitaulukko käyttää koko leveyden (sivupalstat piiloon) */
.proj-layout.focus { grid-template-columns: minmax(0, 1fr); }
.proj-layout.focus .proj-left, .proj-layout.focus .proj-right { display: none; }
table.mat td:nth-child(1) { width: 48px; }
.st { display: inline-block; padding: 6px 8px; border-radius: 6px; font-weight: 600; }
.st.ok { background: #d8f0dc; color: var(--green); }
.st.warn { background: #fff1c7; color: #8a6d00; }
.st.bad { background: #fde0e0; color: var(--red); }

/* Taulukot */
.chk-grid { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tcols { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tcol { display: grid; grid-template-columns: 2fr 80px 150px 1.5fr auto auto auto; gap: 8px; align-items: center; }
.tcol.head { font-size: 13px; font-weight: 600; }
.tcol input, .tcol select, .tsum input, .tsum select { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 42px; background: #fff; width: 100%; }
.tsum { display: grid; grid-template-columns: 1.5fr 140px 2fr 90px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.fld.xs { font-size: 12px; }
@media (max-width: 760px) { .tcol, .tsum { grid-template-columns: 1fr 1fr; } .tcol.head { display: none; } }
.modal.xwide { max-width: 1200px; }
.tbl-body { overflow-x: auto; margin: 8px 0; }
table.tfill { border-collapse: collapse; width: 100%; min-width: 600px; }
table.tfill th { background: var(--o-l); text-align: left; padding: 6px; font-size: 13px; border: 1px solid var(--line); }
table.tfill td { border: 1px solid var(--line); padding: 0; }
table.tfill td input, table.tfill td select { width: 100%; border: 0; font: inherit; padding: 8px; min-height: 40px; background: #fff; }
.h-sub { margin: 14px 0 6px; display: flex; gap: 6px; align-items: center; font-size: 15px; }

/* Pohjaeditorin asetukset */
.tpl-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 16px; align-items: end; }
.tpl-opts .toggle, .tpl-cover .toggle { align-self: flex-start; }
.tpl-cover { border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; padding: 10px 14px; }
.tpl-cover legend { font-size: 12px; color: var(--mut); padding: 0 6px; }
input[type=color] { min-height: 44px; padding: 2px; }

/* Kuva ja pohjakuvaote muistiossa */
.ph-row { display: flex; gap: 8px; align-items: flex-start; }
.ph-row .ph-img { flex: 1; min-width: 0; }
.ph-snip { flex: 0 0 34%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; padding: 0; background: #fff; cursor: pointer; overflow: hidden; }
.ph-snip img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* Raportti */
main:has(.pdf-frame) { max-width: 1400px; }
.pdf-frame { width: 100%; height: calc(100vh - 120px); min-height: 520px; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; background: #525659; }
.cover-opt { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }
.cover-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cover-thumb { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; background: #eee; display: grid; place-items: center; font-size: 12px; color: var(--mut); text-align: center; }
button.gal { border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; }
.font-pick { display: flex; flex-direction: column; gap: 8px; }
.font-opt { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; min-height: 56px; }
.font-opt.on { border-color: var(--o); background: var(--o-l); }
.font-opt input { width: 22px; height: 22px; accent-color: var(--o); flex: none; }
.font-opt span { font-size: 15px; }

/* ---------- Tuloste / esikatselu ---------- */
.print-opts .sub { padding-left: 34px; }
.doc-wrap { background: #fff; max-width: 210mm; margin: 0 auto; box-shadow: 0 2px 12px rgba(0,0,0,.12); padding: 10mm 14mm; overflow-x: auto; }
.doc-loading { padding: 40px; text-align: center; color: var(--mut); }
.screen-head, .screen-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 12px; color: #333; }
.screen-head { border-bottom: 1px solid #333; padding-bottom: 6px; margin-bottom: 14px; text-align: center; }
.screen-head img { max-height: 15mm; max-width: 50mm; }
.screen-foot { border-top: 1px solid #333; padding-top: 6px; margin-top: 18px; align-items: flex-start; }
.doc { font-family: "Noto Sans", Roboto, Arial, sans-serif; font-size: 10.5pt; color: #000; line-height: 1.4; }
.doc h1.doc-title { font-size: 16pt; margin: 0 0 4mm; }
.doc h2 { font-size: 12pt; margin: 6mm 0 2mm; break-after: avoid; page-break-after: avoid; }
.doc table { border-collapse: collapse; }
.doc .meta th, .doc .present th { text-align: left; font-weight: 400; padding: 0.6mm 8mm 0.6mm 0; vertical-align: top; width: 25mm; }
.doc .meta td, .doc .present td { padding: 0.6mm 8mm 0.6mm 0; vertical-align: top; }
.doc hr { border: 0; border-top: .3mm solid #000; margin: 3mm 0; }
.doc .attlist ol { margin: 1mm 0 3mm; padding-left: 0; list-style: none; }
.doc .body p, .doc .body div { margin: 0 0 1.5mm; }
.doc .pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm 8mm; margin: 3mm 0; }
.doc figure.ph { margin: 0; break-inside: avoid; page-break-inside: avoid; text-align: center; }
.doc figure.ph img { width: 100%; max-height: 62mm; object-fit: contain; display: block; margin: 0 auto; }
.doc figure.ph.full { grid-column: 1 / -1; }
.doc figure.ph.full img { max-height: 120mm; }
.doc figcaption { font-size: 9pt; margin-top: 1.5mm; }
.doc .newpage { break-before: page; page-break-before: always; }
.doc .sign { margin-top: 10mm; break-inside: avoid; page-break-inside: avoid; }
.doc .sign img.sig { height: 16mm; display: block; margin: 2mm 0; }
.doc .sig-space { height: 16mm; }
.doc .sig-line { border-top: .3mm solid #000; width: 70mm; }
.doc .sign p { margin: 1mm 0; }
.doc .cover { min-height: 200mm; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 6mm; break-after: page; page-break-after: always; }
.doc .cover-logo { max-height: 30mm; max-width: 90mm; margin: 0 auto; }
.doc .cover-label { letter-spacing: .15em; font-weight: 700; }
.doc .cover h1 { font-size: 22pt; margin: 0; }
.doc .appx { break-before: page; page-break-before: always; text-align: center; }
.doc .appx h2 { text-align: left; }
.doc .appx img { max-width: 100%; max-height: 215mm; object-fit: contain; }
.doc .appx.land { page: landscape; }
.doc .appx.land img { max-height: 135mm; }
.doc .attpage .stamp { text-align: right; font-size: 9pt; font-weight: 700; margin-bottom: 2mm; }
.doc .attpage img { max-height: 220mm; border: .2mm solid #ccc; }
.doc .legend { font-size: 9pt; text-align: left; }
.doc .muted { color: #555; }

/* Osioittainen lomake (asiakas, projekti) */
main:has(.sf), main:has(.ts-wrap), main:has(.ts-month-grid) { max-width: 1400px; }
.sf { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.sf-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 8px; }
.sf-title { font-size: 17px; margin-bottom: 4px; }
.sf-step { display: block; text-decoration: none; color: var(--tx); background: #eef2f6; border-radius: 8px; border-left: 3px solid transparent; padding: 12px 14px; min-height: 58px; }
.sf-step b { display: block; font-weight: 500; }
.sf-step small { display: block; color: var(--mut); font-size: 12px; margin-top: 4px; min-height: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-step.on { background: var(--o-l); border-left-color: var(--o); }
.sf-save { background: #eef2f6; border-radius: 8px; padding: 10px; }
.sf-body .sf-card { scroll-margin-top: 92px; }
.sf-body h4 { margin: 4px 0 6px; font-size: 14px; }
.req { color: var(--red); }
.fld-row { display: flex; gap: 6px; align-items: stretch; }
.fld-row input { flex: 1; min-width: 0; }
.fld-row .btn { white-space: nowrap; }
@media (max-width: 800px) { .sf { grid-template-columns: 1fr; } .sf-nav { position: static; flex-direction: row; overflow-x: auto; } .sf-step { min-width: 150px; } .sf-title, .sf-save { display: none; } }
.cc-row { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.cc-row input { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 44px; min-width: 0; }
@media (max-width: 700px) { .cc-row { grid-template-columns: 1fr 1fr; } }
.cust-card { border-left: 3px solid var(--o); background: var(--o-l); border-radius: 8px; padding: 12px 14px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.cust-card.empty { border-left-color: var(--line); background: #f3f5f7; color: var(--mut); }
.cust-card small { color: var(--mut); }
.cust-ico { width: 38px; height: 38px; border-radius: 9px; background: var(--o-l); color: var(--o); display: grid; place-items: center; flex: none; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 12px; }
.list-row.dim { opacity: .55; }

/* Tuotevalinta ja projektivalinta */
.pk-list { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
.pk-cat { background: #f0f3f6; padding: 8px 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; position: sticky; top: 0; }
.pk-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 12px; font: inherit; cursor: pointer; min-height: 48px; }
.pk-row:nth-child(even) { background: #fafbfc; }
.pk-row:hover { background: var(--o-l); }
.pk-row small { display: block; color: var(--mut); font-style: italic; font-size: 12px; }
.pk-row > span:nth-child(2) { flex: 1; }
.pk-plus { border: 1px solid var(--o-b); border-radius: 6px; width: 30px; height: 26px; display: grid; place-items: center; color: var(--o); flex: none; }
.pk-proj { max-height: 60vh; overflow: auto; }
.pk-p { cursor: pointer; padding: 6px 8px; min-height: 0; }
.pk-p:hover { background: var(--o-l); }
.pk-no { font-weight: 700; min-width: 70px; font-size: 13px; }

/* Tuntikirjaus */
.ts-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ts-head h2 { margin: 0; font-size: 22px; font-weight: 500; }
.ts-nav { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ts-nav input { border: 0; font: inherit; min-height: 44px; padding: 0 6px; }
.ts-user { font: inherit; border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 0 8px; }
.ts-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table.ts { border-collapse: collapse; width: 100%; min-width: 980px; }
table.ts th { background: #f3f4f6; font-weight: 500; padding: 12px 6px; border-left: 1px solid var(--line); font-size: 14px; }
table.ts th.ts-task { text-align: left; padding-left: 14px; width: 30%; }
table.ts th.today { background: var(--o-l); }
table.ts td { border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; text-align: center; vertical-align: middle; }
table.ts td.we, table.ts th.we { background: #f6f6f6; }
table.ts td.ts-task { text-align: left; border-left: 4px solid var(--rc, var(--o)); padding: 6px 10px; }
.ts-cust { display: flex; align-items: center; gap: 6px; }
.ts-cust .eur { width: 18px; height: 18px; border-radius: 50%; background: #6b6f70; color: #fff; display: grid; place-items: center; flex: none; }
.ts-cust .eur .ic { width: 12px; height: 12px; }
.ts-task small { display: block; font-size: 13px; color: var(--tx); margin-top: 2px; }
.ts-task small a { color: #3277b5; text-decoration: none; }
.ts-unpin { margin-left: auto; min-width: 30px; min-height: 30px; opacity: .5; }
.ts-cell { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; }
.ts-in { width: 70px; text-align: center; font: inherit; font-size: 18px; border: 1px solid #cfd4da; border-radius: 6px; padding: 6px 4px; background: #fff; }
.ts-in::placeholder { color: #9aa1a8; }
.ts-cell.has .ts-in { border-color: #8bc34a; box-shadow: 0 0 6px rgba(139,195,74,.45); }
.ts-in:focus { outline: none; border-color: #e0b100; box-shadow: 0 0 6px rgba(224,177,0,.5); }
.ts-cell .ok { color: #43a047; width: 14px; display: grid; }
.ts-cell .ok .ic { width: 14px; height: 14px; }
.ts-note { border: 0; background: none; cursor: pointer; color: #9aa1a8; width: 22px; height: 30px; padding: 0; font-weight: 700; font-size: 16px; opacity: 0; }
.ts-cell:hover .ts-note, .ts-cell:focus-within .ts-note, .ts-note.on { opacity: 1; }
.ts-note.on { color: var(--tx); }
.ts-note .ic { width: 14px; height: 14px; }
@media (pointer: coarse) { .ts-note { opacity: 1; } }
.ts-rt { font-weight: 600; color: var(--mut); }
table.ts tfoot td { padding: 10px 4px; }
table.ts tfoot b { display: block; font-size: 20px; }
table.ts tfoot b.full { color: #2e7d32; }
table.ts tfoot b.part { color: #b26a00; }
table.ts tfoot small { font-size: 11px; color: var(--mut); }
.ts-month-grid { max-width: 760px; }
.tm-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tm-dow { background: #f3f4f6; padding: 8px; font-size: 14px; border-left: 1px solid var(--line); }
.tm-day { border: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: #fff; min-height: 52px; font: inherit; text-align: left; padding: 4px 6px; cursor: pointer; display: flex; gap: 4px; align-items: flex-start; }
.tm-day small { font-size: 11px; font-weight: 700; }
.tm-day b { font-size: 20px; color: #3a6ea5; font-weight: 600; }
.tm-day.we { background: #f6f6f6; }
.tm-day.out { color: #aaa; background: #fbfbfb; }
.tm-day.full { box-shadow: inset 0 0 0 2px #a5d6a7; background: #f1f8e9; }
.tm-day.part { box-shadow: inset 0 0 0 2px #ffcc80; background: #fff8ec; }
.tm-day.today { outline: 2px solid var(--o); outline-offset: -2px; }
.tm-day:hover { background: var(--o-l); }
table.tsum-t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tsum-t th { text-align: left; background: #f3f4f6; padding: 8px; font-weight: 600; }
table.tsum-t td { border-top: 1px solid var(--line); padding: 8px; vertical-align: top; }
table.tsum-t .num { text-align: right; white-space: nowrap; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bar { height: 10px; background: #eceef1; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; background: var(--o); }
.bar span.over { background: var(--red); }
.ex-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ex-row .ex-q { width: 90px; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.dp-head .btn.sm { min-height: 36px; }
.task-item { display: flex; align-items: center; justify-content: space-between; gap: 4px; border-bottom: 1px solid #f0f0f0; }
.task-item .icon-btn { min-width: 36px; min-height: 36px; opacity: .45; }
.task-item:hover .icon-btn { opacity: 1; }
/* Raportit */
main:has(.rep-f) { max-width: 1400px; }
.rep-tabs { margin-bottom: 10px; flex-wrap: wrap; }
.rep-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
@media (max-width: 900px) { .rep-grid { grid-template-columns: 1fr 1fr; } }
table.rep-t tr.sumrow td { font-weight: 700; background: #f7f8f9; }
.rep-total { font-size: 17px; }
.pl-t input { width: 120px; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: right; }
.fld input:disabled { background: #f1f2f4; color: var(--mut); }
/* Laskutus */
main:has(.inv-list), main:has(.inv-form) { max-width: 1300px; }
.inv-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.inv-kpi .card { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.inv-kpi .card b { font-size: 22px; }
.inv-kpi .card small { color: var(--mut); }
.inv-kpi .card.bad b { color: var(--red); }
@media (max-width: 700px) { .inv-kpi { grid-template-columns: 1fr; } }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: var(--o-l); }
td.late { color: var(--red); font-weight: 600; }
.inv-head h2 { margin: 0; font-size: 22px; }
.inv-lines td { vertical-align: top; }
.inv-lines input, .inv-lines textarea { font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; min-width: 0; background: #fff; }
.inv-lines textarea { margin-top: 4px; font-size: 12px; color: var(--mut); resize: vertical; }
.inv-lines td.num input { text-align: right; width: 96px; }
.inv-lines input.sm-in { width: 64px; }
.inv-lines td:first-child { min-width: 280px; }
fieldset:disabled .inv-lines input, fieldset:disabled .inv-lines textarea { background: transparent; border-color: transparent; }
.inv-tot { margin: 12px 0 0 auto; max-width: 360px; }
.inv-tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.inv-tot .big { border-top: 2px solid var(--tx); font-size: 18px; margin-top: 4px; padding-top: 8px; }
.inv-acc { margin: 12px 0; padding: 10px 12px; background: var(--o-l); border-radius: 8px; max-width: 420px; }
.inv-acc div { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; }
.ts-cell.locked .ts-in { background: #f3f4f6; border-color: #cfd4da; box-shadow: none; color: var(--mut); }
.ts-cell.locked .ok { color: var(--mut); }
/* Työaika */
.pos { color: #2e7d32; } .neg { color: var(--red); }
.saldo-chip.pos { color: #2e7d32; } .saldo-chip.neg { color: var(--red); }
table.ts th small.ts-abs { display: block; font-size: 11px; font-weight: 600; color: var(--mut); }
table.ts th small.ts-abs.warn { color: #8a6d00; }
.ts-absadd { display: block; margin: 2px auto 0; font-size: 11px; min-height: 0; color: var(--mut); text-decoration: none; }
.ts-absadd:hover { color: var(--o-d); text-decoration: underline; }
.tm-day i { font-size: 10px; font-style: normal; color: #8a6d00; margin-left: auto; align-self: flex-end; }
.tm-day.abs { background: #fff8e1; }
table.wt-t tr.we td { background: #f6f6f6; color: var(--mut); }
table.wt-t tr.today td { background: var(--o-l); }
table.wt-t tr.dim td { opacity: .5; }
table.wt-t .tag { font-size: 11px; }
.wt-kpi b.pos { color: #2e7d32; } .wt-kpi b.neg { color: var(--red); }
/* Kululaskut */
.exp-rows input, .exp-rows select { font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; min-width: 0; background: #fff; }
.exp-rows td.num input { width: 90px; text-align: right; }
.exp-rows td:nth-child(3) { min-width: 220px; }
.exp-rows td:nth-child(2) select { min-width: 170px; }
.exp-rows .rc { min-height: 0; padding: 2px; }
.exp-rows .rc-x { min-width: 24px; min-height: 24px; }
fieldset:disabled .exp-rows input, fieldset:disabled .exp-rows select { background: transparent; border-color: transparent; appearance: none; }
main:has(.exp-form) { max-width: 1300px; }
/* Tehtävät (kanban) */
main:has(.tk-board), main:has(.rs-t), main:has(.cv-grid), main:has(.cb-list) { max-width: 1400px; }
.tk-bar { margin-bottom: 10px; }
.tk-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 800px) { .tk-board { grid-template-columns: 1fr; } }
.tk-col { background: #eef1f4; border-radius: 10px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.tk-col.over { outline: 2px dashed var(--o); background: var(--o-l); }
.tk-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.tk-card { background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: grab; border-left: 4px solid var(--o); display: flex; flex-direction: column; gap: 4px; }
.tk-card.prio-high { border-left-color: var(--red); }
.tk-card.prio-low { border-left-color: #b0b6bd; }
.tk-card.dragging { opacity: .5; }
.tk-card small { color: var(--mut); font-size: 12px; }
.tk-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--mut); flex-wrap: wrap; }
.tk-meta .ic { width: 13px; height: 13px; vertical-align: -2px; }
.tk-meta .late { color: var(--red); font-weight: 600; }
.tk-who { background: var(--navy); color: #fff; border-radius: 99px; width: 24px; height: 24px; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.tk-move { display: none; gap: 10px; }
.tk-card:hover .tk-move, .tk-card:focus-within .tk-move { display: flex; }
@media (pointer: coarse) { .tk-move { display: flex; } }
.tk-move .linkbtn { font-size: 12px; min-height: 0; }
.tk-empty { text-align: center; padding: 10px; }
.ck-row { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.ck-row .ck-text, .ck-new { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.cal-date.late { color: var(--red); }
/* Resursointi */
table.rs-t { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 14px; }
table.rs-t th { background: #f3f4f6; padding: 8px 6px; font-weight: 500; text-align: center; border-left: 1px solid var(--line); }
table.rs-t th small { display: block; color: var(--mut); font-size: 11px; }
table.rs-t th.today { background: var(--o-l); }
table.rs-t td { border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; text-align: center; }
table.rs-t td:first-child { text-align: left; white-space: nowrap; }
.rs-cell { cursor: pointer; }
.rs-cell i { display: block; font-style: normal; font-size: 11px; color: var(--mut); }
.rs-cell i .ic { width: 11px; height: 11px; }
.rs-t td.low { background: #f5f7fa; } .rs-t td.ok { background: #e8f5e9; } .rs-t td.over { background: #fde5e5; }
.rs-t td small { color: var(--mut); }
tr.rs-proj td { font-size: 12px; color: var(--mut); background: #fcfcfd; }
tr.rs-proj td:first-child { padding-left: 28px; }
.rs-exp { min-height: 0; text-decoration: none; }
.rs-legend { font-size: 12px; color: var(--mut); display: flex; gap: 6px; align-items: center; }
.rs-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.rs-legend i.low { background: #f5f7fa; border: 1px solid var(--line); } .rs-legend i.ok { background: #e8f5e9; } .rs-legend i.over { background: #fde5e5; }
/* Kalenteri */
.cv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .cv-layout { grid-template-columns: 1fr; } }
.cv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.cv-day { min-height: 96px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cv-day:hover { background: var(--o-l); }
.cv-day.we { background: #f7f7f7; } .cv-day.out { opacity: .45; } .cv-day.today { box-shadow: inset 0 0 0 2px var(--o); }
.cv-day > small { font-weight: 700; font-size: 12px; }
.cv-day > small i { font-weight: 500; font-style: normal; color: var(--red); font-size: 10px; }
.cv-it { font-size: 11px; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-it.event { background: #e0f0fa; color: #1a6f95; } .cv-it.task { background: #fff4d6; color: #8a6d00; } .cv-it.absence { background: #f0e6fa; color: #6a5aa8; }
.cv-more { font-size: 11px; color: var(--mut); }
.cal-ev.cv-task .cal-date { color: #8a6d00; } .cal-ev.cv-absence .cal-date { color: #6a5aa8; }
/* Kontaktit */
.cb-contact { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; gap: 2px; }
.cb-contact a { color: var(--o-d); text-decoration: none; }
@media (max-width: 700px) { .cb-contact { display: none; } }
/* Asetukset: hallintapainikkeet */
.set-tiles { margin-bottom: 12px; }
.set-tiles .tile small { display: block; font-size: 12px; color: var(--mut); font-weight: 400; text-align: center; padding: 0 6px; }
/* Valintasirut (asiakasryhmät) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.chip.on { background: var(--o); color: #fff; border-color: var(--o); }
.chip small { opacity: .7; margin-left: 4px; }
.chk-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chk-chip input { width: 16px; height: 16px; }
/* Projektin laskutustiedot */
.bp-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.bp-share { width: 110px; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
/* Raportit: projektien valinta ja kaaviot */
.rep-part .pick { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.rep-part .pick input { width: 20px; height: 20px; }
.rep-part.off { opacity: .5; }
.rep-chart svg { width: 100%; height: auto; display: block; }
.rep-chart .cl { font-size: 12px; fill: var(--tx); }
.rep-chart .cv { font-size: 11px; fill: var(--mut); }
.rep-chart .ca { fill: var(--o); }
.rep-chart .cb { fill: #e0a35a; }
/* Virhe- ja puutelista */
.pl-sum { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 6px; }
.pl-u { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 6px; align-items: start; }
.pl-u input, .pl-u textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; }
.pl-bar { margin: 10px 0; }
.pl-item { border-left: 4px solid #e0a35a; }
.pl-item.fixed { border-left-color: #8bc34a; }
.pl-item.approved { border-left-color: #2e7d32; }
.pl-top { display: flex; gap: 10px; align-items: flex-start; }
.pl-no { font-size: 20px; min-width: 28px; color: var(--o-d); padding-top: 22px; }
.pl-locf { width: 190px; flex: none; }
.pl-dict { margin-top: 22px; }
.pl-mid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: end; margin: 6px 0 6px 38px; }
@media (max-width: 800px) { .pl-top { flex-wrap: wrap; } .pl-locf { width: 100%; } .pl-mid { grid-template-columns: 1fr 1fr; margin-left: 0; } }
.pl-yn { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--mut); }
.pl-yn small { font-size: 11px; }
.yn-btns { display: flex; }
.yn { width: 40px; height: 36px; border: 1px solid #e3a7a7; background: #fff; cursor: pointer; display: grid; place-items: center; color: #c2402f; }
.yn:first-child { border-radius: 6px 0 0 6px; color: #2e7d32; border-color: #a5d6a7; }
.yn:last-child { border-radius: 0 6px 6px 0; }
.yn.on.ok { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.yn.on.bad { background: #c2402f; color: #fff; border-color: #c2402f; }
.yn:disabled { opacity: .55; cursor: default; }
.yn .ic { width: 16px; height: 16px; }
.pl-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 6px 38px; }
.pl-ph { display: flex; gap: 6px; align-items: flex-start; width: min(430px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.pl-ph textarea { flex: 1; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; min-height: 80px; }
.pl-thumb { border: 0; padding: 0; background: none; cursor: zoom-in; flex: none; }
.pl-thumb img { width: 110px; height: 90px; object-fit: cover; border-radius: 6px; display: block; background: #eee; }
.pl-snip { width: auto; flex-direction: column; }
.pl-snip small { font-size: 11px; color: var(--mut); }
.pl-actions { margin-left: 38px; }
@media (max-width: 800px) { .pl-photos, .pl-actions { margin-left: 0; } }
.pl-item.compact { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-left-width: 4px; }
.pl-item.compact .pl-no { padding: 0; font-size: 16px; }
.pl-item.compact .pl-loc { font-weight: 600; min-width: 80px; }
.pl-item.compact .pl-yn { flex-direction: row; align-items: center; }
.pl-item.compact .pl-yn > span { display: none; }
.pm-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #f3f3f3; }
.pm-inner { position: relative; width: 100%; }
.pm-inner img { width: 100%; display: block; cursor: crosshair; }
.pm-dot { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: #d50000; color: #fff; border: 2px solid #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,.4); }



@media print {
  body { background: #fff; }
  .no-print, .topbar, .toast, .actionbar { display: none !important; }
  main { padding: 0; max-width: none; }
  .doc-wrap { box-shadow: none; padding: 0; max-width: none; margin: 0; overflow: visible; }
  .doc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 0.15: resursointi projekteittain, etusivun kaaviot, työaika ja liukuma ---------- */
.rs-tabs { margin-bottom: 12px; }
.rs-chart svg.rs-svg { width: 100%; height: auto; display: block; }
.rs-svg .grid { stroke: #eceef1; } .rs-svg .cv { font-size: 11px; fill: var(--mut); }
.rs-svg .bud { stroke: var(--red); stroke-dasharray: 6 4; stroke-width: 1.5; }
.rs-svg .lp { stroke: var(--o); stroke-width: 2.5; } .rs-svg .la { stroke: #2563eb; stroke-width: 2.5; }
.rs-svg .lp-k { fill: var(--o); } .rs-svg .la-k { fill: #2563eb; }
table.rs-rows select, table.rs-rows input { min-height: 36px; padding: 4px 6px; font: inherit; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
table.rs-rows input[type=number] { width: 90px; text-align: right; }
table.rs-rows td small { color: var(--mut); }
table.rs-plist .bar { margin: 0 0 2px; min-width: 120px; }
.ts-res { color: var(--mut); font-style: normal; } .ts-res.neg { color: var(--red); }
.seg-tabs .seg-link { display: flex; gap: 6px; align-items: center; padding: 0 14px; min-height: 46px; color: var(--o); font-weight: 600; text-decoration: none; border-left: 1px solid var(--line); background: #fff; }
.rep-chart .grid { stroke: #eceef1; }
.dash-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.dash-charts:empty { display: none; }
.dch { margin: 0; } .dch h3 { margin: 0 0 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .dch h3 small { font-weight: 400; }
.dch-wide { grid-column: 1 / -1; }
.dch-kpis { display: flex; gap: 28px; margin: 8px 0; } .dch-kpis div { display: flex; flex-direction: column; } .dch-kpis b { font-size: 22px; } .dch-kpis small { color: var(--mut); }
.dch-bars { width: 100%; height: auto; display: block; } .dch-bars rect { fill: #f2c9a0; } .dch-bars rect.cur { fill: var(--o); } .dch-bars .cv { font-size: 10px; fill: var(--mut); }
.dch-gauge { display: flex; align-items: center; gap: 14px; margin-top: 6px; } .dch-gauge svg { width: 110px; height: 110px; flex: none; }
.dch-gauge div { display: flex; flex-direction: column; } .dch-gauge small { color: var(--mut); font-size: 12px; } .dch-gauge b { font-size: 16px; }
.g-bg { fill: none; stroke: #eceef1; stroke-width: 12; } .g-fg { fill: none; stroke: #2e7d32; stroke-width: 12; stroke-linecap: round; }
.g-fg.mid { stroke: var(--o); } .g-fg.low { stroke: var(--red); } .g-t { font-size: 20px; font-weight: 700; fill: var(--tx); } .g-hole { fill: #fff; }
.dch-pie { display: flex; gap: 12px; align-items: center; margin-top: 6px; } .dch-pie svg { width: 110px; height: 110px; flex: none; }
.dch-pie ul { list-style: none; margin: 0; padding: 0; font-size: 12px; flex: 1; min-width: 0; }
.dch-pie li { display: flex; gap: 6px; align-items: center; } .dch-pie li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dch-pie li i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.dash-prefs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
.wt-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.wt-side .card { margin: 0 0 12px; } .wt-side .col { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.wt-flt { display: flex; gap: 14px; margin-top: 8px; }
.wt-status > div:not(.row) { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wt-status b { font-size: 18px; } .wt-status .row { margin-top: 10px; }
.pos { color: #2e7d32; } .neg { color: var(--red); }
.wt-months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.wt-m { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; color: var(--tx); }
.wt-m.on { border-color: var(--o); box-shadow: 0 0 0 2px var(--o-l); } .wt-m.empty { opacity: .55; }
.wt-m span { font-size: 17px; font-weight: 600; } .wt-m small { color: var(--mut); font-size: 12px; }
table.wc-t { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 720px; font-size: 13px; }
table.wc-t th { background: #f3f4f6; padding: 6px; font-weight: 500; }
table.wc-t th:first-child, table.wc-t td.wc-wk { width: 42px; text-align: center; color: var(--mut); }
table.wc-t th:last-child { width: 96px; }
table.wc-t td { border: 1px solid var(--line); vertical-align: top; padding: 4px 6px; height: 74px; }
.wc-day { cursor: pointer; } .wc-day:hover { background: #fafbfc; }
.wc-day.we { background: #f6f6f6; } .wc-day.today { background: var(--o-l); } .wc-out { opacity: .4; } .wc-day.future .wc-nums span:first-child { color: var(--mut); }
.wc-top { display: flex; justify-content: space-between; } .wc-diff { font-weight: 600; }
.wc-nums { display: flex; flex-direction: column; font-size: 12px; margin-top: 2px; } .wc-run { font-size: 11px; }
.wc-day .tag { font-size: 10px; display: inline-block; margin: 1px 0; padding: 0 4px; }
.wc-sum { text-align: right; } .wc-sum span { font-weight: 600; display: block; } .wc-sum small { color: var(--mut); }
@media (max-width: 900px) { .wt-layout { grid-template-columns: 1fr; } .wt-months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- 0.16: projektin ruutuvalikko, kaavioiden värit, kannattavuus, resursointiaste ---------- */
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 0 0 14px; }
.ptile { background: #fff; border-radius: 20px; min-height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px;
  text-decoration: none; color: var(--tx); font-weight: 600; font-size: 13px; text-align: center; line-height: 1.2; border: 1px solid var(--o-b); }
.ptile .ti .ic { width: 24px; height: 24px; color: var(--o); }
.ptile:hover { background: #fafbfc; }
.ptile.on { background: var(--o); border-color: var(--o); color: #fff; } .ptile.on .ti .ic { color: #fff; }
@media (max-width: 600px) { .ptiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ptile { min-height: 62px; font-size: 12px; } }
/* Kaaviot: muut kuin sivun turkoosi */
.rep-chart .ca { fill: #1e3a5f; } .rep-chart .cb { fill: #f59e0b; }
.rep-chart .cl { font-size: 12px; fill: var(--tx); } .rep-chart .axis { stroke: #94a3b8; stroke-width: 1.2; } .rep-chart .sep { stroke: #f1f5f9; }
.rs-svg .lp { stroke: #ea580c; } .rs-svg .lp-k { fill: #ea580c; } .rs-svg .la { stroke: #1e3a5f; } .rs-svg .la-k { fill: #1e3a5f; }
.dch-bars rect { fill: #fed7aa; } .dch-bars rect.cur { fill: #ea580c; }
.g-fg.mid { stroke: #f59e0b; }
.dch-scope { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.dch-scope .seg-tabs button { min-height: 34px; font-size: 13px; }
.rep-charts2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 12px; align-items: start; }
.rep-charts2 .card { margin: 0 0 12px; }
.rep-donut h3 { margin: 0 0 8px; font-size: 15px; }
.rd-body { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .rd-body svg { width: 160px; height: 160px; flex: none; }
.rd-body ul { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; font-size: 13px; }
.rd-body li { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 6px; align-items: center; padding: 3px 0; }
.rd-body li i { width: 12px; height: 12px; border-radius: 50%; } .rd-body li small { color: var(--mut); text-align: right; }
@media (max-width: 900px) { .rep-charts2 { grid-template-columns: 1fr; } }
/* Resursointiaste */
.r-low { color: #dc2626; } .r-mid { color: #ea580c; } .r-ok { color: #16a34a; }
.rs-cell .rs-pct { display: block; font-size: 12px; font-weight: 600; }
.rs-legend b { font-weight: 600; margin-right: 6px; }

/* ---------- 0.17: kehitys 9 ---------- */
/* Dokumentit */
.dc-lock .ic { width: 16px; height: 16px; vertical-align: -2px; color: #3b4a8a; }
.rev-btn { white-space: nowrap; background: #eef2ff; border-color: #c7d2fe; color: #3b4a8a; }
/* Monivalinta-alasvetovalikko */
details.msel { position: relative; max-width: 520px; margin-bottom: 10px; }
details.msel > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; padding: 11px 40px 11px 14px; background: #fff; position: relative; }
details.msel > summary::-webkit-details-marker { display: none; }
details.msel > summary::after { content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--mut); }
details.msel[open] > summary { border-color: var(--o); }
.msel-pop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; max-height: 340px; overflow: auto; }
.msel-q { width: 100%; box-sizing: border-box; margin-bottom: 6px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
.msel-pop .list { gap: 0; } .msel-pop label { padding: 6px 4px; }
/* Tuntikirjauksen kuukausinäkymä viikkonumeroin */
.tm-wk-grid { grid-template-columns: 54px repeat(7, 1fr); }
.tm-wkh { text-align: center; }
.tm-wk { border-top: 1px solid var(--line); background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; color: var(--mut); cursor: pointer; font-size: 14px; }
.tm-wk small { font-weight: 500; font-size: 11px; } .tm-wk.on { background: var(--o-l); color: var(--tx); }
.tm-day.selw { background-image: linear-gradient(0deg, rgba(26,133,143,.06), rgba(26,133,143,.06)); }
.ts-month-grid .tm-title { margin: 0; text-align: center; }
/* Kululaskun rivit */
table.exp-rows { table-layout: fixed; min-width: 1080px; }
table.exp-rows col.c-date { width: 138px; } table.exp-rows col.c-type { width: 170px; } table.exp-rows col.c-proj { width: 190px; } table.exp-rows col.c-desc { width: auto; min-width: 200px; }
table.exp-rows col.c-qty { width: 104px; } table.exp-rows col.c-rate { width: 84px; } table.exp-rows col.c-vat { width: 72px; } table.exp-rows col.c-sum { width: 100px; } table.exp-rows col.c-rc { width: 84px; } table.exp-rows col.c-del { width: 44px; }
table.exp-rows td { vertical-align: top; }
table.exp-rows input, table.exp-rows select, table.exp-rows textarea { width: 100%; box-sizing: border-box; }
table.exp-rows td.num input { text-align: right; }
.exp-q { display: flex; align-items: center; gap: 4px; } .exp-q small { color: var(--mut); }
textarea.exp-desc { resize: none; min-height: 40px; height: 40px; line-height: 1.35; padding: 9px 10px; transition: height .15s; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
table.exp-rows tr.locked td { background: #f8fafc; }
table.exp-rows td.num b { display: block; padding-top: 10px; }
/* Pystypylväskaavio */
.colchart { width: 100%; height: auto; display: block; }
.colchart .cc-grid { stroke: #eef1f5; } .colchart .cc-axis { stroke: #94a3b8; stroke-width: 1.2; }
.colchart .cc-v, .colchart .cc-c { font-size: 11px; fill: #64748b; } .colchart .cc-n { font-size: 10.5px; fill: #334155; font-weight: 600; } .colchart .cc-l { font-size: 12px; fill: var(--tx); }
.rep-chart .rc-title { margin: 0 0 4px; font-size: 15px; }
.rep-chart .cl { font-size: 11.5px; }
/* Etusivu: resursointiaste piirakan keskellä */
.g-t.r-low { fill: #dc2626; } .g-t.r-mid { fill: #ea580c; } .g-t.r-ok { fill: #16a34a; }
.dch-pie .g-t { font-size: 17px; } .g-s { font-size: 8px; fill: var(--mut); }
/* Resursointi */
.rs-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .rs-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rs-compare h3 { margin: 0 0 8px; font-size: 15px; }
.rs-prog { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.rs-pl { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; align-items: center; font-size: 12px; color: var(--mut); }
.rs-pl b { color: var(--tx); text-align: right; }
.rs-pb { height: 9px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.rs-pb i { display: block; height: 100%; border-radius: 99px; } .rs-pb i.h { background: #1e3a5f; } .rs-pb i.h.over { background: #dc2626; } .rs-pb i.t { background: #f59e0b; }
.rs-note { font-size: 11.5px; font-weight: 600; } .rs-note.warn { color: #dc2626; } .rs-note.ok { color: #16a34a; } .rs-note.info { color: #2563eb; }
table.rs-plist td small.muted { display: block; }
table.rs-t { border-radius: 10px; overflow: hidden; }
table.rs-t td.rs-cell { min-width: 92px; vertical-align: top; padding: 8px 8px 6px; }
table.rs-t td.rs-cell.today { background: #f0fafa; }
.rs-num { display: flex; align-items: baseline; justify-content: center; gap: 4px; } .rs-num b { font-size: 17px; } .rs-num small { color: var(--mut); font-size: 11px; }
.rs-cap { height: 6px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin: 5px 4px 3px; }
.rs-cap i { display: block; height: 100%; border-radius: 99px; background: #94a3b8; }
.rs-cap i.r-low { background: #f87171; } .rs-cap i.r-mid { background: #fb923c; } .rs-cap i.r-ok { background: #22c55e; }
.rs-who { display: flex; align-items: center; gap: 10px; min-width: 210px; } .rs-who small { display: block; font-size: 12px; font-weight: 600; }
.rs-av { width: 34px; height: 34px; border-radius: 50%; background: #1e3a5f; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
table.rs-t tfoot td { background: #f8fafc; border-top: 2px solid var(--line); }

/* Tarjouspyyntömoduuli (tarjous/) kehyksessä */
.tp-frame { display: block; width: 100%; border: 0; background: transparent; }

/* Kokoukset: pöytäkirjassa ei kuvia; liitteet kansioina */
.memo-ed.mtg .photos, .memo-ed.mtg [data-act=camera], .memo-ed.mtg [data-act=planShot], .memo-ed.mtg [data-act=gallery], .memo-ed.mtg [data-act=burst], .memo-ed.mtg .drop-hint { display: none !important; }
.mf { border: 1px solid var(--line, #dcd9d4); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.mf.drag { border-color: var(--o, #1a858f); background: #eef7f8; }
.mf-head { align-items: center; gap: 8px; } .mf-no { min-width: 58px; } .mf-head input { min-width: 160px; }
.mf-files { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 0 66px; }
.mf-file { display: flex; align-items: center; gap: 8px; } .mf-file a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .mf-files { margin-left: 0; } }
.mf-head input { font: inherit; padding: 8px 10px; border: 1px solid #cfd6dc; border-radius: 8px; background: #fff; }

/* ---------- Kirjautumissivu (pilvi) ---------- */
body.auth-page .topbar, body.auth-page .embed-warn, body.auth-page #memoChip { display: none !important; }
body.auth-page main { max-width: none; padding: 0; margin: 0; }
.lg { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.lg-hero { position: relative; overflow: hidden; color: #fff; padding: clamp(32px, 6vw, 72px); display: flex; flex-direction: column; gap: 28px; justify-content: center;
  background: radial-gradient(900px 500px at 15% 10%, rgba(26,133,143,.55), transparent 60%), radial-gradient(700px 420px at 90% 95%, rgba(26,133,143,.35), transparent 60%), linear-gradient(160deg, #0f242e 0%, #12303c 55%, #0b1c24 100%); }
.lg-hero::before { content: ''; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px); background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); }
.lg-hero > * { position: relative; }
.lg-brand { display: flex; align-items: center; gap: 12px; } .lg-brand b { font-size: 22px; letter-spacing: .16em; }
.lg-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--o); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(26,133,143,.45); }
.lg-mark .ic { width: 24px; height: 24px; color: #fff; }
.lg-hero h1 { font-size: clamp(26px, 3.2vw, 42px); line-height: 1.15; margin: 0; max-width: 560px; font-weight: 700; letter-spacing: -.01em; }
.lg-feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 520px; }
.lg-feat li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(4px); }
.lg-feat li > span { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(26,133,143,.35); }
.lg-feat .ic { width: 20px; height: 20px; color: #bfe6ea; }
.lg-feat b { display: block; font-size: 15px; } .lg-feat small { color: #b7c6cc; font-size: 13px; }
.lg-trust { display: flex; align-items: center; gap: 8px; color: #b7c6cc; font-size: 13px; } .lg-trust .ic { width: 16px; height: 16px; }
.lg-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 18px; }
.lg-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px 26px; box-shadow: 0 1px 2px rgba(15,36,46,.06), 0 18px 48px rgba(15,36,46,.12); }
.lg-foot { color: var(--mut); font-size: 12px; margin: 0; }
.lg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #f1efee; margin-bottom: 18px; }
.lg-tabs button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--mut); cursor: pointer; }
.lg-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.lg-form { display: flex; flex-direction: column; gap: 14px; }
.lg-form h2 { margin: 0; font-size: 24px; color: var(--navy); letter-spacing: -.01em; }
.lg-sub { margin: -6px 0 0; color: var(--mut); font-size: 14px; line-height: 1.45; }
.lg-fld { display: flex; flex-direction: column; gap: 6px; } .lg-fld > span { font-size: 13px; font-weight: 600; color: #3b4246; }
.lg-fld input { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 48px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.lg-fld input:focus { outline: none; border-color: var(--o); box-shadow: 0 0 0 4px rgba(26,133,143,.15); }
.lg-pw { position: relative; } .lg-pw input { padding-right: 48px; }
.lg-pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; color: var(--mut); display: grid; place-items: center; }
.lg-pw button:hover { background: #f1efee; } .lg-pw .ic { width: 18px; height: 18px; }
.lg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; min-height: 50px; font: inherit; font-weight: 700; font-size: 16px; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #1f97a2, var(--o)); box-shadow: 0 6px 16px rgba(26,133,143,.3); transition: transform .1s, box-shadow .15s, filter .15s; }
.lg-btn:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(26,133,143,.38); } .lg-btn:active { transform: translateY(1px); } .lg-btn:disabled { opacity: .7; cursor: default; }
.lg-btn .ic { width: 18px; height: 18px; }
.lg-links { display: flex; justify-content: center; } .lg-link { border: 0; background: none; color: var(--o-d); font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.lg-link:hover { text-decoration: underline; } .lg-link .ic { width: 14px; height: 14px; }
.lg-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: var(--red); font-size: 14px; }
.lg-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--o-l); color: var(--o-d); font-size: 14px; line-height: 1.45; } .lg-note .ic { width: 16px; height: 16px; vertical-align: -3px; }
.lg-alt { margin-top: 16px; padding-top: 14px; border-top: 1px solid #efeceb; text-align: center; } .lg-alt a { color: var(--mut); font-size: 12px; }
.lg-steps { margin: 0; padding-left: 20px; color: #3b4246; font-size: 14px; line-height: 1.5; }
.lg-qr { display: grid; place-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; } .lg-qr img { width: 180px; height: 180px; }
.lg-sub code { font-size: 12px; word-break: break-all; background: #f1efee; padding: 2px 6px; border-radius: 6px; }
.lg-code { letter-spacing: .4em; text-align: center; font-size: 22px !important; font-weight: 700; }
.lg-orgs { display: grid; gap: 8px; } .lg-org { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; font: inherit; }
.lg-org:hover { border-color: var(--o); } .lg-org b { flex: 1; } .lg-org small { color: var(--mut); } .lg-org .ic { width: 16px; height: 16px; color: var(--o); }
.lg-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: lgspin .8s linear infinite; }
@keyframes lgspin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .lg { grid-template-columns: 1fr; }
  .lg-hero { padding: 28px 22px 26px; gap: 16px; } .lg-hero h1 { font-size: 24px; } .lg-feat, .lg-trust { display: none; }
  .lg-panel { padding: 0 14px 28px; margin-top: -14px; justify-content: flex-start; } .lg-card { padding: 22px 18px; }
}

/* Palveluntarjoaja ja tunnusten luonti */
.pf-res code { font-size: 13px; background: #f1efee; padding: 2px 6px; border-radius: 6px; } .pf-res tr.pf-bad td { color: var(--red); }
.u-res { margin-top: 10px; }

/* Hyväksyntä ja allekirjoitus */
.btn.ok { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.banner.ok { background: #e8f5ee; border-color: #b9e0c9; color: #17603a; }
.banner.warn { background: #fff6e5; border-color: #f3d39a; color: #7a4a06; }
.appr-row { margin-bottom: 8px; }
.sign-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.sg-row { display: grid; grid-template-columns: 28px 1.1fr 1fr 1.3fr 1fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.sg-row input:not([type=checkbox]) { min-width: 0; }
@media (max-width: 700px) { .sg-row { grid-template-columns: 28px 1fr; } .sg-row > :nth-child(n+3) { grid-column: 2; } }
/* Vahva tunnistus: ei puhelinnumeroa eikä paikan päällä allekirjoitusta */
.sg-meth { margin: 4px 0 12px; max-width: 100%; }
.sg-meth button { min-height: 40px; }
.sg-strong .sg-row [data-k=phone], .sg-strong .sg-row .chk.sm { visibility: hidden; }
.sg-here-only .sg-row [data-k=phone] { visibility: hidden; }
.sign-opt .chk { margin: 6px 0; }
@media (max-width: 700px) { .sg-strong .sg-row [data-k=phone], .sg-strong .sg-row .chk.sm { display: none; } }
.sign-frame { width: 100%; height: min(78vh, 760px); border: 1px solid var(--line); border-radius: 10px; }
/* Kokouspöytäkirja: koko leveys, osallistujille sähköposti */
main:has(.memo-ed.mtg) { max-width: none; padding-left: 16px; padding-right: 16px; }
.mtg .att { grid-template-columns: 32px 1fr 1fr 1.2fr 44px; }
@media (max-width: 760px) { .mtg .att { grid-template-columns: 32px 1fr 44px; } .mtg .att input[data-af=company], .mtg .att input[data-af=email] { grid-column: 2; } }
.sg-row.dist { grid-template-columns: 28px 1fr 1fr 1.3fr; }
@media (max-width: 700px) { .sg-row.dist { grid-template-columns: 28px 1fr; } }
.dist-p { margin: 8px 0 12px; }
.rv-c { display: block; white-space: pre-wrap; font-size: 13px; color: var(--tx); background: #fff; border-left: 3px solid var(--o); padding: 6px 8px; margin-top: 4px; border-radius: 4px; }

/* kehitys 14: leveät näkymät, venytettävät tekstikentät, allekirjoittajat */
main { max-width: none; padding-left: 20px; padding-right: 20px; }
main:has(.home) { max-width: 1800px; }
.mtg .editor { min-height: 360px; resize: vertical; overflow: auto; }
.mtg .att { grid-template-columns: 32px 1fr 1fr 1.2fr auto 44px; }
.att-sig { white-space: nowrap; font-size: 13px; }
@media (max-width: 760px) { .mtg .att .att-sig { grid-column: 2; } }
.dlg-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.modal textarea[data-msg] { resize: vertical; }
.sign-box.partial { border-color: #f3d39a; background: #fffaf0; }
.sign-box.done { border-color: #b9e0c9; background: #f3faf6; }
.sign-box .h-sub .tag { margin-left: 6px; vertical-align: 1px; }
.sg-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rem-log { display: block; color: #8a5a00; font-size: 12px; margin-top: 2px; }
/* Kululasku: selite 3x korkeampi ja venytettävä, ei kokomuutosta kohdistettaessa (rivin poisto osui ohi) */
textarea.exp-desc { resize: vertical; min-height: 40px; height: 120px; transition: none; }
table.exp-rows col.c-type { width: 200px; } table.exp-rows col.c-proj { width: 170px; } table.exp-rows col.c-date { width: 130px; } table.exp-rows col.c-desc { min-width: 240px; }
/* Resursointi: vihreä = suunnitelmassa, oranssi = ylitys > 0,1 %, punainen = ylitys > 5 % */
.rs-kpi .card.good, .rs-compare.good { background: #edf8f0; border: 1px solid #c4e6cf; }
.rs-kpi .card.warn, .rs-compare.warn { background: #fff2e0; border: 1px solid #f5c27a; }
.rs-kpi .card.bad, .rs-compare.bad { background: #fdecec; border: 1px solid #f0b4b0; }
.rs-act.good { color: #1f7a45; } .rs-act.warn { color: #b26a00; font-weight: 700; } .rs-act.bad { color: var(--red); font-weight: 700; }
.ext-docs { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.ext-docs .h-sub { margin: 0; }
table.exp-rows col.c-rc { width: 76px; } table.exp-rows col.c-del { width: 36px; } table.exp-rows col.c-rate { width: 80px; }
/* Maksuluokan ulkopuoliset ominaisuudet */
.tile.locked { opacity: .55; filter: grayscale(.6); cursor: not-allowed; }
.tier-tag { font-size: 10px; background: #eef1f3; color: #555; border-radius: 99px; padding: 1px 7px; margin-top: 2px; }

/* Pohjakuvan valinta: suuri ikkuna, piirustukset ryhmittäin, sivuvalinta */
.modal.plan-chooser { max-width: min(1400px, 96vw); width: 96vw; height: 92vh; max-height: 92vh; display: flex; flex-direction: column; }
.plan-chooser .pc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.plan-chooser .pc-head h2 { margin: 0; }
.plan-chooser .pc-body { flex: 1; overflow: auto; }
.plan-chooser .plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.plan-chooser .plan-tile { display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; cursor: pointer; font: inherit; }
.plan-chooser .plan-tile:hover { border-color: var(--o); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.plan-chooser .plan-tile img, .plan-chooser .pc-thumb { width: 100%; height: 180px; object-fit: contain; background: #f4f5f6; border-radius: 6px; }
.plan-chooser .plan-tile small { color: var(--mut); }
.plan-hint.pulse { animation: hintpulse 1.6s ease; }
@keyframes hintpulse { 0%, 100% { background: rgba(0,0,0,.75); } 30% { background: var(--o); } }
/* Pohjakuvien pikavalinnat muistion ja virhe- ja puutelistan alalaidassa */
.quick-plans { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; padding: 10px 12px; background: #fff; border: 1px dashed var(--o); border-radius: 10px; }
.quick-plans > span { width: 100%; }
.pc-empty { padding: 12px; background: var(--o-l); border-radius: 10px; }
/* Materiaalit: liitteet Tuotetiedot-solussa */
.mat-tiedot .mat-att { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.mat-tiedot .mat-file { font-size: 12px; display: inline-flex; gap: 3px; align-items: center; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-tiedot .mat-file .ic { width: 13px; height: 13px; }
.mat-tiedot.drop-on { outline: 2px dashed var(--o); outline-offset: -3px; background: var(--o-l); }
.bill-t td small { display: block; }
.bill-t input { width: 110px; }
.bill-cfg input[type=number] { max-width: 140px; }
.trash-h { margin: 18px 0 8px; font-size: 16px; }

/* Kalenterit: viikkonumerot ja viikonpäivät (ma–su) kuten seinäkalenterissa; sunnuntait ja arkipyhät punaisella */
.cv-grid { grid-template-columns: 44px repeat(7, minmax(0, 1fr)); }
.cv-dow { text-align: center; text-transform: uppercase; font-weight: 700; letter-spacing: .5px; color: var(--tx); }
.cv-dow.sun, .tm-dow.sun, .cal-dow.sun { color: var(--red); }
.cv-wkh { color: var(--mut); text-transform: none; font-weight: 600; }
.cv-wk { border-top: 1px solid var(--line); background: #f3f4f6; color: var(--mut); font-weight: 700; font-size: 13px; text-align: center; padding-top: 6px; }
.cv-day > small { font-size: 16px; }
.cv-day.red > small { color: var(--red); }
.cal-grid.cal-wkg { grid-template-columns: 26px repeat(7, 1fr); }
.cal-dow { font-weight: 700; color: var(--tx); padding: 2px 0; }
.cal-wkh { color: var(--mut); text-transform: none; font-weight: 600; }
.cal-wkn { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--mut); }
.cal-day { font-weight: 600; }
.cal-day.red { color: var(--red); }
.cal-day.has.red { color: #fff; }
.tm-day.red small { color: var(--red); font-weight: 700; }
/* Resursointi henkilöittäin */
.rs-who { align-items: center; gap: 10px; margin-bottom: 10px; }
.rs-who .fld { display: flex; align-items: center; gap: 8px; margin: 0; }
.rs-who .fld span { font-weight: 600; }
.rs-who select { min-width: 220px; }
.rs-who-t tr.on td { background: var(--o-l); }
.rs-who-t tr.tot td { border-top: 2px solid var(--line); }
/* Resursointikaavio: toteuman pisteet ja arvo, tänään-viiva */
.rs-svg .la { stroke-width: 3; }
.rs-svg .la-dot { fill: #1e3a5f; stroke: #fff; stroke-width: 1.5; }
.rs-svg .la-v { fill: #1e3a5f; font-weight: 700; font-size: 12px; }
.rs-svg .today { stroke: #9aa3ad; stroke-dasharray: 3 3; }
.rs-svg .tdy { font-size: 10px; }

/* Aikataulu (Gantt) */
.gt-card h3 small { font-weight: 500; margin-left: 6px; }
.gt-bar-top { align-items: center; gap: 8px; }
.gt-tools { gap: 6px; margin: 4px 0 10px; align-items: center; }
.gt { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.gt-left { flex: 0 0 auto; max-width: 52%; overflow-x: auto; border-right: 2px solid var(--line); resize: horizontal; }
.gt.wide .gt-left { max-width: 64%; }
.gt-right { flex: 1 1 auto; overflow-x: auto; min-width: 0; }
.gt-svg { display: block; user-select: none; }
.gt-tbl { border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.gt-tbl thead tr { height: 46px; background: #f3f4f6; }
.gt-tbl th { text-align: left; font-size: 12px; padding: 0 6px; border-bottom: 1px solid var(--line); vertical-align: bottom; padding-bottom: 6px; }
.gt-tbl tbody tr { height: 30px; }
.gt-tbl tbody tr:nth-child(even) { background: #f7f8fa; }
.gt-tbl td { padding: 0 4px; height: 30px; box-sizing: border-box; }
.gt-tbl td.gt-no { color: var(--mut); font-size: 11px; text-align: right; width: 26px; }
.gt-tbl input { height: 24px; padding: 0 5px; font: inherit; font-size: 13px; border: 1px solid transparent; border-radius: 5px; background: transparent; }
.gt-tbl input:hover, .gt-tbl input:focus { border-color: var(--line); background: #fff; }
.gt-tbl td.gt-name input { width: 230px; }
.gt-tbl td.gt-start input, .gt-tbl td.gt-end input { width: 122px; }
.gt-tbl td.gt-dur input { width: 52px; text-align: right; }
.gt-tbl td.gt-deps input { width: 74px; }
.gt-tbl td.gt-resp input { width: 120px; }
.gt-tbl td.gt-pct input { width: 56px; text-align: right; }
.gt-tbl td.gt-name > span { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.gt-tbl tr.phase td { font-weight: 700; }
.gt-tbl tr.phase input { font-weight: 700; }
.gt-tbl tr.lvl1 td.gt-name { padding-left: 18px; }
.gt-tbl tr.milestone td.gt-name { color: #b4451a; }
.gt-ms-ico { font-style: normal; color: #c2410c; margin-right: 2px; font-size: 11px; }
.gt-tbl td.gt-act { width: 40px; }
.gt-tbl td.gt-act .icon-btn { min-width: 30px; min-height: 26px; }
.gt-svg .gt-h1 { fill: #f3f4f6; stroke: var(--line); stroke-width: .5; }
.gt-svg .gt-h2 { fill: #f8fafc; }
.gt-svg .gt-ht { font-size: 12px; font-weight: 700; fill: var(--tx); }
.gt-svg .gt-ht2 { font-size: 11px; fill: var(--mut); }
.gt-svg .gt-ht2.red { fill: var(--red); font-weight: 700; }
.gt-svg .gt-mline { stroke: #c9ccd1; stroke-width: 1; }
.gt-svg .gt-wline { stroke: #e6e8eb; stroke-width: 1; }
.gt-svg .gt-we { fill: #f2f3f5; }
.gt-svg .gt-stripe { fill: #f7f8fa; opacity: .7; }
.gt-svg .gt-today { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gt-svg .gt-task { fill: #7fb2d6; }
.gt-svg .gt-prog { fill: #1f5d8c; }
.gt-svg .gt-phase { fill: #263238; }
.gt-svg .gt-ms { fill: #d9541e; stroke: #fff; stroke-width: 1; }
.gt-svg .gt-lbl { font-size: 11px; fill: #555; }
.gt-svg .gt-lbl.b { font-weight: 700; fill: #263238; }
.gt-svg .gt-dep { fill: none; stroke: #8a9099; stroke-width: 1.2; }
.gt-svg .gt-arrowhead { fill: #8a9099; }
.gt-svg .gt-item.drag { cursor: grab; touch-action: none; }
.gt-svg .gt-item.drag:hover .gt-task { fill: #5f9cc8; }
.gt-svg .gt-handle { fill: transparent; cursor: ew-resize; touch-action: none; }
.gt-svg .gt-handle:hover { fill: rgba(31, 93, 140, .35); }
.sched-gantt { margin: 4px 0 8px; }
@media (max-width: 800px) { .gt-left { max-width: 62%; } .gt-tbl td.gt-name input { width: 150px; } }
/* Aikataulu: vierityskehys (otsikot ja tehtävälista pysyvät paikallaan), korkeuden kahva, zoomaus, laajennus */
main:has(.gt-card) { max-width: none; }
.gt { display: block; overflow: auto; position: relative; border: 1px solid var(--line); border-radius: 10px 10px 0 0; background: #fff; overscroll-behavior: contain; }
.gt-in { display: flex; width: max-content; min-width: 100%; }
.gt-left { position: sticky; left: 0; z-index: 3; background: #fff; flex: 0 0 auto; max-width: none; overflow: visible; resize: none; border-right: 2px solid var(--line); }
.gt.wide .gt-left { max-width: none; }
.gt-right { flex: 1 0 auto; overflow: visible; min-width: 0; }
.gt-head { position: sticky; top: 0; z-index: 2; background: #f8fafc; }
.gt-head svg, .gt-right > svg { display: block; }
.gt-tbl thead th { position: sticky; top: 0; z-index: 4; background: #f3f4f6; }
.gt-resize { height: 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: #f3f4f6; cursor: ns-resize; display: grid; place-items: center; touch-action: none; margin-bottom: 8px; }
.gt-resize span { width: 48px; height: 4px; border-radius: 3px; background: #b8bec6; }
.gt-resize:hover span, .gt-resize.on span { background: var(--o); }
.gt-card.gt-full { position: fixed; inset: 0; z-index: 50; margin: 0; border-radius: 0; overflow: auto; }
body:has(.gt-full) { overflow: hidden; }
.gt-zoom { display: inline-flex; align-items: center; gap: 4px; }
.gt-zoom .btn { min-width: 38px; justify-content: center; }
.gt-zl { min-width: 70px; text-align: center; font-size: 13px; color: var(--mut); }
.gt-cols { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; }
.gt-late, .gt-tbl td.gt-late input { color: var(--red) !important; font-weight: 700; }
.gt-svg .gt-item.late .gt-task { stroke: var(--red); stroke-width: 2; }
.gt-svg .gt-item.late .gt-lbl { fill: var(--red); }
.gt-var { margin: 0 0 10px; }
.gt-var { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.gt-var button { border: 0; background: #fff; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--tx); cursor: pointer; }
.gt-var button + button { border-left: 1px solid var(--line); }
.gt-var button.on { background: var(--navy); color: #fff; }
/* Aikataulun taulukko tiiviimmäksi */
.gt-tbl td { padding: 0 3px; }
.gt-tbl td.gt-name input { width: 205px; }
.gt-tbl td.gt-start input, .gt-tbl td.gt-end input { width: 112px; font-size: 12.5px; padding: 0 3px; }
.gt-tbl td.gt-dur input { width: 46px; }
.gt-tbl td.gt-pct input { width: 50px; }
.gt-tbl td.gt-act { width: 34px; }
/* Urakoitsijan yleisaikataulu (PDF) */
.yat-prev { border: 1px solid var(--line); border-radius: 10px; background: #fafafa; padding: 8px; cursor: zoom-in; overflow: auto; max-height: 78vh; margin: 6px 0 12px; }
.yat-prev .yat-canvas { display: block; width: 100%; height: auto; background: #fff; }
.yat-h { margin: 8px 0 6px; font-size: 15px; }
/* Etusivun laskutuskaavio: aikaväli ja kertymät */
.dch-head { align-items: center; gap: 8px; }
.dch-head h3 { margin: 0; }
.dch-per { display: inline-flex; align-items: center; gap: 6px; }
.dch-per select, .dch-head input[type=date] { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; }
.dch-kpis { flex-wrap: wrap; row-gap: 10px; }
.dch-sub { margin: 14px 0 0; font-size: 14px; }
.dch-line { width: 100%; height: auto; display: block; }
.dch-line .grid { stroke: #eceef1; } .dch-line .cv { font-size: 11px; fill: var(--mut); }
/* Esihenkilöikkuna: alaisten valinta */
.sup-dlg .sup-subs { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px; }
.sup-dlg .sup-subs legend { font-weight: 600; padding: 0 6px; }
.sup-dlg .sup-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.sup-dlg .sup-list small { margin-left: 6px; }
/* Etusivun resursointi: aikaväli */
.dch-rper { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 4px; }
.dch-rper select, .dch-rper input[type=date] { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; font: inherit; font-size: 12.5px; background: #fff; }
.dch-rdates { display: inline-flex; gap: 4px; align-items: center; }
/* Etusivun resursointi: resursoitu / kirjattu */
.dch-resk { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 8px; }
.dch-resk div { display: flex; flex-direction: column; } .dch-resk b { font-size: 18px; } .dch-resk small { color: var(--mut); font-size: 11.5px; }
.dch-rlist li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.dch-rlist li small { color: var(--mut); min-width: 44px; text-align: right; }
.dch-rlist li b { min-width: 44px; text-align: right; }
.dch-rlist li.dch-rh { font-size: 11px; color: var(--mut); } .dch-rlist li.dch-rh b { font-weight: 600; }
.dch-rlist li.dch-rsep { grid-template-columns: 1fr; font-size: 11.5px; color: var(--mut); margin-top: 6px; }
.dch-rnote { margin-top: 6px; }
.dch-res .dch-pie { flex-wrap: wrap; }
.dch-res .dch-pie ul.dch-rlist { flex: 1 1 100%; margin-top: 8px; }
/* Materiaalien liitekansiot */
.mat-folders { padding: 10px 14px; margin: 10px 0; }
.mat-folders .row { gap: 8px; align-items: center; }
.mat-fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.mat-fchip:hover { background: var(--o-l); }
.mat-fchip small { background: #eef1f4; border-radius: 999px; padding: 0 7px; color: var(--mut); }
/* Resursointitaulukko: tehtävä ja henkilö mahtuvat näkyviin */
table.rs-rows td:nth-child(1) select { min-width: 230px; }
table.rs-rows td:nth-child(2) select { min-width: 170px; }
table.rs-rows input[type=date] { min-width: 140px; }
/* Materiaalit: pakollinen kenttä puuttuu */
table.mat textarea.miss { border-color: var(--red) !important; background: #fff5f5; }
/* Tekstieditori: Word-tyyliset painikkeet */
.toolbar button .ic { width: 20px; height: 20px; vertical-align: middle; }
.toolbar .tb-strike s { font-size: 13px; }
.tb-split { display: inline-flex; }
.tb-split button:first-child { border-radius: 8px 0 0 8px; }
.tb-split .tb-caret { border-radius: 0 8px 8px 0; border-left: 0; min-width: 26px; padding: 0 4px; }
.toolbar .tb-caret .ic { width: 14px; height: 14px; }
.pop-menu.pm-bullets { display: grid; grid-template-columns: repeat(3, 52px); gap: 4px; min-width: 0; }
.pop-menu.pm-bullets button { justify-content: center; font-size: 20px; padding: 6px; min-height: 48px; border: 1px solid var(--line); }
.pop-menu.pm-bullets button:last-child { font-size: 14px; }
.pop-menu.pm-bullets button.on { border-color: var(--o); background: var(--o-l); }
/* Numero- ja aikakentät: tilaa arvon ja nuolten / kellon väliin */
input[type=number]::-webkit-inner-spin-button { margin-left: 8px; }
input[type=time]::-webkit-calendar-picker-indicator { margin-left: 6px; }
input[type=number] { padding-right: 4px; }
/* Muistion kuvat: kuva samankokoinen kuin pohjakuvaote, kuvateksti yksirivinen kuvan alla */
.photos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); }
.ph-row .ph-col { flex: 0 0 calc((100% - 8px) * 4 / 7); min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ph-row .ph-col .ph-img { flex: none; width: 100%; }
.ph-row .ph-snip { flex: 0 0 calc((100% - 8px) * 3 / 7); }
.photo textarea[data-pf=caption] { min-height: 0; height: auto; padding: 6px 8px; resize: vertical; }
/* Kuvat: yleiskuvat päivittäin */
.ph-actions { margin-bottom: 12px; align-items: center; }
.phday { padding: 10px 14px; margin-bottom: 10px; }
.phday summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none; padding: 4px 0; }
.phday summary::-webkit-details-marker { display: none; }
.phday[open] summary { margin-bottom: 8px; }
.phday .gal img { background: #eef1f4; }
.phbox img { max-height: calc(100vh - 130px); }
.phbox-bar { display: flex; gap: 8px; margin-top: 10px; }
.phbox-bar .icon-btn { color: #fff; background: rgba(255,255,255,.14); border-radius: 10px; width: 44px; height: 44px; }
.phbox-bar .icon-btn:disabled { opacity: .3; }
/* Resursointi: oikea palsta pois, näkymä koko leveydelle */
main:has(.proj-layout.wide) { max-width: none; }
.proj-layout.wide { grid-template-columns: 250px minmax(0, 1fr); }
.proj-layout.wide .proj-right { display: none; }
@media (max-width: 1100px) { .proj-layout.wide { grid-template-columns: minmax(0, 1fr); } }
/* Dokumentit: kansion nimi omalle rivilleen painikkeiden yläpuolelle */
.doc-fhead { align-items: center; gap: 10px; margin-bottom: 8px; }
.doc-fname { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.doc-factions { margin-bottom: 10px; }
/* Projektin tehtävät: pitkä nimi rivittyy, roskakori pysyy omalla paikallaan */
.task-item .chk { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; hyphens: auto; line-height: 1.3; padding: 4px 0; }
.task-item .icon-btn { flex: none; }
.task-item .chk span { min-width: 0; overflow-wrap: anywhere; }
/* Projektin asetukset: logot ja käyttöoikeuksien valinta */
.plogo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 10px; }
.plogo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.plogo-img { grid-column: 1 / -1; height: 70px; display: flex; align-items: center; justify-content: center; background: #fafafa; border-radius: 6px; }
.plogo-img img { max-width: 100%; max-height: 62px; object-fit: contain; }
.plogo input { min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 14px; }
.access-box select.acc-add { height: 48px; min-width: 240px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; background: #fff; }
.access-box .row { align-items: center; gap: 8px; }
/* Gantt: aikajanan otsikko (erillinen, kiinnitetty SVG) – kuukaudet, vuodet ja viikot näkyviin */
.gt-svg-h { display: block; user-select: none; }
.gt-svg-h .gt-h1 { fill: #f3f4f6; stroke: var(--line); stroke-width: .5; }
.gt-svg-h .gt-h2 { fill: #f8fafc; }
.gt-svg-h .gt-ht { font-size: 12px; font-weight: 700; fill: var(--tx); }
.gt-svg-h .gt-ht2 { font-size: 11px; fill: var(--mut); }
.gt-svg-h .gt-ht2.red { fill: var(--red); font-weight: 700; }
.gt-svg-h .gt-mline { stroke: #c9ccd1; stroke-width: 1; }
.gt-svg-h .gt-wline { stroke: #e6e8eb; stroke-width: 1; }
.gt-svg-h .gt-today { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 4 3; }
/* Gantt: valmiusasteen vetokahva palkin alla */
.gt-svg .gt-pctgrip { fill: #1f5d8c; cursor: ew-resize; touch-action: none; opacity: .75; }
.gt-svg .gt-pctgrip:hover { opacity: 1; }
/* Gantt: kesto ja valmius kokonaan näkyviin, vaiheen avaus/sulkeminen, vaiheen päivät kenttien muodossa */
.gt-tbl td.gt-dur input, .gt-tbl td.gt-pct input { width: 66px; }
.gt-tbl .gt-d { padding: 0 5px; font-size: 12.5px; }
.gt-tog { border: 0; background: none; padding: 0; width: 20px; height: 22px; cursor: pointer; color: var(--mut); vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; }
.gt-tog .ic { width: 15px; height: 15px; }
.gt-tog:hover { color: var(--tx); }
.gt-tbl td.gt-name { white-space: nowrap; }
.gt-tbl tr.phase td.gt-name input { width: 210px; }
/* Pöytäkirjan loppu: Kokous päättyi */
.mtg-end .row { align-items: flex-end; gap: 12px; }
.mtg-end .mtg-end-t { margin: 0; }
.mtg-end .mtg-end-t input { width: 140px; }
/* Etusivu: resursointikäyrä ja tiivis piirakka */
.dch-rcurve .dch-rlist { max-width: 680px; }
.dch-rcurve .dch-rlist li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dch-pie1 { justify-content: center; }
.dch-pie1 svg { width: 150px; height: 150px; }
.dch-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* Ohjeet: yläpalkin ?-painike ja ohjepaneeli (oikea reuna; puhelimella koko näyttö) */
.topbar .top-help { color: inherit; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: #fff; z-index: 75; box-shadow: -8px 0 30px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.help-panel[hidden] { display: none; }
.help-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.help-top b { font-size: 17px; } .help-top .help-q { flex: 1; min-height: 40px; }
.help-body { flex: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.help-toc { overflow: auto; border-right: 1px solid var(--line); padding: 6px 8px 24px; }
.help-toc a { display: block; padding: 6px 10px; border-radius: 10px; color: var(--tx); text-decoration: none; font-size: 14px; line-height: 1.3; }
.help-toc a:hover { background: var(--o-l); } .help-toc a.on { background: var(--o); color: #fff; }
.help-g { font-size: 12px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; margin: 14px 10px 4px; }
.help-art { overflow: auto; padding: 16px 24px 48px; line-height: 1.55; font-size: 15px; }
.help-art .help-g { margin: 0 0 2px; } .help-art h2 { margin: 0 0 10px; font-size: 21px; } .help-art h4 { margin: 16px 0 4px; font-size: 15px; }
.help-art ol, .help-art ul { padding-left: 22px; margin: 6px 0 10px; } .help-art li { margin: 4px 0; } .help-art p { margin: 6px 0 10px; }
.h-note { background: var(--o-l); border: 1px solid var(--o-b); border-radius: 12px; padding: 10px 12px; margin: 12px 0; } .h-note b { display: block; margin-bottom: 2px; color: var(--o-d); }
@media (max-width: 700px) { .help-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .help-toc { max-height: 30vh; border-right: 0; border-bottom: 1px solid var(--line); } .help-art { padding: 12px 16px 40px; } }
/* Palveluntarjoaja: yritysrivin toiminnot (kapealla näytöllä nimen alle) */
.pf-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
@media (max-width: 900px) { .list-row[data-org] { flex-wrap: wrap; } .list-row[data-org] .pf-ctl { width: 100%; justify-content: flex-start; } }

/* Allekirjoitus järjestyksessä: numerot ja siirtonuolet; vuoroaan odottavat */
.sg-ordchk { margin: 2px 0 8px; }
.sg-last { display: flex; align-items: center; gap: 6px; }
.sg-ord { display: none; gap: 4px; }
.sg-ordered .sg-ord { display: inline-flex; }
.sg-ordered .sg-row .chk.sm { display: none; }
.sg-row > .chk:first-child[data-n]:not([data-n=""])::after { content: attr(data-n); font-weight: 700; margin-left: 4px; color: var(--o-d); }
.sg-row > .chk:first-child { display: flex; align-items: center; }
.sg-ordered .sg-row { grid-template-columns: 48px 1.1fr 1fr 1.3fr 1fr auto; }
@media (max-width: 700px) { .sg-ordered .sg-row { grid-template-columns: 48px 1fr; } }
.sg-n { font-weight: 700; color: var(--o-d); }
/* Toimitusloki */
.dlv-log { margin-top: 8px; } .dlv-log summary { cursor: pointer; } .dlv-log > div { margin: 2px 0 2px 18px; } .dlv-bad { color: #b42318; }
/* Dokumenttien näkyvyys (projektin asetukset) */
.dacc-t th:first-child, .dacc-t td:first-child { text-align: left; } .dacc-t th.num, .dacc-t td.num { text-align: center; width: 110px; }
