﻿/* ==========================================================================
   Printlane â€” component library
   Every visual element the views compose from. Views add layout, never new
   colours: if something here is missing, add it HERE so it stays consistent.

   Status is never signalled by colour alone â€” pills, banners and meters all
   carry a text label, because this runs on a wall screen and is read by people
   who do not distinguish red from green.
   ========================================================================== */

/* ---------------------------------------------------------------- buttons */
.btn {
  --_bg: var(--surface); --_fg: var(--ink); --_bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); font-size: var(--t-md); font-weight: 550; line-height: 1;
  padding: .625rem .9rem; border-radius: var(--r-sm); cursor: pointer;
  background: var(--_bg); color: var(--_fg); border: 1px solid var(--_bd);
  white-space: nowrap; text-decoration: none;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent);
                            text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn .ico { flex: none; width: 1.05em; height: 1.05em; }

.btn-primary { --_bg: var(--brand-600); --_fg: var(--brand-ink);
               --_bd: var(--brand-600); font-weight: 600; }
.btn-primary:hover:not(:disabled) { --_bg: var(--brand-700); --_bd: var(--brand-700);
                                     color: var(--brand-ink); }
.btn-ghost  { --_bg: transparent; --_bd: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { --_bg: var(--surface-3); }
.btn-outline{ --_bg: transparent; }
.btn-danger { --_bg: transparent; --_fg: var(--danger); --_bd: var(--danger-border); }
.btn-danger:hover:not(:disabled) { --_bg: var(--danger-bg); --_fg: var(--danger);
                                    --_bd: var(--danger); }
.btn-warn   { --_bg: var(--warn); --_fg: #fff; --_bd: var(--warn); font-weight: 600; }
.btn-warn:hover:not(:disabled) { color: #fff; filter: brightness(1.06); }

.btn-lg { padding: .8rem 1.15rem; font-size: var(--t-lg); border-radius: var(--r-md); }
.btn-sm { padding: .4rem .6rem; font-size: var(--t-base); border-radius: var(--r-xs); }
.btn-icon { padding: .5rem; width: 2.2rem; height: 2.2rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-xs);
}
.card-pad { padding: var(--sp-5); }
.card-pad-sm { padding: var(--sp-4); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: var(--t-lg); }
.card-body { padding: var(--sp-5); }
.card-foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line);
             background: var(--surface-2);
             border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-hover { transition: box-shadow var(--speed) var(--ease),
                          border-color var(--speed) var(--ease); }
.card-hover:hover { box-shadow: var(--sh-sm); border-color: var(--line-2); }

/* icon chip, as on the KPI tiles */
.chip-icon {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: var(--accent-bg); color: var(--accent);
}
.chip-icon.is-warn { background: var(--warn-bg); color: var(--warn); }
.chip-icon.is-bad  { background: var(--danger-bg); color: var(--danger); }
.chip-icon.is-ok   { background: var(--ok-bg); color: var(--ok); }
.chip-icon svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: var(--t-sm); font-weight: 600; line-height: 1;
  padding: .3rem .6rem; border-radius: var(--r-full);
  border: 1px solid transparent; white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; flex: none; }
.pill-ok      { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-border); }
.pill-warn    { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-border); }
.pill-danger  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.pill-info    { background: var(--info-bg);   color: var(--info);   border-color: var(--info-border); }
.pill-accent  { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.pill-neutral { background: var(--surface-3); color: var(--ink-2);  border-color: var(--line); }
.pill-sm { font-size: var(--t-xs); padding: .2rem .45rem; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none;
       background: currentColor; }
.dot-live { animation: ph-pulse 2.4s var(--ease) infinite; }
@keyframes ph-pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* ---------------------------------------------------------------- banners */
.banner {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4); border-radius: var(--r-md);
  border: 1px solid transparent; font-size: var(--t-md);
}
.banner .banner-ico { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.banner-title { font-weight: 650; }
.banner-body  { font-size: var(--t-base); opacity: .92; margin-top: 2px; }
.banner-ok     { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-border); }
.banner-warn   { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-border); }
.banner-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.banner-info   { background: var(--info-bg);   color: var(--info);   border-color: var(--info-border); }
.banner-accent { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.banner .grow { color: inherit; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; grid-template-columns: minmax(0,1fr); gap: .35rem; }
.field > label, .label {
  font-size: var(--t-base); font-weight: 600; color: var(--ink-2);
}
.input, input[type="text"], input[type="password"], input[type="number"],
input[type="search"], input[type="email"], select, textarea {
  width: 100%; padding: .6rem .75rem; background: var(--surface);
  color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); transition: border-color var(--speed) var(--ease),
                                           box-shadow var(--speed) var(--ease);
}
select { appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f706b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center;
  background-size: 15px; }
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.input::placeholder, input::placeholder { color: var(--ink-3); }
.hint { font-size: var(--t-sm); color: var(--ink-3); }
.err  { font-size: var(--t-base); color: var(--danger); font-weight: 550; }

.input-icon { position: relative; display: block; }
.input-icon svg { position: absolute; left: .7rem; top: 50%;
  transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3);
  pointer-events: none; }
.input-icon input { padding-left: 2.2rem; }

.check { display: inline-flex; align-items: flex-start; gap: .6rem;
         cursor: pointer; font-size: var(--t-md); }
.check input { appearance: none; flex: none; width: 20px; height: 20px;
  margin: 0; border: 1.5px solid var(--line-2); border-radius: var(--r-xs);
  background: var(--surface); cursor: pointer; position: relative;
  transition: background var(--speed), border-color var(--speed); }
.check input:checked { background: var(--brand-600); border-color: var(--brand-600); }
.check input:checked::after {
  content: ""; position: absolute; inset: 0;
  background: no-repeat center/13px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { flex: none; width: 42px; height: 24px; border-radius: var(--r-full);
  background: var(--n-300); position: relative; transition: background var(--speed); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-xs);
  transition: transform var(--speed) var(--ease); }
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track .knob { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* stepper â€” the "âˆ’ 417 +" control in jam recovery and paper reload */
.stepper { display: flex; align-items: stretch; gap: var(--sp-2); }
.stepper button {
  flex: none; width: 54px; border: 1px solid var(--line-2);
  background: var(--accent-bg); color: var(--accent); border-radius: var(--r-md);
  font-size: var(--t-2xl); font-weight: 500; cursor: pointer; line-height: 1;
  transition: background var(--speed), border-color var(--speed);
}
.stepper button:hover:not(:disabled) { background: var(--brand-100);
                                       border-color: var(--accent); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper input {
  flex: 1; text-align: center; font-size: var(--t-3xl); font-weight: 650;
  letter-spacing: -.02em; padding: .5rem; border-radius: var(--r-md);
  font-variant-numeric: tabular-nums; border: 1.5px solid var(--accent-line);
}
.quickpicks { display: flex; gap: var(--sp-2); }
.quickpicks button {
  flex: 1; padding: .6rem; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; font-variant-numeric: tabular-nums;
  transition: all var(--speed) var(--ease);
}
.quickpicks button[aria-pressed="true"] {
  background: var(--brand-600); border-color: var(--brand-600);
  color: var(--brand-ink);
}

/* ---------------------------------------------------------------- tabs/segments */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line);
        overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; background: none; border: 0; cursor: pointer;
  padding: .7rem .9rem; font-size: var(--t-md); font-weight: 550;
  color: var(--ink-2); white-space: nowrap; display: inline-flex;
  align-items: center; gap: .45rem;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); font-weight: 650; }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: .55rem; right: .55rem; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.tabs .count { font-size: var(--t-xs); font-weight: 700; padding: .1rem .4rem;
  border-radius: var(--r-full); background: var(--surface-3); color: var(--ink-2); }
.tabs button[aria-selected="true"] .count { background: var(--accent-bg);
                                             color: var(--accent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3);
       border: 1px solid var(--line); border-radius: var(--r-sm); }
.seg button { border: 0; background: none; cursor: pointer; border-radius: var(--r-xs);
  padding: .35rem .7rem; font-size: var(--t-base); font-weight: 600;
  color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink);
                                    box-shadow: var(--sh-xs); }

/* ---------------------------------------------------------------- meters */
.meter { display: grid; grid-template-columns: minmax(0,1fr); gap: .3rem; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between;
              gap: var(--sp-2); font-size: var(--t-base); }
.meter-head .k { color: var(--ink-2); display: inline-flex; align-items: center;
                 gap: .4rem; }
.meter-head .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: var(--r-full); background: var(--surface-3);
       overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; border-radius: var(--r-full);
  background: var(--brand-500); transition: width .55s var(--ease); }
.bar > i.is-ok   { background: var(--brand-500); }
.bar > i.is-warn { background: var(--warn); }
.bar > i.is-bad  { background: var(--danger); }
/* hatched = the device does not report this value (Brother trays, toner) */
.bar > i.is-unknown {
  width: 100% !important; opacity: .35;
  background: repeating-linear-gradient(115deg, var(--ink-3) 0 5px,
                                        transparent 5px 10px);
}
.bar-lg { height: 10px; }
.bar-xl { height: 14px; }

.progress-line { display: grid; gap: .4rem; }
.progress-line .pct { font-size: var(--t-md); font-weight: 650;
                      font-variant-numeric: tabular-nums; }

/* donut â€” "Batches 3/5 completed" */
.donut { position: relative; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .donut-track { stroke: var(--surface-3); }
.donut .donut-fill  { stroke: var(--brand-500);
  transition: stroke-dasharray .6s var(--ease); stroke-linecap: round; }
.donut-centre { position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; gap: 0; }
.donut-centre .lbl { font-size: var(--t-sm); color: var(--ink-2); }
.donut-centre .val { font-size: var(--t-xl); font-weight: 700;
                     font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ---------------------------------------------------------------- batches */
.batch-strip { display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.batch {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--sp-4); display: grid; gap: .45rem;
  transition: border-color var(--speed) var(--ease);
}
.batch.is-active { border-color: var(--brand-400); box-shadow: var(--ring); }
.batch.is-done .batch-ico { color: var(--ok); }
.batch.is-active .batch-ico { color: var(--brand-600); }
.batch.is-wait .batch-ico { color: var(--ink-3); }
.batch.is-failed .batch-ico { color: var(--danger); }
.batch-top { display: flex; align-items: center; gap: .5rem; }
.batch-ico { flex: none; width: 18px; height: 18px; }
.batch-name { font-weight: 650; }
.batch-range { font-size: var(--t-base); color: var(--ink-2); }
.batch-foot { display: flex; align-items: center; gap: .35rem;
  font-size: var(--t-base); color: var(--ink-2); border-top: 1px solid var(--line);
  padding-top: .45rem; margin-top: .2rem; }

/* compact squares used in dense lists */
.batch-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.batch-dots i { width: 16px; height: 16px; border-radius: 4px;
  background: var(--surface-3); border: 1px solid var(--line); }
.batch-dots i.done     { background: var(--ok);        border-color: var(--ok); }
.batch-dots i.printing,
.batch-dots i.sending  { background: var(--brand-500); border-color: var(--brand-500); }
.batch-dots i.ready,
.batch-dots i.rendering{ background: var(--warn);      border-color: var(--warn); }
.batch-dots i.failed   { background: var(--danger);    border-color: var(--danger); }

/* ---------------------------------------------------------------- timeline */
.timeline { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
.tl-item { display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-3);
           position: relative; padding-bottom: var(--sp-5); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 12px; top: 24px;
  bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-ico { position: relative; z-index: 1; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-bg); color: var(--ok); border: 2px solid var(--surface); }
.tl-ico svg { width: 14px; height: 14px; }
.tl-item.is-active .tl-ico { background: var(--accent-bg); color: var(--accent); }
.tl-item.is-wait   .tl-ico { background: var(--surface-3); color: var(--ink-3); }
.tl-item.is-bad    .tl-ico { background: var(--danger-bg); color: var(--danger); }
.tl-time { font-size: var(--t-base); color: var(--ink-2);
           font-variant-numeric: tabular-nums; }
.tl-title { font-weight: 600; }
.tl-sub { font-size: var(--t-base); color: var(--ink-2); }

/* ---------------------------------------------------------------- wizard steps */
.steps { display: flex; align-items: center; gap: var(--sp-2);
         overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.steps::-webkit-scrollbar { display: none; }
.step { display: inline-flex; align-items: center; gap: .55rem; flex: none; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid;
  place-items: center; font-size: var(--t-base); font-weight: 700;
  background: var(--surface-3); color: var(--ink-3);
  border: 1px solid var(--line); }
.step-label { font-size: var(--t-md); font-weight: 550; color: var(--ink-3);
              white-space: nowrap; }
.step.is-current .step-n { background: var(--brand-600); color: var(--brand-ink);
                           border-color: var(--brand-600); }
.step.is-current .step-label { color: var(--ink); font-weight: 650; }
.step.is-done .step-n { background: var(--brand-100); color: var(--brand-700);
                        border-color: var(--accent-line); }
.step.is-done .step-label { color: var(--ink-2); }
.step-rule { flex: 1 1 40px; min-width: 24px; height: 2px;
             background: var(--line); border-radius: 2px; }
.step-rule.is-done { background: var(--brand-400); }

/* ---------------------------------------------------------------- accordion */
.acc { border: 1px solid var(--line); border-radius: var(--r-md);
       background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: var(--sp-3); }
.acc.is-current { border-color: var(--brand-400); }
.acc-head { display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  padding: var(--sp-4); background: none; border: 0; cursor: pointer;
  text-align: left; }
.acc-n { flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: var(--t-base);
  background: var(--surface-3); color: var(--ink-2); }
.acc.is-current .acc-n { background: var(--brand-600); color: var(--brand-ink); }
.acc.is-done .acc-n { background: var(--ok-bg); color: var(--ok); }
.acc-title { font-weight: 650; }
.acc-sub { font-size: var(--t-base); color: var(--ink-2); }
.acc-body { padding: 0 var(--sp-4) var(--sp-4); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: var(--t-md); }
.table th {
  text-align: left; font-size: var(--t-sm); font-weight: 650; color: var(--ink-2);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; background: var(--surface);
  z-index: 1;
}
.table td { padding: var(--sp-4); border-bottom: 1px solid var(--line);
            vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--speed); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: var(--accent-bg); }
.table .shrink { width: 1%; white-space: nowrap; }

/* ---------------------------------------------------------------- avatars */
.avatar {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent-bg); color: var(--accent);
  font-size: var(--t-sm); font-weight: 700; letter-spacing: .02em;
  border: 1px solid var(--accent-line);
}
.avatar-sm { width: 26px; height: 26px; font-size: var(--t-xs); }
.avatar-lg { width: 40px; height: 40px; font-size: var(--t-md); }
.avatar-system { background: var(--surface-3); color: var(--ink-2);
                 border-color: var(--line); }

/* ---------------------------------------------------------------- misc */
.kv-list { display: grid; grid-template-columns: minmax(0,1fr); gap: .55rem; }
.kv { display: flex; align-items: baseline; justify-content: space-between;
      gap: var(--sp-3); font-size: var(--t-md); }
.kv .k { color: var(--ink-2); display: inline-flex; align-items: center;
         gap: .45rem; }
.kv .v { font-weight: 600; text-align: right; }
.kv .k svg { width: 15px; height: 15px; color: var(--ink-3); }

.divider { height: 1px; background: var(--line); border: 0; margin: var(--sp-4) 0; }

.empty {
  display: grid; justify-items: center; gap: var(--sp-2); text-align: center;
  padding: var(--sp-8) var(--sp-4); color: var(--ink-3);
}
.empty svg { width: 34px; height: 34px; opacity: .5; }
.empty .t { font-weight: 600; color: var(--ink-2); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%,
              var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%; animation: ph-shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes ph-shimmer { 0% { background-position: 100% 50% }
                        100% { background-position: 0 50% } }

.thumb {
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface); aspect-ratio: 17/22;
}
.thumb.is-selected { border-color: var(--brand-500); box-shadow: var(--ring); }

/* range legend â€” "1â€“400 | 401â€“417 | 418â€“500" */
.range-bar { display: flex; border-radius: var(--r-sm); overflow: hidden;
             border: 1px solid var(--line); }
.range-bar > span { padding: .5rem .35rem; text-align: center; font-size: var(--t-base);
  font-weight: 600; font-variant-numeric: tabular-nums; }
.range-done   { background: var(--ok-bg);     color: var(--ok); }
.range-check  { background: var(--warn-bg);   color: var(--warn); }
.range-todo   { background: var(--surface);   color: var(--ink);
                outline: 1.5px solid var(--brand-500); outline-offset: -1.5px; }

/* ---------------------------------------------------------------- toast */
.toast-host { position: fixed; z-index: 120; right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  display: grid; gap: var(--sp-2); max-width: min(420px, calc(100vw - 2*var(--gutter))); }
@media (max-width: 900px) {
  .toast-host { right: var(--gutter); left: var(--gutter);
                bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; }
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--r-md);
  background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border);
  box-shadow: var(--sh-md); font-size: var(--t-md); font-weight: 550;
  animation: ph-rise .24s var(--ease);
}
.toast.is-bad  { background: var(--danger-bg); color: var(--danger);
                 border-color: var(--danger-border); }
.toast.is-warn { background: var(--warn-bg); color: var(--warn);
                 border-color: var(--warn-border); }
.toast.is-info { background: var(--surface); color: var(--ink);
                 border-color: var(--line); }
.toast .x { margin-left: auto; background: none; border: 0; cursor: pointer;
            color: inherit; opacity: .6; padding: 0 2px; }
.toast .x:hover { opacity: 1; }
@keyframes ph-rise { from { opacity: 0; transform: translateY(8px) } }

/* ---------------------------------------------------------------- dialog / sheet */
dialog.modal {
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-lg);
  width: min(520px, calc(100vw - 2*var(--gutter)));
  max-height: calc(100dvh - 2*var(--gutter));
}
dialog.modal::backdrop { background: rgb(6 14 11 / .5); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.modal-body { padding: 0 var(--sp-5) var(--sp-4); display: grid; grid-template-columns: minmax(0,1fr); gap: var(--sp-4); }
.modal-foot { display: flex; gap: var(--sp-2); justify-content: flex-end;
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line);
  background: var(--surface-2); flex-wrap: wrap; }

/* bottom sheet on phones â€” the "Paper reloaded" flow in the mobile mockup */
@media (max-width: 720px) {
  dialog.modal.sheet {
    width: 100vw; max-width: 100vw; max-height: 92dvh;
    margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0; animation: ph-sheet .26s var(--ease);
  }
  dialog.modal.sheet .modal-head::before {
    content: ""; position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%); width: 42px; height: 4px;
    border-radius: var(--r-full); background: var(--line-2);
  }
  dialog.modal.sheet .modal-head { padding-top: var(--sp-6); position: relative; }
  dialog.modal.sheet .modal-foot { position: sticky; bottom: 0;
    padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); }
}
@keyframes ph-sheet { from { transform: translateY(100%) } }

/* ---- dropzone ----
   The file target on step 1 of the new print job wizard. A dashed edge is the
   one affordance a drop area needs and nothing else in the library carries it,
   so it is defined here rather than improvised in the view.

   It is a <label> with the file input inside: the label gives us the click for
   free, and the input stays in the DOM (clipped, not display:none) so keyboard
   users can still tab to it â€” :focus-within then draws the ring on the box they
   can actually see. */
.dropzone {
  position: relative;
  display: grid; justify-items: center; gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-5); text-align: center; cursor: pointer;
  background: var(--surface-2); color: var(--ink-2);
  border: 2px dashed var(--line-2); border-radius: var(--r-lg);
  transition: border-color var(--speed) var(--ease),
              background var(--speed) var(--ease),
              color var(--speed) var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-bg); }
.dropzone:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.dropzone input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* is-over is toggled by the view on dragenter/dragover and cleared on
   dragleave/drop â€” a drag needs a visible landing state, not just a cursor */
.dropzone.is-over {
  border-color: var(--brand-500); background: var(--accent-bg);
  color: var(--accent);
}
.dropzone-ico { width: 34px; height: 34px; color: var(--accent); }
.dropzone-t { font-size: var(--t-lg); font-weight: 650; color: var(--ink); }
.dropzone-sub { font-size: var(--t-base); color: var(--ink-3); }
.dropzone-link { color: var(--accent); font-weight: 600;
                 text-decoration: underline; }
@media (max-width: 720px) {
  .dropzone { padding: var(--sp-6) var(--sp-4); }
}
