/* Achromatic ledger (taste-skill app sheet, seed 380732561): no colour in the chrome, ink actions,
   a blue-grey meter ground, and one hue (--path) for the startup path this request will take.
   Theme: follows the system; [data-theme] on <html> overrides it (static/js/theme.js). */
:root {
  color-scheme: light;
  --bg:#f2f4f7; --surface:#fff; --surface-2:#eceef1; --line:#e3e5e9; --line-strong:#c9ccd2; --pill:#e4e6ea; --pill-hover:#d8dbe0;
  --ink:#0a0a0a; --muted:#5f636a; --faint:#9a9ea5;
  --accent:#0a0a0a; --accent-text:#0a0a0a; --path:#1d5fbf; --on-path:#fff;
  --positive:#2e7d32; --positive-soft:#e6f4e7; --negative:#c4242a; --negative-soft:#fdeceb;
  --warning:#92400e; --warning-soft:#fdf3e1;
  --primary:#0a0a0a; --primary-hover:#2b2d31; --on-primary:#fff;
  --selection:#d6e2f6;
  --t-slate:#4b5563; --t-blue:#2563c9; --t-teal:#0f7c7a; --t-green:#2f7d3a; --t-amber:#a15c00; --t-rose:#b8325a;
  --t-slate-on:#b6bec9; --t-blue-on:#8fb3f5; --t-teal-on:#6fd0cc; --t-green-on:#8fd19a; --t-amber-on:#f0bd6b; --t-rose-on:#f29ab3;
  --radius-card:8px; --radius-control:6px;
  font-family:"IBM Plex Sans","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  color:var(--ink); background:var(--bg); font-synthesis:none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:#0f1012; --surface:#18191c; --surface-2:#222327; --line:#2a2c30; --line-strong:#3f4247; --pill:#2a2c30; --pill-hover:#35373c;
    --ink:#ececec; --muted:#a0a3a9; --faint:#6e7278;
    --accent:#ececec; --accent-text:#ececec; --path:#6f9df2; --on-path:#0f1012;
    --positive:#66c47a; --positive-soft:#15241a; --negative:#f2867e; --negative-soft:#2d1918;
    --warning:#e6b562; --warning-soft:#2a2215;
    --primary:#ececec; --primary-hover:#d4d4d4; --on-primary:#0f1012;
    --selection:#2b3f66;
    --t-slate:#b6bec9; --t-blue:#8fb3f5; --t-teal:#6fd0cc; --t-green:#8fd19a; --t-amber:#f0bd6b; --t-rose:#f29ab3;
    --t-slate-on:#4b5563; --t-blue-on:#2563c9; --t-teal-on:#0f7c7a; --t-green-on:#2f7d3a; --t-amber-on:#a15c00; --t-rose-on:#b8325a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#0f1012; --surface:#18191c; --surface-2:#222327; --line:#2a2c30; --line-strong:#3f4247; --pill:#2a2c30; --pill-hover:#35373c;
  --ink:#ececec; --muted:#a0a3a9; --faint:#6e7278;
  --accent:#ececec; --accent-text:#ececec; --path:#6f9df2; --on-path:#0f1012;
  --positive:#66c47a; --positive-soft:#15241a; --negative:#f2867e; --negative-soft:#2d1918;
  --warning:#e6b562; --warning-soft:#2a2215;
  --primary:#ececec; --primary-hover:#d4d4d4; --on-primary:#0f1012;
  --selection:#2b3f66;
  --t-slate:#b6bec9; --t-blue:#8fb3f5; --t-teal:#6fd0cc; --t-green:#8fd19a; --t-amber:#f0bd6b; --t-rose:#f29ab3;
  --t-slate-on:#4b5563; --t-blue-on:#2563c9; --t-teal-on:#0f7c7a; --t-green-on:#2f7d3a; --t-amber-on:#a15c00; --t-rose-on:#b8325a;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-size:15px;line-height:1.6;background:var(--bg);color:var(--ink)}
button,input,select{font:inherit;color:inherit}
button,a,input,select,summary,label{-webkit-tap-highlight-color:transparent}
h1,h2,h3,p{margin:0}
[hidden]{display:none!important}
::selection{background:var(--selection);color:var(--ink)}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:var(--line-strong);border:3px solid var(--bg);border-radius:8px}
::-webkit-scrollbar-track{background:transparent}
a{color:var(--ink);text-underline-offset:4px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
input:focus-visible,select:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:fixed;left:12px;top:-100px;background:var(--surface);padding:12px;z-index:20;border-radius:var(--radius-control)}
.skip-link:focus{top:12px}
.muted{color:var(--muted)}

/* Controls */
button{cursor:pointer;min-height:44px;border-radius:var(--radius-control);padding:8px 16px;line-height:1.35;border:1px solid transparent;background:none}
button:disabled{cursor:wait;opacity:.55}
.primary{background:var(--primary);color:var(--on-primary);display:inline-flex;align-items:center;justify-content:center;gap:10px;font-weight:600}
.primary:hover:not(:disabled){background:var(--primary-hover)}
.secondary{background:var(--pill);font-weight:500}
.secondary:hover:not(:disabled){background:var(--pill-hover)}
.compact{min-height:36px;padding:5px 12px;font-size:13px}
.text-button{color:var(--muted);padding:6px 8px;min-height:36px;font-size:13px}
.text-button:hover:not(:disabled){color:var(--ink)}
.icon-button{min-height:40px;width:40px;padding:0;display:inline-grid;place-items:center;color:var(--muted)}
.icon-button:hover:not(:disabled){color:var(--ink);background:var(--surface-2)}
label{display:block;font-weight:500;font-size:14px;margin:0 0 6px}
input,select{width:100%;min-height:46px;border:1px solid var(--line-strong);border-radius:var(--radius-control);background:var(--surface);padding:10px 12px;caret-color:var(--path)}
input::placeholder{color:var(--muted)}
input[type=checkbox]{width:22px;height:22px;min-height:22px;margin:0;flex:none;accent-color:var(--accent);cursor:pointer}

/* Frame */
.brand{display:inline-flex;gap:8px;align-items:center;color:var(--muted);text-decoration:none;font-size:14px;font-weight:500}
.layout{display:grid;grid-template-columns:minmax(0,640px) 300px;grid-template-areas:"work history" "add history";column-gap:48px;justify-content:center;align-items:start;padding:28px 24px 64px}
.work{grid-area:work;min-width:0;outline:none}
.history{grid-area:history;position:sticky;top:24px;padding-top:4px}
.add-device{grid-area:add}

.preview-notice{font-size:13px;color:var(--warning);background:var(--warning-soft);padding:8px 12px;border-radius:8px;margin:14px 0 0}
.notice{padding:12px 14px;background:var(--positive-soft);color:var(--positive);border-radius:var(--radius-control);margin:14px 0 0;overflow-wrap:anywhere;font-size:14px}
.notice.error{background:var(--negative-soft);color:var(--negative)}

/* PC bar */
.pc-bar{display:flex;align-items:center;gap:6px 14px;flex-wrap:wrap}
.pc-title{font-size:24px;font-weight:600;line-height:1.3;letter-spacing:-.02em;min-width:0}
.pc-picker{position:relative;display:inline-flex;align-items:center;max-width:100%}
.pc-picker select{appearance:none;-webkit-appearance:none;border:0;background:transparent;font-weight:600;letter-spacing:inherit;padding:4px 30px 4px 0;min-height:44px;width:auto;max-width:100%;cursor:pointer;text-overflow:ellipsis}
.pc-picker select:focus-visible{box-shadow:none;outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
.pc-picker svg{position:absolute;right:4px;pointer-events:none;color:var(--muted)}
.pc-picker select option{font-size:15px;font-weight:400}
.status{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:var(--muted);white-space:nowrap}
.status::before{content:"";width:8px;height:8px;border-radius:50%;border:1.5px solid var(--faint)}
.status.online{color:var(--positive)}
.status.online::before{background:var(--positive);border-color:var(--positive)}
.bar-actions{display:flex;align-items:center;gap:2px;margin-left:auto}
.menu{position:relative}
.menu>summary{list-style:none;cursor:pointer;border-radius:var(--radius-control)}
.menu>summary::-webkit-details-marker{display:none}
.menu[open]>summary{background:var(--surface-2);color:var(--ink)}
.menu-panel{position:absolute;right:0;top:calc(100% + 6px);z-index:40;min-width:224px;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:0 8px 24px rgb(0 0 0 / .12)}
.menu-item{display:flex;align-items:center;gap:10px;width:100%;white-space:nowrap;min-height:44px;padding:8px 10px;border-radius:var(--radius-control);text-align:left;font-size:14px;color:var(--ink)}
.menu-item:hover{background:var(--surface-2)}
.menu-item svg{color:var(--muted);flex:none}

/* Blocks */
.block{margin-top:32px}
.block-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;margin-bottom:10px}
.block-heading h2{font-size:15px;font-weight:600}
.count{font-weight:400;color:var(--muted);font-size:13px;margin-left:6px;font-variant-numeric:tabular-nums}
.selection-tools{display:flex;gap:2px}

/* Presets */
.preset-strip{display:flex;gap:8px;flex-wrap:wrap}
.preset-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:1px;min-width:136px;flex:0 0 auto;padding:11px 38px 11px 14px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);min-height:62px}
.preset-card:hover:not(:disabled){border-color:var(--line-strong)}
.preset-name{font-weight:600;font-size:15px;max-width:16ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.preset-meta{font-size:13px;color:var(--muted);white-space:nowrap}
.preset-meta.warn{color:var(--warning)}
.preset-check{position:absolute;top:11px;right:11px;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;color:transparent;border:1.5px solid var(--line-strong)}
.preset-card[aria-pressed="true"]{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.preset-card[aria-pressed="true"] .preset-check{background:var(--ink);border-color:var(--ink);color:var(--surface)}
.preset-card.is-modified .preset-meta{color:var(--ink);font-weight:500}
.preset-pieces{display:flex;gap:3px;margin-top:6px;min-height:20px}
.piece{width:20px;height:20px;border-radius:4px;display:grid;place-items:center;background:var(--surface-2);color:var(--tone,var(--muted));font-size:11px;font-variant-numeric:tabular-nums}
.piece.more{width:auto;padding:0 5px}
.preset-card[aria-pressed="true"] .piece{background:var(--ink);color:var(--tone-on,var(--surface))}

/* Task pieces: a grid of toggle tiles (icon over a two-line name). Chosen tiles fill with ink. */
fieldset{min-width:0;border:0;padding:0;margin:0}
.task-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px}
.tile{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:10px;min-height:92px;margin:0;padding:12px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);font-weight:500;font-size:14px;line-height:1.35;cursor:pointer;user-select:none;-webkit-user-select:none}
.tile:hover{border-color:var(--line-strong)}
.tile-input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.tile:has(.tile-input:focus-visible){outline:2px solid var(--ink);outline-offset:2px}
.tile-icon{color:var(--tone,var(--muted));display:grid}
[data-color=slate]{--tone:var(--t-slate);--tone-on:var(--t-slate-on)} [data-color=blue]{--tone:var(--t-blue);--tone-on:var(--t-blue-on)}
[data-color=teal]{--tone:var(--t-teal);--tone-on:var(--t-teal-on)} [data-color=green]{--tone:var(--t-green);--tone-on:var(--t-green-on)}
[data-color=amber]{--tone:var(--t-amber);--tone-on:var(--t-amber-on)} [data-color=rose]{--tone:var(--t-rose);--tone-on:var(--t-rose-on)}
.tile-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;word-break:keep-all}
.tile-check{position:absolute;top:10px;right:10px;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;color:transparent;border:1.5px solid var(--line-strong)}
.tile:has(.tile-input:checked){background:var(--ink);border-color:var(--ink);color:var(--surface)}
.tile:has(.tile-input:checked) .tile-icon{color:var(--tone-on,var(--surface))}
.tile:has(.tile-input:checked) .tile-check{background:var(--surface);border-color:var(--surface);color:var(--ink)}
.tile:active{transform:scale(.98)}
.empty-message{padding:12px 0;color:var(--muted);font-size:14px}

/* In-flight request */
.live-run{display:flex;align-items:center;gap:12px;margin-top:14px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface)}
.live-mark{width:10px;height:10px;border-radius:50%;background:var(--path);flex:none}
.live-run.running .live-mark{background:var(--positive)}
.live-copy{flex:1;min-width:0;display:flex;flex-direction:column}
.live-copy strong{font-weight:600;font-size:15px}
.live-copy span{font-size:13px;color:var(--muted)}

/* Launch */
.launch-bar{margin-top:24px;padding-bottom:8px}
.history-open,.panel-close,.add-device .panel-heading{display:none}
.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.panel-heading h2{font-size:17px;font-weight:600}
.modified{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin-bottom:12px}
.modified-label{font-size:13px;color:var(--ink);font-weight:500}
.modified-actions{display:flex;gap:8px;flex-wrap:wrap}
.preset-form{margin-bottom:12px}
.input-action{display:flex;gap:8px}
.input-action button{flex:none}
.wake{width:100%;min-height:54px;border-radius:12px;font-size:16px}
.launch-note{margin-top:8px;font-size:12px;color:var(--muted);text-align:center}

/* History */
.history h2{font-size:15px;font-weight:600;min-height:36px;display:flex;align-items:center;margin-bottom:6px}
.run{padding:12px 0;border-bottom:1px solid var(--line)}
.run:first-child{padding-top:4px}
.run-header{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.run-state{font-weight:600;font-size:14px}
.run-state.succeeded{color:var(--positive)}
.run-state.failed,.run-state.unknown{color:var(--negative)}
.run-state.expired,.run-state.cancelled{color:var(--muted)}
.run-state.pending,.run-state.running{color:var(--path)}
.run time{font-size:13px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.run-source{color:var(--muted);font-size:13px;margin-top:2px}
.run details{margin-top:6px;font-size:13px}
.run summary{color:var(--muted);cursor:pointer;min-height:28px}
.run-result{margin-top:6px;overflow-wrap:anywhere}
.history-note{margin-top:16px;font-size:12px;color:var(--muted);line-height:1.6}

/* Add PC */
.add-device{margin-top:24px;border-top:1px solid var(--line);padding-top:16px}
.add-device>summary{cursor:pointer;color:var(--muted);font-size:14px;font-weight:500;min-height:40px;display:flex;align-items:center;gap:8px;list-style:none}
.add-device>summary::-webkit-details-marker{display:none}
.add-device>summary::before{content:"+";font-size:18px;line-height:1;width:18px;text-align:center}
.add-device[open]>summary::before{content:"–"}
.add-device>summary:hover{color:var(--ink)}
.add-device form{margin-top:12px;padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-card)}
.add-device form>p{font-size:14px;margin-bottom:18px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}
.empty-state{padding:24px 0 8px}
.empty-state h1{font-size:24px;font-weight:600;letter-spacing:-.02em;margin-bottom:8px}
.empty-state p{max-width:52ch}

/* Login */
.login-page{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px 16px}
.login-panel{width:min(100%,400px)}
.login-panel .login-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:40px}
.login-panel h1{font-size:24px;font-weight:600;letter-spacing:-.02em;margin-bottom:6px}
.login-panel form{margin-top:28px;padding:24px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-card)}
.login-panel input{margin-bottom:18px}
.login-panel .notice{margin-bottom:18px}
.full-width{width:100%}

@media (prefers-reduced-motion: no-preference) {
  button,input,select,.tile{transition:background-color 120ms ease-out,border-color 120ms ease-out,color 120ms ease-out}
  .tile{transition-property:background-color,border-color,color,transform}
  .live-run.pending .live-mark{animation:waiting 1.6s ease-in-out infinite}
  @keyframes waiting{50%{opacity:.3}}
}

/* Tablet and phone: the task screen fits the viewport with no page scroll.
   Only the task list scrolls when a PC has many tasks; history and the add-PC form open as full-screen panels. */
@media (max-width: 999px) {
  .layout{display:block;padding:8px 16px 0}
  .preview-notice{font-size:12px;padding:6px 10px;margin-top:6px}
  .notice{padding:9px 12px;margin-top:8px;font-size:13px}
  .pc-title{font-size:21px;flex:1}
  .pc-bar{gap:0 4px}
  .pc-bar .status{order:3;flex-basis:100%;margin-top:-4px}
  .pc-bar .bar-actions{order:2;margin-right:-8px}
  .history-open{display:inline-grid}
  .block{margin-top:18px}
  .block-heading{min-height:32px;margin-bottom:6px}
  .preset-strip{flex-wrap:nowrap;gap:8px;overflow-x:auto;margin:0 -16px;padding:1px 16px 3px;scroll-snap-type:x proximity;scroll-padding:0 16px;scrollbar-width:none;overscroll-behavior-x:contain}
  .preset-strip::-webkit-scrollbar{display:none}
  .preset-card{flex:0 0 auto;width:132px;min-width:0;min-height:54px;padding:8px 30px 8px 12px;scroll-snap-align:start}
  .preset-name{font-size:14px;max-width:100%}
  .preset-meta{font-size:12px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .preset-check{top:9px;right:9px;width:18px;height:18px}
  .task-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .tile{min-height:84px;padding:10px;gap:8px;font-size:13px}
  .live-run{margin-top:10px;padding:10px 12px}
  .live-copy strong{font-size:14px}
  .live-copy span{font-size:12px}
  .launch-note{display:none}
  .modified{flex-wrap:nowrap;margin-bottom:8px;gap:8px}
  .modified-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .modified-actions{flex-wrap:nowrap;flex:none}
  .preset-form{margin-bottom:8px}
  .preset-form label{font-size:13px}
  .wake{min-height:52px}
  .form-grid{grid-template-columns:1fr}
  .input-action input{min-width:0}

  body.app.has-device{height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
  .has-device .layout{flex:1;min-height:0;display:flex;flex-direction:column;align-items:stretch}
  .has-device .work{flex:1;min-height:0;display:flex;flex-direction:column}
  .has-device #workspace{flex:1;min-height:0;display:flex;flex-direction:column}
  .has-device .task-block{flex:1;min-height:0;display:flex;flex-direction:column}
  .has-device .layout>*,.has-device .work>*,.has-device #workspace>*{min-width:0}
  .has-device .task-grid{flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;align-content:start;padding:2px;margin:-2px}
  .has-device .launch-bar{margin:12px -16px 0;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line)}
  .has-device .add-device:not([open]),.has-device .history{display:none}
  .has-device .add-device[open],.show-history .history{display:block;position:fixed;inset:0;z-index:30;overflow-y:auto;margin:0;border:0;
    padding:12px 16px calc(24px + env(safe-area-inset-bottom));background:var(--bg)}
  .has-device .add-device[open]>summary{display:none}
  .has-device .add-device form{margin-top:0;padding:0;border:0;background:none}
  .has-device .add-device .panel-heading{display:flex;min-height:44px;margin-bottom:8px}
  .history .panel-heading{min-height:44px;margin-bottom:4px}
  .history .panel-heading h2{margin:0;min-height:0}
  .panel-close.text-button{display:inline-flex;align-items:center;font-size:14px;color:var(--accent-text)}
  body:not(.has-device) .layout{padding-bottom:24px}
  body:not(.has-device) .history{display:none}
}
