/* alienverse — Engine room (tools). Loaded only when the tools are opened. */

/* ---------- hub ---------- */
.tl-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; margin-bottom: 14px; }
.tl-search-wrap { position: relative; display: flex; align-items: center; }
.tl-search-wrap > .ico { position: absolute; left: 16px; color: var(--faint); pointer-events: none; }
.tl-search { width: 100%; height: 100%; min-height: 54px; padding-left: 46px; border-radius: 18px; font-size: 1rem; }
.tl-cats { margin-bottom: 18px; }
.tl-shelf { display: grid; gap: 10px; margin-bottom: 18px; }
.tl-shelf:empty { display: none; }
.tl-quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tl-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .9rem; transition: border-color var(--t-fast), scale 380ms var(--spring); }
.tl-chip .ico { color: var(--accent-2); }
.tl-chip.pinned { border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .1); }
.tl-chip:hover { border-color: var(--line-strong); }
.tl-chip:active { scale: .94; }
.tl-sections { display: grid; gap: 26px; }
.tl-section-h { margin: 0 0 12px; font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tl-card { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; overflow: hidden; isolation: isolate;
  transition: border-color var(--t-fast), background var(--t-fast), scale 380ms var(--spring); }
.tl-card::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; background: radial-gradient(260px circle at 0% 50%, rgba(var(--accent-rgb), .16), transparent 70%); transition: opacity var(--t); }
.tl-card:hover { border-color: rgba(var(--accent-rgb), .45); }
.tl-card:hover::after { opacity: 1; }
.tl-card:active { scale: .97; }
.tl-card-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; }
.tl-card-text { min-width: 0; display: grid; gap: 2px; }
.tl-card-text strong { font-size: .98rem; font-weight: 600; }
.tl-card-text small { color: var(--faint); font-size: .8rem; line-height: 1.35; }
.tl-pinned { position: absolute; top: 10px; right: 10px; color: var(--accent-2); }
.cat-pdf { color: #fca5a5; background: rgba(248,113,113,.13); }
.cat-image { color: #86efac; background: rgba(74,222,128,.12); }
.cat-text { color: #93c5fd; background: rgba(96,165,250,.13); }
.cat-make { color: #f0abfc; background: rgba(232,121,249,.13); }
.cat-calc { color: #fde68a; background: rgba(250,204,21,.12); }
.cat-time { color: #67e8f9; background: rgba(34,211,238,.12); }
.tl-offer { display: grid; gap: 8px; }
.tl-privacy { display: flex; align-items: center; gap: 6px; margin-top: 26px; font-size: .82rem; }
@media (max-width: 760px) {
  .tl-top { grid-template-columns: 1fr; }
  .tl-grid { grid-template-columns: 1fr; gap: 8px; }
  .tl-card { padding: 12px; }
  .tl-card-ico { width: 40px; height: 40px; }
}

/* ---------- tool page ---------- */
.tl-back { margin-bottom: 14px; }
.tl-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 22px; }
.tl-badge { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 18px; }
.tl-head-text { flex: 1; min-width: 0; }
.tl-head h1 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.05; letter-spacing: -.01em; }
.tl-head p { margin: 4px 0 0; color: var(--muted); }
.tl-pin-btn.on { color: var(--accent-2); border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .12); }
@media (max-width: 520px) { .tl-badge { width: 46px; height: 46px; border-radius: 14px; } .tl-pin-btn span { display: none; } .tl-pin-btn { width: 38px; padding: 0; justify-content: center; } }
.tl-body { display: grid; gap: 16px; }
.tl-body > div:not(.hidden) { display: grid; gap: 16px; }
.tl-panel { display: grid; gap: 12px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.tl-opt { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); align-items: center; gap: 12px; }
.tl-opt-l { display: grid; font-weight: 500; font-size: .92rem; }
.tl-opt-l small { color: var(--faint); font-weight: 400; font-size: .76rem; line-height: 1.3; }
.tl-opt .seg { justify-self: start; max-width: 100%; overflow-x: auto; }
.tl-opt select, .tl-opt input:not([type="range"]):not([type="color"]):not([type="checkbox"]) { width: 100%; max-width: 420px; }
@media (max-width: 600px) { .tl-opt { grid-template-columns: 1fr; gap: 6px; } .tl-opt .seg { justify-self: stretch; } }
.tl-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.tl-actions.left { justify-content: flex-start; }
.tl-actions .btn:not(.btn-sm) { min-width: 160px; }
@media (max-width: 600px) { .tl-actions .btn:not(.btn-sm) { flex: 1; } }
.tl-inline { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.tl-inline.wrap { flex-wrap: wrap; }
.tl-inline .input { width: auto; flex: 1 1 140px; min-width: 0; }
.tl-num { max-width: 140px; }
.tl-num.big { font-size: 1.4rem; height: 54px; max-width: 220px; }
.tl-range-wrap { display: flex; align-items: center; gap: 12px; }
.tl-range { flex: 1; accent-color: var(--accent); min-width: 0; height: 28px; }
.tl-range-wrap output { min-width: 64px; text-align: right; color: var(--muted); font-size: .82rem; }
.tl-color { width: 44px; height: 36px; padding: 2px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.tl-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 14px; font-size: .85rem; color: var(--muted); background: rgba(250,204,21,.06); border: 1px solid rgba(250,204,21,.2); }
.tl-note .ico { margin-top: 2px; color: #fde68a; flex: none; }
.tl-hint { margin: 0; font-size: .82rem; text-align: center; }
.tl-row-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-row-head > strong { margin-right: auto; }
.tl-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tl-toolbar-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .tl-two { grid-template-columns: 1fr; } }
.tl-area { width: 100%; min-height: 160px; resize: vertical; font-family: var(--font-mono); font-size: .88rem; line-height: 1.55; border-radius: 16px; padding: 14px; }
.tl-check-l { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .85rem; }
.tl-good { color: var(--ok); }
.tl-bad { color: var(--danger); }
.tl-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tl-stat { display: grid; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.tl-stat b { font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.tl-stat span { color: var(--faint); font-size: .74rem; }
.tl-big-num { display: grid; justify-items: end; line-height: 1.1; }
.tl-big-num b { font-size: 2rem; font-weight: 600; color: var(--accent-2); }
.tl-big-num small { color: var(--faint); font-size: .72rem; }
.tl-rows { display: grid; gap: 8px; }
.tl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.tl-row .tl-opt { grid-template-columns: auto auto; gap: 6px; }
.tl-row .tl-opt input, .tl-row .tl-opt select { max-width: 120px; }
.tl-row > .input { flex: 1 1 120px; width: auto; }
.tl-row .tl-mini { margin-left: auto; }

/* drop zone */
.tl-drop { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.tl-drop-main { flex: 1 1 260px; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 130px; padding: 18px; border-radius: 22px; border: 1.5px dashed rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .05);
  color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--t-fast), background var(--t-fast), scale 380ms var(--spring); }
.tl-drop-main:hover { border-color: rgba(var(--accent-rgb), .8); background: rgba(var(--accent-rgb), .09); }
.tl-drop-main:active { scale: .985; }
.tl-drop.over .tl-drop-main { border-style: solid; border-color: var(--accent-2); background: rgba(var(--accent-rgb), .16); scale: 1.01; }
.tl-drop-ico { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 16px; color: var(--accent-2); background: rgba(var(--accent-rgb), .14); }
.tl-drop-text { display: grid; gap: 2px; }
.tl-drop-text strong { font-size: 1rem; }
.tl-drop-text small { color: var(--faint); }
.tl-drop.compact .tl-drop-main { min-height: 54px; padding: 8px 14px; border-radius: 18px; justify-content: flex-start; }
.tl-drop.compact .tl-drop-ico { width: 36px; height: 36px; border-radius: 11px; }
.tl-drop.compact strong { font-size: .92rem; font-weight: 500; }
.tl-drop.compact small { font-size: .76rem; }
.tl-cam { align-self: center; cursor: pointer; }

/* outputs */
.tl-outs { display: grid; gap: 8px; }
.tl-outs:empty { display: none; }
.tl-out { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px solid rgba(110,231,183,.35); background: linear-gradient(120deg, rgba(110,231,183,.09), transparent 60%); animation: toast-in 420ms var(--spring) both; flex-wrap: wrap; }
.tl-out-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #0a0714; background: var(--ok); }
.tl-out-text { flex: 1 1 160px; min-width: 0; display: grid; }
.tl-out-text strong { overflow-wrap: anywhere; }
.tl-out-text small { color: var(--muted); font-size: .8rem; }
.tl-out-btns { display: flex; gap: 6px; }
.tl-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.tl-mini { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); transition: color var(--t-fast), background var(--t-fast), scale 380ms var(--spring); }
.tl-mini:hover { color: var(--text); }
.tl-mini:active { scale: .88; }
.tl-mini.danger:hover { color: var(--danger); }
.tl-mini:disabled { opacity: .4; }
.tl-grip { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--faint); background: transparent; cursor: grab; touch-action: none; }
.tl-grip:active { cursor: grabbing; color: var(--accent-2); }
[data-sort].dragging { position: relative; z-index: 20; opacity: .92; box-shadow: 0 24px 50px -16px rgba(0,0,0,.85), 0 0 0 2px rgba(var(--accent-rgb), .6); transition: none !important; }

/* thumbnails (scan, organize) */
.tl-thumbs, .tl-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.tl-thumb, .tl-page { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.tl-thumb-img, .tl-page-img { display: grid; place-items: center; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; background: #fff; }
.tl-thumb-img canvas, .tl-page-img canvas { max-width: 100%; max-height: 100%; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.tl-page-img canvas { transform: rotate(var(--rot, 0deg)); transition: transform var(--t) var(--spring); }
.tl-thumb-n { position: absolute; top: 12px; left: 12px; padding: 2px 8px; border-radius: 999px; font-size: .66rem; color: #fff; background: rgba(10,7,20,.75); }
.tl-thumb-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tl-page-pick { position: relative; display: block; padding: 0; border-radius: 10px; background: none; }
.tl-check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: transparent; background: rgba(10,7,20,.55); border: 1.5px solid rgba(255,255,255,.7); transition: background var(--t-fast), color var(--t-fast), scale 300ms var(--spring); }
.tl-page.sel { border-color: rgba(var(--accent-rgb), .8); background: rgba(var(--accent-rgb), .1); }
.tl-page.sel .tl-check { color: #0a0714; background: var(--accent-2); border-color: transparent; scale: 1.1; }
@media (max-width: 520px) { .tl-thumbs, .tl-pages { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; } }

/* file rows */
.tl-files { display: grid; gap: 8px; }
.tl-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.tl-file-thumb { width: 44px; height: 56px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: #fff; }
.tl-file-thumb canvas { max-width: 100%; max-height: 100%; }
.tl-file-text { flex: 1; min-width: 0; display: grid; }
.tl-file-text strong { font-size: .92rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-file-text small { color: var(--faint); font-size: .78rem; }
.tl-strip { display: flex; gap: 8px; overflow-x: auto; }
.tl-strip-item canvas { display: block; height: 120px; width: auto; border-radius: 8px; background: #fff; }

/* signatures */
.tl-sigpad { width: 100%; height: 170px; border-radius: 16px; background: #fff; touch-action: none; cursor: crosshair; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tl-sig-typed { display: grid; place-items: center; min-height: 120px; margin-top: 8px; border-radius: 16px; background: #fff; overflow: hidden; }
.tl-sig-typed canvas { max-width: 92%; max-height: 110px; }
.tl-sig-saved { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #fff; }
.tl-sig-saved img { height: 44px; }
.tl-sign-stage { position: relative; width: 100%; max-width: 760px; margin: 0 auto; border-radius: 6px; overflow: hidden; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8); touch-action: manipulation; }
.tl-sign-page { display: block; width: 100%; height: auto; cursor: copy; }
.tl-placed { position: absolute; border: 1.5px dashed rgba(var(--accent-rgb), .9); border-radius: 4px; cursor: move; touch-action: none; background: rgba(var(--accent-rgb), .06); }
.tl-placed canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.tl-placed-x { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); }
.tl-placed-h { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2); border: 2px solid #fff; cursor: nwse-resize; }

/* background remover */
.tl-cut { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); grid-template-areas: "tools tools" "stage side" "note note" "out out"; }
.tl-cut-tools { grid-area: tools; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tl-cut-scroll { grid-area: stage; overflow: auto; max-height: 72vh; border-radius: 18px; border: 1px solid var(--line); }
.tl-cut-side { grid-area: side; display: grid; gap: 12px; align-content: start; }
.tl-cut > .tl-note { grid-area: note; }
.tl-cut > .tl-outs { grid-area: out; }
.tl-cut-stage { display: block; min-width: 100%; line-height: 0; }
.tl-cut-canvas { display: block; width: 100%; height: auto; touch-action: none; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #d9d9e3 25%, transparent 25%), linear-gradient(-45deg, #d9d9e3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d9d9e3 75%), linear-gradient(-45deg, transparent 75%, #d9d9e3 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
@media (max-width: 900px) { .tl-cut { grid-template-columns: 1fr; grid-template-areas: "tools" "stage" "side" "note" "out"; } }

/* crop */
.tl-crop-wrap { display: grid; place-items: center; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.tl-crop-stage { position: relative; line-height: 0; max-width: 100%; user-select: none; }
.tl-crop-img { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; }
.tl-crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(3,2,8,.6); outline: 2px solid #fff; cursor: move; touch-action: none;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 33.333% 33.333%; background-position: -1px -1px; }
.tl-crop-stage { overflow: hidden; }
.tl-h { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.tl-h.nw { left: -11px; top: -11px; cursor: nwse-resize; } .tl-h.ne { right: -11px; top: -11px; cursor: nesw-resize; }
.tl-h.sw { left: -11px; bottom: -11px; cursor: nesw-resize; } .tl-h.se { right: -11px; bottom: -11px; cursor: nwse-resize; }

/* passport */
.tl-pp { grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); align-items: start; }
.tl-pp-left { display: grid; gap: 8px; }
.tl-pp-frame { position: relative; width: 100%; overflow: hidden; border-radius: 6px; background: #fff; touch-action: none; cursor: grab; box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); }
.tl-pp-canvas { display: block; width: 100%; height: 100%; }
.tl-pp-guide { position: absolute; inset: 0; pointer-events: none; }
.tl-pp-guide svg { width: 100%; height: 100%; }
.tl-pp-right { display: grid; gap: 12px; }
@media (max-width: 760px) { .tl-pp { grid-template-columns: 1fr; } .tl-pp-left { max-width: 300px; margin: 0 auto; width: 100%; } }

/* privacy check */
.tl-privacy-list { display: grid; gap: 10px; }
.tl-meta { display: flex; gap: 14px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.tl-meta.warn { border-color: rgba(251,113,133,.5); background: linear-gradient(120deg, rgba(251,113,133,.1), transparent 60%); }
.tl-meta.ok { border-color: rgba(110,231,183,.35); }
.tl-meta-thumb canvas { display: block; width: 84px; height: auto; border-radius: 10px; }
.tl-meta-body { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.tl-meta-body p { margin: 0; }
.tl-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.tl-meta-row strong { color: var(--text); font-weight: 500; }
.tl-meta-row.danger { color: #fecdd3; }

/* palette */
.tl-pal { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); align-items: start; }
.tl-pal-left { display: grid; gap: 6px; }
.tl-pal-img { width: 100%; height: auto; border-radius: 16px; cursor: crosshair; }
.tl-pal-right { display: grid; gap: 10px; }
.tl-swatches { display: grid; gap: 8px; }
.tl-swatch { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.tl-swatch-color { width: 52px; height: 52px; flex: none; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.tl-swatch-text { display: grid; justify-items: start; gap: 1px; font-size: .82rem; }
.tl-picked { display: grid; gap: 6px; }
@media (max-width: 760px) { .tl-pal { grid-template-columns: 1fr; } }

/* text tools */
.tl-diff-sum { font-family: var(--font-mono); font-size: .9rem; margin-bottom: 8px; }
.tl-diff-body { margin: 0; max-height: 60vh; overflow: auto; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); font-size: .82rem; line-height: 1.6; white-space: pre-wrap; }
.tl-diff-body .da { display: block; color: #bbf7d0; background: rgba(74,222,128,.12); }
.tl-diff-body .dd { display: block; color: #fecdd3; background: rgba(251,113,133,.12); text-decoration: line-through; text-decoration-color: rgba(251,113,133,.5); }
.tl-diff-body .de { display: block; color: var(--muted); }
.tl-hashes { display: grid; gap: 8px; }
.tl-hash { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.tl-hash.match { border-color: rgba(110,231,183,.6); }
.tl-hash-v { text-align: left; overflow-wrap: anywhere; font-size: .8rem; }

/* qr + password */
.tl-qr { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.tl-qr > div { display: grid; gap: 12px; }
.tl-qr-side { display: grid; gap: 12px; position: sticky; top: 90px; }
.tl-qr-prev { display: grid; place-items: center; aspect-ratio: 1; padding: 16px; border-radius: 22px; background: #fff; }
.tl-qr-prev.empty img { display: none; }
.tl-qr-prev:not(.empty) span { display: none; }
.tl-qr-prev span { color: #6b7280; }
.tl-qr-img { width: 100%; height: auto; image-rendering: pixelated; }
@media (max-width: 760px) { .tl-qr { grid-template-columns: 1fr; } .tl-qr-side { position: static; max-width: 340px; margin: 0 auto; width: 100%; } }
.tl-pw { display: grid; gap: 10px; }
.tl-pw-value { width: 100%; padding: 22px 18px; border-radius: 20px; border: 1px solid rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .08); color: var(--text); font-size: clamp(1.05rem, 3.5vw, 1.5rem); text-align: center; overflow-wrap: anywhere; letter-spacing: .02em; transition: scale 380ms var(--spring), border-color var(--t-fast); }
.tl-pw-value:hover { border-color: rgba(var(--accent-rgb), .8); }
.tl-pw-value:active { scale: .98; }
.tl-pw p { margin: 0; text-align: center; }
.tl-meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tl-meter i { display: block; height: 100%; border-radius: 4px; transition: width var(--t) var(--spring); }
.tl-meter.weak i { background: var(--danger); } .tl-meter.ok i { background: #fde68a; } .tl-meter.strong i { background: var(--ok); } .tl-meter.superb i { background: linear-gradient(90deg, var(--ok), var(--accent-2)); }

/* attendance */
.tl-att { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tl-att .empty { grid-column: 1 / -1; }
.tl-att-total { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.tl-att-total b { font-size: 1.5rem; color: var(--accent-2); }
.tl-att-card { display: grid; gap: 10px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.tl-att-card.good { border-color: rgba(110,231,183,.35); }
.tl-att-card.edge { border-color: rgba(253,230,138,.45); }
.tl-att-card.bad { border-color: rgba(251,113,133,.5); }
.tl-att-head { display: flex; align-items: center; gap: 10px; }
.tl-att-head strong { flex: 1; min-width: 0; font-size: 1.05rem; outline: none; border-radius: 6px; }
.tl-att-head strong:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .5); }
.tl-att-pct { font-size: 1.3rem; font-weight: 600; }
.good .tl-att-pct { color: var(--ok); } .edge .tl-att-pct { color: #fde68a; } .bad .tl-att-pct { color: var(--danger); }
.tl-att-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); }
.tl-att-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent-2); transition: width var(--t) var(--spring); }
.good .tl-att-bar i { background: var(--ok); } .bad .tl-att-bar i { background: var(--danger); } .edge .tl-att-bar i { background: #fde68a; }
.tl-att-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; border-radius: 1px; }
.tl-att-msg { margin: 0; font-size: .88rem; color: var(--muted); }
.tl-att-btns { display: flex; gap: 6px; }
.tl-att-btns .btn:not(:last-child) { flex: 1; }

/* converters */
.tl-conv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.tl-conv-row { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; transition: border-color var(--t-fast), scale 380ms var(--spring); }
.tl-conv-row:hover { border-color: var(--line-strong); }
.tl-conv-row:active { scale: .97; }
.tl-conv-row b { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.tl-conv-row span { color: var(--faint); font-size: .85rem; }
.tl-tz { display: grid; gap: 8px; }
.tl-tz-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.tl-tz-row.work { border-color: rgba(110,231,183,.35); }
.tl-tz-row.sleep { opacity: .7; }
.tl-tz-name { display: grid; min-width: 0; }
.tl-tz-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-tz-time { font-size: 1.5rem; }
.tl-tz-mood { font-size: .72rem; font-family: var(--font-mono); color: var(--faint); }
.work .tl-tz-mood { color: var(--ok); }
@media (max-width: 600px) { .tl-tz-row { grid-template-columns: minmax(0, 1fr) auto auto; } .tl-tz-mood { display: none; } .tl-tz-row > small { display: none; } }
.tl-split { display: grid; gap: 6px; padding: 16px; border-radius: 20px; border: 1px solid rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .06); }
.tl-split-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tl-split-row b { font-size: 1.15rem; }

/* focus timer */
.tl-focus { display: grid; justify-items: center; gap: 16px; padding: 10px 0; }
.tl-focus .tl-actions { justify-content: center; }
.tl-focus-ring { position: relative; width: 220px; height: 220px; }
.tl-focus-ring svg { rotate: -90deg; }
.tf-track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.tf-fill { fill: none; stroke: var(--accent-2); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .5s linear; filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), .6)); }
.tl-focus-ring.brk .tf-fill { stroke: var(--ok); }
.tl-focus-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.tl-focus-time { font-size: 3rem; font-weight: 600; letter-spacing: -.02em; }
.tl-focus-phase { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.center { text-align: center; }
.tl-focus-chip { position: fixed; left: 50%; top: calc(72px + env(safe-area-inset-top)); translate: -50% 0; z-index: 70; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; color: var(--text);
  background: rgba(13,11,26,.88); border: 1px solid rgba(var(--accent-rgb), .45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: .82rem; animation: toast-in var(--t) var(--spring) both; }
.tl-focus-chip .ico { color: var(--accent-2); }

/* recorder */
.tl-rec { display: grid; justify-items: center; gap: 14px; padding: 20px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.tl-rec-live { width: 100%; max-width: 560px; border-radius: 16px; background: #000; }
.tl-rec-meter { width: 100%; max-width: 560px; height: 70px; }
.tl-rec-clock { font-size: 2.2rem; }
.tl-rec-btn.on { background: var(--danger); color: #fff; animation: rec-pulse 1.6s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 12px rgba(251,113,133,0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(251,113,133,.5); } }
.tl-rec-item { display: grid; }
.tl-rec-play { width: 100%; border-radius: 14px; }
.tl-cut-tools .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 520px) { .tl-cut-tools .seg-btn { padding: 0 8px; font-size: .8rem; gap: 4px; } .tl-cut-tools { flex-direction: column; align-items: stretch; } }
