/* Reference Case workspace — Direction D restyle.
   Every selector here is queried by the untouched solvyn-reference-case.js
   engine (tabs/panels/rail) or is the visual system for the artifact shelf,
   verify vectors and browser-first dialog it drives. Tokens are the page's
   own :root custom properties (--ink, --hair, --blue, --green, --sp1..4);
   they resolve at computed-value time regardless of stylesheet load order. */

.svp-workspace {
  --svp-fail: #B04E26;
  --svp-neutral: var(--ink2);
  position: relative;
  margin-top: 40px;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--raised);
  box-shadow: 0 1px 2px rgba(23,24,26,.04), 0 20px 48px rgba(23,24,26,.05);
}
.svp-passport { margin-top:24px; padding:18px 20px 0; border:1px solid var(--hair); border-radius:14px; background:var(--raised); }
.svp-passport-id { display:flex; flex-wrap:wrap; gap:7px 14px; align-items:center; font:500 10px "IBM Plex Mono",monospace; letter-spacing:.08em; text-transform:uppercase; color:var(--ink3); }
.svp-passport-id strong { color:var(--ink); font-size:12px; }
.svp-passport p { max-width:76ch; margin:14px 0 18px; font-size:15px; line-height:1.5; color:var(--ink); }
.svp-passport-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0 -20px; border-top:1px solid var(--hair); }
.svp-passport-facts div { min-width:0; padding:14px 16px 16px; border-right:1px solid var(--hair); }
.svp-passport-facts div:last-child { border-right:0; }
.svp-passport-facts dt { font:500 9.5px "IBM Plex Mono",monospace; letter-spacing:.1em; text-transform:uppercase; color:var(--ink3); }
.svp-passport-facts dd { margin:6px 0 0; font-size:12px; line-height:1.45; color:var(--ink2); }

/* ---------- spectrum hairline ---------- */
.svp-spectrum {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sp1), var(--sp2), var(--sp3), var(--sp4), var(--sp1));
  background-size: 240% 100%;
  animation: svp-spectrum-pan 16s ease-in-out infinite alternate;
}
@keyframes svp-spectrum-pan { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* ---------- filebar ---------- */
.svp-filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--hair);
}
.svp-file-identity { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.svp-file-kind { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.svp-file-identity strong { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svp-file-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.svp-file-meta span { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--hair2); border-radius: 999px; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .05em; color: var(--ink2); }

/* ---------- tabnav + rail ---------- */
.svp-tabnav.tab-rail-shell { position: relative; }

.svp-tabbar {
  display: flex;
  border-bottom: 1px solid var(--hair);
  background: var(--subtle);
}
.svp-tabbar[role="tablist"] button[role="tab"] {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 15px 14px;
  border: 0;
  border-right: 1px solid var(--hair);
  background: transparent;
  color: var(--ink2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.003em;
  text-align: center;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.svp-tabbar button[role="tab"]:last-child { border-right: 0; }
.svp-tabbar button[role="tab"] { white-space: nowrap; }
.svp-tab-mobile { display: none; }
.svp-tabbar button[role="tab"]:hover { color: var(--ink); }
.svp-tabbar button[role="tab"][aria-selected="true"] { color: var(--ink); background: var(--raised); }
.svp-tabbar button[role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--blue);
}

/* ---------- body: full-width panels ---------- */
.svp-body { display:block; }

.svp-panels { min-width: 0; }
.svp-panel { padding: 32px 34px 36px; }
.svp-panel[hidden] { display: none; }
.svp-panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.svp-panel-head > div > span { display: block; margin-bottom: 7px; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.svp-panel-head h3 { max-width: 44ch; margin: 0; font-size: clamp(19px,2vw,23px); font-weight: 500; line-height: 1.22; letter-spacing: -.015em; }
.svp-panel-chip { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 27px; padding: 0 11px; border: 1px solid var(--hair2); border-radius: 999px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: .04em; color: var(--ink2); white-space: nowrap; }

/* ---------- record: fixed timeline ---------- */
.svp-timeline { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.svp-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--raised);
}
.svp-timeline li::after { content: ""; position: absolute; left: 15px; top: 100%; width: 1px; height: 6px; background: var(--hair2); }
.svp-timeline li:last-child::after { display: none; }
.svp-timeline li.is-terminal { border-color: color-mix(in srgb, var(--green) 30%, var(--hair)); background: color-mix(in srgb, var(--green) 6%, var(--raised)); }
.svp-step { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--hair2); border-radius: 999px; }
.svp-step-label { font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500; color: var(--ink3); }
.svp-timeline strong { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.svp-timeline small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink2); }

/* ---------- claim classes (record + evidence) ---------- */
.svp-claim {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
}
.svp-claim.observed { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 24%, transparent); }
.svp-claim.derived { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); border-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.svp-claim.unknown { color: var(--svp-neutral); background: var(--subtle); border-color: var(--hair2); }

/* ---------- evidence & boundary ---------- */
.svp-claim-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.svp-claim-grid article { min-width: 0; padding: 16px; border: 1px solid var(--hair); border-radius: 12px; background: var(--raised); }
.svp-claim-grid article > strong { display: block; margin: 12px 0 6px; font-size: 13.5px; font-weight: 600; }
.svp-claim-grid article > p { margin: 0; font-size: 12.5px; line-height: 1.52; color: var(--ink2); }

.svp-boundary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.svp-boundary > div { padding: 16px; border: 1px solid var(--hair); border-radius: 12px; background: var(--subtle); }
.svp-boundary span { display: block; margin-bottom: 8px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--ink3); }
.svp-boundary p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink2); }

/* ---------- verify (Task 8 content; contract styled here) ---------- */
.svp-vector-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.svp-vector-tabs button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--hair2);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.svp-vector-tabs button:hover { border-color: var(--ink3); color: var(--ink); }
.svp-vector-tabs button.is-active { color: #fff; border-color: var(--ink); background: var(--ink); }

.svp-verdict { padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--green) 26%, transparent); border-left: 3px solid var(--green); border-radius: 12px; background: color-mix(in srgb, var(--green) 8%, var(--raised)); }
.svp-verdict[data-svp-verdict-tone="fail"] { border-color: color-mix(in srgb, var(--svp-fail) 26%, transparent); border-left-color: var(--svp-fail); background: color-mix(in srgb, var(--svp-fail) 8%, var(--raised)); }
.svp-verdict[data-svp-verdict-tone="neutral"] { border-color: var(--hair2); border-left-color: var(--svp-neutral); background: var(--subtle); }
.svp-verdict > span { display: block; margin-bottom: 5px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--green); }
.svp-verdict[data-svp-verdict-tone="fail"] > span { color: var(--svp-fail); }
.svp-verdict[data-svp-verdict-tone="neutral"] > span { color: var(--svp-neutral); }
.svp-verdict strong { display: block; font-size: 14.5px; font-weight: 600; }
.svp-verdict p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink2); }

.svp-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.svp-checks > div { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 11px; align-items: start; padding: 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--raised); }
.svp-check { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-align: center; white-space: nowrap; }
.svp-check.pass { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.svp-check.fail { color: var(--svp-fail); background: color-mix(in srgb, var(--svp-fail) 12%, transparent); }
.svp-check.neutral { color: var(--svp-neutral); background: var(--hair); }
.svp-checks p { margin: 0; }
.svp-checks strong { display: block; font-size: 12px; font-weight: 600; }
.svp-checks small { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.4; color: var(--ink3); }
.svp-verify-note { margin: 14px 0 0; max-width: 74ch; font-size: 12px; line-height: 1.55; color: var(--ink2); }
.svp-verify-note strong { color: var(--ink); font-weight: 600; }

/* ---------- format ---------- */
.svp-format-layout { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(0,1.3fr); gap: 20px; }
.svp-format-object { display: grid; gap: 6px; align-content: start; padding: 16px; border: 1px solid var(--night-hair); border-radius: 12px; background: var(--night); }
.svp-format-object > span { color: #6B7280; font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.svp-format-object code { padding-left: 16px; color: var(--night-ink); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.svp-format-copy > p { margin: 0 0 16px; max-width: 56ch; font-size: 13px; line-height: 1.58; color: var(--ink2); }
.svp-format-layers { display: grid; gap: 10px; }
.svp-format-layers > div { padding-top: 10px; border-top: 1px solid var(--hair2); }
.svp-format-layers strong { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.svp-format-layers span { display: block; font-size: 11.5px; line-height: 1.5; color: var(--ink2); }
.svp-format-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.svp-footer { padding: 20px 24px 24px; border-top: 1px solid var(--hair); background: var(--subtle); }

/* ---------- artifact shelf ---------- */
.svp-artifact-shelf { margin-top: 22px; }
.svp-artifact-shelf-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; margin-bottom: 16px; }
.svp-artifact-eyebrow { display: block; margin-bottom: 5px; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.svp-artifact-shelf-head strong { font-size: 15px; font-weight: 600; letter-spacing: -.008em; }
.svp-artifact-shelf-head p { max-width: 42ch; font-size: 13px; line-height: 1.5; color: var(--ink2); }

.svp-artifact-grid { --artifact-control-height:38px; --artifact-primary-row:38px; --artifact-secondary-row:24px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; border:1px solid var(--hair); border-radius:12px; overflow:hidden; }
.svp-artifact-card { display:grid; grid-template-rows:auto auto minmax(0,1fr) calc(var(--artifact-primary-row) + var(--artifact-secondary-row) + 8px); gap:6px; min-width:0; padding:16px; border:0; border-right:1px solid var(--hair); border-radius:0; background:var(--raised); }
.svp-artifact-card:last-child { border-right:0; }
.svp-artifact-card-primary { border-color: var(--hair2); box-shadow: 0 1px 2px rgba(23,24,26,.05); }
.svp-artifact-card-top { display: flex; justify-content: space-between; gap: 8px; font-family: "IBM Plex Mono", monospace; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.svp-artifact-audience, .svp-artifact-extension { white-space: nowrap; }
.svp-artifact-card h4 { margin: 2px 0 0; font-size: 14px; font-weight: 600; letter-spacing: -.008em; }
.svp-artifact-card > p { margin:0; font-size:12.5px; line-height:1.52; color:var(--ink2); }
.svp-artifact-card code { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; }
.svp-artifact-card-actions { display:grid; grid-template-rows:var(--artifact-primary-row) var(--artifact-secondary-row); align-items:center; gap:8px; margin:0; padding:0; text-align:center; }
.svp-artifact-card-actions .button { align-self:end; justify-self:center; display:inline-flex; align-items:center; justify-content:center; width:max-content; min-height:var(--artifact-control-height); height:var(--artifact-control-height); padding:0 14px; line-height:1.4; white-space:nowrap; }
.svp-artifact-text-link { align-self:start; justify-self:center; display:inline-flex; align-items:center; justify-content:center; min-height:var(--artifact-secondary-row); font-family:inherit; font-size:12.5px; font-weight:500; line-height:1.4; color:var(--blue); text-align:center; text-decoration:none; }
.svp-artifact-card button.svp-artifact-text-link { appearance:none; -webkit-appearance:none; min-height:var(--artifact-secondary-row); margin:0; padding:0; border:0; background:transparent; color:var(--blue); font-family:inherit; font-size:12.5px; font-weight:500; line-height:1.4; text-align:center; cursor:pointer; }
.svp-artifact-text-link:hover { text-decoration: underline; }
.svp-package-drawer { width:min(720px,calc(100vw - 40px)); max-height:min(720px,calc(100vh - 40px)); margin:auto; padding:22px; border:1px solid var(--hair2); border-radius:14px; background:var(--raised); box-shadow:0 24px 72px rgba(14,14,16,.24); overflow:auto; }
.svp-package-drawer::backdrop { background:rgba(14,14,16,.48); backdrop-filter:blur(2px); }
.svp-package-drawer-head { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.svp-package-drawer-head strong { font-size:14px; }
.svp-package-drawer-head button { width:36px; height:36px; border:1px solid var(--hair2); border-radius:999px; background:var(--raised); font-size:18px; cursor:pointer; }
.svp-package-drawer > p { margin:8px 0 16px; color:var(--ink2); font-size:12.5px; line-height:1.5; }
.svp-package-groups { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.svp-package-groups div { padding:12px; border:1px solid var(--hair); border-radius:8px; background:var(--raised); }
.svp-package-groups strong,.svp-package-groups span { display:block; }
.svp-package-groups strong { font-size:12px; }
.svp-package-groups span { margin-top:5px; color:var(--ink2); font:10.5px/1.45 "IBM Plex Mono",monospace; overflow-wrap:anywhere; }
.svp-package-all { appearance:none; margin-top:14px; padding:0; border:0; background:transparent; color:var(--blue); font-family:inherit; font-size:12.5px; font-weight:500; line-height:1.4; cursor:pointer; }
.svp-package-drawer pre { margin:10px 0 0; padding:12px; overflow:auto; border:1px solid var(--hair); background:var(--raised); font:11px/1.45 "IBM Plex Mono",monospace; }

/* ---------- browser-first artifact dialog ---------- */
html.svp-dialog-open { overflow: hidden; }
.svp-artifact-dialog {
  width: min(680px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 64px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--raised);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(23,24,26,.24);
}
.svp-artifact-dialog::backdrop { background: rgba(14,14,16,.5); backdrop-filter: blur(2px); }
.svp-artifact-dialog-shell { display: flex; flex-direction: column; max-height: min(720px, calc(100vh - 64px)); }
.svp-artifact-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--hair); }
.svp-artifact-dialog-role { display: block; margin-bottom: 4px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.svp-artifact-dialog-head h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.svp-artifact-dialog-head p { margin: 6px 0 0; max-width: 48ch; font-size: 12.5px; line-height: 1.5; color: var(--ink2); }
.svp-artifact-dialog-close { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--hair2); border-radius: 999px; background: var(--raised); color: var(--ink2); font-size: 16px; line-height: 1; cursor: pointer; }
.svp-artifact-dialog-close:hover { color: var(--ink); border-color: var(--ink3); }
.svp-artifact-dialog-status { padding: 16px 22px; font-size: 13px; color: var(--ink2); }
.svp-artifact-dialog-status.is-error { color: var(--svp-fail); }
.svp-artifact-dialog-content { min-height: 0; overflow: auto; padding: 18px 22px 22px; }

.svp-solv-readable { display: grid; gap: 16px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--hair); }
.svp-solv-readable-main > span { display: block; margin-bottom: 6px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.svp-solv-readable-main > strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; }
.svp-solv-readable-main > p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink2); }
.svp-solv-readable-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.svp-solv-readable-grid dt { font-family: "IBM Plex Mono", monospace; font-size: 9.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--ink3); }
.svp-solv-readable-grid dd { margin: 3px 0 0; font-size: 12.5px; color: var(--ink); word-break: break-word; }

.svp-artifact-source-shell { border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; }
.svp-artifact-source-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--hair); background: var(--subtle); }
.svp-artifact-source-toolbar span { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); }
.svp-artifact-source-toolbar button { border: 1px solid var(--hair2); border-radius: 999px; padding: 5px 11px; background: var(--raised); color: var(--ink2); font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer; }
.svp-artifact-source-toolbar button:hover { color: var(--ink); border-color: var(--ink3); }
.svp-artifact-source-shell pre { margin: 0; max-height: 320px; overflow: auto; padding: 14px 16px; background: var(--subtle); }
.svp-artifact-source-shell code { font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

.svp-artifact-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 16px 22px; border-top: 1px solid var(--hair); }
.svp-artifact-dialog-foot > p { margin: 0; max-width: 40ch; font-size: 11.5px; line-height: 1.45; color: var(--ink3); }
.svp-artifact-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }

/* ---------- shared button primitives used inside this workspace ---------- */
.svp-workspace .button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.svp-workspace .button:active { transform: scale(.97); }
.svp-workspace .button-primary { background: var(--ink); color: var(--bg); }
.svp-workspace .button-primary:hover { background: #2E2F33; }
.svp-workspace .button-secondary { border-color: var(--hair2); color: var(--ink); background: var(--raised); }
.svp-workspace .button-secondary:hover { border-color: var(--ink3); }

/* ---------- live region ---------- */
.svp-live-region { 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; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .svp-panel { scroll-margin-top: 124px; }
  .svp-claim-grid { grid-template-columns: 1fr 1fr; }
  .svp-format-layout { grid-template-columns: 1fr; }
  .svp-artifact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .svp-package-groups { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .svp-passport-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .svp-passport-facts div:nth-child(2) { border-right:0; }
  .svp-passport-facts div:nth-child(n+3) { border-top:1px solid var(--hair); }
  .svp-workspace { border-radius: 14px; }
  .svp-filebar { padding: 16px 18px 14px; }
  .svp-file-identity { flex-direction: column; gap: 3px; }

  .svp-tabnav.tab-rail-shell { padding:0; }
  .svp-tabbar { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 40px; scrollbar-width: none; }
  .svp-tabbar::-webkit-scrollbar { display: none; }
  .svp-tabbar[role="tablist"] button[role="tab"] { flex:1 1 0; min-width:0; scroll-snap-align:start; border-right:1px solid var(--hair); font-size:12px; padding-inline:6px; }
  .svp-tab-desktop { display:none; }
  .svp-tab-mobile { display:inline; }

  .svp-panel { padding: 24px 18px 28px; }
  .svp-panel-head { flex-direction: column; }
  .svp-timeline li { grid-template-columns: 30px minmax(0,1fr); }
  .svp-timeline .svp-claim { grid-column: 2; width: max-content; margin-top: 6px; }
  .svp-claim-grid, .svp-boundary, .svp-checks, .svp-format-layout, .svp-artifact-grid { grid-template-columns: 1fr; }
  .svp-artifact-card { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:14px; row-gap:5px; padding:14px; }
  .svp-artifact-card-top { grid-column:1/-1; }
  .svp-artifact-card h4 { align-self:end; }
  .svp-artifact-card-actions { grid-column:2; grid-row:2 / span 3; align-self:center; width:max-content; }
  .svp-artifact-card-actions .button { min-height:44px; }
  .svp-artifact-card .svp-artifact-text-link { min-height:40px; display:inline-flex; align-items:center; }
  .svp-package-groups { grid-template-columns:1fr; }
  .svp-artifact-dialog-foot { flex-direction: column; align-items: stretch; }
  .svp-artifact-dialog-actions { margin-left: 0; }
  .svp-artifact-dialog-actions .button { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   ACCESSIBILITY & ADAPTATION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .svp-spectrum { animation: none; }
}
@media (forced-colors: active) {
  .svp-spectrum { background: Highlight; }
  .svp-claim, .svp-check, .svp-artifact-card, .svp-timeline li { border-color: CanvasText; }
}

/* Touch targets on phones (FS §21): 44px where practical */
@media (max-width: 640px) {
  .svp-workspace .button, .svp-vector-tabs button { min-height: 44px; }
  .svp-artifact-text-link { display: inline-flex; align-items: center; min-height: 40px; }
}
