/* =========================================================
   Pošta – moderní vzhled
   ========================================================= */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --sidebar: #f3f4f7;
  --rail: #e9ebf1;
  --border: #e4e6eb;
  --border-strong: #d5d8e0;
  --text: #16181d;
  --muted: #6b7080;
  --faint: #a3a7b3;
  --hover: #eceef3;
  --selected: #eceeff;
  --selected-border: #c7cdfd;
  --accent: #4f5bd5;
  --accent-hover: #4048c0;
  --accent-soft: #e6e8ff;
  --accent-text: #ffffff;
  --star: #f59e0b;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 12px 40px rgba(16, 24, 40, .14), 0 3px 10px rgba(16, 24, 40, .06);
  --radius: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13; --panel: #15171c; --sidebar: #121318; --rail: #0a0b0e; --border: #23262e; --border-strong: #30343e;
    --text: #e9eaf0; --muted: #9a9fae; --faint: #626776; --hover: #1d2028;
    --selected: #1d2142; --selected-border: #3b4290; --accent: #8b95ff; --accent-hover: #a3abff; --accent-soft: #222650;
    --accent-text: #0e0f13; --star: #fbbf24; --danger: #f87171;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 14px 44px rgba(0,0,0,.55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13; --panel: #15171c; --sidebar: #121318; --rail: #0a0b0e; --border: #23262e; --border-strong: #30343e;
  --text: #e9eaf0; --muted: #9a9fae; --faint: #626776; --hover: #1d2028;
  --selected: #1d2142; --selected-border: #3b4290; --accent: #8b95ff; --accent-hover: #a3abff; --accent-soft: #222650;
  --accent-text: #0e0f13; --star: #fbbf24; --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 14px 44px rgba(0,0,0,.55); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- Tlačítka ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--panel); padding: 7px 13px; border-radius: 10px; white-space: nowrap; font-weight: 500; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transition: background .12s, color .12s; text-decoration: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--star); }
.icon-btn.on svg { fill: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Přihlášení ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 34px 30px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); outline: none; transition: border-color .12s, box-shadow .12s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); background: var(--panel); }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.error { color: var(--danger); font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.hint { font-size: 12px; color: var(--faint); margin-top: 18px; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #6d77ff, #4f5bd5 55%, #7c3aed); display: inline-grid; place-items: center; color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, #4f5bd5 35%, transparent); }
.logo svg { width: 18px; height: 18px; }

/* =========================================================
   Rozvržení: pruh aplikací | složky | seznam | čtení
   ========================================================= */
.app { display: grid; grid-template-columns: 76px var(--sw, 248px) minmax(320px, 400px) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.app:not([data-mode="mail"]) { grid-template-columns: 76px minmax(0, 1fr); }

/* Pruh aplikací */
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 6px; min-height: 0; border-right: 1px solid var(--border); z-index: 20; }
.rail-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 19px; color: #fff; letter-spacing: -.03em; background: linear-gradient(135deg, #6d77ff, #4f5bd5 55%, #7c3aed); box-shadow: 0 4px 14px color-mix(in srgb, #4f5bd5 40%, transparent); margin-bottom: 14px; flex: none; }
.rail-apps { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 8px; }
.rail-apps button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; border: 0; background: transparent; padding: 8px 2px 7px; border-radius: 12px; color: var(--muted); transition: background .12s, color .12s; }
.rail-apps button svg { width: 22px; height: 22px; stroke-width: 1.7; }
.rail-apps button .lbl { font-size: 10.5px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.rail-apps button:hover { background: var(--hover); color: var(--text); }
.rail-apps button.on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); }
.rail-apps button.on::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-apps .badge { position: absolute; top: 3px; right: 6px; min-width: 18px; text-align: center; }
.rail-tools { margin-top: auto; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.rail-tool { display: grid; place-items: center; width: 40px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.rail-tool:hover { background: var(--hover); color: var(--text); }
.badge:empty { display: none; }
.badge { background: var(--accent); color: var(--accent-text); font-size: 10.5px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 999px; box-shadow: 0 0 0 2px var(--rail); }

/* Panel se složkami (jen v Poště) */
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; position: relative; }
.app:not([data-mode="mail"]) .sidebar { display: none; }
.account { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; min-width: 0; }
.account .avatar { box-shadow: 0 0 0 2px var(--panel); }
.acc-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.acc-txt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-txt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .compose-btn { margin: 4px 14px 14px; justify-content: center; padding: 10px; border-radius: 12px; font-size: 14px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent); }
.folders { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.folder { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; padding: 7px 10px; border-radius: 9px; text-align: left; color: var(--text); font-weight: 500; transition: background .1s; }
.folder:hover { background: var(--hover); }
.folder.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.folder .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--hover); padding: 1px 7px; border-radius: 999px; }
.folder.active .count { color: var(--accent); background: var(--panel); }
.folder svg { color: var(--muted); width: 18px; height: 18px; }
.folder.active svg { color: var(--accent); }
.folder-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 16px 10px 6px; }
.folder-sep { height: 1px; background: var(--border); margin: 8px 10px; }
.new-folder { color: var(--muted); }
.new-folder:hover { color: var(--accent); }
.new-folder:hover svg { color: var(--accent); }
.resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 5; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, body.resizing .resizer::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }

/* ---------- Seznam zpráv ---------- */
.list-pane { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.list-head { padding: 16px 14px 10px; }
.list-title { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.list-title h2 { flex: 1; margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid transparent; background: var(--hover); border-radius: 10px; outline: none; transition: border-color .12s, background .12s, box-shadow .12s; }
.search input:focus { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.filters { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--border); background: var(--panel); padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: all .12s; }
.chip:hover { background: var(--hover); color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.bulkbar { display: flex; align-items: center; gap: 2px; padding: 6px 10px; margin: 0 10px 6px; border-radius: 10px; background: var(--accent-soft); }
.bulkbar .n { flex: 1; font-size: 13px; font-weight: 600; padding-left: 6px; color: var(--accent); }

.messages { flex: 1; overflow-y: auto; padding: 2px 8px 12px; }
.msg { display: grid; grid-template-columns: 22px 38px 1fr; gap: 0 10px; align-items: start; padding: 11px 10px 11px 6px; border-radius: 12px; cursor: pointer; position: relative; margin-bottom: 1px; transition: background .1s; }
.msg + .msg::after { content: ""; position: absolute; top: -1px; left: 72px; right: 10px; height: 1px; background: var(--border); }
.msg:hover { background: var(--hover); }
.msg:hover::after, .msg:hover + .msg::after, .msg.active::after, .msg.active + .msg::after { opacity: 0; }
.msg.active { background: var(--selected); }
.msg.unread .from, .msg.unread .subj { font-weight: 700; }
.msg.unread::before { content: ""; position: absolute; left: 6px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--accent); }
.msg .check { margin: 11px 0 0 4px; opacity: 0; accent-color: var(--accent); }
.msg:hover .check, .msg .check:checked, .has-selection .msg .check { opacity: 1; }
.msg.unread .check { margin-left: 6px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; letter-spacing: -.02em; }
.msg-body { min-width: 0; }
.msg-row { display: flex; gap: 8px; align-items: baseline; }
.msg .from { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.msg .date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg.unread .date { color: var(--accent); font-weight: 600; }
.msg .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); flex: 1; font-size: 13.5px; }
.msg.unread .subj { color: var(--text); }
.msg .meta { display: flex; gap: 4px; color: var(--faint); }
.msg .meta svg { width: 14px; height: 14px; }
.msg .meta .star { color: var(--star); fill: currentColor; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.load-more { display: flex; margin: 14px auto; }
.spinner { width: 24px; height: 24px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Čtení ---------- */
.reader { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.reader-empty { flex: 1; display: grid; place-items: center; color: var(--faint); text-align: center; padding: 24px; }
.reader-empty svg { width: 52px; height: 52px; stroke-width: 1.1; margin-bottom: 10px; color: var(--border-strong); }
.reader-empty kbd, .keys kbd { font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--border); border-bottom-width: 2px; padding: 1px 7px; border-radius: 6px; background: var(--panel); color: var(--text); }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel); overflow-x: auto; scrollbar-width: none; }
.toolbar .btn { flex: none; }
@media (max-width: 1300px) { .toolbar .btn .lbl { display: none; } }
.toolbar .spacer { flex: 1; }
.reader-scroll { flex: 1; overflow-y: auto; padding: 26px 32px 48px; }
.reader h1 { font-size: 24px; line-height: 1.3; margin: 0 0 18px; letter-spacing: -.025em; word-wrap: break-word; }
.sender { display: flex; gap: 4px 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.sender .who { flex: 1; min-width: 180px; }
.sender .name { font-weight: 600; }
.sender .addr { color: var(--muted); font-size: 13px; font-weight: 400; }
.sender .to { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender .when { color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.banner .grow { flex: 1; min-width: 160px; }
.banner button { border: 0; background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 8px; font-weight: 600; font-size: 12.5px; }
.mail-frame { width: 100%; border: 1px solid var(--border); border-radius: 14px; background: #fff; min-height: 120px; display: block; box-shadow: var(--shadow-sm); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.att { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); text-decoration: none; color: var(--text); max-width: 300px; box-shadow: var(--shadow-sm); transition: border-color .12s; }
.att:hover { border-color: var(--accent); }
.att svg { color: var(--muted); }
.att .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.att .sz { color: var(--muted); font-size: 12px; white-space: nowrap; }
.quick-reply { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Psaní ---------- */
.compose { position: fixed; right: 24px; bottom: 0; width: 620px; max-width: calc(100vw - 32px); height: min(660px, calc(100dvh - 40px)); background: var(--panel); border: 1px solid var(--border); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 40; overflow: hidden; }
.compose.max { right: 50%; transform: translateX(50%); bottom: 20px; width: min(980px, calc(100vw - 32px)); height: calc(100dvh - 40px); border-radius: 16px; }
.compose-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 18px; background: var(--sidebar); border-bottom: 1px solid var(--border); font-weight: 600; }
.compose-head .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow { display: flex; align-items: center; gap: 8px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.crow label { color: var(--muted); font-size: 13px; width: 54px; flex: none; }
.crow input { flex: 1; border: 0; outline: none; background: transparent; padding: 11px 0; min-width: 0; }
.crow .link { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 4px 6px; border-radius: 6px; }
.crow .link:hover { color: var(--accent); background: var(--hover); }
.fmt { display: flex; gap: 2px; padding: 5px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.fmt .icon-btn { width: 30px; height: 30px; }
.fmt select { border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 4px 8px; font-size: 12px; margin-left: auto; max-width: 170px; }
.editor { flex: 1; overflow-y: auto; padding: 16px 18px; outline: none; line-height: 1.6; }
.editor blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.editor:empty::before { content: attr(data-placeholder); color: var(--faint); }
.compose-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; }
.compose-files:not(:empty) { padding: 8px 18px; border-top: 1px solid var(--border); }
.file-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--hover); padding: 4px 4px 4px 11px; border-radius: 999px; font-size: 12px; max-width: 240px; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: 0; background: none; color: var(--muted); padding: 0 5px; font-size: 15px; }
.compose-foot { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.compose-foot .spacer { flex: 1; }
.compose-foot .note { font-size: 12px; color: var(--faint); }
.compose.dragover::after { content: "Pusťte soubory pro přiložení"; position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 2px dashed var(--accent); border-radius: inherit; font-weight: 600; color: var(--accent); }
.suggest { position: absolute; z-index: 50; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; min-width: 260px; padding: 4px; }
.suggest div { padding: 7px 10px; cursor: pointer; font-size: 13px; border-radius: 8px; }
.suggest div small { color: var(--muted); margin-left: 6px; }
.suggest div.on, .suggest div:hover { background: var(--accent-soft); }

/* ---------- Dialogy ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 18, .5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s ease-out; }
.dialog { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .16s ease-out; }
.dialog-head { display: flex; align-items: center; padding: 16px 16px 10px 22px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.dialog-head .t { flex: 1; }
.dialog-body { padding: 4px 22px 16px; overflow-y: auto; }
.dialog-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.dialog h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 20px 0 8px; }
.dialog .row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.dialog .row > * { flex: 1; }
.check-row { display: flex; align-items: center; gap: 9px; margin: 8px 0; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.tpl { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.tpl input, .tpl textarea { width: 100%; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; }
.tpl textarea { min-height: 64px; resize: vertical; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13px; }
.folder-pick { display: flex; flex-direction: column; gap: 2px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }

/* ---------- Toasty ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #1b1d24; color: #f4f5f8; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; pointer-events: auto; font-size: 13px; font-weight: 500; animation: up .18s ease-out; }
.toast button { background: none; border: 0; color: #a5b0ff; font-weight: 700; padding: 0; }
.toast.err { background: #8a1c1c; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* =========================================================
   Aplikace v pravé části (Bakaláři, Poznámky, Disk)
   ========================================================= */
.app-pane { display: none; grid-column: 2 / -1; min-height: 0; min-width: 0; flex-direction: column; background: var(--bg); position: relative; }
.app-pane.on { display: flex; }
.app:not([data-mode="mail"]) .list-pane, .app:not([data-mode="mail"]) .reader { display: none !important; }
.app-pane [data-bk="menu"], .app-pane [data-n="menu"], .app-pane [data-d="menu"] { display: none !important; }

.bak-head { display: flex; align-items: center; gap: 6px; padding: 18px 28px 12px; background: var(--panel); }
.bak-title { flex: 1; min-width: 0; }
.bak-title h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.bak-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bak-tabs { display: flex; gap: 4px; padding: 0 22px; background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.bak-tab { border: 0; background: none; padding: 10px 12px 11px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s; }
.bak-tab:hover { color: var(--text); }
.bak-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.bak-body { flex: 1; overflow-y: auto; padding: 20px 28px 48px; }
.bak-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 22px 0 10px; }
.bak-h:first-child { margin-top: 4px; }
.bak-setup { flex: 1; overflow-y: auto; display: grid; place-items: start center; padding: 28px 16px; }
.bak-setup h1 svg { width: 24px; height: 24px; color: var(--accent); }

.m1 { --mc: #16a34a; } .m2 { --mc: #65a30d; } .m3 { --mc: #d97706; } .m4 { --mc: #ea580c; } .m5 { --mc: #dc2626; } .m0 { --mc: var(--muted); }
.recent-marks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mark { display: flex; gap: 11px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; min-width: 0; box-shadow: var(--shadow-sm); }
.mark.new { border-color: var(--selected-border); background: var(--selected); }
.mval { flex: none; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; background: var(--mc); }
.mtxt { min-width: 0; display: flex; flex-direction: column; }
.mtxt b, .mtxt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtxt small { color: var(--muted); font-size: 12px; }
.subjects { display: flex; flex-direction: column; gap: 8px; }
.subject { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.subject summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.subject summary::-webkit-details-marker { display: none; }
.sname { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smarks { display: flex; gap: 4px; }
.mini { font-size: 12px; font-weight: 700; color: var(--mc); min-width: 14px; text-align: center; }
.savg { font-weight: 800; font-size: 15px; color: var(--mc); min-width: 44px; text-align: right; }
.smark-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 0 14px 14px; }
@media (max-width: 600px) { .smarks { display: none; } }

.week-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; font-weight: 600; }
.week-nav span { margin: 0 4px; }
.week-nav .chip { margin-left: 8px; }
.tt-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-sm); }
.tt { display: grid; min-width: max-content; }
.tt > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 7px 9px; min-height: 54px; }
.tt-hour, .tt-day { display: flex; flex-direction: column; justify-content: center; background: var(--sidebar); }
.tt-hour { text-align: center; min-height: 0 !important; }
.tt-hour small, .tt-day small { color: var(--muted); font-size: 11px; }
.tt-day.today { background: var(--accent-soft); color: var(--accent); }
.tt-cell { display: flex; flex-direction: column; gap: 4px; }
.tt-cell.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tt-atom { display: flex; flex-direction: column; line-height: 1.25; }
.tt-atom small { color: var(--muted); font-size: 11px; }
.tt-atom.changed b { color: var(--danger); }
.tt-free { display: grid; place-items: center; color: var(--muted); font-style: italic; }

.hw { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.hw.done { opacity: .6; }
.hw-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.hw-subj { flex: 1; font-weight: 700; }
.hw-due { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.hw.done .hw-due { color: var(--muted); background: var(--hover); }
.hw-text { overflow-wrap: anywhere; }
.hw-teacher { color: var(--muted); font-size: 12px; }

.komens-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.komens { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 12px 16px; }
.komens:last-child { border-bottom: 0; }
.komens:hover { background: var(--hover); }
.komens.unread .k-title, .komens.unread .k-from { font-weight: 700; }
.k-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-date { font-size: 12px; color: var(--muted); }
.k-title { grid-column: 1 / -1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-h { margin: 18px 0 4px; font-size: 22px; letter-spacing: -.02em; }
.k-meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.abs { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.abs th, .abs td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--border); }
.abs tr:last-child td { border-bottom: 0; }
.abs th:first-child, .abs td:first-child { text-align: left; }
.abs th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--sidebar); }
.abs td.over { color: var(--danger); font-weight: 700; }

/* ---------- Poznámky ---------- */
.notes { flex: 1; display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); min-height: 0; }
.notes-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--panel); }
.notes-head { display: flex; align-items: center; gap: 8px; padding: 18px 16px 12px; }
.notes-head h2 { flex: 1; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.notes-search { margin: 0 16px 10px; }
.notes-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.note-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 12px; margin-bottom: 2px; transition: background .1s; }
.note-item:hover { background: var(--hover); }
.note-item.active { background: var(--selected); }
.ni-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ni-title { flex: 1; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ni-pin { width: 14px; height: 14px; color: var(--accent); }
.ni-date { font-size: 12px; color: var(--text); white-space: nowrap; font-weight: 500; }
.ni-prev { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-editor { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); }
.note-bar { display: flex; align-items: center; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.note-bar .spacer { flex: 1; }
.note-status { font-size: 12px; color: var(--muted); }
.note-status.err { color: var(--danger); }
.note-title { border: 0; outline: none; background: transparent; font-size: 28px; font-weight: 750; letter-spacing: -.03em; padding: 28px 40px 6px; max-width: 860px; width: 100%; }
.note-body { flex: 1; border: 0; outline: none; background: transparent; resize: none; padding: 8px 40px 24px; font: 15.5px/1.7 var(--font); max-width: 860px; width: 100%; }
.note-meta { font-size: 12px; color: var(--faint); padding: 0 40px 16px; }

/* ---------- Google Disk ---------- */
#drive .bak-head .btn { flex: none; }
.drive-bar { display: flex; gap: 10px; align-items: center; padding: 0 28px 12px; background: var(--panel); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.drive-bar .filters { margin-top: 0; }
.drive-bar .search { flex: 1; min-width: 200px; }
.crumbs { display: flex; align-items: center; gap: 4px; padding: 14px 28px 6px; font-weight: 600; flex-wrap: wrap; }
.crumbs button { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.crumbs button:hover { color: var(--accent); background: var(--hover); }
.crumbs .sep { color: var(--faint); }
.drive-body { flex: 1; overflow-y: auto; padding: 6px 28px 48px; }
.d-list { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.d-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 90px 80px 112px; gap: 12px; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 48px; transition: background .1s; }
.d-row:last-child { border-bottom: 0; }
.d-row:hover { background: var(--hover); }
.d-headrow { cursor: default; min-height: 0; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--sidebar); padding-top: 9px; padding-bottom: 9px; }
.d-headrow:hover { background: var(--sidebar); }
.d-icon { width: 20px; height: 20px; }
.d-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; font-weight: 500; }
svg.d-star { width: 14px; height: 14px; color: var(--star); fill: currentColor; flex: none; }
.d-mod, .d-size { font-size: 12px; color: var(--muted); white-space: nowrap; }
.d-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .1s; }
.d-row:hover .d-actions, .d-row:focus-within .d-actions { opacity: 1; }
.d-actions .icon-btn { width: 32px; height: 32px; }
#drive.dragover::after { content: "Pusťte soubory pro nahrání na Disk"; position: absolute; inset: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 2px dashed var(--accent); border-radius: 16px; font-weight: 600; color: var(--accent); z-index: 10; }
.guide { max-width: 740px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 10px 28px 22px; box-shadow: var(--shadow-sm); }
.guide h3 { font-size: 18px; margin: 16px 0 8px; }
.guide ol { padding-left: 22px; }
.guide li { margin-bottom: 12px; line-height: 1.6; }
.guide pre, .guide code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sidebar); border: 1px solid var(--border); border-radius: 8px; }
.guide code { padding: 1px 6px; }
.guide pre { padding: 10px 12px; margin: 8px 0 0; white-space: pre-wrap; }
.guide .muted, .muted { color: var(--muted); }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.copy-row code { padding: 6px 10px; overflow-wrap: anywhere; }
@media (max-width: 1300px) { #drive .bak-head .btn .lbl { display: none; } }

/* =========================================================
   Menší obrazovky
   ========================================================= */
.mobile-only { display: none; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 76px var(--sw, 220px) minmax(280px, 330px) minmax(0, 1fr); }
  .reader-scroll { padding: 22px 24px 40px; }
}

/* Mobil: pruh aplikací jako lišta dole, složky jako vysouvací panel */
@media (max-width: 860px) {
  .mobile-only { display: inline-grid; }
  .hide-mobile { display: none !important; }
  .app, .app:not([data-mode="mail"]) { grid-template-columns: 1fr; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom); flex-direction: row; justify-content: space-around; gap: 0; border-right: 0; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(12px); }
  .rail-logo { display: none; }
  .rail-apps { flex-direction: row; flex: 1; padding: 0; gap: 2px; }
  .rail-apps button { flex: 1; padding: 6px 2px; }
  .rail-apps button.on { background: transparent; box-shadow: none; }
  .rail-apps button.on::before { left: 30%; right: 30%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .rail-apps .badge { right: calc(50% - 22px); }
  .rail-tools { margin: 0; flex-direction: row; }
  .rail-tool { width: 38px; }
  .resizer { display: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 300px; max-width: 85vw; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app.drawer .sidebar { transform: none; }
  .app.drawer::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .app-pane { grid-column: 1; }
  .list-pane { border-right: 0; }
  .app[data-view="reader"] .list-pane { display: none; }
  .app[data-view="list"] .reader { display: none; }
  .reader-scroll { padding: 18px 16px 40px; }
  .reader h1 { font-size: 21px; }
  .compose, .compose.max { inset: 0; right: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; transform: none; }
  .msg .check { display: none; }
  .msg { grid-template-columns: 38px 1fr; padding-left: 16px; }
  .msg + .msg::after { left: 64px; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .bak-head { padding: 14px 16px 10px; }
  .bak-tabs { padding: 0 10px; }
  .bak-body { padding: 16px 14px 40px; }
  .notes { grid-template-columns: 1fr; }
  .notes.editing .notes-side, .notes:not(.editing) .note-editor { display: none; }
  .notes-side { border-right: 0; }
  .note-title { padding: 18px 18px 4px; font-size: 24px; }
  .note-body { padding: 4px 18px 16px; }
  .note-meta { padding: 0 18px 12px; }
  .drive-bar { padding: 0 14px 10px; }
  .crumbs { padding: 12px 14px 4px; }
  .drive-body { padding: 6px 14px 40px; }
  .d-row { grid-template-columns: 24px minmax(0, 1fr) 72px; }
  .d-row .d-size, .d-row .d-mod { display: none; }
  .d-actions { opacity: 1; }
}
.note-bar .icon-btn.on { color: var(--accent); }

.rail-logo svg { width: 22px; height: 22px; stroke-width: 1.9; }

/* =========================================================
   Úprava lišty
   ========================================================= */
.rail-apps .rail-edit { color: var(--faint); margin-top: 4px; }
.rail-apps .rail-edit svg { width: 19px; height: 19px; }
.rail-apps .rail-edit:hover { color: var(--accent); }
.rail-list { display: flex; flex-direction: column; gap: 6px; }
.rail-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: 12px; opacity: .65; transition: opacity .12s, border-color .12s, background .12s; }
.rail-row.is-on { opacity: 1; border-color: var(--selected-border); background: var(--selected); }
.rail-row .rr-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); flex: none; }
.rail-row .rr-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.rail-row .rr-txt small { color: var(--muted); font-size: 12px; }
.rail-row .icon-btn { width: 30px; height: 30px; }
.rail-row .icon-btn:disabled { opacity: .3; cursor: default; }
.switch { position: relative; width: 40px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .6; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =========================================================
   Počasí
   ========================================================= */
.wx-now { display: grid; grid-template-columns: auto 1fr; gap: 18px 36px; align-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--panel) 70%); border: 1px solid var(--border); border-radius: 20px; padding: 22px 26px; box-shadow: var(--shadow-sm); }
.wx-main { display: flex; align-items: center; gap: 16px; }
.wx-emoji { font-size: 64px; line-height: 1; }
.wx-temp { font-size: 54px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.wx-desc { color: var(--muted); font-weight: 600; margin-top: 4px; }
.wx-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
.wx-facts small { display: block; color: var(--muted); font-size: 12px; }
.wx-facts b { font-size: 16px; }
.hours { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.hour { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.hour small { font-size: 11.5px; color: var(--muted); }
.hour .rain { color: #2563eb; font-weight: 600; }
.hour .em { font-size: 22px; line-height: 1.2; }
.days { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.day { display: grid; grid-template-columns: minmax(80px, 140px) 34px 70px 36px minmax(80px, 1fr) 36px; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.day:last-child { border-bottom: 0; }
.dname { font-weight: 600; text-transform: capitalize; }
.day .em { font-size: 22px; text-align: center; }
.drain { font-size: 12px; color: #2563eb; white-space: nowrap; }
.tmin { color: var(--muted); text-align: right; }
.tmax { font-weight: 700; }
.tbar { position: relative; height: 6px; border-radius: 999px; background: var(--hover); }
.tbar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #fbbf24 60%, #f97316); }
.place-picker { max-width: 520px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.place-picker .search { width: 100%; }
.place-results { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.place { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; padding: 10px 12px; text-align: left; }
.place:hover { border-color: var(--accent); }
.place svg { color: var(--accent); }
.place span { display: flex; flex-direction: column; }
.place small { color: var(--muted); font-size: 12px; }
.bak-sub svg { width: 13px; height: 13px; vertical-align: -2px; }

/* =========================================================
   Úkoly
   ========================================================= */
.todo-wrap { max-width: 760px; }
.todo-add { display: flex; gap: 8px; margin-bottom: 8px; }
.todo-add #tText { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); outline: none; box-shadow: var(--shadow-sm); }
.todo-add #tDue { padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--muted); }
.todo-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.todo-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 6px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--border); }
.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--hover); }
.todo .icon-btn { opacity: 0; width: 30px; height: 30px; }
.todo:hover .icon-btn, .todo:focus-within .icon-btn { opacity: 1; }
.t-text { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: text; }
.todo.done .t-text { text-decoration: line-through; color: var(--faint); }
.t-due { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.t-due.today { background: var(--accent-soft); color: var(--accent); }
.t-due.late { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.bak-h.late { color: var(--danger); }
.bak-h.today { color: var(--accent); }
.t-check { position: relative; width: 22px; height: 22px; flex: none; cursor: pointer; }
.t-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.t-check span { position: absolute; inset: 0; border: 2px solid var(--border-strong); border-radius: 50%; transition: all .15s; }
.t-check:hover span { border-color: var(--accent); }
.t-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.t-check input:checked + span::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.t-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.done-toggle { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 14px 4px 8px; }
.done-toggle:hover { color: var(--accent); }

/* =========================================================
   Kurzy měn
   ========================================================= */
.converter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-sm); max-width: 820px; }
.conv-side { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.conv-side input { font-size: 26px; font-weight: 700; letter-spacing: -.02em; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); outline: none; width: 100%; }
.conv-side input:focus { border-color: var(--accent); }
.conv-side select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.conv-czk { padding: 7px 10px; color: var(--muted); }
.conv-eq { color: var(--muted); display: grid; place-items: center; }
.rate-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.rate-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "flag code" "val val" "sub sub"; gap: 2px 8px; text-align: left; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); transition: border-color .12s; }
.rate-card:hover { border-color: var(--accent); }
.rc-flag { grid-area: flag; font-size: 18px; }
.rc-code { grid-area: code; font-weight: 700; color: var(--muted); align-self: center; }
.rate-card b { grid-area: val; font-size: 19px; letter-spacing: -.02em; }
.rate-card small { grid-area: sub; color: var(--muted); font-size: 12px; }
.rates-table td:nth-child(3), .rates-table th:nth-child(3) { text-align: left; }
.rates-table td:nth-child(2), .rates-table th:nth-child(2) { text-align: left; }


@media (max-width: 860px) {
  .rail-apps { overflow-x: auto; scrollbar-width: none; }
  .rail-apps button { flex: 1 0 58px; }
  .rail-apps .rail-edit { margin-top: 0; }
  .wx-now { grid-template-columns: 1fr; padding: 18px; }
  .wx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day { grid-template-columns: 74px 30px 0 30px minmax(50px, 1fr) 30px; gap: 8px; padding: 10px 12px; }
  .drain { display: none; }
  .todo-add { flex-wrap: wrap; }
  .todo-add #tText { flex-basis: 100%; }
  .todo .icon-btn { opacity: 1; }
}
@media (max-width: 860px) { .rail-apps { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); } }

/* =========================================================
   Nastavení podle záložky
   ========================================================= */
.dialog select { width: 100%; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.set-row:last-of-type { border-bottom: 0; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.gen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gen-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); transition: border-color .12s, background .12s; }
.gen-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.gen-btn svg { color: var(--accent); width: 20px; height: 20px; }
.gen-btn span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.gen-btn small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-btn[data-g="logout"] svg { color: var(--danger); }
.cur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.cur-chip { position: relative; cursor: pointer; }
.cur-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.cur-chip span { display: block; text-align: center; padding: 7px 4px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .12s; }
.cur-chip input:checked + span { background: var(--accent-soft); border-color: var(--selected-border); color: var(--accent); }
.cur-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.notes.size-s .note-body { font-size: 14px; }
.notes.size-l .note-body { font-size: 18px; line-height: 1.75; }
.notes.size-l .note-title { font-size: 32px; }
@media (max-width: 600px) { .gen-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Čas: stopky, minutka, pomodoro
   ========================================================= */
.clock-wrap { max-width: 620px; margin: 0 auto; }
.clock-card { display: flex; flex-direction: column; align-items: center; gap: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 24px; padding: 34px 24px 28px; box-shadow: var(--shadow-sm); }
.big-time { font-size: 64px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.clock-btns { display: flex; gap: 18px; align-items: center; justify-content: center; }
.round-btn { width: 74px; height: 74px; border-radius: 50%; border: 1px solid var(--border); background: var(--hover); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--text); transition: transform .1s, background .12s; }
.round-btn:hover:not(:disabled) { background: var(--border); }
.round-btn:active:not(:disabled) { transform: scale(.95); }
.round-btn:disabled { opacity: .4; cursor: default; }
.round-btn svg { width: 20px; height: 20px; }
.round-btn.main { width: 92px; height: 92px; background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-size: 12.5px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.round-btn.main:hover { background: var(--accent-hover); }
.round-btn.main svg { width: 26px; height: 26px; fill: currentColor; }
.round-btn.main.pause { background: #f59e0b; border-color: #f59e0b; color: #1b1405; box-shadow: 0 6px 18px rgba(245, 158, 11, .35); }
.laps { margin-top: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.lap { display: grid; grid-template-columns: 1fr auto 110px; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; align-items: baseline; }
.lap:last-child { border-bottom: 0; }
.lap small { color: var(--muted); text-align: right; }
.lap.best b { color: #16a34a; }
.lap.worst b { color: var(--danger); }
.timer-set { display: flex; align-items: flex-start; gap: 8px; font-size: 52px; font-weight: 300; }
.timer-set label { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.timer-set input { width: 2.4ch; font-size: 56px; font-weight: 300; text-align: center; border: 0; border-bottom: 2px solid var(--border); background: transparent; outline: none; font-variant-numeric: tabular-nums; -moz-appearance: textfield; padding: 0; }
.timer-set input::-webkit-inner-spin-button, .timer-set input::-webkit-outer-spin-button { -webkit-appearance: none; }
.timer-set input:focus { border-bottom-color: var(--accent); }
.timer-set small { font-size: 12px; color: var(--muted); font-weight: 600; }
.timer-set > span { padding-top: 4px; color: var(--faint); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.presets .chip { padding: 6px 13px; font-size: 13px; }
.ring-box { position: relative; width: 260px; height: 260px; }
.ring { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--hover); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring.short .ring-fg, .ring.long .ring-fg { stroke: #16a34a; }
.ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.ring-txt .big-time { font-size: 52px; }
.ring-txt small { color: var(--muted); font-weight: 600; }
.pomo-phase { font-size: 14px; font-weight: 700; padding: 5px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pomo-phase.short, .pomo-phase.long { background: color-mix(in srgb, #16a34a 14%, transparent); color: #16a34a; }
.pomo-dots { display: flex; gap: 8px; }
.pomo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--hover); border: 1px solid var(--border-strong); }
.pomo-dots i.cur { background: var(--accent-soft); border-color: var(--accent); }
.pomo-dots i.done { background: var(--accent); border-color: var(--accent); }
.alarm-body { text-align: center; padding: 6px 0 4px; }
.alarm-ico { font-size: 54px; animation: shake .5s ease-in-out infinite alternate; }
.alarm-body p { font-size: 17px; font-weight: 600; margin: 8px 0 0; }
@keyframes shake { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }

/* =========================================================
   Kalkulačka
   ========================================================= */
.calc-wrap { display: grid; grid-template-columns: minmax(280px, 380px) minmax(200px, 300px); gap: 24px; justify-content: center; align-items: start; }
.calc { background: var(--panel); border: 1px solid var(--border); border-radius: 24px; padding: 16px; box-shadow: var(--shadow-sm); }
.calc-screen { padding: 14px 12px 18px; text-align: right; min-width: 0; }
.calc-expr { color: var(--muted); font-size: 16px; min-height: 22px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.calc-res { font-size: 44px; font-weight: 300; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--muted); }
.calc-res.done { color: var(--text); font-weight: 500; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ck { height: 58px; border: 0; border-radius: 16px; background: var(--hover); font-size: 21px; font-weight: 500; transition: background .1s, transform .08s; }
.ck:hover { background: var(--border); }
.ck:active, .ck.pressed { transform: scale(.94); }
.ck.fn { color: var(--accent); font-weight: 600; }
.ck.op { background: var(--accent-soft); color: var(--accent); font-size: 24px; }
.ck.eq { background: var(--accent); color: var(--accent-text); font-size: 24px; }
.ck.eq:hover { background: var(--accent-hover); }
.ck.back { grid-column: 1 / -1; height: 44px; font-size: 18px; }
.calc-hist .bak-h { margin-top: 4px; }
.hist { display: flex; flex-direction: column; align-items: flex-end; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.hist:hover { background: var(--hover); }
.hist small { color: var(--muted); overflow-wrap: anywhere; }
.hist b { font-size: 17px; }

/* =========================================================
   Odpočet
   ========================================================= */
.cd-wrap { max-width: 900px; }
.cd-suggest { justify-content: flex-start; margin-bottom: 18px; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cd-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 20px 18px 16px; box-shadow: var(--shadow-sm); text-align: center; }
.cd-card.soon { background: linear-gradient(160deg, var(--accent-soft), var(--panel) 75%); border-color: var(--selected-border); }
.cd-card.past { opacity: .55; }
.cd-num { font-size: 52px; font-weight: 750; letter-spacing: -.04em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.cd-card.past .cd-num { color: var(--muted); }
.cd-unit { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.cd-name { font-weight: 700; font-size: 16px; margin-top: 12px; overflow-wrap: anywhere; }
.cd-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cd-del { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; opacity: 0; }
.cd-card:hover .cd-del, .cd-card:focus-within .cd-del { opacity: 1; }

@media (max-width: 860px) {
  .big-time { font-size: 52px; }
  .ring-box { width: 220px; height: 220px; }
  .ring-txt .big-time { font-size: 44px; }
  .clock-btns { gap: 12px; }
  .calc-wrap { grid-template-columns: 1fr; }
  .cd-del { opacity: 1; }
  .timer-set, .timer-set input { font-size: 44px; }
}
.todo-add #cdName { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); outline: none; box-shadow: var(--shadow-sm); }
.todo-add #cdDate { padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--muted); }
@media (max-width: 860px) { .todo-add #cdName { flex-basis: 100%; } }

/* =========================================================
   Přihlášení přes Google a účet
   ========================================================= */
.google-btn { width: 100%; justify-content: center; gap: 10px; padding: 11px; font-weight: 600; text-decoration: none; color: var(--text); background: var(--panel); }
.google-btn:hover { background: var(--hover); }
.g-logo { width: 19px; height: 19px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--faint); font-size: 12px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.acc-rows { display: flex; flex-direction: column; gap: 8px; }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.acc-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--hover); color: var(--accent); flex: none; }
.acc-ico .g-logo { width: 18px; height: 18px; }
.acc-info { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acc-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row .btn:disabled { opacity: .5; }
#mailconnect h1 svg { width: 24px; height: 24px; color: var(--accent); }
