/* Fokus Tube: a calm, YouTube-like layout (dark by default, light when the phone is light). Its own colors and logo. */
:root {
  --bg: #0f0f0f; --bg-raised: #212121; --bg-hover: #272727; --bg-chip: #272727; --bg-chip-on: #f1f1f1;
  --text: #f1f1f1; --text-2: #aaaaaa; --text-chip-on: #0f0f0f; --line: #3f3f3f; --accent: #5b7cfa; --accent-2: #8ea6ff;
  --progress: #f03e3e; --good: #3ccf7a; --warn: #ffb020; --danger: #ff6b6b; --scrim: rgba(0,0,0,.6);
  --top: 56px; --bottom: 56px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --radius: 12px; --side: 0px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #ffffff; --bg-raised: #f2f2f2; --bg-hover: #e5e5e5; --bg-chip: #f2f2f2; --bg-chip-on: #0f0f0f;
    --text: #0f0f0f; --text-2: #606060; --text-chip-on: #ffffff; --line: #e0e0e0; --accent: #3d5afe; --accent-2: #3d5afe;
    --scrim: rgba(0,0,0,.45); color-scheme: light; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
body { overscroll-behavior-y: contain; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--text-2); }
.error { color: var(--danger); min-height: 1.4em; }
.icon { fill: currentColor; flex: none; }

/* ---------- logo (original: an indigo tile with a play mark inside a focus ring) ---------- */
.logo { width: 30px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #5b7cfa, #3949ab); position: relative; display: inline-block; flex: none; }
.logo::before { content: ""; position: absolute; inset: 4px 9px; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; }
.logo::after { content: ""; position: absolute; left: 13px; top: 7.5px; border-left: 7px solid #fff; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }
.logo.big { width: 72px; height: 52px; border-radius: 14px; }
.logo.big::before { inset: 9px 22px; border-width: 3px; }
.logo.big::after { left: 31px; top: 17px; border-left-width: 15px; border-top-width: 8px; border-bottom-width: 8px; }

/* ---------- top bar ---------- */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: calc(var(--top) + var(--safe-t)); padding: var(--safe-t) 8px 0 12px; display: flex; align-items: center; gap: 4px; background: var(--bg); z-index: 30; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.brand-thin { font-weight: 400; margin-left: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active, .icon-btn:hover { background: var(--bg-hover); }
.back-btn { display: none; margin-left: -6px; }
#app.subpage .back-btn { display: inline-flex; }
#app.subpage .brand-name { display: none; }

/* ---------- navigation ---------- */
#bottomnav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottom) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: var(--bg); border-top: 1px solid var(--line); z-index: 30; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--text); }
.nav-item .icon { opacity: .75; }
.nav-item.on .icon { opacity: 1; }
.nav-item.on { font-weight: 600; }
#sidenav { display: none; }
#views { padding-top: calc(var(--top) + var(--safe-t)); padding-bottom: calc(var(--bottom) + var(--safe-b) + 8px); min-height: 100vh; }
#app.watching #bottomnav { display: none; }
#app.watching #views { padding-bottom: calc(var(--safe-b) + 16px); }
#app.has-mini #views { padding-bottom: calc(var(--bottom) + var(--safe-b) + 72px); }
.view { display: none; }
.view.on { display: block; }

@media (min-width: 900px) {
  :root { --side: 220px; }
  #bottomnav { display: none; }
  #sidenav { display: block; position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--side); padding: 12px; z-index: 20; }
  #sidenav .nav-item { flex-direction: row; justify-content: flex-start; gap: 20px; padding: 0 12px; height: 40px; border-radius: 10px; font-size: 14px; }
  #sidenav .nav-item.on, #sidenav .nav-item:hover { background: var(--bg-hover); }
  #views { padding-left: var(--side); padding-bottom: 24px; }
  #app.watching #sidenav { display: none; }
  #app.watching #views { padding-left: 0; }
}

/* ---------- chips ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 8px 12px 12px; scrollbar-width: none; position: sticky; top: calc(var(--top) + var(--safe-t)); background: var(--bg); z-index: 5; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--bg-chip); font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--bg-chip-on); color: var(--text-chip-on); }

/* ---------- video cards ---------- */
.feed { display: grid; grid-template-columns: 1fr; gap: 4px 16px; }
@media (min-width: 600px) { .feed { grid-template-columns: repeat(2, 1fr); padding: 0 16px; gap: 24px 16px; } }
@media (min-width: 1200px) { .feed { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1600px) { .feed { grid-template-columns: repeat(4, 1fr); } }
.card { display: block; padding-bottom: 20px; position: relative; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-raised); overflow: hidden; }
@media (min-width: 600px) { .thumb { border-radius: var(--radius); } }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 500; padding: 1px 4px; border-radius: 4px; }
.watched { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.3); }
.watched > div { height: 100%; background: var(--progress); }
.card-body { display: flex; gap: 12px; padding: 12px 8px 0 12px; }
@media (min-width: 600px) { .card-body { padding: 12px 0 0; } }
.card-text { flex: 1; min-width: 0; }
.card-title { font-size: 15px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.card-reason { color: var(--accent-2); font-size: 12px; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.card-menu { width: 32px; height: 32px; margin-top: -4px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.card-menu:active { background: var(--bg-hover); }
.avatar { border-radius: 50%; color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; user-select: none; }

/* compact cards (up next, lists) */
.row-card { display: flex; gap: 10px; padding: 6px 12px; align-items: flex-start; }
.row-card .thumb { width: 168px; flex: none; border-radius: 8px; }
.row-card .card-title { font-size: 14px; }
.row-card .card-meta { font-size: 12px; }
.row-card .card-menu { margin-left: auto; }

.shelf { padding: 4px 0 12px; }
.shelf-title { font-size: 18px; font-weight: 700; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.shelf-row { display: flex; gap: 12px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row .card { width: 260px; flex: none; padding-bottom: 0; }
.shelf-row .thumb { border-radius: 10px; }
.shelf-row .card-body { padding: 8px 0 0; }

.state { padding: 40px 24px; text-align: center; color: var(--text-2); }
.state h2 { color: var(--text); font-size: 18px; margin: 12px 0 6px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 16px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }
.banner { margin: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-raised); color: var(--text-2); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.banner .spinner { width: 18px; height: 18px; border-width: 2px; margin: 0; flex: none; }

/* ---------- pills, sheets, toast ---------- */
.pill { height: 36px; padding: 0 16px; border-radius: 18px; background: var(--bg-chip); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; flex: none; }
.pill.on { background: var(--bg-chip-on); color: var(--text-chip-on); }
.pill.primary { background: var(--accent); color: #fff; }
.pill.danger { color: var(--danger); }
.pill.wide { width: 100%; justify-content: center; height: 44px; border-radius: 22px; font-size: 15px; }
.pill:disabled { opacity: .5; }
.link { color: var(--accent-2); font-weight: 500; }
#sheet-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 60; }
#sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow-y: auto; background: var(--bg-raised); border-radius: 16px 16px 0 0; padding: 8px 0 calc(12px + var(--safe-b)); z-index: 61; }
@media (min-width: 600px) { #sheet { left: 50%; right: auto; width: 420px; transform: translateX(-50%); bottom: 24px; border-radius: 16px; } }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 8px; }
.sheet-item { width: 100%; display: flex; align-items: center; gap: 16px; padding: 12px 20px; text-align: left; font-size: 15px; }
.sheet-item:active, .sheet-item:hover { background: var(--bg-hover); }
.sheet-body { padding: 4px 20px 12px; }
.sheet-body h3 { margin: 6px 0 10px; font-size: 16px; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 4px 0 10px; }
.meter > div { height: 100%; background: var(--accent); }
#toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: #323232; color: #fff; padding: 10px 16px; border-radius: 8px; display: flex; gap: 16px; align-items: center; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-action { color: #8ea6ff; font-weight: 600; }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); z-index: 100; }
#login-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
#login-form h1 { margin: 4px 0 0; font-size: 24px; }
#login-form input[type=password] { width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-raised); font-size: 16px; }

/* ---------- player (fixed, outside the pages) ---------- */
#player-root { position: fixed; z-index: 25; display: none; }
#player-root[data-mode=full] { display: block; top: calc(var(--top) + var(--safe-t)); left: 0; width: 100%; }
@media (min-width: 900px) { #player-root[data-mode=full] { left: 50%; transform: translateX(-50%); width: min(100%, 1100px); padding: 0 24px; } }
#player-root[data-mode=mini] { display: flex; align-items: center; left: 0; right: 0; bottom: calc(var(--bottom) + var(--safe-b)); height: 60px; background: var(--bg-raised); border-top: 1px solid var(--line); }
@media (min-width: 900px) { #player-root[data-mode=mini] { left: auto; right: 16px; bottom: 16px; width: 400px; height: auto; flex-direction: column; align-items: stretch; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); } }
.player-box { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; width: 100%; }
@media (min-width: 900px) { #player-root[data-mode=full] .player-box { border-radius: 12px; } }
#player-root[data-mode=mini] .player-box { width: 107px; flex: none; }
@media (min-width: 900px) { #player-root[data-mode=mini] .player-box { width: 100%; } }
.yt-frame, .yt-frame iframe, #yt-target { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { position: absolute; inset: 0; z-index: 2; }
.player-box.tap-through .shield, .player-box.tap-through .poster { pointer-events: none; }
.player-box.tap-through .poster { opacity: 0; }
.poster { position: absolute; inset: 0; z-index: 3; display: none; background: #000; }
.player-box.posterized .poster { display: block; }
.poster img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.big-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; display: flex; align-items: center; justify-content: center; }
#player-root[data-mode=mini] .big-play { width: 32px; height: 32px; }
#player-root[data-mode=mini] .big-play .icon { width: 20px; height: 20px; }
/* The dim layer lets taps through to the shield (tap = hide controls); only its buttons and the bar take taps. */
.controls { position: absolute; inset: 0; z-index: 4; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.player-box.show-controls .controls { opacity: 1; }
.player-box.show-controls .controls > * { pointer-events: auto; }
.player-box.show-controls .controls .bottom { pointer-events: none; }
.player-box.show-controls .controls .bottom > * { pointer-events: auto; }
#player-root[data-mode=mini] .controls, #player-root[data-mode=mini] .thin-progress { display: none; }
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 36px; color: #fff; }
.ctl { color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.center .ctl:not(.skip) { width: 60px; height: 60px; border-radius: 50%; background: rgba(0,0,0,.4); }
.skip { font-weight: 700; font-size: 15px; width: 48px; height: 48px; border-radius: 50%; }
.bottom { position: absolute; left: 12px; right: 8px; bottom: 14px; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 12.5px; }
.speed { font-weight: 600; font-size: 13px; min-width: 40px; height: 32px; }
.fs-icon { width: 18px; height: 14px; border: 2px solid #fff; border-radius: 2px; display: inline-block; margin: 9px; }
.seek { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; cursor: pointer; touch-action: none; }
.seek > div { position: absolute; left: 0; bottom: 4px; height: 3px; }
.seek-buffer { background: rgba(255,255,255,.35); }
.seek-fill { background: var(--progress); }
.seek-knob { width: 12px !important; height: 12px !important; border-radius: 50%; background: var(--progress); transform: translate(-6px, 4.5px); }
.thin-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 3; background: rgba(255,255,255,.2); }
.thin-progress > div { height: 100%; background: var(--progress); }
.player-box.show-controls .thin-progress, .player-box.posterized .thin-progress { display: none; }
.cover { position: absolute; inset: 0; z-index: 6; display: none; background: #000; color: #fff; align-items: center; justify-content: center; padding: 12px; }
.player-box.covered .cover { display: flex; }
.cover-card { width: min(100%, 420px); display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.cover-label { color: #bbb; font-size: 13px; }
.cover-next { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; }
.cover-next img { width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.cover-next-title { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cover .pill { background: rgba(255,255,255,.15); color: #fff; }
.cover .pill.primary { background: var(--accent); }
.cover-count { color: #ccc; font-size: 13px; }
#player-root[data-mode=mini] .cover { padding: 2px; }
#player-root[data-mode=mini] .cover-card > :not(.cover-actions) { display: none; }
#player-root[data-mode=mini] .cover .pill { height: 26px; padding: 0 8px; font-size: 11px; }
.player-message { position: absolute; inset: 0; z-index: 7; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; background: #000; text-align: center; padding: 16px; }
.player-box.errored .player-message, .player-message:not(:empty) { display: flex; }
.player-message .pill { background: rgba(255,255,255,.15); color: #fff; }
.flash { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 8; background: rgba(0,0,0,.7); color: #fff; padding: 6px 12px; border-radius: 16px; font-size: 13px; pointer-events: none; }
.sound-pill { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9; background: rgba(0,0,0,.82); color: #fff; padding: 12px 18px; border-radius: 26px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.player-box.fullscreen, .player-box.pseudo-fullscreen { aspect-ratio: auto; }
.player-box.pseudo-fullscreen { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; }
.mini-bar { display: none; flex: 1; min-width: 0; align-items: center; gap: 4px; padding: 0 4px 0 12px; height: 100%; cursor: pointer; }
#player-root[data-mode=mini] .mini-bar { display: flex; }
@media (min-width: 900px) { #player-root[data-mode=mini] .mini-bar { height: 56px; } }
.mini-text { flex: 1; min-width: 0; }
.mini-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-channel { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; }

/* ---------- watch page ---------- */
.watch { max-width: 1100px; margin: 0 auto; }
@media (min-width: 900px) { .watch { padding: 0 24px; } }
.player-space { aspect-ratio: 16 / 9; width: 100%; }
.watch-info { padding: 12px; }
@media (min-width: 900px) { .watch-info { padding: 12px 0; } }
.watch-title { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0; }
.watch-meta { color: var(--text-2); font-size: 12.5px; margin-top: 6px; }
.watch-channel { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.watch-channel-name { font-weight: 600; font-size: 15px; }
.actions { display: flex; gap: 8px; overflow-x: auto; padding: 14px 12px 4px; scrollbar-width: none; }
@media (min-width: 900px) { .actions { padding: 14px 0 4px; } }
.actions::-webkit-scrollbar { display: none; }
.ai-box { margin: 12px; padding: 12px; border-radius: 12px; background: var(--bg-raised); }
@media (min-width: 900px) { .ai-box { margin: 12px 0; } }
.ai-box .label { font-size: 12px; color: var(--accent-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ai-box .summary { margin: 6px 0 0; font-size: 14px; }
.topic-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.topic { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg-hover); color: var(--text-2); }
.desc { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; margin-top: 10px; max-height: 5.6em; overflow: hidden; position: relative; }
.desc.open { max-height: none; }
.desc-toggle { margin-top: 6px; font-weight: 600; font-size: 13px; }
.chapters { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.chapter { flex: none; max-width: 200px; text-align: left; padding: 8px 10px; border-radius: 10px; background: var(--bg-hover); font-size: 12.5px; }
.chapter b { display: block; color: var(--accent-2); font-weight: 600; }
.upnext-head { display: flex; align-items: center; padding: 16px 12px 6px; font-weight: 700; font-size: 16px; }
@media (min-width: 900px) { .upnext-head { padding: 16px 0 6px; } .watch .row-card { padding: 6px 0; } }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.switch { width: 36px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: .2s; flex: none; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 18px; }

/* ---------- search ---------- */
.search-bar { display: flex; gap: 8px; padding: 8px 12px; position: sticky; top: calc(var(--top) + var(--safe-t)); background: var(--bg); z-index: 5; }
.search-bar input { flex: 1; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-raised); font-size: 16px; }
.recent { padding: 4px 0; }
.recent-item { display: flex; align-items: center; gap: 16px; padding: 10px 16px; width: 100%; text-align: left; }

/* ---------- library, settings, fokus ---------- */
.section { padding: 8px 12px 16px; }
.section h2 { font-size: 18px; margin: 8px 0 10px; display: flex; align-items: center; gap: 8px; }
.section h3 { font-size: 15px; margin: 14px 0 6px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px; scrollbar-width: none; position: sticky; top: calc(var(--top) + var(--safe-t)); background: var(--bg); z-index: 5; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field label { font-weight: 600; }
.field .hint { color: var(--text-2); font-size: 12.5px; }
.field textarea { min-height: 120px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-raised); resize: vertical; font-size: 15px; line-height: 1.45; }
.field input[type=text], .field input[type=number] { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); font-size: 15px; }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.row { display: flex; align-items: center; gap: 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .text { flex: 1; }
.setting-row .text small { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 12px; border-radius: 15px; background: var(--bg-chip); font-size: 13px; }
.tag button { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--bg-raised); border-radius: 12px; padding: 10px 12px; }
.tile .num { font-size: 22px; font-weight: 700; }
.tile .lbl { color: var(--text-2); font-size: 12px; }
.catbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 12px 0 6px; background: var(--line); gap: 2px; }
.catbar > div { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--c); }
.timeline { position: relative; height: 22px; border-radius: 6px; background: var(--bg-raised); margin-top: 10px; overflow: hidden; }
.timeline > div { position: absolute; top: 0; bottom: 0; }
.timeline-hours { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-2); margin-top: 3px; }
.qcard { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); border-radius: 12px; padding: 12px; margin: 8px 0; }
.qcard.past { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--bg)); }
.qcard-title { font-weight: 600; font-size: 15px; }
.qcard-sub { color: var(--text-2); font-size: 13px; margin: 2px 0 8px; }
.qcard .row { flex-wrap: wrap; gap: 6px; }
.qcard .pill.good { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.marks { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; margin-top: 8px; color: var(--text-2); }
.mark b { font-weight: 700; margin-right: 3px; }
.mark.done b { color: var(--good); }
.mark.missed { text-decoration: line-through; }
.mark.open b { color: var(--warn); }
.mark.now b { color: var(--accent-2); }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.todo.done .box { background: var(--good); border-color: var(--good); color: #fff; }
.todo.done .todo-text { text-decoration: line-through; color: var(--text-2); }
.todo .todo-text { flex: 1; word-break: break-word; }
.todo.pending { opacity: .6; }
.todo .del { color: var(--text-2); }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row input { flex: 1; height: 42px; padding: 0 14px; border-radius: 21px; border: 1px solid var(--line); background: var(--bg-raised); font-size: 15px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-2); flex: none; }
.status-dot.ok { background: var(--good); }
.status-dot.warn { background: var(--warn); }
.session-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg-raised); margin: 8px 0; width: 100%; text-align: left; }
.session-link .text { flex: 1; min-width: 0; }
.session-link small { display: block; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Claude session (Diary / Dashboard) ---------- */
.convo { padding: 8px 12px 160px; }
.msg { margin: 0 0 14px; }
.msg-head { font-size: 11.5px; color: var(--text-2); margin-bottom: 3px; }
.msg-head b { color: var(--text-2); font-weight: 600; }
.msg.prompt .msg-body { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.msg.prompt.pending { opacity: .6; }
.msg-body { font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.msg-body p { margin: 0 0 8px; }
.msg-body h1, .msg-body h2, .msg-body h3, .msg-body h4 { margin: 10px 0 6px; font-size: 15.5px; }
.msg-body ul, .msg-body ol { margin: 0 0 8px; padding-left: 22px; }
.msg-body li { margin: 2px 0; }
.msg-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg-raised); padding: 1px 4px; border-radius: 4px; }
.msg-body pre { background: var(--bg-raised); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 0 0 8px; }
.msg-body pre code { background: none; padding: 0; }
.msg-body blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--text-2); }
.msg-body .tbl { overflow-x: auto; margin: 0 0 8px; }
.msg-body table { border-collapse: collapse; font-size: 13px; }
.msg-body th, .msg-body td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.msg-body th { background: var(--bg-raised); }
.msg-body hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--bottom) + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); padding: 8px 12px; z-index: 20; }
@media (min-width: 900px) { .composer { left: var(--side); bottom: 0; } }
.composer .keys { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
.composer .keys .pill { height: 30px; padding: 0 12px; font-size: 13px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 42px; max-height: 140px; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-raised); resize: none; font-size: 15px; line-height: 1.35; }
.composer .send { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.busy-line { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; padding: 4px 0 8px; }
.busy-line .spinner { width: 14px; height: 14px; border-width: 2px; margin: 0; }
.menu-card { border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--bg)); border-radius: 10px; padding: 10px; margin: 0 0 10px; }
.menu-card pre { white-space: pre-wrap; font-size: 12.5px; margin: 6px 0; font-family: ui-monospace, Menlo, monospace; }
.offline-note { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--bg-raised); color: var(--text-2); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }

/* ---------- live Fokus: memo, mic, sessions ---------- */
.h2-note { font-size: 12px; font-weight: 400; margin-left: auto; }
.row.wrap { flex-wrap: wrap; }
.todo-sub { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; margin: 14px 0 2px; }
.icon-btn.small { width: 32px; height: 32px; color: var(--text-2); }
.memo-area { width: 100%; min-height: 120px; max-height: 420px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); font-size: 15px; line-height: 1.45; resize: vertical; }
.mic-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-raised); border: 1px solid var(--line); flex: none; }
.mic-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-btn.busy { opacity: .6; }
.mic-btn.busy::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.mic-time { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 30%, transparent); } }
@keyframes spin { to { transform: rotate(360deg); } }
.status-dot.attn { background: var(--accent); }
.session-head { padding: 8px 12px 0; }
.session-head b { font-size: 16px; }
.session-status { padding: 0 12px; }
.pane { margin: 8px 8px 170px; padding: 10px; border-radius: 8px; background: #000; color: #e6e6e6; font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; }
.pill.on { background: var(--bg-chip-on); color: var(--text-chip-on); }
.composer form .mic-btn { width: 38px; height: 38px; }
.chips.wrap { flex-wrap: wrap; position: static; padding: 6px 0 0; overflow: visible; background: none; }

/* ---------- player: speed menu, subtitles ---------- */
.ctl.cc { width: 40px; height: 36px; opacity: .8; }
.ctl.cc.on { opacity: 1; color: var(--accent-2); }
.ctl.speed { min-width: 44px; height: 36px; font-weight: 700; font-size: 14px; }
.player-menu { position: absolute; inset: 0; z-index: 12; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.player-menu-card { background: #212121; color: #f1f1f1; border-radius: 14px; padding: 8px; min-width: 180px; max-height: 92%; overflow-y: auto; }
.player-menu-title { font-size: 12px; color: #aaa; padding: 6px 12px; }
.player-menu-item { display: block; width: 100%; text-align: left; padding: 10px 14px; border-radius: 8px; font-size: 15px; }
.player-menu-item.on { background: rgba(255,255,255,.12); font-weight: 700; }
.player-menu-item:active { background: rgba(255,255,255,.2); }

/* ---------- Shorts and Bacaan: full screen, swipe up ---------- */
#app.shorts-mode #topbar { display: none; }
#app.shorts-mode #views { padding-top: 0; }
.shorts-pager, .deck-pager { position: fixed; left: 0; right: 0; top: var(--safe-t); bottom: calc(var(--bottom) + var(--safe-b)); overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; background: #000; z-index: 1; }
.shorts-pager::-webkit-scrollbar, .deck-pager::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .shorts-pager, .deck-pager { left: var(--side); bottom: 0; } }
.short { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; color: #fff; }
.short-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.short-play { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; z-index: 3; color: rgba(255,255,255,.85); pointer-events: none; }
.short.paused .short-play { display: flex; }
.short-info { position: absolute; left: 12px; right: 76px; bottom: 16px; z-index: 3; text-shadow: 0 1px 3px rgba(0,0,0,.8); pointer-events: none; }
.short-info::before { content: ""; position: absolute; left: -12px; right: -76px; bottom: -16px; height: 180px; background: linear-gradient(transparent, rgba(0,0,0,.7)); z-index: -1; }
.short-channel { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.short-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.short-summary { font-size: 13px; opacity: .85; margin-top: 4px; }
.short-actions { position: absolute; right: 6px; bottom: 20px; z-index: 3; display: flex; flex-direction: column; gap: 14px; }
.shorts-act { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 60px; color: #fff; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.shorts-act .icon { width: 46px; height: 46px; padding: 9px; border-radius: 50%; background: rgba(0,0,0,.35); }
.shorts-act.on .icon { background: rgba(255,255,255,.9); color: #000; }
.shorts-stage { position: fixed; left: 0; right: 0; top: var(--safe-t); bottom: calc(var(--bottom) + var(--safe-b)); z-index: 2; pointer-events: none; background: #000; }
@media (min-width: 900px) { .shorts-stage { left: var(--side); bottom: 0; } }
.shorts-stage #shorts-target, .shorts-stage iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
.shorts .sound-pill { position: fixed; z-index: 20; top: 40%; left: 50%; transform: translate(-50%, -50%); }
.break-card, .short.empty { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #13293d, #1d4a3b); }
.break-inner { text-align: center; padding: 24px; max-width: 420px; }
.break-emoji { font-size: 56px; }
.break-inner h2 { margin: 12px 0 8px; }
.break-inner p { color: rgba(255,255,255,.8); }
.deck-slot { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; padding: 10px; }
.deck { position: relative; height: 100%; border-radius: 18px; padding: 22px 20px 20px; color: #fff; display: flex; flex-direction: column; overflow: hidden; user-select: none; -webkit-user-select: none; cursor: pointer; }
.deck-bars { display: flex; gap: 4px; margin-bottom: 18px; }
.deck-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.deck-bar > div { height: 100%; width: 0; background: #fff; transition: width .25s; }
.deck-head { display: flex; gap: 12px; align-items: center; }
.deck-emoji { font-size: 34px; }
.deck-topic { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; opacity: .75; }
.deck-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.deck-text { flex: 1; display: flex; align-items: center; font-size: 22px; line-height: 1.45; font-weight: 500; padding: 10px 2px; white-space: pre-wrap; }
.deck-text.last { font-size: 20px; }
.deck-count { font-size: 13px; opacity: .75; min-height: 20px; margin-bottom: 10px; }
.deck-source { color: #fff; text-decoration: underline; opacity: .9; }
.deck-actions { display: flex; gap: 10px; }
.deck-act { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.deck-act.on { background: #fff; color: #222; }
#bottomnav .nav-item span { white-space: nowrap; }
button.mark { background: none; border: 0; color: inherit; font: inherit; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
button.mark:active, button.mark:hover { background: var(--bg-hover); }
