/* ImportFlow brand foundation; role-specific layout and report states stay local. */
:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --surface: #fff;
  --inset: #f6f7f2;
  --hover: #edf1ea;
  --text: #1d2922;
  --muted: #56645b;
  --border: #c8d1c8;
  --control-border: #748a7b;
  --primary: #245a43;
  --primary-hover: #194832;
  --on-primary: #fff;
  --focus: #176443;
  --warning: #825900;
  --danger: #a33328;
  --radius: 6px;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --motion: 140ms ease-out;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}
.empty-state[hidden],
#report[hidden] {
  display: none;
}
body {
  margin: 0;
}
button,
textarea {
  font: inherit;
}
button {
  touch-action: manipulation;
}
button,
a,
textarea,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}
::selection {
  background: var(--text);
  color: var(--bg);
}
.button,
a,
summary {
  transition:
    background-color var(--motion),
    color var(--motion);
}
.shell {
  width: min(100% - 4rem, 1280px);
  margin-inline: auto;
}
.masthead {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-block: 0.75rem;
}
.brand {
  font-size: 1rem;
  font-weight: 600;
}
.brand-divider {
  color: var(--muted);
  margin-inline: 0.625rem;
  font-weight: 400;
}
.tool-name {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 400;
}
.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.intro {
  padding-block: 1.5rem;
}
.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
}
h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}
.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 65ch;
}
.privacy {
  margin: 0;
  max-width: 90ch;
  font-size: 0.875rem;
}
.privacy strong {
  font-weight: 600;
}
.local-mark {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--text);
  margin-right: 0.5rem;
}
.scope-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  border-left: 2px solid var(--border);
  padding: 0.125rem 0 0.125rem 1rem;
  margin-top: 1rem;
  max-width: 100ch;
  color: var(--muted);
  font-size: 0.875rem;
}
.scope-notice strong {
  color: var(--text);
  font-weight: 500;
}
.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.profile code {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}
.profile-note {
  margin-left: 0.625rem;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  align-items: start;
}
.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface);
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.panel-heading > div {
  min-width: 0;
}
.panel-heading .eyebrow {
  margin-bottom: 0.25rem;
}
h2 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}
.button.secondary {
  background: var(--surface);
  color: var(--text);
}
.button.primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  padding-inline: 1rem;
}
.button.secondary:hover:not(:disabled) {
  background: var(--hover);
}
.button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button:disabled {
  color: var(--muted);
  background: var(--inset);
  border-color: var(--border);
  cursor: not-allowed;
}
.editor-label {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}
label {
  font-weight: 500;
}
.muted,
.helper {
  color: var(--muted);
}
.helper {
  font-size: 0.8125rem;
  margin: 0.5rem 0 0.875rem;
  line-height: 1.6;
}
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 14rem;
  max-height: 65vh;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--inset);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.8;
  tab-size: 2;
}
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.input-note {
  min-height: 2.6rem;
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.shortcut {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}
.result-panel {
  display: flex;
  flex-direction: column;
}
.result-summary {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 70ch;
}
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 14rem;
  padding: 1rem;
  color: var(--muted);
}
.empty-state p {
  margin: 0.375rem 0;
}
.empty-symbol {
  font-family: var(--mono);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
#report {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--inset);
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  overscroll-behavior: contain;
  max-height: 32rem;
  width: 100%;
  tab-size: 2;
}
[data-outcome="outside_envelope_observed"] #result-title,
[data-outcome="error"] #result-title {
  color: var(--danger);
}
[data-outcome="more_evidence_required"] #result-title,
[data-outcome="refused"] #result-title {
  color: var(--warning);
}
.status {
  min-height: 1.5rem;
  margin: 1rem 0 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.reading-guide {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.reading-guide h2 {
  font-size: 1rem;
}
.outcomes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1rem 0 0;
}
.outcomes dt {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.outcomes dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 2rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.skip-link {
  position: absolute;
  top: -10rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  z-index: 1;
}
.skip-link:focus {
  top: 1rem;
}

@media (max-width: 64rem) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .outcomes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  .shell {
    width: calc(100% - 2rem);
  }
  .masthead {
    gap: 0.75rem;
  }
  .panel {
    padding: 1rem;
  }
  .panel-heading {
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .panel-heading h2 {
    font-size: 1rem;
  }
  textarea {
    font-size: 1rem;
  }
  .profile-note {
    width: 100%;
    margin-left: 0;
  }
  .shortcut {
    margin-left: 0;
  }
  .outcomes {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
  .outcomes dt {
    margin-bottom: 0.25rem;
  }
}

@media (forced-colors: active) {
  .button,
  .badge,
  .panel,
  textarea,
  #report {
    border: 1px solid CanvasText;
  }
  .local-mark {
    background: CanvasText;
  }
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  width: 100%;
}
a {
  color: var(--text);
  text-underline-offset: 0.2em;
}

[hidden] {
  display: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.file-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background: var(--inset);
}
.file-zone.drag-active {
  border-style: solid;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.file-zone > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.file-zone strong {
  font-size: 0.875rem;
  font-weight: 500;
}
.file-state {
  margin: 0.125rem 0 0;
  overflow-wrap: anywhere;
}
.file-button {
  cursor: pointer;
}
.discovery {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.discovery-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.discovery-heading > span {
  font-size: 0.75rem;
  text-align: right;
}
.target-list {
  display: grid;
  gap: 0.5rem;
  max-height: 24rem;
  overflow: auto;
  overscroll-behavior: contain;
}
.target-item {
  min-width: 0;
}
.target-button {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.875rem;
  background: var(--inset);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.target-button:hover:not(:disabled),
.target-button.selected {
  background: var(--hover);
}
.target-button.selected {
  border-color: var(--primary);
}
.target-button:disabled {
  cursor: wait;
  opacity: 0.72;
}
.target-button code {
  max-width: 100%;
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.target-meta {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}
.report-view {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--inset);
  overflow: hidden;
}
.report-section {
  padding: 0.875rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.report-section:first-child {
  border-top: 0;
}
.report-section h3 {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.report-section-body {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
p.report-section-body {
  font-family: inherit;
}
.report-section[data-section="RESULT"] .report-section-body {
  font-weight: 600;
}
.raw-report-details {
  margin-top: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.raw-report-details summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}
.raw-report-details[open] summary {
  border-bottom: 1px solid var(--border);
}
.raw-report-details #report {
  border: 0;
  border-radius: 0;
  max-height: 28rem;
}
.report-share-note {
  margin-bottom: 0;
}

@media (max-width: 36rem) {
  .file-zone,
  .discovery-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .file-button {
    width: 100%;
  }
  .discovery-heading > span {
    text-align: left;
  }
  .target-list {
    max-height: none;
  }
}

.decision-facts {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.decision-facts li {
  padding-block: 0.375rem;
}
.decision-facts li + li {
  margin-top: 0.45rem;
}
.fact-basis {
  font-weight: 600;
}
.decision-section[data-decision-section="DECISION"] .decision-facts,
.decision-section[data-decision-section="COVERAGE"] .decision-facts {
  list-style: none;
  padding-left: 0;
}
#technical-evidence .report-section {
  padding-top: 1rem;
}

[hidden] {
  display: none;
}
a {
  color: var(--primary);
  text-underline-offset: 0.25em;
}
.brand {
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.035em;
  font-size: 1.125rem;
}
.masthead nav,
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
}
.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.intro {
  padding-block: 2rem 1.5rem;
}
h1 {
  max-width: 32ch;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.lede {
  max-width: 92ch;
  margin-bottom: 0.75rem;
}
.privacy {
  color: var(--text);
  font-size: 0.8125rem;
}
.workspace {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.5rem;
}
.panel {
  padding: 1.5rem;
}
.button,
textarea,
.raw-report-details,
.target-button {
  border-radius: var(--radius);
}
textarea {
  min-height: 12rem;
  font-size: 0.875rem;
}
.empty-state {
  min-height: 16rem;
  text-align: center;
  padding: 2rem;
  border-style: dashed;
}
.report-section {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 1.25rem 0;
}
.report-section h3 {
  font-size: 0.875rem;
  letter-spacing: 0.015em;
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.decision-facts {
  font-size: 0.875rem;
  list-style: none;
  padding: 0;
}
.fact-basis {
  font-size: 0.6875rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.raw-report-details {
  overflow: visible;
}
.raw-report-details summary {
  min-height: 44px;
  color: var(--text);
  overflow-wrap: anywhere;
}
#technical-evidence .report-section {
  margin-inline: 1rem;
}
.commercial-bridge {
  max-width: 52rem;
  border-top: 1px solid var(--border);
  margin: 3rem auto;
  padding: 2rem 0;
}
.commercial-bridge > p {
  max-width: 66ch;
}
.commercial-bridge a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.reading-guide {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.file-zone:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}
.target-button code,
.report-section-body,
.result-summary,
.commercial-bridge {
  overflow-wrap: anywhere;
}

@media (max-width: 68rem) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .empty-state {
    min-height: 7rem;
  }
}
@media (max-width: 36rem) {
  .shell {
    width: calc(100% - 2rem);
  }
  .intro {
    padding-block: 1.5rem;
  }
  .panel {
    padding: 1rem;
  }
  .panel-heading {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .privacy {
    line-height: 1.8;
  }
  textarea {
    font-size: 1rem;
  }
  .commercial-bridge {
    padding-inline: 0.25rem;
  }
  footer {
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  .button,
  a,
  summary {
    transition: none;
    animation: none;
    scroll-behavior: auto;
  }
}

.report-section h3 {
  text-transform: none;
}
.result-panel {
  scroll-margin-top: 1rem;
}

h1 {
  max-width: none;
  font-size: clamp(1.75rem, 2.5vw, 2rem);
}
textarea {
  height: 13rem;
  min-height: 10rem;
}
.input-note {
  min-height: 0;
}
.report-view {
  background: transparent;
  border: 0;
  border-radius: 0;
}
.report-section {
  padding-inline: 0.25rem;
}
@media (min-width: 68rem) {
  .workspace {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }
}

@media (max-width: 36rem) {
  .masthead nav a[href="#guide-title"] {
    display: none;
  }
  .intro {
    padding-block: 1rem;
  }
  .intro > .eyebrow {
    display: none;
  }
  .intro h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  .intro .lede {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }
  .privacy {
    font-size: 0.75rem;
    line-height: 1.6;
  }
  .input-panel > .panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .input-panel h2 {
    font-size: 1rem;
  }
  .file-zone {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .file-button {
    width: auto;
  }
  .file-state {
    font-size: 0.75rem;
    line-height: 1.4;
  }
}

.button.secondary,
textarea,
.target-button {
  border-color: var(--control-border);
}
.target-button.selected {
  border-color: var(--primary);
}
.eyebrow {
  color: var(--primary);
}
