/* DIÁR – štýly. Bez frameworku, CSS premenné pre svetlý/tmavý režim. */
:root {
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #eef2f8;
  --border: #e3e8f0; --border-strong: #cfd7e3; --text: #0f172a; --muted: #64748b; --faint: #94a3b8;
  --primary: #2563eb; --primary-600: #1d4ed8; --primary-weak: #e8f0fe; --on-primary: #fff;
  --hol: #dc2626; --hol-weak: #fdecec; --ok: #15803d; --warn: #b45309;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06); --shadow: 0 6px 24px rgb(15 23 42 / .10); --shadow-lg: 0 18px 48px rgb(15 23 42 / .22);
  --r: 14px; --r-sm: 10px; --gutter: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1220; --surface: #121b2e; --surface-2: #162036; --surface-3: #1c2842;
  --border: #233150; --border-strong: #31426a; --text: #e6ebf5; --muted: #9aa8c1; --faint: #6b7a96;
  --primary: #5b8cff; --primary-600: #7aa2ff; --primary-weak: #1b2a4d; --on-primary: #0b1220;
  --hol: #f87171; --hol-weak: #3a1c24; --ok: #4ade80; --warn: #fbbf24;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 8px 28px rgb(0 0 0 / .45); --shadow-lg: 0 18px 50px rgb(0 0 0 / .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.4; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .ok { color: var(--ok); } .warn { color: var(--warn); }
.ic { width: 18px; height: 18px; flex: none; }
.sp { flex: 1; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
html:not(.ready) .app { opacity: 0; }
.app { transition: opacity .15s; }

/* ---------- Tlačidlá ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--hol); }
.btn.danger:not(.ghost) { border-color: color-mix(in srgb, var(--hol) 40%, transparent); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; margin: 12px 0 24px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; } .icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.primary { background: var(--primary); color: var(--on-primary); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-3); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.small button { height: 28px; padding: 0 10px; font-size: 13px; }

/* ---------- Rozloženie ---------- */
.app { display: grid; height: 100vh; height: 100dvh; grid-template-columns: 272px minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top top" "left main right"; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: .02em; margin-right: 8px; }
.brand img { border-radius: 7px; }
.navgrp { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.today-btn { margin-right: 4px; }
.period { font-size: 17px; font-weight: 700; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); margin-right: 6px; white-space: nowrap; border: 0; background: transparent; padding: 4px 8px; border-radius: 9px; font-weight: 600; position: relative; }
.status:hover { background: var(--surface-2); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status .st-ic { width: 15px; height: 15px; display: none; }
.status.g .st-ic { display: block; }
.status.g i { display: none; }
.status.warn, .status.st-offline, .status.st-auth { color: var(--warn); }
.status.st-error { color: var(--danger, #dc2626); }
.status.st-syncing { color: var(--primary); }
.status.st-syncing .st-ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.st-pend { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 10.5px; display: inline-grid; place-items: center; }
.status.local { cursor: default; }
.theme-btn .i-sun { display: none; } [data-theme="dark"] .theme-btn .i-sun { display: block; } [data-theme="dark"] .theme-btn .i-moon { display: none; }
.left { grid-area: left; overflow-y: auto; padding: 14px 12px 24px 14px; border-right: 1px solid var(--border); background: var(--surface); }
.main { grid-area: main; overflow-y: auto; overflow-x: hidden; padding: 18px 20px 0; outline: none; position: relative; }
.right { grid-area: right; overflow-y: auto; padding: 14px 14px 24px; border-left: 1px solid var(--border); background: var(--bg); }
.bottomnav, .fab { display: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.left .card { border: 0; box-shadow: none; padding: 6px 4px 14px; margin: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.left .card:last-child { border-bottom: 0; }
.left h4 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- Mini kalendár ---------- */
.mini-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mini-h b { font-size: 14px; }
.mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-w { font-size: 11px; color: var(--faint); padding: 4px 0; }
.mini-d { position: relative; border: 0; background: transparent; height: 30px; border-radius: 50%; font-size: 12.5px; aspect-ratio: 1; justify-self: center; width: 30px; padding: 0; }
.mini-d:hover { background: var(--surface-3); }
.mini-d.other { color: var(--faint); }
.mini-d.weekend { color: color-mix(in srgb, var(--hol) 75%, var(--text)); }
.mini-d.is-holiday { color: var(--hol); font-weight: 700; }
.mini-d.busy::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--primary); opacity: .8; }
.mini-d.today { box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary); font-weight: 700; }
.mini-d.sel { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.mini-d.sel::after { background: var(--on-primary); }

/* ---------- Legenda, najbližšie ---------- */
.legend { list-style: none; padding: 0; margin: 0; }
.legend li { padding: 3px 0; }
.legend label, .legend-hol { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.legend input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; transition: opacity .15s; }
.legend input:not(:checked) + .sw { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.legend input:not(:checked) ~ * { opacity: .7; }
.legend input:focus-visible + .sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.legend-hol { cursor: default; }
.upcoming { list-style: none; padding: 0; margin: 0; }
.upcoming li { display: flex; flex-direction: column; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.upcoming li:hover { background: var(--surface-3); }
.up-d { font-size: 11.5px; color: var(--muted); }
.up-t { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.up-t i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.up-hol .up-t { color: var(--hol); }

/* ---------- Pohľad Deň ---------- */
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.day-head h2 { font-size: 26px; letter-spacing: -.01em; }
.day-head .nd { color: var(--muted); font-size: 15px; }
.day-head .sub { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.ws-d { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ws-d span { font-size: 11.5px; color: var(--muted); }
.ws-d b { font-size: 18px; }
.ws-d:hover { border-color: var(--border-strong); }
.ws-d.weekend b, .ws-d.is-holiday b { color: var(--hol); }
.ws-d.today { border-color: var(--primary); }
.ws-d.sel { background: var(--primary); border-color: var(--primary); }
.ws-d.sel span, .ws-d.sel b { color: var(--on-primary); }

/* ---------- Časová os ---------- */
.view-day, .view-week { height: 100%; display: flex; flex-direction: column; padding-bottom: 16px; }
.tl { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); position: relative; }
.tl-sticky { position: sticky; top: 0; z-index: 3; background: var(--surface); border-radius: var(--r) var(--r) 0 0; }
.tl-head, .tl-allday { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); }
.tl-head { border-bottom: 1px solid var(--border); padding-top: 2px; }
.tl-allday { border-bottom: 1px solid var(--border); grid-template-rows: repeat(var(--lanes), 22px); row-gap: 2px; padding: 3px 0; min-height: 30px; }
.tl-allday.is-empty { grid-template-rows: 24px; }
.tl-allday > .band { margin: 0 3px; z-index: 1; }
.tl-gutter-h { font-size: 10.5px; color: var(--faint); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; text-align: right; }
.tl-adc { border-left: 1px solid var(--border); min-width: 0; margin: -3px 0; }
.tl-dh { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; padding: 6px 0 7px; border-left: 1px solid var(--border); border-radius: 0; }
.tl-dh .dw { font-size: 11.5px; color: var(--muted); }
.tl-dh .dn { font-size: 18px; font-weight: 700; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.tl-dh.weekend .dn, .tl-dh.is-holiday .dn { color: var(--hol); }
.tl-dh.today .dn { background: var(--primary); color: var(--on-primary); }
.tl-dh.sel:not(.today) .dn { box-shadow: inset 0 0 0 2px var(--primary); }
.tl-dh:hover .dw { color: var(--text); }
.tl-body { position: relative; display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); }
.tl-gutter { position: relative; }
.tl-hour { position: absolute; left: 0; right: 0; height: var(--hh); }
.tl-hour span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tl-hour:first-child span { display: none; }
.tl-cols { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px), linear-gradient(to bottom, transparent calc(var(--hh) / 2), color-mix(in srgb, var(--border) 45%, transparent) calc(var(--hh) / 2), color-mix(in srgb, var(--border) 45%, transparent) calc(var(--hh) / 2 + 1px), transparent calc(var(--hh) / 2 + 1px)); background-size: 100% var(--hh); }
.tl-col { position: relative; border-left: 1px solid var(--border); min-width: 0; cursor: cell; }
.tl-col.weekend { background: color-mix(in srgb, var(--surface-3) 45%, transparent); }
.tl-col.today { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--hol); z-index: 2; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--hol); }
.ev { position: absolute; z-index: 1; background: var(--c); color: #fff; border-radius: 8px; padding: 4px 8px; overflow: hidden; cursor: grab; box-shadow: 0 1px 2px rgb(0 0 0 / .12), inset 0 0 0 1px rgb(255 255 255 / .12); touch-action: pan-y; user-select: none; transition: box-shadow .15s, filter .15s; }
.ev:hover { filter: brightness(1.05); box-shadow: 0 4px 12px rgb(0 0 0 / .18); }
.ev-t { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.ev-m { font-size: 11.5px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-short { padding-top: 2px; display: flex; gap: 6px; align-items: baseline; }
.ev-short .ev-t { flex: 0 1 auto; min-width: 0; }
.ev-short .ev-m { flex: 0 1000 auto; min-width: 0; }
.ev-ic { width: 12px; height: 12px; opacity: .85; }
.ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.ev-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: rgb(255 255 255 / .55); opacity: 0; }
.ev:hover .ev-resize::after { opacity: 1; }
.ev.dragging { z-index: 10; opacity: .92; box-shadow: var(--shadow-lg); cursor: grabbing; transition: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- Čipy ---------- */
.chip { font-size: 12px; line-height: 1.25; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; user-select: none; }
.chip-fill { background: var(--c); color: #fff; font-weight: 600; }
.chip-timed { display: flex; align-items: center; gap: 4px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--text); }
.chip-timed i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.chip-timed .ct { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.chip-hol { background: var(--hol-weak); color: var(--hol); font-weight: 600; cursor: default; }
.chip-hol.soft { font-weight: 500; opacity: .85; }
.chip:hover:not(.chip-hol) { filter: brightness(.97); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.chip.dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; box-shadow: var(--shadow-lg); opacity: .95; }

/* ---------- Mesiac ---------- */
.view-month { height: 100%; display: flex; flex-direction: column; padding-bottom: 18px; }
.month { flex: 1; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.month-head, .mweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month.with-wn .month-head, .month.with-wn .mweek { grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
.mweeks { flex: 1; display: flex; flex-direction: column; }
.mweek { flex: 1; min-height: 104px; grid-template-rows: 48px repeat(var(--lanes), 20px) 19px 1fr; row-gap: 2px; position: relative; }
.mweek > .band { margin: 0 3px; z-index: 1; align-self: stretch; }
.band { line-height: 16px; }
.band.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0 !important; }
.band.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0 !important; }
.mweek > .mc-more { z-index: 1; align-self: start; }
.mh { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; padding: 8px 0; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .05em; }
.mh.wn, .mwn { color: var(--faint); font-size: 10.5px; }
.mwn { display: flex; justify-content: center; padding-top: 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mc { position: relative; padding: 4px 5px 4px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; cursor: pointer; transition: background .12s; }
.month:not(.with-wn) .mweek > .mc[style^="grid-column:1;"] { border-left: 0; }
.month.with-wn .mc { border-left: 1px solid var(--border); }
.mc:hover { background: var(--surface-2); }
.mc.other { background: var(--surface-2); }
.mc.other .mc-num { color: var(--faint); }
.mc.sel { background: var(--primary-weak); }
.mc.drop { background: color-mix(in srgb, var(--primary) 16%, transparent); box-shadow: inset 0 0 0 2px var(--primary); }
.mc-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.mc-num { border: 0; background: transparent; width: 26px; height: 26px; border-radius: 50%; font-weight: 650; font-size: 13px; flex: none; padding: 0; }
.mc-num:hover { background: var(--surface-3); }
.mc.weekend .mc-num, .mc.is-holiday .mc-num { color: var(--hol); }
.mc.today .mc-num { background: var(--primary); color: var(--on-primary); }
.mc-nd { font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.mc-mk { display: inline-flex; gap: 2px; color: var(--faint); }
.mc-mk .mk { width: 12px; height: 12px; }
.mc-hol { font-size: 11px; color: var(--hol); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.mc-hol.soft { font-weight: 500; opacity: .8; }
.mc-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-more { border: 0; background: transparent; text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.mc-more:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Agenda ---------- */
.view-agenda { max-width: 820px; }
.ag-day { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ag-date { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 12px; align-self: start; }
.ag-date:hover { background: var(--surface-3); }
.ag-date b { font-size: 24px; line-height: 1.1; }
.ag-date span { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.ag-day.today .ag-date b { color: var(--primary); }
.ag-day.is-holiday .ag-date b { color: var(--hol); }
.ag-items { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-ev { display: grid; grid-template-columns: 112px 4px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.ag-ev:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ag-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-bar { width: 4px; height: 100%; min-height: 22px; border-radius: 2px; background: var(--c); }
.ag-main { display: flex; flex-direction: column; min-width: 0; }
.ag-main b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-main small { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.ag-main small .ic, .ag-hol .ic, .ag-task .ic { width: 14px; height: 14px; }
.ag-hol { display: flex; align-items: center; gap: 6px; color: var(--hol); font-weight: 600; font-size: 13px; padding: 2px 0; }
.ag-hol.soft { font-weight: 500; opacity: .85; }
.ag-task { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 2px 10px; }

/* ---------- Pravý panel ---------- */
.card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card h3 { font-size: 15px; }
.day-card .dc-date { font-weight: 700; font-size: 16px; }
.dc-nd { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dc-hol { display: flex; align-items: center; gap: 6px; color: var(--hol); font-weight: 600; margin-top: 6px; font-size: 13px; }
.dc-hol small { font-weight: 400; color: var(--muted); }
.dc-hol.soft { font-weight: 500; }
.dc-hol .ic { width: 15px; height: 15px; }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); min-height: 38px; }
.task:last-child { border-bottom: 0; }
.tk-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); background: transparent; display: grid; place-items: center; padding: 0; flex: none; color: transparent; transition: background .15s, border-color .15s; }
.tk-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.tk-check:hover { border-color: var(--ok); }
.task.done .tk-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.tk-title { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: text; }
.task.done .tk-title { text-decoration: line-through; color: var(--muted); }
.tk-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-del { opacity: 0; } .task:hover .tk-del, .tk-del:focus-visible { opacity: 1; }
.tk-edit { width: 100%; border: 1px solid var(--primary); border-radius: 6px; padding: 3px 6px; background: var(--surface); }
.task-form { display: flex; gap: 6px; margin-top: 10px; }
.task-form input { min-width: 0; height: 36px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--surface-2); }
.task-form input[name=title] { flex: 1; }
.task-form input[type=time] { width: 92px; flex: none; font-size: 13px; padding: 0 6px; }
.task-form input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.overdue { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.od-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--warn); font-weight: 600; margin-bottom: 4px; }
.note-card textarea { width: 100%; min-height: 180px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); line-height: 1.55; background-image: linear-gradient(transparent calc(1.55em - 1px), var(--border) 1px); background-size: 100% 1.55em; background-attachment: local; background-position-y: 10px; }
.note-card textarea:focus { outline: none; border-color: var(--primary); background-color: var(--surface); }
.note-foot { text-align: right; margin-top: 4px; }

/* ---------- Dialógy ---------- */
.dlg { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); }
.dlg::backdrop { background: rgb(9 14 26 / .45); backdrop-filter: blur(2px); }
.dlg[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg.small { width: min(400px, calc(100vw - 24px)); }
.dlg.top { margin-top: 8vh; width: min(620px, calc(100vw - 24px)); }
.dlg-body { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.dlg-h h3 { font-size: 18px; }
.dlg-scroll { overflow-y: auto; padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.dlg-f { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld input, .fld select, .fld textarea, .rep-end select, .rep-end input, .set-row select { height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--surface-2); min-width: 0; }
.fld textarea { height: auto; padding: 8px 10px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.fld input[name=title] { font-size: 17px; font-weight: 600; height: 46px; }
.fld.inline { flex-direction: row; align-items: center; gap: 8px; }
.fld.inline input { width: 72px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dt { display: flex; gap: 6px; }
.dt input[type=date] { flex: 1.4; } .dt input[type=time] { flex: 1; }
.is-allday .dt input[type=time] { display: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; padding: 2px 0; }
.switch input { position: absolute; opacity: 0; }
.sw-track { width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.sw-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked + .sw-track { background: var(--primary); }
.switch input:checked + .sw-track::after { transform: translateX(16px); }
.switch input:focus-visible + .sw-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-opt input { position: absolute; opacity: 0; }
.cat-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.cat-opt i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cat-opt input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); font-weight: 600; }
.cat-opt input:focus-visible + span { outline: 2px solid var(--primary); }
.repeat { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rep-more { display: none; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.has-repeat .rep-more { display: flex; }
.rep-wd { display: none; } .is-weekly .rep-wd { display: flex; }
.rep-unit { font-style: normal; color: var(--muted); }
.wd-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.wd-pick input { position: absolute; opacity: 0; }
.wd-pick span { display: grid; place-items: center; width: 36px; height: 32px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font-size: 12.5px; font-weight: 600; background: var(--surface); }
.wd-pick input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.wd-pick input:focus-visible + span { outline: 2px solid var(--primary); }
.rep-end { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-end input[type=number] { width: 90px; }
.rep-sum { margin: 0; }
.form-err { color: var(--hol); margin: 0; min-height: 1em; font-weight: 600; font-size: 13px; }
.choice { padding: 20px; gap: 8px; }
.choice p { color: var(--muted); margin: 4px 0 8px; }
.choice-opts { display: flex; flex-direction: column; gap: 8px; }
.choice-opts .btn { justify-content: center; height: 42px; }
.search { max-height: 70vh; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-bar input { flex: 1; border: 0; background: transparent; height: 40px; font-size: 16px; color: var(--text); outline: none; }
.search-res { overflow-y: auto; padding: 8px 10px 14px; }
.search-res h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 8px 4px; }
.search-res ul { list-style: none; margin: 0; padding: 0; }
.search-res li button { width: 100%; display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 10px; }
.search-res li button:hover, .search-res li button:focus-visible { background: var(--surface-3); }
.sr-d { font-size: 12px; color: var(--muted); } .sr-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; } .sr-s { font-size: 12px; }
.search-res p { padding: 8px; }
.settings section { padding: 6px 0 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.settings section:last-child { border-bottom: 0; }
.settings h4 { font-size: 13px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cat-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cat-edit li { display: flex; gap: 8px; align-items: center; }
.cat-edit input[type=color] { width: 36px; height: 32px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.cat-edit input:not([type]) { flex: 1; height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--surface-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.settings a { color: var(--primary); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 14px; background: #0f172a; color: #fff; padding: 10px 14px 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 24px); }
[data-theme="dark"] .toast { background: #e6ebf5; color: #0b1220; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-btn { border: 0; background: transparent; color: #8fb3ff; font-weight: 700; padding: 4px 6px; border-radius: 6px; }
[data-theme="dark"] .toast-btn { color: #1d4ed8; }

/* ---------- Stredná šírka: bez ľavého panelu ---------- */
@media (max-width: 1279px) {
  .app { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "top top" "main right"; }
  .left { display: none; }
  .status.local { display: none; }
  .status.g .st-txt { display: none; }
}

/* ---------- Mobil a tablet na výšku: 1 stĺpec ---------- */
@media (max-width: 1023px) {
  body { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "main" "bottom"; }
  .right, .views, .new-btn, .status.local { display: none; }
  .status.g { margin: 0; padding: 6px; width: 34px; height: 34px; justify-content: center; }
  .status.g .st-pend { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; font-size: 9.5px; padding: 0 3px; box-shadow: 0 0 0 2px var(--surface); }
  .topbar { flex-wrap: wrap; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); gap: 2px; row-gap: 0; }
  .brand { font-size: 17px; margin-right: 2px; } .brand img { width: 26px; height: 26px; }
  .navgrp { order: 2; margin-left: 4px; }
  .period { order: 10; flex-basis: 100%; font-size: 15px; margin: 2px 4px 2px; }
  body[data-view="day"] .period, body[data-view="tasks"] .period { display: none; }
  .main { padding: 12px 12px 0; }
  .bottomnav { grid-area: bottom; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav button { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .bottomnav .ic { width: 22px; height: 22px; }
  .bottomnav button.on { color: var(--primary); }
  .bottomnav button.on .ic { stroke-width: 2.4; }
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 45%, transparent); z-index: 20; transition: transform .1s; }
  .fab:active { transform: scale(.94); }
  .fab .ic { width: 26px; height: 26px; }
  .day-head h2 { font-size: 23px; }
  .weekstrip { gap: 4px; }
  .ws-d { padding: 6px 0; border-radius: 11px; }
  :root { --gutter: 46px; }
  .view-day, .view-week { padding-bottom: 10px; }
  #installBtn { display: none; }
  .view-week .tl-dh .dn { font-size: 15px; width: 28px; height: 28px; }
  .view-week .ev { padding: 2px 3px; border-radius: 5px; }
  .view-week .ev-t { font-size: 11px; } .view-week .ev-m { display: none; }
  .view-week .chip { font-size: 10.5px; padding: 1px 3px; }
  .view-month { height: auto; padding-bottom: 96px; }
  .mweek { min-height: 84px; grid-template-rows: 44px repeat(var(--lanes), 17px) 16px 1fr; row-gap: 1px; }
  .mweek > .band { margin: 0 1px; }
  .mweek .chip { font-size: 10.5px; padding: 0 3px; border-radius: 4px; line-height: 16px; }
  .mc { padding: 3px 2px; }
  .mc-top { justify-content: center; }
  .mc-nd, .mc-mk { display: none; }
  .mc-hol { font-size: 9.5px; text-align: center; }
  .chip-timed .ct, .chip-timed i { display: none; }
  .chip-timed { background: color-mix(in srgb, var(--c) 22%, transparent); }
  .mc-more { font-size: 10.5px; padding: 0 3px; text-align: center; }
  .view-agenda { padding-bottom: 90px; }
  .ag-day { grid-template-columns: 54px 1fr; gap: 8px; }
  .ag-ev { grid-template-columns: 4px 1fr; gap: 8px; }
  .ag-time { grid-column: 2; grid-row: 2; font-size: 12px; } .ag-bar { grid-row: 1 / 3; grid-column: 1; } .ag-main { grid-column: 2; grid-row: 1; }
  .view-tasks { padding-bottom: 96px; }
  .tk-del { opacity: .6; }
  .dlg.sheet { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .dlg.sheet[open] { animation: sheet .2s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
  .dlg.sheet .dlg-body { max-height: 94dvh; }
  .row2 { grid-template-columns: 1fr; }
  .search-res li button { grid-template-columns: 1fr; gap: 0; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .fld input, .fld select, .task-form input { font-size: 16px; } /* iOS bez zoomu */
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .topbar, .left, .right, .bottomnav, .fab { display: none !important; }
  .app { display: block; height: auto; } .main { overflow: visible; }
  body.printing > *:not(#printArea), body.printing dialog, body.printing .toast { display: none !important; }
  body.printing #printArea { display: block !important; }
  body.printing { background: #fff; color: #000; }
}

/* ---------- Výber dátumu a času ---------- */
.pk { position: relative; min-width: 0; }
.pk[hidden] { display: none; }
.pk-in { width: 100%; font-variant-numeric: tabular-nums; cursor: pointer; }
.pk-date { flex: 1.6; } .pk-time { flex: 1; max-width: 96px; }
.pk.open .pk-in { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.pk-pop { position: fixed; z-index: 2000; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; margin: 0; }
.pk-pop-date { width: 272px; }
.pk-cal-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px; }
.pk-cal-h b { font-size: 14px; }
.pk-nav { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--muted); }
.pk-nav:hover { background: var(--surface-2); color: var(--text); }
.pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pk-wd { font-size: 10.5px; text-align: center; color: var(--faint); font-weight: 600; padding: 2px 0 4px; text-transform: uppercase; }
.pk-d { border: 0; background: transparent; height: 34px; border-radius: 9px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
.pk-d:hover { background: var(--surface-2); }
.pk-d.other { color: var(--faint); }
.pk-d.we { color: var(--hol); }
.pk-d.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.pk-d.on { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.pk-foot { display: flex; justify-content: flex-end; padding-top: 4px; }
.pk-pop-time { width: 110px; padding: 4px; }
.pk-times { max-height: 232px; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; }
.pk-t { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--text); flex: none; }
.pk-t:hover { background: var(--surface-2); }
.pk-t.on { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.is-allday .dt .pk-time { display: none; }
.task-form .pk-time { flex: 0 0 74px; max-width: 74px; }

/* ---------- Google a pripomienky v nastaveniach ---------- */
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); margin: 6px 0; }
.notice .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); }
.g-acc { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.g-acc .ic { width: 20px; height: 20px; }
.g-cals { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.g-cals li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.g-cals li:hover { background: var(--surface-2); }
.g-cals i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.g-cals label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.g-cals .ro { color: var(--faint); font-size: 11.5px; }
.g-stat { font-size: 12.5px; margin: 6px 0; }
.g-stat.err { color: var(--danger, #dc2626); }
.backups { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 3px; max-height: 180px; overflow: auto; }
.backups li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 3px 6px; border-radius: 8px; background: var(--surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.st-pend[hidden] { display: none !important; }
.dlg-scroll { min-height: 0; flex: 1 1 auto; }
.g-cals input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--primary); }
.g-cals span { font-size: 14px; font-weight: 500; color: var(--text); margin: 0; }

/* ---------- Fáza 3: prílohy, diktovanie, prepis, porada, PLAUD ---------- */
.print-area { display: none; }
.minutes { font: 11pt/1.45 Calibri, "Segoe UI", Arial, sans-serif; color: #111; max-width: 180mm; margin: 0 auto; }
.minutes h1 { font-size: 18pt; color: #1f3a8a; margin: 0 0 10pt; }
.minutes h2 { font-size: 13pt; color: #1f3a8a; margin: 14pt 0 4pt; border-bottom: 1px solid #ccd; padding-bottom: 2pt; }
.minutes h3 { font-size: 11.5pt; margin: 10pt 0 3pt; }
.minutes p { margin: 0 0 4pt; } .minutes ul { margin: 0 0 6pt; padding-left: 18pt; }
.minutes table { border-collapse: collapse; width: 100%; margin: 4pt 0 8pt; }
.minutes th, .minutes td { border: 1px solid #999; padding: 3pt 6pt; text-align: left; vertical-align: top; }
.minutes .pm-meta th { width: 32%; background: #f1f4fa; }
.minutes .pm-tbl thead th { background: #e8eefb; }
.minutes .pm-foot { margin-top: 18pt; font-size: 9pt; color: #777; }

.fld-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mic-btn.on { background: var(--hol); color: #fff; animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hol) 50%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.dict-interim { font-size: 12.5px; color: var(--muted); font-style: italic; min-height: 0; padding: 2px 4px; }
.dict-interim:empty { display: none; }
.note-card header .mic-btn { margin-left: 4px; }

.att-sec { display: flex; flex-direction: column; gap: 6px; border: 1px dashed transparent; border-radius: 12px; padding: 2px; transition: border-color .15s, background .15s; }
.att-sec.drag-over { border-color: var(--primary); background: var(--primary-weak); }
.note-card .att-sec { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; border-radius: 0; }
.att-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.att { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.att-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 2px; border-radius: 8px; }
.att-main:hover { background: var(--surface-3); }
.att-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.att-ic { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; position: relative; }
.att-ic .ic { width: 20px; height: 20px; }
.att-ic.k-pdf { color: #dc2626; background: color-mix(in srgb, #dc2626 12%, transparent); }
.att-ic.k-doc { color: #2563eb; background: color-mix(in srgb, #2563eb 12%, transparent); }
.att-ic.k-sheet { color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.att-ic.k-audio { color: #9333ea; background: color-mix(in srgb, #9333ea 12%, transparent); }
.att-ic.k-image, .att-ic.k-video { color: #ea7a12; background: color-mix(in srgb, #ea7a12 12%, transparent); }
.att-ic.fav img { position: absolute; inset: 10px; width: 20px; height: 20px; border-radius: 4px; background: var(--surface); }
.att-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.att-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-s { display: flex; align-items: center; gap: 4px; }
.att-s .ic { width: 13px; height: 13px; }
.att-cloud { color: var(--ok); display: inline-flex; } .att-wait { color: var(--warn); display: inline-flex; }
.att-tr { color: var(--text); opacity: .8; font-style: italic; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.att-job { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); white-space: nowrap; }
.att-job .ic { width: 14px; height: 14px; }
.att-tools { display: flex; flex-wrap: wrap; gap: 2px; }
.att-tools .btn { color: var(--muted); }
.att-tools .btn .ic { width: 16px; height: 16px; }
.att-sec.compact .att-tools .btn span { display: none; }
.att-sec.compact .att-tools .btn { padding: 0 8px; }
.att-drop { font-size: 11.5px; }
@media (hover: none) { .att-drop { display: none; } }
@media (hover: hover) { .cam-btn { display: none !important; } }

.plaud-rec { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.plaud-rec > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.plaud-rec > summary::-webkit-details-marker { display: none; }
.plaud-rec > summary .ic { color: #9333ea; }
.plaud-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.plaud-body audio { width: 100%; }
.plaud-body h5 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.plaud-sum .pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; max-height: 220px; overflow: auto; }
.plaud-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plaud-tools h5 { margin: 0; }
.plaud-q { flex: 1; min-width: 140px; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.segs { list-style: none; margin: 6px 0 0; padding: 0; max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.segs li { padding: 4px 6px; border-radius: 8px; line-height: 1.45; }
.segs li.hit { background: color-mix(in srgb, #facc15 22%, transparent); }
.segs li.cur { background: var(--primary-weak); }
.segs .ts { border: 0; background: var(--surface-3); color: var(--primary); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.segs .spk { color: var(--muted); }

.att-view .dlg-scroll { display: flex; flex-direction: column; gap: 8px; }
.av-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.av-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-prev { display: grid; place-items: center; min-height: 120px; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.av-prev img, .av-prev video { max-width: 100%; max-height: 60vh; display: block; }
.av-prev iframe { width: 100%; height: 60vh; border: 0; background: #fff; }
.av-prev audio { width: 100%; margin: 20px; }
.av-prev pre { width: 100%; max-height: 50vh; overflow: auto; margin: 0; padding: 12px; white-space: pre-wrap; font-size: 12.5px; }
.av-big { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); padding: 24px; text-align: center; }
.av-big .ic { width: 48px; height: 48px; }
.av-tr-h { display: flex; align-items: center; justify-content: space-between; }
.av-tr-h h5 { margin: 0; font-size: 13px; }
.av-tr-text { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); resize: vertical; margin-top: 6px; }
.dlg-f a.btn { text-decoration: none; }

.meet-sw .ic { color: var(--primary); }
fieldset.meeting { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
fieldset.meeting[hidden] { display: none; }
.m-actions { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.m-act { display: grid; grid-template-columns: auto minmax(0, 3fr) minmax(0, 1fr) 130px auto auto; gap: 6px; align-items: center; }
.m-act input:not([type=checkbox]) { height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; background: var(--surface); min-width: 0; }
.m-act .ma-done { width: 18px; height: 18px; accent-color: var(--primary); }
.ma-task.linked { color: var(--ok); }
.m-export { align-items: center; }

.rec-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 3000; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 14px; padding: 8px 10px 8px 14px; }
.rec-bar[hidden] { display: none; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--hol); animation: micpulse 1.2s infinite; }
.rec-t { font-variant-numeric: tabular-nums; min-width: 40px; }
.stt-panel { position: fixed; right: 16px; bottom: 16px; z-index: 2500; width: min(340px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.stt-panel[hidden] { display: none; }
.stt-h { display: flex; align-items: center; gap: 8px; }
.stt-h b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stt-panel .bar { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.stt-panel .bar i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.stt-p { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.quick { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.quick h3 { display: flex; align-items: center; gap: 8px; }
.qa-row { display: flex; gap: 6px; }
.qa-row input { flex: 1; height: 46px; font-size: 17px; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; background: var(--surface-2); min-width: 0; }
.qa-row input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.qa-row .mic-btn { width: 46px; height: 46px; border: 1px solid var(--border); }
.qa-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--primary-weak); }
.qa-t { font-size: 16px; } .qa-w { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.share-what { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
.share-what div { display: flex; align-items: center; gap: 6px; min-width: 0; word-break: break-all; }
.share-text { white-space: pre-wrap; }
.share-targets { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 44vh; overflow: auto; }
.share-targets li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); }
.share-targets label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.share-targets label > span { display: flex; flex-direction: column; min-width: 0; }
.share-targets .pk { max-width: 160px; }
.link-form .fld input { width: 100%; }
.stt-set select { max-width: 60%; }
@media (max-width: 1023px) {
  .rec-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .stt-panel { right: 12px; left: 12px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .m-act { grid-template-columns: auto minmax(0, 1fr) auto; }
  .m-act .ma-who, .m-act .ma-due { grid-column: 2 / 3; }
  .att-tools .btn span { display: none; }
  .quick-btn { display: none; }
}
.share h3, .quick h3 { display: flex; align-items: center; gap: 8px; }
.share-targets .pk { max-width: 150px; flex: none; }
