/* Koti-ikkuna (V5, 2026-10-31): projektit elinkaariviivoilla elinkaarimalleittain + huomiot + kartta taustalla. */
.koti { position: relative; display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; font-size: 13px;
    color: var(--color-text); background: var(--color-surface, var(--color-bg, #fff)); container-type: inline-size;
    --koti-lbl: 240px; --koti-veil: color-mix(in srgb, var(--color-surface, #fff) 82%, transparent); }
.koti-map { position: absolute; top: 0; bottom: 0; width: 46%; z-index: 0; pointer-events: none; opacity: .55; filter: grayscale(.35);
    background: var(--color-surface, #fff); }
.koti.map-right .koti-map { right: 0; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 45%); mask-image: linear-gradient(to right, transparent 0, #000 45%); }
.koti.map-left .koti-map { left: 0; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 45%); mask-image: linear-gradient(to left, transparent 0, #000 45%); }
.koti-map .leaflet-control-attribution { pointer-events: auto; font-size: 9px; }
.koti-bar, .koti-body, .koti-pad { position: relative; z-index: 1; }
.koti-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--color-border); background: var(--koti-veil); }
.koti-title { font-weight: 750; font-size: 15px; }
.koti-muted { color: var(--color-text-muted); font-size: 12px; }
.koti-pad { padding: 24px 16px; }
.koti-sel { height: 30px; max-width: 200px; }
.koti-search { height: 30px; width: 180px; }
.koti-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0; overflow: auto; }
.koti.map-right .koti-body { grid-template-columns: 290px minmax(0, 1fr); }
.koti.map-right .koti-attn { order: -1; border-left: 0; border-right: 1px solid var(--color-border); }
.koti-cal { min-width: 0; padding: 4px 14px 14px; background: color-mix(in srgb, var(--color-surface, #fff) 45%, transparent); }
.koti-row { display: grid; grid-template-columns: var(--koti-lbl) minmax(0, 1fr); align-items: center; min-height: 40px; }
.koti-months { position: sticky; top: 0; z-index: 2; min-height: 36px; background: var(--koti-veil); border-bottom: 1px solid var(--color-border); }
.koti-lane { position: relative; height: 100%; min-height: 26px; }
.koti-year { position: absolute; top: 2px; font-size: 10.5px; font-weight: 700; padding-left: 4px; white-space: nowrap; }
.koti-month { position: absolute; top: 18px; font-size: 11px; color: var(--color-text-muted); padding-left: 4px; border-left: 1px solid var(--color-border); white-space: nowrap; text-transform: capitalize; }
.koti-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #c62828; z-index: 2; pointer-events: none; }
.koti-today b { position: absolute; top: 4px; left: 4px; font-size: 10.5px; color: #c62828; font-weight: 700; }
.koti-group { margin-top: 10px; }
.koti-ghead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 0 4px; border-bottom: 1px solid var(--color-border); }
.koti-ghead b { font-size: 13px; }
.koti-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--color-text-muted); }
.koti-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.koti-proj { border-bottom: 1px solid var(--color-border-light, var(--color-border)); }
.koti-proj:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.koti-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 5px 10px 5px 0; text-align: left; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.koti-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.koti-proj.mine .koti-name::after { content: "•"; margin-left: 5px; color: var(--color-primary, #1d4ed8); }
.koti-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--color-text-muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.koti-sub > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.koti-ph { padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; flex: none; }
.koti-q { width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; flex: none;
    border: 1px solid var(--color-text-muted); color: var(--color-text-muted); }
.koti-bar-ph { position: absolute; top: 50%; height: 12px; margin-top: -6px; border-radius: 3px; background: var(--c); }
.koti-bar-ph.est { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 40%, transparent) 5px 9px); opacity: .85; }
.koti-bar-ph.cur { height: 16px; margin-top: -8px; box-shadow: 0 0 0 2px var(--color-surface, #fff), 0 0 0 3px var(--c); z-index: 1; }
.koti-ev { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; z-index: 3; background: var(--color-text); }
.koti-ev-handover { transform: rotate(45deg); }
.koti-ev-start { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.koti-ev-static { position: relative; display: inline-block; top: auto; margin: 0 4px 0 0; vertical-align: -1px; }
.koti-today-sample { display: inline-block; width: 2px; height: 12px; background: #c62828; vertical-align: -2px; margin-right: 5px; }
.koti-est-sample { display: inline-block; width: 22px; height: 9px; border-radius: 2px; vertical-align: -1px; margin-right: 4px;
    background: repeating-linear-gradient(135deg, #5b84e6 0 5px, rgba(91, 132, 230, .4) 5px 9px); }
.koti-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 0 0; }
.koti-attn { min-width: 0; padding: 10px 14px; border-left: 1px solid var(--color-border); background: var(--koti-veil); }
.koti-attn h3 { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); margin: 4px 0 8px; }
.koti-at { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: start; width: 100%; text-align: left; padding: 8px 4px;
    border: 0; border-bottom: 1px solid var(--color-border-light, var(--color-border)); background: none; color: inherit; font: inherit; cursor: pointer; }
.koti-at:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.koti-at-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: color-mix(in srgb, var(--color-text) 30%, transparent); }
.koti-at-d .koti-at-dot { background: #c62828; }
.koti-at-w .koti-at-dot { background: #b26a00; }
.koti-at-c { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 12.5px; }
.koti-at-c b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.koti-at-c span { color: var(--color-text-muted); }
.koti-at-d .koti-at-c span { color: #c62828; }
.koti-at-go { font-size: 11.5px; color: var(--color-primary, #1d4ed8); white-space: nowrap; font-weight: 600; }
:root[data-theme="dark"] .koti-at-d .koti-at-c span, :root[data-theme="dark"] .koti-today b { color: #ff7b72; }
:root[data-theme="dark"] .koti-today { border-left-color: #ff7b72; }
:root[data-theme="dark"] .koti-map { opacity: .35; filter: grayscale(.4) brightness(.7); }
@container (max-width: 860px) {
    .koti-body, .koti.map-right .koti-body { grid-template-columns: minmax(0, 1fr); }
    .koti-attn, .koti.map-right .koti-attn { order: -1; border: 0; border-bottom: 1px solid var(--color-border); }
    .koti { --koti-lbl: 170px; }
}
