:root {
    --bg:#ffffff; --panel:#ffffff; --panel-2:#fafaf5;
    --line:#e7e7e2; --ink:#1c1c1a; --muted:#6f6f6a; --faint:#a6a6a0;
    --stabilo:#ffe600; --stabilo-2:#edd400; --line-yellow:#d4c300;
    --on-yellow:#191a00; --green:#1f9d55; --red:#d64545; --amber:#d97706;
    --shadow:0 1px 2px rgba(20,20,18,.05), 0 10px 28px -20px rgba(20,20,18,.5);
  }
  * { box-sizing:border-box; }
  html,body { margin:0; height:100%; }
  body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:var(--bg); color:var(--ink); font-size:14px; line-height:1.5;
    -webkit-font-smoothing:antialiased;
  }
  .mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace; }

  /* layout: left sidebar */
  .app { display:flex; min-height:100vh; }
  .side { width:244px; flex-shrink:0; background:var(--bg); border-right:1px solid var(--line);
    display:flex; flex-direction:column; padding:18px 12px; position:sticky; top:0; height:100vh; }
  .brand { display:flex; align-items:center; gap:10px; padding:0 8px 16px; }
  .brand a { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); }
  .brand .logo { width:30px; height:30px; border-radius:7px; background:var(--stabilo);
    color:var(--on-yellow); display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:14px; }
  .brand .name { font-weight:700; letter-spacing:.2px; }
  .nav-label { font-size:10px; text-transform:uppercase; letter-spacing:1.2px; color:var(--faint);
    padding:10px 10px 6px; }
  .nav { display:flex; flex-direction:column; gap:2px; padding:0 4px; }
  .nav a { display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:8px;
    color:var(--muted); text-decoration:none; font-weight:500; font-size:13.5px; }
  .nav a:hover { background:var(--panel-2); color:var(--ink); }
  .nav a.active { background:var(--stabilo); color:var(--on-yellow); font-weight:600; }
  .nav a .n { margin-left:auto; color:var(--faint); font-size:11px; font-family:ui-monospace,Consolas,monospace; }
  .nav a.active .n { color:var(--on-yellow); opacity:.6; }
  .nav-empty { color:var(--faint); font-size:12.5px; padding:6px 10px; }
  .devrow { display:flex; align-items:center; border-radius:8px; }
  .devrow.active { background:var(--stabilo); }
  .devrow .devlink { flex:1; min-width:0; display:flex; align-items:center; gap:8px; padding:8px 8px 8px 10px;
    color:var(--muted); text-decoration:none; font-weight:500; font-size:13.5px; }
  .devrow .devlink .n { margin-left:auto; color:var(--faint); font-size:11px; font-family:ui-monospace,Consolas,monospace; }
  .devrow.active .devlink { color:var(--on-yellow); font-weight:600; }
  .devrow.active .devlink .n { color:var(--on-yellow); opacity:.6; }
  .devrow .devdel { visibility:hidden; background:none; border:none; color:var(--faint); width:26px; height:26px;
    margin-right:4px; border-radius:6px; cursor:pointer; font-size:15px; line-height:1; }
  .devrow:hover .devdel { visibility:visible; }
  .devrow .devdel:hover { background:var(--red); color:#fff; }
  .navbtn { display:block; width:100%; text-align:left; background:none; border:none; color:var(--muted);
    font-size:13px; font-weight:500; padding:8px 10px; margin-top:2px; border-radius:8px; cursor:pointer; }
  .navbtn:hover { background:var(--panel-2); color:var(--ink); }
  .navbtn.accent { color:var(--amber); font-weight:600; }

  /* modal + confirm dialog */
  #modal, #confirm { position:fixed; inset:0; display:none; align-items:center; justify-content:center;
    background:rgba(28,28,26,.45); z-index:50; padding:16px; }
  #confirm { z-index:60; }
  #modal.show, #confirm.show { display:flex; }
  #modal .box, #confirm .box { background:#fff; border:1px solid var(--line); border-radius:14px; padding:22px;
    width:100%; max-width:420px; box-shadow:0 20px 50px -20px rgba(0,0,0,.5); }
  #modal .mh { font-size:17px; font-weight:700; margin:0 0 4px; }
  #modal .mm { color:var(--muted); font-size:12.5px; margin:0 0 16px; }
  #modal .md, #confirm .md { display:flex; justify-content:flex-end; gap:8px; margin-top:4px; }
  #modal h2, #confirm h2 { font-size:12px; text-transform:uppercase; letter-spacing:1px; color:var(--muted); margin:0 0 12px; }
  #confirm .mm { color:var(--muted); font-size:13px; margin:0 0 16px; }
  .side .grow { flex:1; overflow-y:auto; }
  .side .foot { border-top:1px solid var(--line); padding:12px 8px 0; font-size:11.5px; color:var(--muted); }
  .side .foot .k { color:var(--faint); }
  .live { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); margin-top:14px; }
  .live .pulse { width:8px; height:8px; border-radius:50%; background:var(--stabilo);
    box-shadow:0 0 0 0 rgba(255,230,0,.5); animation:pulse 2s infinite; }
  @keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(255,230,0,.5);} 70%{box-shadow:0 0 0 8px rgba(255,230,0,0);} 100%{box-shadow:0 0 0 0 rgba(255,230,0,0);} }

  .main { flex:1; min-width:0; max-width:1180px; margin:0 auto; padding:24px 26px 80px; }
  .topbar2 { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
  .topbar2 h1 { font-size:20px; margin:0; }
  .topbar2 .muted { color:var(--muted); font-size:13px; }

  .stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(148px,1fr)); gap:14px; margin-bottom:22px; }
  .card { background:var(--panel); border:1px solid var(--line); border-radius:12px;
    padding:16px 16px 14px; box-shadow:var(--shadow); margin-bottom:16px; }
  .card h2 { font-size:12px; text-transform:uppercase; letter-spacing:1px; color:var(--muted);
    margin:0 0 14px; display:flex; align-items:center; justify-content:space-between; }
  .card h2 .count { color:var(--line-yellow); font-weight:700; }
  .stat .tag { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); margin-bottom:10px; }
  .stat .sw { width:8px; height:8px; border-radius:2px; background:var(--stabilo); }
  .stat .sw.green{background:var(--green);} .stat .sw.amber{background:var(--amber);} .stat .sw.red{background:var(--red);}
  .stat .val { font-size:26px; font-weight:700; letter-spacing:-.5px; }

  .cols { display:grid; grid-template-columns:1.45fr 1fr; gap:16px; align-items:start; }
  @media (max-width:960px){ .cols{ grid-template-columns:1fr; } }

  label { display:block; font-size:11.5px; color:var(--muted); margin:0 0 4px; }
  .field { margin-bottom:12px; }
  input, textarea, select.slot { width:100%; background:var(--panel-2); border:1px solid var(--line);
    border-radius:9px; color:var(--ink); padding:9px 11px; font-size:14px; font-family:inherit;
    transition:border-color .12s, box-shadow .12s; }
  input:focus, textarea:focus, select.slot:focus { outline:none; border-color:var(--stabilo-2);
    box-shadow:0 0 0 3px rgba(255,230,0,.25); background:#fff; }
  .r2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  button.btn { background:var(--stabilo); color:var(--on-yellow); border:none; border-radius:9px;
    padding:9px 16px; font-size:14px; font-weight:600; cursor:pointer; transition:background .12s; }
  button.btn:hover { background:var(--stabilo-2); }
  button.btn:disabled { opacity:.5; cursor:not-allowed; }
  a.btn { text-decoration:none; }
  .btn.ghost { background:var(--panel-2); color:var(--ink); border:1px solid var(--line); font-weight:500; }
  button.mini, a.mini { background:var(--panel-2); color:var(--ink); border:1px solid var(--line);
    border-radius:8px; padding:5px 11px; font-size:12.5px; font-weight:600; cursor:pointer;
    text-decoration:none; display:inline-block; }
  button.mini:hover, a.mini:hover { border-color:var(--ink); }
  button.mini.ok { color:#fff; background:var(--green); border-color:var(--green); }
  button.mini.ok:hover { background:#178a48; }
  button.mini.danger { color:var(--red); }
  button.mini.danger:hover { background:var(--red); color:#fff; border-color:var(--red); }

  table { width:100%; border-collapse:collapse; font-size:13.5px; }
  th, td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:middle; }
  th { color:var(--faint); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.6px; }
  tr:last-child td { border-bottom:none; }
  .badge { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; }
  .badge::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--faint); }
  .badge.initializing::before{background:var(--stabilo-2); animation:pulse 1.2s infinite;}
  .badge.restarting::before{background:var(--stabilo-2); animation:pulse 1.2s infinite;}
  .badge.queued::before{background:var(--faint);}
  .badge.ready::before{background:var(--green);}
  .badge.error::before{background:var(--red);}
  .badge.waiting-captcha::before{background:var(--amber);}
  .badge.created::before{background:var(--faint);}
  .badge.created{color:var(--muted);} .badge.initializing{color:var(--amber);}
  .badge.restarting{color:var(--amber);} .badge.queued{color:var(--muted);}
  .badge.ready{color:var(--green);} .badge.error{color:var(--red);}
  .badge.waiting-captcha{color:var(--amber);}
  /* event log levels */
  .badge.log-info{color:var(--muted);} .badge.log-info::before{background:var(--faint);}
  .badge.log-warn{color:var(--amber);} .badge.log-warn::before{background:var(--amber);}
  .badge.log-error{color:var(--red);} .badge.log-error::before{background:var(--red);}
  .row-actions { display:flex; gap:6px; justify-content:flex-end; }
  .empty { color:var(--faint); font-size:13px; padding:14px 4px; }
  .hint { color:var(--muted); font-size:11.5px; margin-top:10px; }
  .hint.inline { font-size:11px; font-weight:500; }

  /* android slots grid */
  .slots { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px; align-items:start; }
  .slot {
    border:1px solid var(--line); border-radius:11px; padding:12px 12px 10px;
    background:var(--panel-2); display:flex; flex-direction:column; gap:6px;
    border-left:4px solid var(--line);
  }
  .slot.used { background:#fff; }
  /* state tag on running/queued slots */
  .slot.used.st-initializing, .slot.used.st-restarting {
    border-left-color:var(--amber); animation:pulseBox 1.6s infinite; }
  .slot.used.st-queued { border-left-color:var(--faint); border-style:dashed; background:var(--panel-2); }
  .slot.used.st-ready { border-left-color:var(--green); }
  .slot.used.st-error { border-left-color:var(--red); }
  @keyframes pulseBox { 0%,100%{ box-shadow:0 0 0 0 rgba(217,119,6,.0);} 50%{ box-shadow:0 0 0 5px rgba(217,119,6,.16);} }
  .snum { font-size:11px; color:var(--faint); font-weight:600; letter-spacing:.5px;
    display:flex; align-items:center; justify-content:space-between; gap:6px; white-space:nowrap; }
  .statag { font-size:10px; font-weight:700; letter-spacing:.6px; padding:2px 8px; border-radius:999px;
    text-transform:uppercase; }
  .statag.initializing, .statag.restarting { background:rgba(217,119,6,.16); color:var(--amber); }
  .statag.queued { background:#e7e7e2; color:var(--muted); }
  .slot .sname { font-family:ui-monospace,"Cascadia Mono",Consolas,monospace; font-size:13px; font-weight:700; }
  .slot .smail { font-family:ui-monospace,"Cascadia Mono",Consolas,monospace; font-size:11px; color:var(--muted);
    word-break:break-all; }
  .slot .bed { margin-top:auto; }
  .slot.free { border-style:dashed; background:var(--panel-2); color:var(--faint);
    align-items:center; justify-content:center; min-height:104px; font-size:12px;
    font-family:inherit; cursor:pointer; text-align:center; transition:border-color .12s, background .12s, color .12s; }
  .slot.free:hover { border-color:var(--stabilo-2); background:#fff8cc; color:var(--ink); }
  .slot.free .snum { font-size:10px; letter-spacing:.6px; color:var(--faint); }
  .slot.free:hover .snum { color:var(--on-yellow); }
  .slot.free .add { font-size:14px; font-weight:600; margin-top:2px; }
  .slot.free:hover .add { color:var(--on-yellow); }
  /* screenshot at the top of each used slot */
  .slot .shotwrap { margin:-12px -12px 6px; background:#000; border-bottom:1px solid var(--line);
    border-radius:10px 10px 0 0; overflow:hidden; }
  .slot .shotwrap img { display:block; width:100%; aspect-ratio:9/16; object-fit:cover; cursor:zoom-in; }
  .slot .shotwrap .noshot { min-height:140px; padding:16px; display:flex; align-items:center; justify-content:center;
    color:var(--faint); font-size:11px; background:var(--panel-2); text-align:center; }
  .shot-full { display:block; width:100%; max-height:68vh; object-fit:contain; background:#000; border-radius:9px; }
  /* batch controls under the slot card header */
  .batchbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:12px;
    padding-top:10px; border-top:1px dashed var(--line); }
  .batchform { display:flex; align-items:center; gap:6px; margin:0; }
  .batchbar input[type=number] { width:64px; padding:5px 8px; font-size:12.5px; }
  .batchbar select.psel { width:auto; min-width:140px; padding:5px 8px; font-size:12.5px; }
  .batch-label { font-size:11.5px; color:var(--muted); font-weight:500; }
  .batchbar .delall { margin-left:auto; }

  .device-head { display:flex; align-items:center; justify-content:space-between; }
  .device-head .dm-title { font-size:20px; font-weight:700; }
  .device-head .mono { color:var(--muted); }

  .chips { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
  .chip { display:inline-flex; align-items:center; gap:4px; background:var(--panel-2);
    border:1px solid var(--line); border-radius:999px; padding:3px 5px 3px 12px; font-size:13px;
    transition:border-color .12s, box-shadow .12s; }
  .chip:hover { border-color:var(--line-yellow); }
  .chip.editing { border-color:var(--stabilo-2); box-shadow:0 0 0 3px rgba(255,230,0,.25); background:#fff; }
  .chip .chip-name { padding-right:2px; }
  .chip .rename { display:none; align-items:center; gap:2px; margin:0; }
  .chip.editing .chip-name, .chip.editing .edit, .chip.editing .del { display:none; }
  .chip.editing .rename { display:inline-flex; }
  .chip .rin { width:120px; padding:4px 8px; font-size:13px; border-radius:999px; }
  .chip .cbtn { background:none; border:none; cursor:pointer; color:var(--faint); width:22px; height:22px;
    border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
    font-size:13px; line-height:1; padding:0; }
  .chip .cbtn:hover { background:var(--panel-2); color:var(--ink); }
  .chip .cbtn.del:hover { background:var(--red); color:#fff; }
  .chip .cbtn.save:hover { background:var(--green); color:#fff; }
  .chip .cbtn.edit { opacity:0; }
  .chip:hover .cbtn.edit { opacity:1; }

  /* manage-names list (modal) */
  .nmanage { display:flex; flex-direction:column; gap:8px; }
  .nbar { display:flex; align-items:center; gap:8px; }
  .nbar .nsearch { flex:1; padding:7px 10px; font-size:13px; }
  .nbar .ncount { color:var(--faint); font-size:11.5px; font-family:ui-monospace,Consolas,monospace; }
  .nlist { display:flex; flex-direction:column; max-height:280px; overflow-y:auto;
    border:1px solid var(--line); border-radius:10px; }
  .nitem { display:flex; align-items:center; gap:8px; padding:7px 9px; border-bottom:1px solid var(--line); }
  .nitem:last-child { border-bottom:none; }
  .ncheck { display:flex; margin:0; }
  .ncheck input { width:15px; height:15px; accent-color:var(--stabilo-2); cursor:pointer; }
  .nitem .nedit { display:flex; flex:1; gap:6px; margin:0; align-items:center; }
  .nitem .nedit input { flex:1; min-width:0; padding:5px 9px; font-size:13px; }
  .nfoot { justify-content:space-between; }
  .nitem.hidden { display:none; }

  /* playlists (overview card + manage modal) */
  .plists { display:flex; flex-direction:column; gap:10px; }
  .pitem { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--panel-2); }
  .pitem .phead { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
  .pitem .pname { font-weight:700; font-size:13.5px; }
  .pitem .pmeta { margin-left:auto; color:var(--faint); font-size:11px;
    font-family:ui-monospace,Consolas,monospace; }
  .psongs { display:flex; flex-wrap:wrap; gap:6px; }
  .songpill { background:#fff; border:1px solid var(--line); border-radius:999px;
    padding:2px 10px; font-size:12px; }
  .pmanage { display:flex; flex-direction:column; gap:12px; max-height:360px; overflow-y:auto; }
  .pblock { border:1px solid var(--line); border-radius:10px; padding:10px; }
  .pblock-head { display:flex; gap:6px; align-items:center; margin-bottom:8px; }
  .pblock-head .prename { display:flex; flex:1; gap:6px; margin:0; }
  .pblock-head .prename input { flex:1; min-width:0; padding:5px 9px; font-size:13px; }
  .psonglist { display:flex; flex-direction:column; border:1px solid var(--line);
    border-radius:8px; margin-bottom:8px; }
  .songrow { display:flex; align-items:center; gap:6px; padding:5px 9px; border-bottom:1px solid var(--line); }
  .songrow:last-child { border-bottom:none; }
  .songrow .songtitle { flex:1; min-width:0; font-size:13px; }
  .addsong { display:flex; gap:6px; margin:0; }
  .addsong input { flex:1; min-width:0; padding:6px 9px; font-size:13px; }
  select.psel { width:100%; background:#fff; border:1px solid var(--line); border-radius:8px;
    color:var(--ink); padding:5px 8px; font-size:12px; font-family:inherit; cursor:pointer; }
  select.psel:focus { outline:none; border-color:var(--stabilo-2); box-shadow:0 0 0 3px rgba(255,230,0,.25); }
  select.psel.warn { border-color:var(--amber); color:var(--amber); font-weight:600; }
  .pwarn { color:var(--amber); font-size:11px; font-weight:600; margin:2px 0 6px; }
  pre.diaglog { background:var(--panel-2); border:1px solid var(--line); border-radius:9px;
    padding:10px; font-family:ui-monospace,Consolas,monospace; font-size:11.5px; color:var(--muted);
    max-height:260px; overflow:auto; white-space:pre-wrap; word-break:break-word; margin:8px 0 0; }

  /* screenshot wall */
  .wall-dev { font-size:12px; text-transform:uppercase; letter-spacing:1px; color:var(--muted);
    margin:22px 0 10px; display:flex; align-items:center; gap:8px; }
  .wall { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
  .wall-tile { border:1px solid var(--line); border-radius:11px; overflow:hidden; background:var(--panel-2); }
  .wall-tile img { display:block; width:100%; aspect-ratio:9/16; object-fit:cover; background:#000; cursor:zoom-in; }
  .wall-empty { aspect-ratio:9/16; display:flex; align-items:center; justify-content:center;
    color:var(--faint); font-size:12px; background:var(--panel-2); }
  .wall-cap { display:flex; align-items:center; gap:6px; padding:6px 8px 2px; font-size:12px; }
  .wall-cap .badge { margin-left:auto; }
  .wall-time { padding:0 8px 7px; color:var(--faint); font-size:11px; }

  .htmx-indicator { opacity:0; transition:opacity .2s; }
  .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity:1; }

  #toast { position:fixed; bottom:22px; right:22px; max-width:360px; background:#1c1c1a; color:#fff;
    border-left:3px solid var(--stabilo); border-radius:9px; padding:12px 16px; font-size:13px;
    box-shadow:0 10px 30px -12px rgba(0,0,0,.4); opacity:0; transform:translateY(8px);
    pointer-events:none; transition:opacity .18s, transform .18s; z-index:100; display:none; }
  #toast.show { opacity:1; transform:translateY(0); }
  [hidden] { display:none !important; }
  button:disabled { opacity:.5; cursor:not-allowed; }
  a { color:inherit; text-underline-offset:3px; }
  :focus-visible { outline:3px solid var(--stabilo-2); outline-offset:3px; }
  .health-summary, .toolbar, .filter-buttons, .view-buttons, .queue-active, .android-actions {
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  }
  .health-summary { color:var(--muted); padding-bottom:14px; border-bottom:1px solid var(--line); }
  .toolbar { margin-top:14px; justify-content:space-between; }
  .filter-buttons, .view-buttons { gap:5px; }
  .mini.selected { background:var(--stabilo); border-color:var(--line-yellow); color:var(--on-yellow); }
  .queue-active { justify-content:space-between; padding:10px 0; }
  .queue-active + .queue-active { border-top:1px solid var(--line); }
  .queue-active .hint, .shot-age { margin-top:0; }
  .active-android-highlight { position:sticky; top:8px; z-index:8; display:flex; align-items:center; gap:12px;
    margin:0 0 12px; padding:8px 12px; border:1px solid #e2e8f0; border-left:3px solid #2563eb;
    border-radius:8px; background:#fff; color:#172554; box-shadow:0 2px 8px rgba(15,23,42,.06); }
  .active-android-pulse { width:8px; height:8px; flex:none; border-radius:50%; background:#2563eb; animation:runningPulse 2s infinite; }
  @keyframes runningPulse { 0%,100% { box-shadow:0 0 0 0 rgba(37,99,235,0); } 50% { box-shadow:0 0 0 5px rgba(37,99,235,.14); } }
  .active-android-highlight > div { display:flex; flex:1; min-width:0; flex-direction:column; line-height:1.35; }
  .active-android-highlight strong { font-size:11px; color:#1d4ed8; text-transform:uppercase; letter-spacing:.7px; }
  .active-android-highlight span:not(.active-android-pulse) { font-weight:700; overflow-wrap:anywhere; }
  .active-android-highlight small { color:#475569; overflow-wrap:anywhere; }
  .active-android-highlight .active-job-heading { display:flex; align-items:baseline; gap:4px 10px; flex-wrap:wrap; }
  .active-android-highlight .active-job-heading strong { font-size:10px; }
  .active-android-highlight .active-job-heading span { font-size:12px; }
  .active-android-highlight .active-job-heading small { font-size:11px; }
  .active-android-highlight .active-step { margin:2px 0; font-size:12px; font-weight:500; overflow-wrap:anywhere; }
  .active-android-highlight details { font-size:11px; }
  .active-android-highlight details summary { cursor:pointer; color:#475569; width:fit-content; }
  .active-android-highlight details[open] { padding-top:3px; }
  .active-android-highlight details small { display:block; }
  .active-android-highlight progress { margin:4px 0; accent-color:#2563eb; }
  .active-android-highlight > a { flex-shrink:0; color:#1d4ed8; background:#fff; border-color:#bfdbfe; }
  .active-android-highlight > a:hover { background:#dbeafe; border-color:#2563eb; }
  .active-android-highlight > a:focus-visible { outline-color:#2563eb; }
  @media(max-width:480px) { .active-android-highlight { gap:8px; padding:10px; } .active-android-highlight > a { max-width:84px; text-align:center; } }
  .batchform { flex-wrap:wrap; }
  .batchform label { margin:0; }
  .device-menu { margin-left:auto; }
  details { position:relative; }
  summary.mini { display:inline-block; padding:5px 11px; border:1px solid var(--line); border-radius:8px; font-size:12.5px; cursor:pointer; list-style:none; font-weight:600; background:var(--panel-2); }
  summary::-webkit-details-marker { display:none; }
  .action-menu { position:absolute; top:calc(100% + 5px); right:0; z-index:10; min-width:170px; display:flex; flex-direction:column; gap:6px; background:#fff; padding:10px; border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); }
  .android-actions { margin-top:auto; padding-top:10px; gap:6px; }
  .workflow-progress { display:flex; flex-direction:column; gap:5px; margin:6px 0; color:var(--amber); font-size:12px; overflow-wrap:anywhere; }
  .workflow-label { margin:6px 0; padding:6px 8px; border-radius:6px; background:#eff6ff; color:#1d4ed8; font-size:12px; font-weight:600; overflow-wrap:anywhere; }
  .workflow-progress span { color:var(--muted); font-size:11px; }
  progress { width:100%; height:6px; accent-color:var(--green); }
  .failure-detail { color:var(--red); background:#fff5f5; padding:9px; border-radius:8px; font-size:12px; max-height:125px; overflow:auto; overflow-wrap:anywhere; }
  .table-scroll { overflow-x:auto; }
  .slot-table { padding:12px; border:1px solid var(--line); border-radius:12px; }
  .slot-table table { min-width:800px; }
  .slot-table td { min-width:130px; vertical-align:top; }
  .slot-table td:nth-child(2) { min-width:220px; max-width:320px; }
  .slot-table .smail { font-size:11px; color:var(--muted); overflow-wrap:anywhere; }
  .slot-table .action-menu { position:static; }
  .activity-item { padding:12px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
  .activity-item:last-child { border-bottom:0; }
  .activity-item strong { margin-left:8px; }
  .activity-item a { font-size:12px; margin-left:8px; }
  .manager-page .pmanage, .manager-page .nlist { max-height:none; }
  .duration-form, .analytics-filter { display:flex; align-items:center; gap:7px; }
  .duration-form label { margin:0; }
  .duration-form input, .duration-label input { width:80px; padding:5px 8px; }
  .duration-label { margin:0; font-size:11px; }
  .duration-label input { display:block; }
  .analytics-filter { align-items:end; flex-wrap:wrap; margin-bottom:12px; }
  .analytics-filter input[type=date] { width:auto; min-width:150px; }
  .slot.used:focus, .slot-table tr:focus { outline:3px solid var(--stabilo-2); outline-offset:3px; scroll-margin-top:120px; }
  @media (prefers-reduced-motion:reduce) { .active-android-pulse { animation:none; } }
  .songrow { flex-wrap:wrap; }
  .songrow .songtitle { flex-basis:180px; }
  .addsong { align-items:end; flex-wrap:wrap; }
  @media(max-width:700px) {
    .app { flex-direction:column; }
    .side { width:100%; height:auto; position:static; border-right:0; border-bottom:1px solid var(--line); padding:12px; }
    .brand { padding-bottom:8px; }
    .nav { flex-direction:row; flex-wrap:wrap; }
    .nav-label, #sidebar-devices, .side .foot { display:none; }
    .navbtn.accent { width:auto; }
    .main { width:100%; padding:18px 14px 40px; }
    .slots { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); }
    .r2 { grid-template-columns:1fr; }
    .batchbar .device-menu { margin-left:0; }
    .batchform { width:100%; }
    .toolbar { align-items:flex-start; }
    .duration-form { flex-wrap:wrap; }
  }
