/* HeroUI v3 light theme, adapted to the existing native HTML controls.
 * Sources: heroui-inc/heroui v3 packages/styles/themes/default/variables.css
 * and packages/styles/components/{button,card,input}.css. No behavior dependency.
 */
:root {
  color-scheme: light;
  /* Deeper accent keeps small white button text and blue links clear. */
  --hero-accent: oklch(0.56 0.195 253.83);
  --hero-background: oklch(0.9702 0 0);
  --hero-foreground: oklch(0.2103 0.0059 285.89);
  --hero-muted: oklch(0.5517 0.0138 285.94);
  --hero-default: oklch(94% 0.001 286.375);
  --hero-surface: #fff;
  --hero-secondary: oklch(0.9524 0.0013 286.37);
  --hero-separator: oklch(92% 0.004 286.32);
  --hero-border: oklch(90% 0.004 286.32);
  --hero-field-radius: 12px;
  --hero-card-radius: 20px;
  --hero-button-radius: 24px;
  --hero-hover: color-mix(in oklab, var(--hero-default) 96%, var(--hero-foreground) 4%);
  --hero-focus: color-mix(in oklab, var(--hero-accent) 24%, transparent);
  --blue: var(--hero-accent);
  --blue-soft: color-mix(in oklab, var(--hero-accent) 9%, white);
  --blue-soft-hover: color-mix(in oklab, var(--hero-accent) 14%, white);
  --blue-soft-ink: color-mix(in oklab, var(--hero-accent) 85%, var(--hero-foreground));
  --green: #137b40;
  --green-soft: #edf9f0;
  --amber: #a16207;
  --amber-soft: #fff8e8;
  --red: #c72732;
  --red-soft: #fff0f1;
  --ink: var(--hero-foreground);
  --text: #3f3f46;
  --text-secondary: var(--hero-muted);
  --text-tertiary: var(--hero-muted);
  --muted: var(--hero-muted);
  --line: var(--hero-separator);
  --canvas: var(--hero-background);
  --card: var(--hero-surface);
  --shadow: 0 2px 8px rgba(0,0,0,.06), 0 -6px 12px rgba(0,0,0,.03), 0 14px 28px rgba(0,0,0,.08);
  --card-shadow: 0 1px 2px rgba(0,0,0,.035);
  --font-meta: 13px;
  --font-body: 15px;
  --font-task: 16px;
  --font-section: 18px;
  --font-page: 28px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--canvas); }
body {
  min-height: 100vh;
  padding: 18px;
  color: var(--ink);
  font-size: var(--font-body);
  line-height: 1.6;
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
.desktop-window-chrome { display: none; }
html.desktop-shell body { padding: calc(8px + env(titlebar-area-height, 38px)) 8px 8px; }
html.desktop-shell .desktop-window-chrome {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: env(titlebar-area-height, 38px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  box-shadow: 0 1px 0 rgba(28, 43, 71, .02);
  pointer-events: none;
}
.desktop-window-drag {
  width: calc(100% - 152px);
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  color: var(--text);
  font-size: var(--font-meta);
  font-weight: 600;
  user-select: none;
  pointer-events: auto;
  -webkit-app-region: drag;
}
.desktop-window-drag strong, .desktop-window-drag small { display: block; line-height: 1.25; }
.desktop-window-drag small { margin-top: 1px; color: var(--muted); font-size: var(--font-meta); font-weight: 400; }
.desktop-window-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--blue); box-shadow: none; font-size: var(--font-meta); font-weight: 800; }
button, input, textarea, select { font: inherit; }
strong, b { font-weight: 600; }
input, textarea, select { font-size: var(--font-body); font-weight: 400; line-height: 1.5; }
button { border: 0; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
.task-more > summary:focus-visible, #computer-management > summary:focus-visible, .create-optional > summary:focus-visible { outline: 3px solid var(--hero-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.button-with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button-icon { width: 20px; height: 20px; flex: 0 0 auto; pointer-events: none; }
.icon-only-button { width: 36px; min-width: 36px; padding: 0; display: inline-grid; place-items: center; }
.icon-only-button .button-icon { width: 20px; height: 20px; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
.is-loading .icon-refresh, #refresh:disabled .icon-refresh { animation: icon-spin .8s linear infinite; }
.status-icon { width: 14px; height: 14px; flex: 0 0 auto; pointer-events: none; }
.status-icon-running { transform-origin: center; animation: icon-spin 1.4s linear infinite; }

.app-shell {
  width: min(1240px, 100%);
  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--canvas);
  box-shadow: var(--shadow);
}
html.desktop-shell .app-shell {
  width: 100%;
  height: calc(100vh - env(titlebar-area-height, 38px) - 16px);
  height: calc(100dvh - env(titlebar-area-height, 38px) - 16px);
  min-height: 0;
  border-radius: 16px;
}
.sidebar {
  position: relative;
  z-index: 20;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--card);
}
.brand, .auth-brand { display: flex; align-items: center; gap: 11px; }
.brand { padding: 2px 8px 24px; }
html.desktop-shell .sidebar .brand { justify-content: center; padding: 4px 8px 20px; }
html.desktop-shell .sidebar .brand-copy,
html.desktop-shell .auth-brand { display: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  box-shadow: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: var(--font-body); font-weight: 600; line-height: 1.25; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: var(--font-meta); font-weight: 400; line-height: 1.4; }
.nav-list { display: grid; gap: 7px; }
.nav-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: var(--font-body);
  font-weight: 500;
  text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.nav-button:hover { color: var(--ink); background: var(--hero-secondary); }
.nav-button.active { color: var(--blue); background: var(--blue-soft); box-shadow: none; font-weight: 600; }
.nav-button svg { width: 20px; height: 20px; flex: 0 0 auto; }
.admin-mobile { display: none; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 2px; }
.admin-entry { display: flex; align-items: center; gap: 9px; color: var(--muted); background: transparent; font-size: var(--font-body); font-weight: 500; }
.admin-entry .button-icon { color: currentColor; }
.admin-entry:hover:not(:disabled), .admin-entry.active { color: var(--blue); }

.main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d4d4d8 transparent;
}
.main::-webkit-scrollbar { width: 10px; height: 10px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #d4d4d8; background-clip: padding-box; }
.main::-webkit-scrollbar-thumb:hover { background: #a1a1aa; background-clip: padding-box; }
.main::-webkit-scrollbar-corner { background: transparent; }
.main-inner { width: 100%; padding: 26px clamp(20px, 3vw, 38px) 38px; }
.page-view { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading { min-width: 0; }
.page-heading h1 { color: var(--ink); font-size: var(--font-page); font-weight: 600; line-height: 1.3; }
.page-heading p { margin-top: 5px; color: var(--muted); font-size: var(--font-meta); line-height: 1.5; }
.top-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.status-pill, .count {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .82);
  font-size: var(--font-meta);
  font-weight: 500;
}
.status-pill { overflow-wrap: anywhere; }
.count { white-space: nowrap; }
.status-pill.ok { color: #177245; background: #f0fdf4; border-color: #dcfce7; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(100, 116, 139, .12); }
.status-pill.ok .dot { box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
.icon-button, .ghost-button, .text-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--hero-button-radius);
  color: var(--text);
  background: var(--hero-default);
  font-size: var(--font-body);
  font-weight: 600;
}
.icon-button:hover:not(:disabled), .ghost-button:hover:not(:disabled) { color: var(--ink); border-color: var(--hero-border); background: var(--hero-hover); }
.icon-button:active:not(:disabled), .ghost-button:active:not(:disabled) { background: color-mix(in oklab, var(--hero-hover) 96%, var(--ink)); }
.text-button { border: 0; color: var(--text-secondary); background: transparent; }
.text-button:hover:not(:disabled) { color: var(--blue); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--hero-card-radius);
  background: var(--card);
  box-shadow: var(--card-shadow);
}
.panel-head h2, .section-head h2, .subsection-head h2 { margin-top: 4px; font-size: var(--font-section); font-weight: 600; }
.page-heading .computer-preparation { max-width: 680px; white-space: normal; overflow-wrap: anywhere; }
.computer-preparation.success { color: var(--green); }
.eyebrow { color: var(--text-tertiary); font-size: var(--font-meta); font-weight: 500; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.section-head p, .panel-head p { margin-top: 5px; color: var(--muted); font-size: var(--font-meta); line-height: 1.5; }
.section-actions { display: flex; align-items: center; gap: 8px; }
.task-create-action { min-height: 38px; padding: 0 14px; border-radius: var(--hero-button-radius); color: #fff; background: var(--blue); font-size: var(--font-body); font-weight: 600; white-space: nowrap; }
.task-create-action:hover:not(:disabled) { background: color-mix(in oklab, var(--blue) 94%, var(--ink)); }
form button[type="submit"]:hover:not(:disabled) { background: color-mix(in oklab, var(--blue) 94%, var(--ink)); }
.task-create-action:active:not(:disabled), form button[type="submit"]:active:not(:disabled) { background: color-mix(in oklab, var(--blue) 90%, var(--ink)); }

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-select {
  width: 240px;
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 11px;
  border: 1px solid var(--hero-border);
  border-radius: var(--hero-field-radius);
  color: var(--muted);
  background: #fff;
  box-shadow: 0 3px 10px rgba(28,43,71,.04);
  font-size: var(--font-meta);
  font-weight: 500;
  white-space: nowrap;
}
.filter-select:hover { border-color: var(--hero-border); }
.filter-select:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.filter-select select {
  width: 0;
  min-width: 0;
  min-height: 36px;
  flex: 1 1 auto;
  padding: 0 30px 0 0;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background-color: transparent;
  font-size: var(--font-body);
  font-weight: 400;
  cursor: pointer;
}
.filter-select-status { width: 200px; }
.filter-select select:focus { border-color: transparent; outline: 0; }
.filter-select select:focus-visible { outline: 0; }
.filter-select select option { color: var(--text); }

.computer-task-groups { display: grid; gap: 20px; }
.computer-task-group { min-width: 0; }
.computer-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; margin: 0 0 8px; }
.computer-group-title { flex: 1 1 auto; display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.computer-group-title strong { min-width: 0; font-size: var(--font-body); white-space: normal; overflow-wrap: anywhere; }
.computer-state { flex: 0 0 auto; color: var(--muted); font-size: var(--font-meta); white-space: nowrap; }
.computer-state.online { color: var(--green); }
.task-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.task-card {
  --accent: var(--blue);
  --soft: var(--blue-soft);
  --accent-border: #bfdbfe;
  min-width: 0;
  padding: 15px 15px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(28,43,71,.025);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.task-card[data-state="pending"] { --accent: var(--muted); --soft: var(--hero-secondary); --accent-border: var(--line); }
.task-card[data-state="disabled"] { --accent: var(--muted); --soft: var(--hero-secondary); --accent-border: var(--line); }
.task-card[data-state="completed"] { --accent: var(--green); --soft: var(--green-soft); --accent-border: #bbf7d0; }
.task-card[data-state="failed"] { --accent: var(--red); --soft: var(--red-soft); --accent-border: #fecaca; }
.fixed-scenario-card { border-left: 3px solid var(--accent-border); }
.task-card.highlight { border-color: rgba(37,99,235,.55); box-shadow: 0 0 0 4px rgba(37,99,235,.1), var(--card-shadow); }
@media (hover: hover) and (pointer: fine) {
  .task-card:hover { border-color: var(--hero-border); box-shadow: 0 10px 26px rgba(28,43,71,.08); transform: translateY(-1px); }
  .task-card.highlight:hover { border-color: rgba(37,99,235,.62); box-shadow: 0 0 0 4px rgba(37,99,235,.1), 0 10px 26px rgba(28,43,71,.08); }
}
.task-main { min-width: 0; }
.task-info { min-width: 0; }
.task-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.state-chip { height: 24px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid transparent; border-radius: 999px; color: var(--accent); background: var(--soft); font-size: var(--font-meta); font-weight: 500; }
.task-name { overflow: hidden; color: var(--ink); font-size: var(--font-task); font-weight: 600; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.task-summary { margin-top: 7px; overflow: hidden; color: var(--text-secondary); font-size: var(--font-meta); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.task-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.task-fact { min-width: 0; padding: 8px 9px; border-radius: 9px; background: var(--hero-secondary); }
.task-fact small, .task-fact strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-fact small { color: var(--text-tertiary); font-size: var(--font-meta); white-space: normal; overflow-wrap: anywhere; }
.task-fact strong { margin-top: 3px; color: var(--text); font-size: var(--font-body); font-weight: 500; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.task-secondary-actions { min-width: 0; display: flex; align-items: center; gap: 5px; }
.task-detail-toggle, .task-more > summary, .task-primary-action, .task-danger-action { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--hero-button-radius); font-size: var(--font-body); font-weight: 600; white-space: nowrap; }
.task-detail-toggle { color: var(--text-secondary); background: transparent; }
.task-detail-toggle:hover:not(:disabled) { color: var(--blue); background: var(--blue-soft); }
.task-detail-toggle { font-weight: 600; }
.task-detail-icon { transition: transform .18s ease; }
.task-detail-toggle[aria-expanded="true"] .task-detail-icon { transform: rotate(180deg); }
.task-more { position: relative; }
.task-more > summary { width: 36px; padding: 0; border: 1px solid transparent; color: var(--text); background: var(--hero-default); cursor: pointer; list-style: none; user-select: none; }
.task-more > summary::-webkit-details-marker { display: none; }
.task-more > summary:hover { border-color: var(--hero-border); color: var(--ink); background: var(--hero-secondary); }
.task-more[open] > summary { color: var(--blue); border-color: #bfdbfe; background: var(--blue-soft); }
.task-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 220px; max-height: var(--task-menu-max-height, none); overflow-y: auto; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.task-more.opens-up > .task-more-menu { top: auto; bottom: calc(100% + 6px); }
.task-menu-action { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); background: transparent; font-size: var(--font-body); font-weight: 500; text-align: left; }
.task-menu-action .button-icon { width: 18px; height: 18px; }
.task-menu-copy { min-width: 0; display: grid; gap: 2px; line-height: 1.5; overflow-wrap: anywhere; }
.task-menu-description { color: var(--muted); font-size: var(--font-meta); font-weight: 400; }
.task-menu-separator { height: 1px; margin: 4px 8px; background: var(--line); }
.task-menu-action:hover:not(:disabled) { color: var(--ink); background: var(--hero-secondary); }
.task-menu-action:active:not(:disabled) { background: var(--hero-hover); }
.task-menu-action.danger { color: var(--red); background: transparent; }
.task-menu-action.danger:hover:not(:disabled), .task-menu-action.danger:focus-visible { color: var(--red); background: var(--red-soft); }
.task-primary-action { margin-left: auto; color: #fff; background: var(--blue); }
.task-primary-action:hover:not(:disabled) { background: color-mix(in oklab, var(--blue) 94%, var(--ink)); }
.task-danger-action { margin-left: auto; border: 1px solid transparent; color: var(--red); background: var(--red-soft); }
.task-danger-action:hover:not(:disabled) { background: var(--red-soft); }
.task-details { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-detail-section + .task-detail-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.task-detail-section h3 { color: var(--text); font-size: var(--font-body); font-weight: 600; }
.section-heading-with-icon { display: flex; align-items: center; gap: 7px; }
.section-heading-icon { width: 17px; height: 17px; flex: 0 0 auto; color: var(--muted); }
.task-detail-section .task-facts { gap: 0 18px; margin-top: 10px; padding: 0 12px; overflow: hidden; border: 0; border-radius: 12px; background: var(--hero-secondary); }
.task-detail-section .task-fact { padding: 10px 0; border-radius: 0; background: transparent; }
.task-detail-section .task-fact:nth-child(n+3) { border-top: 1px solid var(--line); }
.task-detail-section .task-fact:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.task-detail-section .task-fact strong { overflow: visible; text-overflow: clip; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-detail-list { display: grid; gap: 5px; margin-top: 3px; }
.task-detail-list span { min-width: 0; padding: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.scenario-member-list { display: grid; gap: 8px; margin-top: 10px; }
.scenario-member { min-width: 0; padding: 10px 11px; border: 0; border-radius: 12px; background: var(--hero-secondary); }
.scenario-member-heading { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 8px; }
.scenario-member-heading strong { min-width: 0; color: var(--text); font-size: var(--font-body); line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.scenario-member-order { color: var(--muted); font-size: var(--font-meta); font-weight: 600; }
.scenario-member p { margin: 6px 0 0; color: var(--muted); font-size: var(--font-meta); overflow-wrap: anywhere; }
.task-detail-section .run-item { box-shadow: none; }
.loading, .empty-state { padding: 30px 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.55); font-size: var(--font-body); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--text); font-size: var(--font-body); }
.empty-state span { margin-top: 6px; line-height: 1.6; }
.task-empty-state { padding-block: 34px; }
.task-empty-state .empty-state-icon { width: 48px; height: 48px; display: block; margin: 0 auto 13px; color: var(--muted); stroke-width: 1.55; }

.create-layout { display: grid; grid-template-columns: minmax(250px,.65fr) minmax(0,1.35fr); gap: 16px; align-items: start; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-title-with-icon { min-width: 0; display: flex; align-items: center; gap: 10px; }
.panel-title-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid transparent; border-radius: 12px; color: var(--muted); background: var(--hero-default); }
.panel-title-icon svg { width: 18px; height: 18px; }
.create-submission-results { margin-bottom: 16px; border-color: var(--line); background: var(--card); }
.create-submission-result-list { display: grid; gap: 9px; }
.create-submission-result { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.create-submission-result strong { overflow-wrap: anywhere; }
.create-submission-result p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: var(--font-meta); line-height: 1.5; overflow-wrap: anywhere; }
.create-submission-result .status-pill { align-self: start; }
.create-submission-result[data-result="created"] { border-color: rgba(22,163,74,.28); }
.create-submission-result[data-result="rejected"] { border-color: rgba(220,38,38,.24); }
.create-submission-result[data-result="unconfirmed"] { border-color: rgba(217,119,6,.28); }
.create-submission-result[data-result="created"] .status-pill { color: var(--green); border-color: #bbf7d0; background: var(--green-soft); }
.create-submission-result[data-result="rejected"] .status-pill { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.create-submission-result[data-result="unconfirmed"] .status-pill { color: var(--amber); border-color: #fde68a; background: var(--amber-soft); }
.computer-selection { display: grid; gap: 9px; }
.computer-choice { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: var(--hero-field-radius); background: var(--card); cursor: pointer; }
.computer-choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.computer-choice input { width: 20px; min-height: 20px; margin-top: 2px; }
.computer-choice-content { display: grid; gap: 4px; min-width: 0; }
.computer-choice-content strong { color: var(--text); overflow-wrap: anywhere; }
.computer-choice-content span { color: var(--muted); font-size: var(--font-meta); overflow-wrap: anywhere; }
.computer-management-panel { margin-bottom: 24px; }
.managed-computers { display: grid; gap: 10px; }
.managed-computer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 14px; border: 0; border-radius: var(--hero-field-radius); background: var(--hero-secondary); }
.managed-computer-facts { display: grid; gap: 4px; min-width: 0; }
.managed-computer-facts strong { overflow-wrap: anywhere; }
.managed-computer-facts span { color: var(--muted); font-size: var(--font-meta); }
.managed-computer-actions { min-width: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: end; }
.managed-computer-rename { min-width: 0; display: flex; gap: 8px; align-items: center; }
.managed-computer-rename > button { flex: 0 0 auto; }
.managed-computer-rename input { width: min(230px,38vw); }
.task-plan-fields { display: grid; gap: 8px; }
.task-plan-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: end; gap: 8px; }
.task-plan-row.once { grid-template-columns: repeat(2,minmax(0,1fr)); }
.task-plan-row.daily { grid-template-columns: minmax(0,1fr) auto; }
.task-plan-row button, .task-plan-add { min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--hero-button-radius); color: var(--text); background: var(--hero-default); font-size: var(--font-body); font-weight: 600; }
.task-plan-add:hover:not(:disabled) { color: var(--ink); border-color: var(--hero-border); background: var(--hero-hover); }
.task-plan-add { justify-self: start; }
.task-plan-row .compact-remove-button,
.create-list-row .compact-remove-button { width: 44px; min-width: 44px; min-height: 44px; padding: 0; display: inline-grid; place-items: center; justify-self: end; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.compact-remove-button:hover:not(:disabled) { border-color: #fecaca; color: var(--red); background: var(--red-soft); }
.task-plan-zone { margin: -2px 0 1px; color: var(--muted); font-size: var(--font-meta); }
#create-task { gap: 16px; }
#task-plan-fields:empty, #create-error:empty { display: none; }
.create-config-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.create-config-field { min-width: 0; min-height: 44px; flex: 1 1 120px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--hero-border); border-radius: var(--hero-field-radius); color: var(--text); background: var(--card); }
.create-config-field:nth-child(2) { flex: 1.6 1 220px; }
.create-config-field:nth-child(3) { flex: 1.1 1 140px; }
.create-config-field:hover { background: var(--hero-secondary); }
.create-config-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--hero-focus); }
.create-config-label { flex: 0 0 auto; color: var(--muted); font-size: var(--font-meta); font-weight: 500; white-space: nowrap; }
.create-config-field select { min-width: 0; min-height: 42px; flex: 1 1 auto; padding: 0 16px 0 0; border: 0; border-radius: 0; color: var(--text); background-color: transparent; font-weight: 400; }
.fixed-scenario-goal { margin: -5px 0 0; padding: 10px 12px; border-radius: 12px; color: var(--text-secondary); background: var(--hero-secondary); font-size: var(--font-meta); line-height: 1.6; }
#create-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,max(190px,calc((100% - 12px)/2))),1fr)); align-items: start; gap: 12px; }
.create-field, .create-list, .create-field-control, .create-list-control { min-width: 0; }
.create-field, .create-list, .create-field-control, .create-list-control { display: grid; gap: 8px; }
.create-field-heading { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.create-field-label { min-width: 0; color: var(--text); font-size: var(--font-body); font-weight: 500; overflow-wrap: anywhere; }
.create-field-optional { flex: 0 0 auto; color: var(--muted); font-size: var(--font-meta); font-weight: 400; }
.create-field-string, .create-object { grid-column: 1 / -1; }
.create-field-compact { min-height: 44px; grid-template-columns: auto minmax(88px,1fr); align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--hero-border); border-radius: var(--hero-field-radius); background: var(--card); }
.create-field-compact:hover { background: var(--hero-secondary); }
.create-field-compact:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--hero-focus); }
.create-field-compact .create-field-heading { flex-wrap: wrap; gap: 2px 7px; }
.create-field-compact .create-field-control { display: block; }
.create-field-compact input, .create-field-compact select { min-height: 42px; padding-block: 0; border: 0; border-radius: 0; background-color: transparent; }
.create-field-compact input { padding-inline: 0; }
.create-field-compact select { padding-inline: 0 12px; }
.create-object { min-width: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.create-object-heading { max-width: 100%; display: inline-flex; align-items: baseline; gap: 8px; padding-right: 10px; }
.create-object-fields { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,max(190px,calc((100% - 12px)/2))),1fr)); align-items: start; gap: 12px; }
.create-field-presence { display: flex; align-items: center; gap: 7px; width: fit-content; color: var(--muted); font-size: var(--font-meta); font-weight: 400; }
.create-field-presence input { flex: 0 0 auto; }
.is-field-disabled > [data-field-control] { opacity: .52; }
.create-list-heading { min-height: 32px; align-items: center; flex-wrap: wrap; }
.create-list-heading .create-list-add { margin-left: auto; }
.create-list-hint { color: var(--muted); font-size: var(--font-meta); font-weight: 400; }
.create-list-rows { display: grid; gap: 8px; }
.create-list-row { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: start; gap: 8px; }
.create-list-row > .create-object { grid-row: 1; }
.create-list-row > .create-object > .create-object-heading { max-width: calc(100% - 52px); min-height: 44px; align-items: center; }
.create-list-row > .compact-remove-button { grid-column: 2; grid-row: 1; }
.create-list-add { min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; color: var(--text-secondary); background: transparent; font-size: var(--font-meta); font-weight: 600; }
.create-list-add:hover:not(:disabled) { color: var(--ink); background: var(--hero-hover); }
.create-list-choice-group { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.create-list-choice { min-width: 64px; max-width: 100%; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: var(--hero-button-radius); color: var(--text); background: var(--hero-default); font-size: var(--font-body); font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.create-list-choice[aria-pressed="false"]:hover:not(:disabled) { border-color: var(--hero-border); color: var(--ink); background: var(--hero-secondary); }
.create-list-choice[aria-pressed="true"] { border-color: #bfdbfe; color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(37,99,235,.06); }
form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--text); font-size: var(--font-body); font-weight: 500; }
input, textarea, select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--hero-border); border-radius: var(--hero-field-radius); color: var(--ink); background: var(--card); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: 3px solid var(--hero-focus); }
input[type="checkbox"] { width: 20px; min-height: 20px; box-shadow: none; }
.create-config-field select, .create-field-compact input, .create-field-compact select, .filter-select select { box-shadow: none; }
.create-config-field select:focus, .create-config-field select:focus-visible,
.create-field-compact input:focus, .create-field-compact input:focus-visible,
.create-field-compact select:focus, .create-field-compact select:focus-visible { border-color: transparent; outline: 0; }
#create-task textarea { min-height: 72px; }
#create-task .create-list-row textarea { height: 44px; min-height: 44px; }
#create-task .create-list-lines-textarea { height: auto; min-height: 44px; resize: none; overflow-y: auto; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.form-actions button, form > button, .admin-form > button { min-height: 40px; padding: 0 14px; border-radius: var(--hero-button-radius); color: #fff; background: var(--blue); font-size: var(--font-body); font-weight: 600; }
.form-actions .ghost-button { color: var(--text); background: var(--hero-default); }
.create-form-actions { justify-content: space-between; }
.create-form-actions .create-clear-action { margin-right: auto; padding-inline: 4px; color: var(--text-secondary); background: transparent; }
.create-form-actions .create-clear-action:hover:not(:disabled) { color: var(--ink); background: transparent; }
.create-submit-actions .ghost-button:hover:not(:disabled) { color: var(--ink); border-color: var(--hero-border); background: var(--hero-hover); }
.create-form-actions button { min-height: 44px; }
.create-submit-actions { display: flex; align-items: center; gap: 8px; }
.form-message { min-height: 18px; color: var(--red); font-size: var(--font-meta); line-height: 1.5; overflow-wrap: anywhere; }
.facts { display: grid; gap: 9px; margin-top: 16px; }
.computer-entitlement { width: fit-content; margin-top: 12px; }
.facts div { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 12px; background: var(--hero-secondary); }
.facts dt { flex: 0 0 auto; color: var(--muted); font-size: var(--font-meta); }
.facts dd { min-width: 0; margin: 0; color: var(--text); font-size: var(--font-body); font-weight: 500; overflow-wrap: anywhere; }

.runs-head { align-items: end; }
.runs-controls { width: min(560px,62%); display: flex; align-items: end; gap: 8px; }
.task-select-label { min-width: 0; flex: 1 1 auto; }
.runs-controls .ghost-button { min-height: 43px; flex: 0 0 auto; }
.runs { display: grid; gap: 9px; }
.run-item { padding: 14px; border: 0; border-radius: 16px; background: var(--hero-secondary); box-shadow: none; }
.run-grid { display: grid; grid-template-columns: repeat(4,minmax(90px,1fr)); gap: 12px; }
.run-grid > .run-cell { min-width: 0; display: grid; align-content: start; gap: 4px; }
.run-grid small { color: var(--text-tertiary); font-size: var(--font-meta); }
.run-field-label { display: inline-flex; align-items: center; gap: 5px; }
.run-field-icon { width: 14px; height: 14px; flex: 0 0 auto; color: var(--muted); }
.run-grid strong { color: var(--text); font-size: var(--font-body); font-weight: 500; overflow-wrap: anywhere; white-space: normal; }
.run-grid > .run-cell:last-child { grid-column: 1 / -1; }
.run-status-value { display: inline-flex; align-items: center; gap: 6px; }
.run-status-value[data-state="pending"], .run-status-value[data-state="disabled"] { color: var(--muted); }
.run-status-value[data-state="running"] { color: var(--blue); }
.run-status-value[data-state="completed"] { color: var(--green); }
.run-status-value[data-state="failed"], .run-status-value[data-state="interrupted"] { color: var(--red); }

.admin-panel { min-height: 360px; }
.inline-form { grid-template-columns: minmax(260px,1fr) auto; align-items: end; }
.admin-results { display: grid; gap: 8px; margin: 18px 0; }
.admin-result { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--hero-secondary); font-size: var(--font-body); }
.admin-result > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.admin-result button { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--hero-button-radius); color: var(--text); background: var(--hero-default); font-size: var(--font-body); font-weight: 600; white-space: nowrap; }
.admin-result button:hover:not(:disabled) { color: var(--blue); border-color: #bfdbfe; background: var(--blue-soft); }
.admin-customer { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-status-actions { justify-content: flex-start; margin: 14px 0; }
.admin-status-actions .admin-danger-action { border: 1px solid #fecaca; color: var(--red); background: #fff; }
.admin-status-actions .admin-danger-action:hover:not(:disabled) { background: var(--red-soft); }
.admin-form { grid-template-columns: repeat(3,minmax(130px,1fr)) auto; align-items: end; margin-top: 14px; }
.subsection-head { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.muted { margin-top: 8px; color: var(--muted); font-size: var(--font-meta); line-height: 1.6; }

.auth-screen { min-height: calc(100vh - 36px); display: grid; place-items: center; }
html.desktop-shell .auth-screen { min-height: calc(100vh - env(titlebar-area-height, 38px) - 16px); }
html.desktop-shell .main-inner { padding: 22px clamp(18px, 2.5vw, 30px) 30px; }
.auth-card { width: min(510px,100%); padding: 34px; border: 1px solid var(--line); border-radius: var(--hero-card-radius); background: var(--card); box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 30px; }
.auth-copy h1 { margin-top: 8px; font-size: var(--font-page); font-weight: 600; line-height: 1.3; }
.auth-copy p { margin: 8px 0 24px; color: var(--muted); font-size: var(--font-body); line-height: 1.65; }
.auth-purpose-field { display: grid; gap: 7px; color: var(--text); font-size: var(--font-body); font-weight: 500; }
.auth-purpose-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--hero-default); }
.auth-purpose-button { min-height: 38px; border-radius: 12px; color: var(--muted); background: transparent; font-weight: 600; }
.auth-purpose-button.active { color: var(--blue); background: var(--card); box-shadow: var(--card-shadow); }
.auth-form .form-actions { margin-top: 2px; }
.auth-card > .text-button { width: fit-content; display: flex; margin: 18px auto 0; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; width: max-content; max-width: min(560px,calc(100% - 28px)); display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 16px; color: var(--ink); background: var(--card); box-shadow: var(--shadow); font-size: var(--font-body); line-height: 1.5; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(12px); transition: .2s ease; }
.notice-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { color: var(--green); background: var(--green-soft); }
.toast.error { color: var(--red); background: var(--red-soft); }
.toast.info { color: var(--text); background: var(--card); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 176px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar .brand { padding-inline: 4px; }
  .create-layout { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: repeat(2,minmax(140px,1fr)); }
}

@media (max-width: 720px) {
  :root { --font-page: 24px; --hero-card-radius: 16px; }
  body { padding: 0; background: var(--canvas); }
  input, textarea, select, .filter-select select { font-size: 16px; }
  .app-shell { height: auto; min-height: 100vh; min-height: 100dvh; display: block; border: 0; border-radius: 0; box-shadow: none; }
  .sidebar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 100; height: calc(68px + env(safe-area-inset-bottom)); display: block; padding: 0 5px env(safe-area-inset-bottom); border-top: 1px solid var(--line); border-right: 0; background: var(--card); box-shadow: 0 -2px 8px rgba(0,0,0,.04); }
  .brand, .sidebar-foot { display: none; }
  .nav-list { height: 68px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; }
  .admin-mobile { display: flex; }
  .nav-button { min-height: 68px; flex-direction: column; justify-content: center; gap: 4px; padding: 0; border-radius: 0; font-size: var(--font-meta); text-align: center; }
  .nav-button:hover, .nav-button.active { background: transparent; box-shadow: none; }
  .nav-button svg { width: 22px; height: 22px; }
  .main { min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .main-inner { padding: calc(18px + env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { align-items: stretch; flex-direction: column; gap: 10px; margin-bottom: 16px; }
  #home-view > .topbar { align-items: center; flex-direction: row; justify-content: space-between; gap: 12px; }
  #home-view > .topbar .page-heading { min-width: 0; flex: 1 1 auto; }
  #home-view > .topbar .top-actions { flex: 0 0 auto; flex-wrap: nowrap; }
  html.desktop-shell #home-view > .topbar { align-items: stretch; flex-direction: column; }
  html.desktop-shell #home-view > .topbar .top-actions { flex: 0 1 auto; flex-wrap: wrap; }
  .top-actions { justify-content: flex-start; gap: 6px; }
  .page-heading h1 { font-size: var(--font-page); }
  .page-heading p { display: none; }
  .status-pill { min-height: 28px; padding: 0 9px; font-size: var(--font-meta); }
  .icon-button, .ghost-button, .text-button { min-height: 44px; }
  .icon-only-button { width: 44px; min-width: 44px; padding: 0; }
  html.desktop-shell .page-heading .computer-preparation { display: block; max-width: 100%; }
  .section-head { align-items: flex-start; }
  .filter-bar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .managed-computer { grid-template-columns: 1fr; align-items: stretch; }
  .managed-computer-actions, .managed-computer-rename { width: 100%; }
  .managed-computer-rename input { width: auto; min-width: 0; flex: 1 1 auto; }
  .managed-computer-actions > button { flex: 1 1 100%; min-height: 44px; }
  .task-create-action, .filter-select, .auth-purpose-button { min-height: 44px; }
  .filter-select, .filter-select-status { width: auto; }
  .filter-select select { min-height: 42px; }
  .task-card { padding: 13px 12px 10px; }
  .task-detail-toggle, .task-more > summary, .task-primary-action, .task-danger-action { min-height: 44px; }
  .task-footer { align-items: stretch; flex-direction: column; }
  .task-secondary-actions { width: 100%; order: 2; }
  .task-detail-toggle { flex: 1 1 auto; }
  .task-more { flex: 0 0 44px; }
  .task-more > summary { width: 44px; }
  .task-more-menu { width: 220px; }
  .task-primary-action, .task-danger-action { width: 100%; margin-left: 0; order: 1; }
  .panel { padding: 16px; }
  .create-config-grid { display: grid; grid-template-columns: 1fr; }
  #create-fields, .create-object-fields { grid-template-columns: 1fr; }
  .create-submission-results .panel-head { align-items: stretch; flex-direction: column; }
  .runs-head { align-items: stretch; flex-direction: column; }
  .runs-controls { width: 100%; }
  .run-grid { grid-template-columns: repeat(2,minmax(90px,1fr)); }
  .inline-form, .admin-form { grid-template-columns: 1fr; }
  .form-actions button, form > button, .admin-form > button, .admin-result button { min-height: 44px; }
  .task-plan-add, .create-list-add,
  .task-plan-row .compact-remove-button,
  .create-list-row .compact-remove-button { min-height: 44px; }
  .auth-screen { min-height: 100vh; min-height: 100dvh; padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 26px 20px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  html.desktop-shell body { padding: env(titlebar-area-height, 38px) 0 0; }
  html.desktop-shell .app-shell {
    height: calc(100vh - env(titlebar-area-height, 38px));
    height: calc(100dvh - env(titlebar-area-height, 38px));
    min-height: calc(100vh - env(titlebar-area-height, 38px));
    min-height: calc(100dvh - env(titlebar-area-height, 38px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  html.desktop-shell .main {
    height: calc(100vh - env(titlebar-area-height, 38px));
    height: calc(100dvh - env(titlebar-area-height, 38px));
    min-height: calc(100vh - env(titlebar-area-height, 38px));
    min-height: calc(100dvh - env(titlebar-area-height, 38px));
    overflow: auto;
  }
  html.desktop-shell .main-inner { padding: 18px 14px 92px; }
}

@media (max-width: 430px) {
  .top-actions { gap: 5px; }
  .top-actions .icon-button { padding-inline: 10px; }
  .section-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .section-actions { width: 100%; justify-content: space-between; }
  .filter-bar { grid-template-columns: 1fr; }
  .task-grid { gap: 10px; }
  .task-card { padding: 12px 12px 9px; border-radius: 14px; }
  .task-title-row { gap: 5px; }
  .state-chip { height: 24px; padding: 0 6px; font-size: var(--font-meta); }
  .task-summary { margin-top: 4px; }
  .task-facts, .run-grid { grid-template-columns: 1fr; }
  .task-summary, .run-grid strong { overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
  .task-footer { gap: 8px; margin-top: 9px; padding-top: 8px; }
  .task-details { margin-top: 9px; padding-top: 9px; }
  .task-detail-section + .task-detail-section { margin-top: 12px; padding-top: 11px; }
  .task-detail-section .task-facts { gap: 0; margin-top: 8px; padding: 0 10px; border: 0; border-radius: 11px; background: var(--hero-secondary); }
  .task-detail-section .task-fact { padding: 9px 0; border-radius: 0; background: transparent; }
  .task-detail-section .task-fact:nth-child(even) { padding-left: 0; border-left: 0; }
  .task-detail-section .task-fact + .task-fact { border-top: 1px solid var(--line); }
  .task-detail-section .task-fact strong { margin-top: 2px; }
  .task-detail-section .task-detail-list { gap: 3px; }
  .task-detail-section .task-detail-list span { padding: 2px 0; border-radius: 0; background: transparent; }
  .task-detail-section > .runs { margin-top: 8px; gap: 7px; }
  .task-detail-section .run-item { padding: 10px; }
  .task-plan-row.once { grid-template-columns: 1fr; }
  .task-plan-row.daily, .task-plan-row.weekly, .create-list-row { grid-template-columns: minmax(0,1fr) 44px; }
  .task-plan-row.weekly > label:first-child { grid-column: 1 / -1; }
  .task-plan-row .compact-remove-button, .create-list-row .compact-remove-button { width: 44px; min-width: 44px; min-height: 44px; }
  .create-panel > .panel-head { align-items: stretch; flex-direction: column; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions button { width: 100%; }
  .create-submit-actions { width: 100%; order: 1; flex-direction: column-reverse; }
  .create-form-actions .create-clear-action { margin-right: 0; order: 2; }
  .admin-result { align-items: stretch; flex-direction: column; }
  .admin-result button { width: 100%; }
}

@media (max-width: 360px) {
  #home-view > .topbar { align-items: stretch; flex-direction: column; }
  #home-view > .topbar .top-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Compact task management shares the original shell, palette and field controls. */
.computer-management-panel { padding: 16px 20px; margin-bottom: 18px; }
.computer-overview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-weight: 600; }
.read-time { font-size: var(--font-meta); color: var(--muted); font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
#computer-management { margin-top: 10px; }
#computer-management > summary { min-height: 36px; padding-block: 8px; cursor: pointer; color: var(--blue); font-size: var(--font-body); }
#computer-management[open] > summary { margin-bottom: 12px; }
.filter-bar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.75fr) minmax(0,2fr); align-items: end; gap: 12px; padding: 0; }
.filter-bar > label { display: grid; gap: 5px; font-size: var(--font-meta); min-width: 0; }
.task-status-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 0; padding: 4px; border-radius: 16px; background: var(--hero-default); }
.task-status-tab { flex: 0 0 auto; padding: 10px 14px; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 12px; font-size: var(--font-body); font-weight: 600; }
.task-status-tab.active { color: var(--blue); background: var(--card); box-shadow: var(--card-shadow); }
@media (hover: hover) and (pointer: fine) {
  .task-status-tab:not(.active):hover:not(:disabled) { color: var(--ink); background: var(--hero-hover); }
  .task-card.task-row:not(.selected):not(.highlight):hover { background: var(--hero-secondary); }
}
.task-select-line { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 0; font-size: var(--font-meta); color: var(--muted); }
.task-select-line label { display: flex; gap: 8px; align-items: center; }
input[type="checkbox"] { accent-color: var(--blue); }
.task-bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px; margin-top: 12px; border: 1px solid color-mix(in oklab, var(--blue) 18%, white); border-radius: var(--hero-card-radius); background: var(--blue-soft); }
.task-bulk-bar strong { margin-right: auto; }
.task-bulk-bar p { margin: 0; width: 100%; color: var(--muted); font-size: var(--font-meta); }
.task-control-results { padding: 14px; margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--hero-card-radius); font-size: var(--font-body); box-shadow: var(--card-shadow); }
.task-control-results details { margin-top: 8px; }
.task-control-results ul { padding-left: 20px; max-height: 400px; overflow: auto; }
.task-control-results li { padding: 4px 0; overflow-wrap: anywhere; }
.task-control-results { margin-bottom: 16px; }
.task-control-results li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.task-control-results li p { margin: 5px 0; line-height: 1.6; }
.task-control-results li > button { width: auto; margin-right: 12px; }
.operation-reference, .operation-run-fact { color: var(--text-secondary); overflow-wrap: anywhere; }
.history-summary { overflow-wrap: anywhere; font-size: var(--font-meta); }
.task-card.task-row.configuration-row { grid-template-columns: 20px minmax(160px,1fr) minmax(110px,.5fr) minmax(100px,.4fr) minmax(140px,.65fr); align-items: start; }
.configuration-parameter-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: var(--font-meta); margin-top: 5px; }
.configuration-counts { font-size: var(--font-meta); line-height: 1.8; color: var(--text-secondary); overflow-wrap: anywhere; }
.configuration-counts > span { white-space: nowrap; }
.configuration-row .configuration-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.configuration-row .configuration-actions > button { width: auto; min-width: 0; flex: 0 0 auto; }
.configuration-members { display: grid; gap: 8px; }
.configuration-members[hidden] { display: none; }
.task-order-section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.task-order-section > summary { color: var(--text-secondary); font-size: var(--font-meta); cursor: pointer; }
.task-order-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding-top: 10px; }
.task-order-row > span { font-size: var(--font-meta); overflow-wrap: anywhere; }
.task-order-row button { width: auto; min-height: 40px; padding: 5px 10px; }
@media (max-width: 720px) {
  .task-card.task-row.configuration-row { grid-template-columns: 44px minmax(0,1fr); gap: 8px; }
  .configuration-row > .task-selection { grid-column: 1; grid-row: 1; }
  .configuration-row > .task-main { grid-column: 2; grid-row: 1; }
  .configuration-row > .configuration-counts, .configuration-row > .task-row-plan, .configuration-row > .configuration-actions { grid-column: 2; grid-row: auto; }
  .configuration-row > .configuration-actions { justify-content: start; }
  .configuration-row > .task-details { grid-column: 1 / -1; }
  .configuration-row .configuration-actions > button { min-height: 44px; }
  .task-order-section { padding-inline: 12px; }
}
.task-grid { gap: 0; border: 1px solid var(--line); border-radius: var(--hero-card-radius); background: var(--card); box-shadow: var(--card-shadow); }
.task-card.task-row { display: grid; grid-template-columns: 20px minmax(0,1fr) 90px minmax(100px,.55fr) 142px; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--card); transform: none; transition: background-color .15s ease; }
.task-row:first-child { border-radius: var(--hero-card-radius) var(--hero-card-radius) 0 0; }.task-row:last-child { border-bottom: 0; border-radius: 0 0 var(--hero-card-radius) var(--hero-card-radius); }.task-row:only-child { border-radius: var(--hero-card-radius); }
.task-row.selected { background: var(--blue-soft); }.task-card.task-row.highlight { background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.task-selection { width: 20px; min-height: 20px; display: grid; place-items: center; gap: 0; cursor: pointer; }
.task-row .task-name { display: block; text-align: left; max-width: 100%; padding: 0; background: transparent; min-height: 28px; color: var(--ink); white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.task-row .task-name:hover { color: var(--blue); }
.task-row .task-summary { margin: 3px 0 0; font-size: var(--font-meta); white-space: normal; overflow-wrap: anywhere; }
.task-row-plan { font-size: var(--font-meta); color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.task-row-actions { display: grid; grid-template-columns: auto 36px; gap: 6px; justify-content: end; align-items: center; }
.task-row-actions > .task-more { grid-column: 2; }
.task-row-actions > button { width: auto; min-width: 0; flex: 0 0 auto; padding: 7px 10px; font-size: var(--font-body); white-space: nowrap; }
.task-row .task-primary-action { border: 1px solid color-mix(in oklab, var(--blue) 18%, white); color: var(--blue-soft-ink); background: var(--blue-soft); }
.task-row .task-primary-action:hover:not(:disabled) { background: var(--blue-soft-hover); }
.task-row .task-primary-action:active:not(:disabled) { background: color-mix(in oklab, var(--blue) 18%, white); }
.task-row > .state-chip { justify-self: start; }
.task-row > .task-details { grid-column: 1 / -1; }
.create-layout { display: grid; grid-template-columns: minmax(0,1fr); max-width: 920px; gap: 16px; }
.create-layout .panel { padding: 20px; }
.create-layout .panel-head { align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.create-layout .panel-head h2 { margin-top: 0; font-size: var(--font-section); }
.create-layout .panel-head p { margin-top: 0; }
#task-plan-fields:not(:empty) { margin-top: 12px; }
.create-summary { padding: 16px 20px; background: var(--blue-soft); border-radius: var(--hero-card-radius); font-size: var(--font-body); line-height: 1.8; }
.create-optional { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.create-optional > summary { min-height: 36px; display: flex; align-items: center; gap: 8px; padding-block: 8px; cursor: pointer; color: var(--text-secondary); font-size: var(--font-body); line-height: 1.5; list-style: none; }
.create-optional > summary::-webkit-details-marker { display: none; }
.create-optional > summary::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; margin: 0 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.create-optional[open] > summary::before { transform: rotate(45deg); }
.create-optional-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,max(190px,calc((100% - 12px)/2))),1fr)); gap: 12px; margin-top: 12px; }
.create-optional-fields > .create-field-string,.create-optional-fields > .create-object { grid-column: 1 / -1; }
.computer-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.computer-choice > label { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; }
.computer-choice input[type="checkbox"] { flex: 0 0 20px; }
.computer-choice > .text-button { color: var(--blue); font-size: var(--font-body); white-space: nowrap; }
.task-dialog-body { min-height: 0; overflow: auto; padding: 24px; }.task-dialog-body h2 { font-size: 20px; font-weight: 600; line-height: 1.4; }.task-dialog-body p { color: var(--muted); font-size: var(--font-body); line-height: 1.8; }
#task-action-dialog { width: min(580px,calc(100vw - 30px)); max-height: calc(100dvh - 40px); margin: auto; border: 0; border-radius: var(--hero-card-radius); padding: 0; color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
#task-action-dialog[open] { display: flex; flex-direction: column; }
#task-action-dialog::backdrop { background: rgba(24,24,27,.4); }
#task-action-items { margin: 16px 0 0; padding: 0; list-style: none; max-height: 240px; overflow: auto; }
#task-action-items li { border-top: 1px solid var(--line); padding: 10px 0; font-size: var(--font-body); overflow-wrap: anywhere; }
.task-dialog-actions { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.task-dialog-actions > button { min-height: 44px; padding: 0 16px; border-radius: var(--hero-button-radius); font-size: var(--font-body); font-weight: 600; }
.task-dialog-actions > .task-danger-action { margin-left: 0; }
#task-action-confirm:not(.task-danger-action) { color: #fff; background: var(--blue); }

@media (max-width: 1100px) {
  .filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar .task-search-label { grid-column: 1 / -1; }
  .managed-computer { grid-template-columns: minmax(0,1fr); align-items: start; }
  .managed-computer-actions { justify-content: flex-start; }
  .managed-computer-rename { flex: 1 1 320px; }
  .managed-computer-rename input { width: auto; min-width: 0; flex: 1 1 auto; }
  .task-card.task-row { grid-template-columns: 20px minmax(0,1fr) 80px 142px; }
  .task-row-plan { grid-column: 2 / 4; }
  .task-row-actions { grid-column: 4; grid-row: 1 / 3; }
  .runs-head { flex-wrap: wrap; }
  .runs-controls { width: 100%; }
  .run-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  #create-view > .topbar { align-items: center; flex-direction: row; }
  #create-view > .topbar > button { flex: 0 0 auto; }
  .computer-management-panel { position: relative; padding: 12px 14px; }
  .computer-overview { min-height: 44px; padding-right: 96px; align-content: center; overflow-wrap: anywhere; }
  #computer-overview { min-width: 0; }
  #computer-management { margin-top: 0; }
  #computer-management > summary, .create-optional > summary { min-height: 44px; padding-block: 12px; font-size: var(--font-body); }
  #computer-management > summary { position: absolute; top: 12px; right: 14px; padding-block: 10px; }
  #computer-management[open] > .managed-computers { margin-top: 12px; }
  .managed-computer-actions { justify-content: flex-end; }
  .managed-computer-actions > button { flex: 0 0 auto; width: auto; min-height: 44px; margin-left: 0; }
  #home-view > .section-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; }
  #home-view > .section-head > div:first-child, #home-view > .section-head > .section-actions { display: contents; }
  #home-view > .section-head h2 { grid-column: 1; grid-row: 1; margin: 0; }
  #home-view > .section-head > div:first-child > p { display: none; }
  #task-count { grid-column: 2; grid-row: 1; justify-self: start; max-width: 100%; white-space: normal; }
  #create-task-shortcut { grid-column: 3; grid-row: 1; }
  .filter-bar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar > label { min-width: 0; }
  .filter-bar .task-search-label { grid-column: 1 / -1; min-width: 0; }
  .task-status-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-bottom: 0; }
  .task-status-tab { min-height: 44px; padding: 8px 6px; border: 1px solid transparent; border-radius: 12px; font-size: var(--font-body); }
  .task-status-tab.active { border-color: transparent; background: var(--card); }
  .task-select-line { padding-block: 6px; }
  .task-select-line label { min-height: 44px; }
  .task-select-line .read-time { width: 100%; }
  .task-bulk-bar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; }
  .task-bulk-bar strong, .task-bulk-bar p { grid-column: 1 / -1; }
  .task-bulk-bar button { width: auto; justify-self: start; min-height: 44px; margin: 0; padding: 8px 12px; font-size: var(--font-body); order: 0; }
  .task-card.task-row { grid-template-columns: 44px auto minmax(0,1fr); gap: 8px 10px; padding: 12px; }
  .task-row > .task-selection { width: 44px; min-height: 44px; align-self: start; }
  .task-row > .task-main { min-width: 0; grid-column: 2 / -1; grid-row: 1; }
  .task-row .task-name { min-height: 36px; }
  .task-row > .state-chip { grid-column: 2; grid-row: 2; align-self: start; }
  .task-row-plan { grid-column: 3; grid-row: 2; }
  .task-row-actions { display: flex; grid-column: 2 / -1; grid-row: auto; justify-content: flex-end; }
  .task-row-actions > button { flex: 0 0 auto; width: auto; min-width: 0; min-height: 44px; margin-left: 0; padding-inline: 12px; font-size: var(--font-body); order: 0; }
  .task-row-actions > .task-more { flex: 0 0 44px; margin-left: 0; order: 1; }
  .task-menu-action { min-height: 44px; }
  .create-layout .panel { padding: 16px; }
  .create-layout .panel-head { align-items: flex-start; gap: 6px; }
  .create-layout .create-panel > .panel-head { flex-direction: column; }
  .create-optional-fields { grid-template-columns: 1fr; }
  .computer-choice { flex-wrap: wrap; }
  .computer-choice > label { flex: 1 1 200px; }
  .create-form-actions { align-items: stretch; flex-direction: column; }
  .create-submit-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); width: 100%; order: 1; }
  .create-submit-actions > button { width: 100%; }
  .create-form-actions .create-clear-action { align-self: flex-start; width: auto; margin-right: 0; padding-inline: 12px; order: 2; }
  .task-dialog-body { padding: 20px; }
  .task-dialog-actions { padding: 14px 20px; }
  .task-dialog-actions > button { flex: 1 1 0; width: auto; }
}

@media (max-width: 430px) {
  .run-grid { grid-template-columns: minmax(0,1fr); }
  .runs-controls { flex-wrap: wrap; }
  .runs-controls .task-select-label { flex-basis: 100%; }
  .runs-controls .ghost-button { min-height: 44px; margin-left: auto; }
}
