:root {
  font-family:var(--font-sans);
  font-synthesis:none;

  font-size:14px;
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 0;
}
button,input,select,textarea {
  font:inherit
}
button,a {
  touch-action:manipulation
}
button {
  cursor:pointer
}
button:disabled {
  cursor:not-allowed
}
a {
  color:inherit;
  text-decoration:none
}
[hidden] {
  display:none!important
}
.sr-only,.skip-link:not(:focus) {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap
}
.skip-link:focus {
  position:fixed;
  z-index:100;
  background:var(--bg-surface);
  padding:15px;
  top:10px;
  left:10px;
  border-radius:var(--radius-md)
}
.topbar {

  align-items:center;

}
.brand {
  display:flex;
  gap:9px;
  align-items:center;

  font-weight:600;
  font-size:28px;
  letter-spacing:-1.3px;
}
.topbar nav {

  color:var(--muted);
}
.header-actions {
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:18px;
}
.connection {

  display:flex;
  align-items:center;
  gap:7px;
  color:var(--text-secondary);
  font-size:11px;
}
.connection:before {
  content:"";
  height:6px;
  width:6px;
  border-radius:50%;
  background:var(--brand-accent)
}
.connection.offline:before {
  background:var(--danger)
}
.icon-button {
  border:1px solid var(--line);
  background:var(--bg-surface);
  border-radius:var(--radius-md);
  min-width:34px;
  min-height:34px;
  font-size:16px;
  color:var(--text-secondary)
}
.icon-button:hover {
  background:var(--bg-page)
}
.shell {

  margin:auto;
  max-width:1440px;
  padding:0 32px;
}
.intro {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:30px;
}
.eyebrow {
  font-size:9px;
  letter-spacing:1.7px;
  font-weight: 500;
  color:var(--text-muted)
}
h1 {

  line-height:1.2;
  font-size:38px;
  margin:12px 0 10px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
h1 span {
  color:var(--text-muted)
}
.workspace-grid {
  display:grid;

  align-items:start;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:24px;
}
.workspace-card {
  border:1px solid var(--line);
}
.files-section {

  border-bottom:1px solid var(--border-default)
}
.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
}
h2 {
  font-size:15px;
  margin:0;
}
.step {
  display:inline-grid;
  place-items:center;

  border:1px solid var(--border-default);

  color:var(--text-secondary);

}
.muted {

  line-height:1.7
}
.dropzone {
  display:flex;
  align-items:center;

  position:relative;
  cursor:pointer;
  gap:16px;
}
.dropzone input {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer
}
.upload-icon {
  display:grid;
  place-items:center;

  background:var(--bg-surface);
  border:1px solid var(--border-default);

  flex-shrink:0
}
.drop-copy {
  display:grid;
  gap:7px;
  flex:1;
  min-width: 0;
}
.drop-copy strong {

  font-weight: 500
}
.choose-button {

  border:1px solid var(--border-default);

  white-space:nowrap
}
.file-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;

  color:var(--text-secondary);
  margin:18px 0 11px;
  font-size:12px;
}
.text-button {
  border:0;
  padding:6px 0;
  background:transparent;

  text-underline-offset:3px
}
.text-button:hover {
  text-decoration:underline
}
.file-list {
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:7px;
  max-height:300px;
  overflow:auto;
  scrollbar-width:thin
}
.file-row {
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  background:var(--bg-surface)
}
.file-preview {
  width:39px;
  height:39px;
  flex-shrink:0;
  display:grid;
  place-items:center;
  border-radius:var(--radius-sm);
  background:var(--bg-page);
  color:var(--text-secondary);
  font-size:9px;
  font-weight: 500;
  overflow:hidden
}
.file-preview img {
  width:100%;
  height:100%;
  object-fit:cover
}
.file-copy {
  flex:1;
  min-width:0
}
.file-name {
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.file-copy small {
  display:block;
  font-size:10px;
  margin-top:5px
}
.file-controls {
  display:flex;
  gap:3px
}
.file-controls button {
  background:transparent;
  border:0;
  color:var(--text-secondary);
  min-width:29px;
  min-height:32px;
  border-radius:var(--radius-sm);
  font-size:16px
}
.file-controls button:hover {
  background:var(--bg-page)
}
.file-controls button:disabled {
  opacity:.25
}
.tab {
  flex:1;
  display:flex;
  justify-content:center;



  font-size:12px;
  padding:11px 9px;
  text-align:left;
  white-space:normal;

}
.tab:disabled {
  opacity:.6
}
.field-label,.parameters label {
  display:block;

  font-weight: 500;
  color:var(--text-secondary);
  margin:0 0 8px
}
input:not([type=file]),select,textarea {
  width:100%;
  border:1px solid var(--border-default);
  background:var(--bg-surface);
  border-radius:var(--radius-md);
  padding:12px;
  color:var(--ink);
  min-height:43px
}
select:disabled {
  background:var(--bg-subtle);
  color:var(--text-muted)
}
textarea {
  line-height:1.7;
  resize:vertical;
  min-height:114px
}
input::placeholder,textarea::placeholder {
  color:var(--text-muted);
  font-weight:400
}
.search-wrap {
  margin-bottom:12px;
  position:relative;
}
.search-wrap input {
  background:var(--bg-subtle)
}
.quick-actions,.suggestions {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-bottom:15px
}
.quick-actions button,.suggestions button {
  line-height:1.4
}
.quick-actions button[aria-pressed=true] {
  background:var(--brand-tint);
  border-color:var(--brand-accent);
  color:var(--brand-tint-fg)
}
.quick-actions button:hover,.suggestions button:hover {
  background:var(--bg-page);
  border-color:var(--brand-accent)
}
.operation-hint {
  margin:10px 0 0
}
.parameters {
  display:grid;
  grid-template-columns:1fr 1fr;

  margin-top:19px
}
.parameters:empty {
  margin:0
}
.parameters small {

  display:block;
  margin-top:7px
}
.parameters label .optional {
  font-weight:400;
  font-size:10px;
  color:var(--text-muted);
  margin-left:6px
}
.password-wrap {
  position:relative
}
.password-wrap input {
  padding-right:80px
}
.password-wrap button {
  position:absolute;
  right:8px;
  top:7px;
  border:0;
  background:var(--bg-page);
  font-size:10px;
  border-radius:var(--radius-sm);
  padding:8px;
  color:var(--text-secondary)
}
.ai-heading {
  display:flex;

  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
  gap:12px;
}
.ai-heading p {
  margin:0;

}
.ai-heading button {
  white-space:nowrap
}
.ai-messages {
  display:grid;

  overflow:auto;

  scrollbar-width:thin;
  max-height:420px;
  gap:13px;
  margin:18px 0;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.ai-messages:empty {
  margin:0
}
.ai-message {

  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.ai-message.error {

  color:var(--danger)
}
.ai-message strong {
  display:block;

}
.ai-message a {
  display:block;
  margin-top:8px;
  font-size:11px;
  color:var(--brand-tint-fg);
  text-decoration:underline
}
.thinking {
  display:flex;

  align-items:center;

}
.spinner {
  width:14px;
  height:14px;
  border:2px solid var(--border-default);
  border-top-color:var(--brand-accent);
  border-radius:50%;
  display:inline-block;
  animation:spin .8s linear infinite;
  flex-shrink:0
}
.submit-row {
  display:flex;

  justify-content:space-between;
  align-items:center;
  padding:19px 0;
  margin-top:20px;
  border-color:var(--border-default);

}
.submit-row strong {
  font-weight:500;

  display:block;
  line-height:1.5
}
.submit-row>div>span {
  display:block;

  margin-top:5px;
}
.primary {


  white-space:nowrap;
}
.upload-status {
  padding:0 0 20px;
  display:grid;
  gap:8px;
  font-size:11px;
  color:var(--text-secondary)
}
.upload-status>span {
  font-size:10px;
  color:var(--text-muted)
}
progress {
  width:100%;
  height:6px;
  border:0;
  border-radius:var(--radius-sm);
  overflow:hidden
}
progress::-webkit-progress-bar {
  background:var(--bg-muted);
  border-radius:var(--radius-sm)
}
progress::-webkit-progress-value {
  background:var(--brand-accent);
  border-radius:var(--radius-sm)
}
.notice {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  line-height:1.7;
  padding:13px 15px;
  border-radius:var(--radius-md);
  margin:14px 0
}
.notice.error {
  background:var(--bg-page);
  color:var(--danger);
  border:1px solid var(--warning-border)
}
.notice button {
  color:inherit
}
.results-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
}
.counter {
  display:inline-grid;
  place-items:center;
  font-size:10px;

  min-width:21px;
  min-height:20px;

  vertical-align:middle
}
.result-filters {
  display:flex;

  border-bottom:1px solid var(--line);
}
.result-filters button {
  border:0;
  background:transparent;
  color:var(--text-muted);

  min-height:30px;
  white-space:nowrap
}
.result-filters span {
  margin-left:3px
}
.jobs {
  max-height:65vh;
  overflow:auto;
  scrollbar-width:thin;
  display:grid;

  margin:15px -2px 0;
  padding:2px
}
.job {
  background:var(--bg-surface);
  border:1px solid var(--border-default);

}
.job-top {
  display:flex;
  align-items:center;
  gap:10px
}
.job-symbol {
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  border-radius:var(--radius-md);
  background:var(--bg-page);
  color:var(--brand-accent);
  font-size:15px;
  flex-shrink:0
}
.job-copy {
  min-width:0;
  flex:1
}
.job-copy strong {
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:12px;
  font-weight: 500
}
.job-copy small {
  display:block;
  font-size:10px;
  margin-top:5px;
  line-height:1.5
}
.job-status {

  color:var(--text-muted);

  line-height:1.5;
  margin:13px 0 0;
}
.job-status.completed {
  color:var(--brand-tint-fg)
}
.job-status.failed {
  color:var(--danger)
}
.job-error {
  font-size:11px;
  color:var(--danger);
  line-height:1.7;
  margin:10px 0;
  overflow-wrap:anywhere
}
.job-actions {
  display:flex;

  align-items:center;
  justify-content:space-between;
  margin-top:12px;
  gap:13px;
}
.download {

  padding:10px 13px;
  flex:1;
  text-align:center;
}
.job-dismiss {

  min-height:32px;

}
.empty {
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;

  color:var(--text-muted)
}
.empty-symbol {
  width:52px;
  height:52px;
  border:1px solid var(--border-default);

  border-radius:var(--radius-lg);
  display:grid;
  place-items:center;
  font-size:24px;

  margin-bottom:17px
}
.empty strong {

  font-weight: 500
}
.empty p {

  color:var(--text-muted);

  max-width:230px;
  margin:8px 0
}
footer {
  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:20px;
  padding:26px 0;
}
.footer-divider {
  color:var(--text-muted);
  margin:0 10px
}
.toast {
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  z-index:50;

  color:var(--fg-inverse);


  display:flex;
  align-items:center;
  gap:18px;
  box-shadow:var(--shadow-card);

  line-height:1.6
}
.toast button {
  border:0;
  background:transparent;
  color:var(--brand-accent);
  padding:5px;
  white-space:nowrap
}
.toast #toast-close {
  font-size:19px;
  color:var(--text-muted)
}
dialog {
  border:1px solid var(--border-default);
  max-width:520px;
  width:calc(100% - 32px);
  padding:34px;
  color:var(--ink);
  box-shadow:var(--shadow-card);
  overscroll-behavior: contain;
}
dialog::backdrop {
  backdrop-filter:blur(3px);
  background: rgba(9, 9, 11, 0.45);
}
dialog h2 {
  font-size:25px;
  margin:12px 0 24px
}
dialog ol {
  padding-left:20px;
  font-size:13px;
  line-height:1.9
}
dialog li {
  padding-left:7px;
  margin-bottom:15px
}
dialog p {
  font-size:12px;
  line-height:1.8;
  color:var(--text-muted)
}
.dialog-close {
  position:absolute;
  right:15px;
  top:15px
}
.invalid {
  border-color:var(--danger)!important
}
.filter-empty {
  padding:30px 8px
}
.file-order {
  font-size:9px;
  color:var(--text-muted);
  flex-shrink:0
}
@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important
  }
}
@media(max-width:1100px) {
  .files-section,.action-section {
    padding-left:21px;
    padding-right:21px
  }
  .dropzone {
    flex-wrap:wrap;
  }
  .choose-button {
    display:none
  }
}
@media(max-width:850px) {
  .jobs {
    max-height:none;
    align-items:start;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .empty {
    grid-column:1/-1;
  }
  .results-panel {
    scroll-margin-top:20px
  }
}
@media(max-width:550px) {
  .header-actions {
    margin-left:0;
}
  .connection:before {
    height:7px;
    width:7px
  }
  .icon-button {
    min-width:32px;
    min-height:32px
  }
  h1 {

    max-width:310px;
    font-size:31px;
    line-height:1.2;
    margin:10px 0;
}
  h1 span {
    display:block
  }
  .intro p {

    margin-top:9px
  }
  .section-heading {
    align-items:start;
  }
  .section-heading>.muted {

    text-align:right
  }
  .file-preview {
    width:33px;
    height:33px
  }
  .file-row {
    gap:8px;
    padding:8px
  }
  .file-controls {
    gap:0
  }
  .file-controls button {
    min-width:26px
  }
  .file-name {
    font-size:11px
  }
  .file-list {
    max-height:235px
  }
  .tab {
    font-size:10px;

}
  .parameters input,.parameters select {
    padding:10px;
    font-size:13px;
    min-height:43px
  }
  .parameters .optional {
    display:block;
    margin:4px 0 0
  }
  .submit-row {

    bottom:0;
    background:var(--bg-surface);

    z-index:2;
    position:static;
    flex-direction:column;
    align-items:stretch;
    padding:17px 0;
  }
  .submit-row>div>span {

    margin:0;
}
  .primary {
    width:100%;
}
  .ai-heading button {
    font-size:10px
  }
  .toast {
    gap:9px;
    width:calc(100vw - 30px);
  }
  .notice {
    font-size:11px
  }
  footer {

    gap:12px;
    line-height:1.6;
  }
  footer>span {
    max-width:195px;
    line-height:1.8
  }
  .footer-divider {
    margin:0 5px
  }
  dialog {
    padding:28px 23px
  }
  dialog h2 {
    font-size:22px
  }
}
/* Keep supporting copy readable on both desktop and phone screens. */
.file-copy small,
.operation-hint,
.parameters small,
.ai-heading p,
.submit-row>div>span,
.drop-copy>span,
.job-copy small {
  color:var(--text-secondary)
}
@media(max-width:550px) {
  .file-copy small {
    font-size:10px
  }
  footer>.text-button {
    flex-shrink:0
  }
}
/* Full result library */
.all-results-link {

  display:inline-block;
  padding:2px 0
}
.all-results-link:hover {
  text-decoration:underline
}
.results-route .shell {
  max-width:1450px
}
.results-intro {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:25px;
}
.results-intro h1 {

  margin:6px 0 9px;
  font-size:36px;
}
.title-dot {
  color:var(--brand-accent)!important
}
.results-intro p {

  line-height:1.7;

  margin:0
}
.new-job {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  min-width:160px
}
.results-metrics {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:15px;
  margin-bottom:27px
}
.results-metrics button {

  background:var(--bg-subtle);
  text-align:left;
  border:1px solid var(--border-default);

  color:var(--text-primary);
  transition:border-color .15s,background .15s
}
.results-metrics button:hover,.results-metrics button.metric-selected {
  background:var(--bg-page);
  border-color:var(--brand-accent)
}
.results-metrics button>span {

  color:var(--text-secondary);
  display:flex;
  align-items:center;
  gap:7px
}
.results-metrics strong {
  display:block;
  font-size:31px;
  font-weight: 500;
  letter-spacing:-1px;
  margin:12px 0 7px;
  line-height:1
}
.results-metrics small {

  line-height:1.5
}
.metric-dot {
  display:inline-block;
  height:6px;
  width:6px;
  border-radius:50%;
  background:var(--border-strong)
}
.metric-dot.ready {
  background:var(--brand-accent)
}
.metric-dot.running {
  background:var(--warning)
}
.metric-dot.failed {
  background:var(--warning)
}
.result-library {
  border:1px solid var(--border-default);
  overflow:clip;
}
.library-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 23px 0;
  gap:15px;
  border-bottom:1px solid var(--border-default)
}
.library-tabs {
  display:flex;
  gap:23px;
  align-items:center
}
.library-tabs button {
  background:transparent;
  border:0;
  border-bottom:2px solid transparent;
  padding:15px 0 18px;
  color:var(--text-muted);
}
.library-tabs button[aria-pressed=true] {
  color:var(--text-secondary);
  border-bottom-color:var(--brand-accent);
  font-weight:500
}
.library-tabs button span {
  font-size:10px;
  font-weight:400;
  margin-left:6px;
  background:var(--bg-muted);
  color:var(--text-muted);
  padding:3px 6px;
  border-radius:var(--radius-sm)
}
.library-live {
  display:flex;
  gap:8px;
  align-items:center;
  color:var(--text-muted);
  font-size:10px;
  padding-bottom:10px
}
.library-live .status-dot {
  width:5px;
  height:5px;
  background:var(--brand-accent);
  border-radius:50%
}
.library-live .icon-button {
  margin-left:6px;
  min-width:30px;
  min-height:30px;
  font-size:18px
}
.library-controls {
  display:flex;
  gap:15px;
  padding:23px 23px 0;
  align-items:center;
  justify-content:space-between
}
.library-search {
  position:relative;
  flex:1;
  max-width:460px
}
.library-search input {
  padding-left:39px;
  background:var(--bg-subtle);
}
.library-search>span {
  position:absolute;
  left:14px;
  top:10px;
  font-size:23px;
  line-height:1;
  color:var(--text-muted);
  pointer-events:none
}
.library-controls select {
  max-width:210px;
  min-height:43px;
  padding-right:28px;
  background:var(--bg-subtle);
  color:var(--text-secondary)
}
.selection-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:13px 22px;
  background:var(--bg-page);
  border-top:1px solid var(--border-default);
  border-bottom:1px solid var(--border-default)
}
.selection-bar>div {
  display:flex;
  gap:17px;
  align-items:center
}
.selection-bar strong {
  font-size:12px;
  font-weight: 500
}
.selection-bar .primary {
  font-size:11px;
  padding:10px 15px;
  min-height:36px
}
.secondary {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border:1px solid var(--border-default);

  background:var(--bg-surface);

  line-height:1.5;
  cursor:pointer
}
.secondary:hover {
  background:var(--bg-page)
}
.secondary:disabled {
  opacity:.4;
  cursor:not-allowed
}
.library-columns,.library-row {
  display:grid;
  grid-template-columns:24px minmax(190px,1fr) 145px 90px 125px 80px;
  gap:17px;
  align-items:center
}
.library-columns {
  padding:13px 24px;
  background:var(--bg-subtle);
  border-top:1px solid var(--border-default);
  border-bottom:1px solid var(--border-default);
}
.select-page {
  padding:10px 24px;
  display:flex;
  gap:10px;
  align-items:center;
  background:var(--bg-surface);
  border-bottom:1px solid var(--border-default)
}
.select-page input,.library-row>input {
  appearance:auto;
  accent-color:var(--brand-accent);
  width:15px;
  min-height:15px;
  height:15px;
  flex-shrink:0;
  margin:0;
  padding:0;
  cursor:pointer
}
.select-page label {
  font-size:10px;
  color:var(--text-muted);
  cursor:pointer;
  line-height:1.6
}
.library-row {
  padding:18px 24px;
  border-bottom:1px solid var(--border-default);
  min-height:90px;
  transition:background .15s
}
.library-row:hover {
  background:var(--bg-subtle)
}
.library-row.selected {
  background:var(--bg-subtle)
}
.library-row>input:disabled {
  opacity:.3;
  cursor:not-allowed
}
.library-file {
  display:flex;
  gap:12px;
  align-items:center;
  text-align:left;
  padding:0;
  border:0;
  background:transparent;
  min-width:0;
  color:var(--text-primary)
}
.library-file:hover strong {
  text-decoration:underline;
  text-underline-offset:3px
}
.result-file-icon {
  display:grid;
  place-items:center;
  flex-shrink:0;
  width:40px;
  height:44px;
  background:var(--bg-page);
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  color:var(--text-muted);
  font-size:9px;
  font-weight: 500
}
.result-file-icon.failed {
  background:var(--bg-page);
  color:var(--warning);
  border-color:var(--border-default)
}
.library-file-copy {
  display:grid;
  gap:6px;
  min-width:0
}
.library-file-copy strong {
  font-weight: 500;

  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis
}
.library-file-copy small {

  line-height:1.6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.state-pill {
  display:inline-flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;

  color:var(--text-muted);
  line-height:1.6;
  justify-self:start;
  padding:5px 8px;
  border-radius:var(--radius-sm);
  background:var(--bg-page);
  max-width:100%;
  font-size:11px;
}
.state-pill.completed {
  background:var(--bg-page);
  color:var(--brand-tint-fg)
}
.state-pill.failed {
  background:var(--bg-page);
  color:var(--warning)
}
.state-pill.processing {
  background:var(--bg-page);
  color:var(--warning)
}
.state-pill small {
  width:100%;
  font-size:9px;
  color:var(--warning)
}
.state-pill .spinner {
  width:11px;
  height:11px
}
.row-size,.row-date {
  line-height:1.6
}
.row-actions {
  display:flex;
  gap:7px;
  justify-content:flex-end
}
.row-actions button {
  min-width:32px;
  min-height:33px;
  border:1px solid var(--border-default);
  border-radius:var(--radius-sm);
  background:var(--bg-subtle);
  color:var(--text-muted);
  font-size:17px
}
.row-actions button:hover {
  background:var(--bg-muted);
  border-color:var(--border-strong)
}
.row-actions .row-more {
  border-color:transparent;
  color:var(--text-muted)
}
.library-loading {
  padding:55px 24px;
  text-align:center;
  color:var(--text-muted);
  font-size:12px
}
.library-empty {
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:55px 20px
}
.library-empty h2 {
  font-size:17px;
  line-height:1.6
}
.library-empty p {
  font-size:12px;
  color:var(--text-muted);
  line-height:1.8;
  max-width:370px;
  margin:9px 0 23px
}
.library-empty .primary {
  font-size:12px;
  display:inline-flex
}
.library-pagination {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:17px 24px;
  gap:15px
}
.library-pagination>div {
  display:flex;
  gap:8px
}
.library-page-label {
  font-size:11px
}
.library-note {
  font-size:10px;

  line-height:1.8;
  margin:17px 4px;
  color:var(--text-secondary);
}
.result-detail {
  max-width:580px;
  padding:34px 30px;
  max-height:88vh;
  overflow:auto
}
.result-detail h2 {
  font-size:21px;
  line-height:1.4;
  margin:13px 0;
  overflow-wrap:anywhere;
  padding-right:13px
}
.detail-heading {
  margin-bottom:24px
}
.detail-facts {
  display:grid;
  grid-template-columns:135px minmax(0,1fr);
  gap:12px;
  font-size:12px;
  line-height:1.7;
  border-top:1px solid var(--border-default);
  border-bottom:1px solid var(--border-default);
  padding:19px 0;
  margin:0
}
.detail-facts dt {
  color:var(--text-muted);
  font-size:11px
}
.detail-facts dd {
  margin:0;
  color:var(--text-secondary)
}
.detail-sources {
  padding:20px 0
}
.detail-sources h3 {
  font-size:12px;
  font-weight: 500;
  margin:0 0 12px
}
.detail-sources p {
  font-size:11px;
  line-height:1.7;
  margin:6px 0;
  overflow-wrap:anywhere;
  color:var(--text-muted)
}
.detail-guidance {
  background:var(--bg-page);
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  padding:13px 15px;
  font-size:11px;
  line-height:1.8;
  color:var(--text-muted);
  overflow-wrap:anywhere
}
.detail-actions {
  display:flex;
  gap:9px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:20px
}
.detail-actions .primary {
  font-size:11px;
  padding:12px 15px
}
.detail-actions .text-button {
  width:100%;
  text-align:left;
  margin-top:6px
}
.detail-id {
  font-family:var(--font-mono);
  font-size:9px;
  color:var(--text-muted);
  overflow-wrap:anywhere;
  margin-top:25px
}
.result-preview {
  display:block;
  max-width:100%;
  max-height:380px;
  object-fit:contain;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  margin:20px auto 0;
  background:repeating-conic-gradient(var(--bg-page) 0 25%,var(--bg-surface) 0 50%) 0 0/20px 20px
}
.result-library>.notice {
  margin:15px 23px
}
.results-route footer {
  padding-top:16px
}
@media(max-width:1100px) {
  .library-columns,.library-row {
    grid-template-columns:22px minmax(150px,1fr) 125px 75px 96px 72px;
    gap:11px;
    padding-left:20px;
    padding-right:20px;
  }
  .library-file {
    gap:9px
  }
}
@media(max-width:850px) {
  .library-columns,.library-row {
    grid-template-columns:20px minmax(150px,1fr) 110px 70px 70px;
    gap:10px
  }
  .row-date {
    display:none
  }
  .library-columns>span:nth-child(5) {
    display:none
  }
  .results-metrics {
    gap:10px;
    margin-bottom:20px
  }
  .results-metrics strong {
    font-size:27px
  }
  .library-heading {
    padding:13px 18px 0
  }
  .library-controls {
    padding:19px 18px 0
  }
  .result-file-icon {
    width:34px;
    height:38px;
    font-size:8px
  }
}
@media(max-width:550px) {
  .results-intro {
    align-items:flex-start;
    display:grid;
    grid-template-columns:1fr;
    gap:15px;
}
  .results-intro h1 {

    line-height:1.2;
    max-width:none;
    font-size:29px;
  }
  .results-intro h1 span {
    display:inline
  }
  .results-intro>.new-job {
    min-width:0;

    padding:10px;

    margin-top:29px
  }
  .results-metrics {
    grid-template-columns:1fr 1fr;

    margin-bottom:18px;
    gap:9px;
  }
  .results-metrics strong {
    font-size:25px;
    margin:11px 0 6px
  }
  .library-heading {
    padding:9px 15px 0;
    gap:10px
  }
  .library-tabs {
    gap:18px
  }
  .library-tabs button {
    padding-bottom:15px
  }
  .library-live>span:not(.status-dot) {
    display:none
  }
  .library-live {
    gap:0
  }
  .library-controls {
    padding:17px 14px 0;
    flex-direction:column;
    gap:10px;
    align-items:stretch
  }
  .library-search {
    max-width:none
  }
  .library-search input {
    min-height:43px
  }
  .library-controls select {
    max-width:none;
    padding-top:10px;
    padding-bottom:10px;
    min-height:39px
  }
  .library-columns {
    display:none
  }
  .select-page {
    padding:11px 17px;
    border-top:1px solid var(--border-default)
  }
  .library-row {

    padding:16px;
    min-height:105px;
    grid-template-columns:28px minmax(0,1fr) 70px;
    gap:8px;
  }
  .library-row>input {
    grid-row:1/3;
    align-self:center
  }
  .library-file {
    grid-column:2/3;
    gap:9px
  }
  .result-file-icon {
    height:36px;
    width:30px;
    font-size:8px
  }
  .library-row>.state-pill {
    grid-column:2;
    grid-row:2;
    margin-left:39px;
    font-size:9px;
    padding:3px 6px
  }
  .library-row>.row-size {
    grid-column:3;
    grid-row:2;
    text-align:right;
    font-size:10px
  }
  .library-row>.row-actions {
    grid-column:3;
    grid-row:1;
    gap:3px
  }
  .row-actions button {
    min-width:30px;
    min-height:33px
  }
  .library-pagination {
    padding:15px;
    gap:10px
  }
  .library-pagination .secondary {
    padding:8px 11px;
    font-size:10px
  }
  .library-pagination>.muted {
    font-size:10px
  }
  .selection-bar {
    padding:12px 14px;
    flex-wrap:wrap;
    gap:10px
  }
  .selection-bar>div {
    gap:12px;
    flex-wrap:wrap;
  }
  .selection-bar>div:last-child {
    width:100%
  }
  .selection-bar .primary,.selection-bar .secondary {
    flex:1;
    font-size:10px;
    padding:10px 12px
  }
  .selection-bar strong {
    font-size:11px
  }
  .library-note {
    font-size:10px;
    line-height:1.8;
    margin:13px 2px
  }
  .library-empty {
    padding:36px 17px
  }
  .library-empty h2 {
    font-size:15px
  }
  .library-empty p {
    font-size:11px
  }
  .result-detail {
    padding:30px 22px;
    max-height:90vh
  }
  .result-detail h2 {
    font-size:19px
  }
  .detail-facts {
    grid-template-columns:100px 1fr;
    gap:11px;
    font-size:11px
  }
  .detail-facts dt {
    font-size:10px
  }
  .detail-actions>.primary,.detail-actions>.secondary {
    width:100%;
    text-align:center;
    justify-content:center
  }
  .result-library>.notice {
    margin:12px 14px
  }
  .detail-id {
    font-size:8px
  }
}
/* Readable labels and controls at normal browser zoom. */
.library-file-copy small,.row-size,.row-date,.library-columns,.results-metrics small {
  font-size:11px;
  color:var(--text-secondary)
}
.selection-bar .primary:disabled {
  opacity:.5;
  cursor:not-allowed
}
.result-select {
  display:grid;
  place-items:center;
  width:24px;
  min-height:44px;
  cursor:pointer
}
.result-select input {
  appearance:auto;
  accent-color:var(--brand-accent);
  width:16px;
  height:16px;
  min-height:16px;
  margin:0;
  padding:0;
  cursor:pointer
}
.result-select input:disabled {
  opacity:.3;
  cursor:not-allowed
}
@media(max-width:550px) {
  .results-intro p {
    max-width:330px;
}
  .results-intro>.new-job {
    width:100%;
    margin:0;
    min-height:42px;
    font-size:12px
  }
  .library-row>.result-select {
    grid-row:1/3;
    align-self:center;
    width:28px
  }
  .result-select input {
    width:18px;
    height:18px;
    min-height:18px
  }
}
/* Clear states before files are added and unambiguous result actions. */
#operation-fields {
  border:0;
  margin:0;
  padding:0;
  min-inline-size:0;
  transition:opacity .15s
}
#operation-fields.awaiting-files {
  opacity:.57
}
.primary:disabled {

  border:1px solid var(--border-strong);
  box-shadow:none;
}
.job-actions>.download {
  flex:1;
  min-width:0
}
.job-actions>.job-dismiss {
  flex-shrink:0;
  border:1px solid var(--border-default);
  background:var(--bg-surface);
  border-radius:var(--radius-sm);
  font-size:10px;
  min-width:64px;
  min-height:36px;
  padding:8px;
  color:var(--text-muted)
}
.job-actions>.job-dismiss:hover {
  background:var(--bg-page);
  border-color:var(--border-strong)
}
.job-symbol.completed {
  color:var(--brand-tint-fg);
  background:var(--brand-tint);
  border:1px solid var(--border-default);
  font-weight:600
}
.job-symbol.failed {
  color:var(--warning);
  background:var(--bg-page);
  border:1px solid var(--border-default)
}
.suggestions button:disabled {
  color:var(--text-muted);
  background:var(--bg-page);
  cursor:not-allowed
}
@media(max-width:550px) {
  .job-actions {
    gap:13px
  }
  .job-actions>.job-dismiss {
    min-width:70px;
    min-height:39px
  }
  .job-actions>.download {
    min-height:39px
  }
}
.panel-bulk-actions {
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);

  margin:16px 0 12px;
  gap:9px;
  margin-top:16px;
}
.panel-bulk-actions .secondary {

  white-space:nowrap
}
.panel-bulk-actions .secondary:first-child {
  background:var(--bg-page);
  color:var(--brand-tint-fg);
  border-color:var(--border-default)
}
.pipeline-progress {
  list-style:none;
  margin:15px 0 4px;
  padding:0;
  display:grid;
  gap:12px
}
.pipeline-step {
  display:flex;
  gap:10px;
  align-items:flex-start;
  position:relative
}
.pipeline-marker {
  width:21px;
  height:21px;
  display:grid;
  place-items:center;
  flex-shrink:0;
  border:1px solid var(--border-default);
  border-radius:50%;
  font-size:9px;
  color:var(--text-muted);
  background:var(--bg-subtle)
}
.pipeline-step:not(:last-child):after {
  content:"";
  position:absolute;
  left:10px;
  top:24px;
  bottom:-9px;
  border-left:1px solid var(--border-default)
}
.pipeline-step-copy {
  display:grid;
  gap:4px;
  padding-top:1px;
  flex:1 1 0;
}
.pipeline-step-copy strong {
  font-size:11px;
  font-weight:500;
  line-height:1.6;

  color:var(--text-secondary);
  overflow-wrap:anywhere;
}
.pipeline-step-copy small {
  font-size:9px;
  line-height:1.5;
  color:var(--text-muted)
}
.pipeline-step.completed .pipeline-marker {
  color:var(--brand-tint-fg);
  background:var(--bg-muted);
  border-color:var(--border-default)
}
.pipeline-step.processing .pipeline-marker {
  background:var(--bg-page);
  border-color:var(--warning-border);
  color:var(--warning)
}
.pipeline-step.failed .pipeline-marker {
  background:var(--bg-muted);
  border-color:var(--warning-border);
  color:var(--warning)
}
.pipeline-step.skipped {
  opacity:.55
}
.pipeline-files {
  margin:10px 0 4px;
  padding-top:10px;
  border-top:1px solid var(--border-default)
}
.pipeline-files-title {
  margin:0 0 6px;
  font-size:12px;
  font-weight:600;
  color:var(--text-secondary)
}
.pipeline-file-list {
  display:grid;
  gap:6px;
  margin:0;
  padding:0;
  list-style:none
}
.pipeline-file {
  display:grid;
  gap:2px;
  padding:7px 9px;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  font-size:12px
}
.pipeline-file.failed {
  border-color:var(--warning)
}
.pipeline-file-head {
  display:flex;
  gap:8px;
  justify-content:space-between;
  align-items:baseline
}
.pipeline-file-name {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.pipeline-file-state {
  flex:none;
  color:var(--text-secondary)
}
.pipeline-file.failed .pipeline-file-state {
  color:var(--warning)
}
.pipeline-file-trace,
.pipeline-file-reason,
.pipeline-files-more {
  display:block;
  color:var(--text-secondary);
  overflow-wrap:anywhere
}
.result-detail .pipeline-progress {
  padding:17px;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  background:var(--bg-subtle);
  margin:4px 0 20px
}
.result-detail .pipeline-step-copy strong {
  font-size:12px
}
.result-detail .pipeline-step-copy small {
  font-size:10px
}
/* Square selected-file tiles;
only the document itself scrolls. */
#file-list.file-list {
  display:grid;

  margin:0;
  padding:2px;
  min-width:0;
  gap:11px;
  overflow:visible;
  max-height:none;
  grid-template-columns:repeat(auto-fill,minmax(135px,1fr));
}
#file-list .file-row {
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  position:relative;
  aspect-ratio:1;
  min-width:0;
  width:100%;
  gap:0;
  padding:0;

}
#file-list .file-preview {

  min-width:0;

  letter-spacing:1px;
  font-weight:600;

  overflow:hidden
}
#file-list .has-preview .file-preview {
  background:repeating-conic-gradient(var(--bg-page) 0 25%,var(--bg-subtle) 0 50%) 0 0/18px 18px
}
#file-list .file-preview img {

  display:block;
  min-width:0;

  border-radius:0;
  width:100%;
  height:100%;
  object-fit:contain;
  min-height:0;
}
#file-list .file-copy {
  width:100%;
  min-width:0;

}
#file-list .file-name {

  font-weight:500;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
#file-list .file-copy small {

  line-height:1.5;
  font-size:10px;
  color:var(--text-muted);
  margin-top:3px;
}
#file-list .file-order {
  position:absolute;

  z-index:1;

  line-height:1;
  left:8px;
  top:8px;
  background:color-mix(in srgb, var(--bg-surface) 85%, transparent);
  color:var(--text-secondary);
  border:1px solid var(--border-default);
  font-size:10px;
  padding:3px 5px;
  border-radius:var(--radius-sm);

}
#file-list .file-controls {
  position:absolute;

  display:flex;

  z-index:1;
  top:6px;
  right:6px;
  gap:2px;
  opacity:0;
  transition:opacity .12s;
  pointer-events:none;
}
#file-list .file-controls button {
  display:grid;
  place-items:center;

  padding:0;

  line-height:1;

  box-shadow:var(--shadow-card);
  width:27px;
  height:28px;
  border:1px solid var(--border-default);
  border-radius:var(--radius-sm);
  background:color-mix(in srgb, var(--bg-surface) 95%, transparent);
  font-size:15px;
  color:var(--text-secondary);
  pointer-events:auto;
}
#file-list .file-controls button:hover {

  border-color:var(--brand-accent);
  background:var(--bg-muted);
}
#file-list .file-controls button:disabled {
  box-shadow:none
}
.results-panel {
  position:static;
  max-width:100%;
  top:94px;
  border-color:var(--border-default);
  padding:23px 20px;
}
#jobs.jobs {
  grid-template-columns:minmax(0,1fr);
  max-height:none;
  overflow:visible;
  min-width:0;
  margin-left:0;
  margin-right:0;
  padding:0
}
#jobs .job {
  min-width:0;
  max-width:100%;
  overflow:hidden
}
#jobs .job-top {
  min-width:0;
  max-width:100%
}
#jobs .job-copy {
  min-width:0;
  max-width:100%;
  flex:1 1 0
}
#jobs .job-copy strong {
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  white-space:normal;
  overflow:hidden;
  overflow-wrap:anywhere;
  text-overflow:ellipsis;
  line-height:1.6;
  max-width:100%
}
#jobs .job-copy small {
  white-space:normal;
  overflow-wrap:anywhere;
  max-width:100%;
  font-size:11px;
  margin-top:5px;
  color:var(--text-muted);
  line-height:1.5;
}
#jobs .job-actions {
  min-width:0;
  max-width:100%
}
.pipeline-progress,.pipeline-step,.pipeline-step-copy {
  min-width:0;
  max-width:100%
}
.jobs-preview-note {
  font-size:10px;
  line-height:1.8;
  color:var(--text-muted);
  margin:13px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
}
/* Shared file previews and durable request history. */
.file-history-icon {
  position:relative;
  display:inline-flex;
  flex:0 0 54px;
  width:54px;
  height:60px;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-radius:var(--radius-lg);
  background:var(--bg-page);
  color:var(--brand-tint-fg);
  font-size:12px
}
.file-history-icon svg {
  width:28px;
  height:28px;
  margin-bottom:9px
}
.file-history-icon img {
  position:absolute;
  inset:3px;
  width:calc(100% - 6px);
  height:calc(100% - 18px);
  object-fit:contain;
  background:var(--bg-page)
}
.file-format {
  position:absolute;
  bottom:3px;
  left:0;
  right:0;
  text-align:center;
  font-size:8px;
  line-height:12px
}
.history-source {
  display:flex;
  align-items:center;
  gap:12px;
  overflow-wrap:anywhere
}
.request-list {
  display:grid;
  gap:20px
}
.request-pages {
  flex-wrap:wrap;
  margin:24px 0;
}
.request-reply {
  white-space:pre-wrap;
  background:var(--bg-page);
  padding:16px;
  border-radius:var(--radius-lg);
  font-size:13px;
  line-height:1.8;
}
.request-error {
  background:var(--bg-page);
  color:var(--danger)
}
/* Compact composer and progress disclosure retain their state across status polling. */
#ai-prompt {

  resize:none;
  overflow-y:hidden;
  border-radius:0;
  outline:0;
  box-shadow:none;
  flex: 1;
  min-height: 44px;
  max-height: 180px;
  padding: 4px 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-primary);
  border: 0;
  background: transparent;

}
.pipeline-disclosure {
  min-width:0;
  margin:13px 0 4px;
  border-top:1px solid var(--border-default);
  padding-top:10px
}
.pipeline-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
  list-style:none;
  border-radius:var(--radius-sm);
  padding:4px 0;
  color:var(--text-secondary)
}
.pipeline-summary::-webkit-details-marker {
  display:none
}
.pipeline-summary:focus-visible {
  outline:3px solid var(--brand-accent);
  outline-offset:4px
}
.pipeline-summary-copy {
  display:grid;
  gap:4px;
  min-width:0
}
.pipeline-summary-copy strong {

  font-weight: 500
}
.pipeline-summary-copy small {

  color:var(--text-muted)
}
.pipeline-toggle {
  display:flex;
  align-items:center;
  gap:6px;

  flex-shrink:0
}
.pipeline-chevron {
  display:inline-block;
  font-size:17px;
  line-height:1;
  transform:rotate(-90deg)
}
.pipeline-disclosure[open] .pipeline-chevron {
  transform:rotate(0)
}
.pipeline-hide {
  display:none
}
.pipeline-disclosure[open] .pipeline-hide {
  display:inline
}
.pipeline-disclosure[open] .pipeline-show {
  display:none
}
.pipeline-disclosure>.pipeline-progress {
  margin-top:12px
}
.result-detail .pipeline-disclosure {
  margin:6px 0 20px;
  padding:14px;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  background:var(--bg-subtle)
}
.result-detail .pipeline-disclosure .pipeline-progress {
  padding:0;
  border:0;
  margin:16px 0 0;
  background:transparent
}
.ai-message .text-button {
  display:block;
  margin-top:8px;
  text-align:left;
  white-space:normal
}
@media(prefers-reduced-motion:reduce) {
  .spinner {
    animation:none
  }
}
