:root {
  color-scheme: light;
  --paper: #fff;
  --canvas: #f1f5f6;
  --ink-950: #071c24;
  --ink-900: #102f3b;
  --ink-700: #304f5a;
  --ink-600: #526d76;
  --ink-500: #71868d;
  --ink-300: #b7c8cd;
  --ink-200: #d3dfe2;
  --ink-100: #e7edef;
  --ink-050: #f6f9f9;
  --teal-800: #075b54;
  --teal-700: #086a61;
  --teal-600: #087b70;
  --teal-100: #ccece7;
  --teal-050: #eef9f7;
  --amber-800: #77420a;
  --amber-700: #9a590e;
  --amber-100: #f7dfb6;
  --amber-050: #fff8ea;
  --red-800: #7c2d32;
  --red-700: #a53f46;
  --red-100: #f3ccd0;
  --red-050: #fdf2f3;
  --blue-700: #256187;
  --blue-100: #d4e7f3;
  --shadow-sm: 0 3px 12px rgb(16 47 59 / 7%);
  --shadow-lg: 0 22px 64px rgb(7 28 36 / 18%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --content: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 10% -10%, rgb(8 123 112 / 9%), transparent 34rem),
    linear-gradient(180deg, #f8fafa 0, var(--canvas) 32rem);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
label[for],
a {
  -webkit-tap-highlight-color: transparent;
}

button,
.file-picker {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 0;
  color: var(--ink-900);
  letter-spacing: -0.025em;
  line-height: 1.17;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.35rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.08rem; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  color: var(--paper);
  background: var(--ink-900);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  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;
}

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  color: var(--paper);
  background: rgb(16 47 59 / 97%);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  box-shadow: 0 3px 18px rgb(7 28 36 / 16%);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  width: min(calc(100% - 40px), var(--content));
  min-height: 70px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  color: var(--paper);
  text-decoration: none;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 39px;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 9px;
}

.brand-mark span {
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.brand-mark span:first-child {
  color: var(--ink-900);
  background: var(--paper);
}

.brand-mark span:last-child {
  color: var(--paper);
  background: var(--teal-600);
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  color: #bcd0d5;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.privacy-badge,
.account-name {
  display: inline-flex;
  align-items: center;
  color: #d4e4e7;
  font-size: 0.74rem;
  gap: 7px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #63dbc8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(99 219 200 / 13%);
}

.icon-button,
.icon-only-button {
  display: inline-flex;
  min-height: 38px;
  padding: 7px 11px;
  align-items: center;
  justify-content: center;
  color: inherit;
  background: transparent;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 720;
  text-decoration: none;
  gap: 7px;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgb(255 255 255 / 9%);
  border-color: rgb(255 255 255 / 36%);
}

.icon-only-button {
  width: 40px;
  padding: 0;
  color: var(--ink-700);
  background: var(--paper);
  border-color: var(--ink-200);
  font-size: 1.3rem;
}

.page-shell {
  width: min(calc(100% - 40px), var(--content));
  padding: 46px 0 90px;
  margin: 0 auto;
}

.panel {
  background: rgb(255 255 255 / 96%);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.input-panel,
.settings-panel,
.result-section,
.filter-panel,
.error-panel {
  padding: clamp(22px, 4vw, 34px);
}

.input-panel {
  border-top: 4px solid var(--teal-600);
}

.section-heading {
  display: flex;
  padding-bottom: 21px;
  margin-bottom: 24px;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink-100);
  gap: 28px;
}

.section-heading > p {
  max-width: 570px;
  margin-bottom: 0;
  color: var(--ink-600);
  font-size: 0.84rem;
  text-align: right;
}

.step-label,
.eyebrow,
.section-index {
  margin-bottom: 5px;
  color: var(--teal-700);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.upload-card {
  min-width: 0;
  padding: 22px;
  background: var(--ink-050);
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-md);
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.upload-card.is-dragover {
  background: var(--teal-050);
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgb(8 123 112 / 9%);
}

.upload-card.is-readonly .file-picker {
  display: none;
}

.upload-card legend {
  padding: 0 6px;
  color: var(--ink-900);
  font-size: 0.94rem;
  font-weight: 800;
}

.compact-upload {
  min-height: 0;
  background: var(--paper);
}

.field-help {
  margin: 0 0 14px;
  color: var(--ink-600);
  font-size: 0.76rem;
  line-height: 1.5;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-picker {
  display: inline-flex;
  min-height: 62px;
  padding: 11px 16px;
  align-items: center;
  color: var(--ink-900);
  background: var(--paper);
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgb(16 47 59 / 5%);
  gap: 12px;
}

.file-picker:hover,
.file-input:focus-visible + .file-picker {
  background: var(--teal-050);
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgb(8 123 112 / 10%);
}

.primary-picker {
  width: min(100%, 480px);
}

.compact-picker {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.picker-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  color: var(--paper);
  background: var(--teal-700);
  border-radius: 9px;
  font-size: 0.66rem;
  font-weight: 850;
  place-items: center;
}

.file-picker > span:last-child {
  display: grid;
}

.file-picker small {
  color: var(--ink-500);
  font-size: 0.72rem;
}

.selected-file,
.file-list-wrap {
  margin-top: 14px;
}

.empty-file {
  color: var(--ink-500);
  font-size: 0.76rem;
}

.configuration-warning {
  color: var(--amber-800);
}

.file-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.file-item {
  display: flex;
  min-height: 52px;
  padding: 9px 11px;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  gap: 12px;
}

.file-meta {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.file-position {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 850;
  place-items: center;
}

.batch-file-summary {
  margin: 9px 0 0;
  color: var(--ink-600);
  font-size: 0.7rem;
  font-weight: 720;
  text-align: right;
}

.file-meta strong,
.file-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta strong {
  color: var(--ink-900);
  font-size: 0.78rem;
}

.file-meta span {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.remove-file,
.remove-rule-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--red-700);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  place-items: center;
}

.remove-file:hover,
.remove-rule-button:hover {
  background: var(--red-050);
}

.form-actions,
.report-actions {
  display: flex;
  padding-top: 20px;
  margin-top: 22px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--ink-100);
  gap: 20px;
}

.form-actions p,
.report-actions p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-600);
  font-size: 0.78rem;
}

.form-actions p strong,
.form-actions p span {
  display: block;
}

.form-actions p strong {
  color: var(--ink-900);
  font-size: 0.85rem;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 43px;
  padding: 9px 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 780;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
  gap: 8px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: var(--paper);
  background: var(--teal-700);
  border-color: var(--teal-700);
}

.button-primary:hover:not(:disabled) {
  background: var(--teal-800);
  border-color: var(--teal-800);
}

.button-secondary {
  color: var(--teal-700);
  background: var(--paper);
  border-color: var(--teal-600);
}

.button-secondary:hover:not(:disabled) {
  background: var(--teal-050);
}

.button-quiet {
  color: var(--ink-700);
  background: transparent;
  border-color: var(--ink-200);
}

.button-quiet:hover:not(:disabled) {
  background: var(--ink-050);
  border-color: var(--ink-300);
}

.button-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgb(255 255 255 / 36%);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .button-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  padding: 12px 14px;
  color: var(--ink-700);
  background: var(--ink-050);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.alert-error {
  color: var(--red-800);
  background: var(--red-050);
  border-color: var(--red-100);
}

.alert-success {
  color: var(--teal-800);
  background: var(--teal-050);
  border-color: var(--teal-100);
}

.form-message {
  margin-top: 18px;
}

.settings-panel {
  margin-top: 20px;
  border-top: 4px solid var(--teal-600);
}

.settings-heading {
  align-items: start;
}

.settings-intro {
  max-width: 880px;
  margin-bottom: 24px;
  color: var(--ink-600);
  font-size: 0.86rem;
}

.settings-card {
  display: grid;
  padding: 18px;
  margin-bottom: 22px;
  grid-template-columns: minmax(220px, 0.7fr) minmax(440px, 1.3fr);
  align-items: start;
  background: var(--teal-050);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-md);
  gap: 22px;
}

.settings-card h3 {
  margin: 0;
}

.settings-card .settings-intro {
  margin: 8px 0 0;
  font-size: 0.79rem;
}

.settings-actions {
  display: flex;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.data-table th,
.data-table td {
  padding: 12px 11px;
  vertical-align: top;
  border-bottom: 1px solid var(--ink-100);
  text-align: left;
}

.data-table thead th {
  color: var(--ink-600);
  background: var(--ink-050);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table thead th:first-child {
  border-radius: 7px 0 0 7px;
}

.data-table thead th:last-child {
  border-radius: 0 7px 7px 0;
}

.data-table tbody tr:hover {
  background: var(--ink-050);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom-color: transparent;
}

.quality-rules-table-wrap {
  min-width: 0;
}

.quality-rules-table select,
.quality-rules-table input[type="text"] {
  width: 100%;
  min-width: 150px;
  padding: 8px 9px;
  color: var(--ink-900);
  background: var(--paper);
  border: 1px solid var(--ink-300);
  border-radius: 6px;
  font-size: 0.74rem;
}

.quality-rules-table th:nth-child(3),
.quality-rules-table td:nth-child(3) {
  width: 68px;
  text-align: center;
}

.empty-table-cell {
  padding: 28px !important;
  color: var(--ink-500);
  text-align: center !important;
}

.analysis-status {
  display: flex;
  padding: 18px 22px;
  margin-top: 20px;
  align-items: center;
  color: var(--paper);
  background: var(--ink-900);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  gap: 15px;
}

.analysis-status strong,
.analysis-status span {
  display: block;
}

.analysis-status strong {
  font-size: 0.84rem;
}

.analysis-status span {
  color: #c4d7db;
  font-size: 0.74rem;
}

.loader {
  display: flex;
  align-items: center;
  gap: 4px;
}

.loader span {
  width: 7px;
  height: 7px;
  background: #6fd9ca;
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: 140ms; }
.loader span:nth-child(3) { animation-delay: 280ms; }

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.error-panel {
  display: grid;
  margin-top: 20px;
  grid-template-columns: auto 1fr;
  border-color: var(--red-100);
  gap: 18px;
}

.error-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  color: var(--paper);
  background: var(--red-700);
  border-radius: 50%;
  font-weight: 850;
  place-items: center;
}

.error-panel p,
.error-panel ul {
  color: var(--ink-700);
  font-size: 0.8rem;
}

.error-panel ul {
  padding-left: 20px;
}

.error-panel details {
  margin: 12px 0;
  color: var(--ink-600);
  font-size: 0.74rem;
}

.error-panel pre {
  max-height: 220px;
  padding: 10px;
  overflow: auto;
  background: var(--ink-050);
  white-space: pre-wrap;
}

.results {
  padding-top: 38px;
}

.results-title-row {
  display: flex;
  margin-bottom: 20px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.results-title-row p:last-child {
  margin: 6px 0 0;
  color: var(--ink-600);
  font-size: 0.78rem;
}

.result-status {
  display: inline-flex;
  padding: 7px 11px;
  align-items: center;
  color: var(--ink-700);
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 7px;
  white-space: nowrap;
}

.result-status[data-state="passed"] {
  color: var(--teal-800);
  background: var(--teal-050);
  border-color: var(--teal-100);
}

.result-status[data-state="issues"] {
  color: var(--red-800);
  background: var(--red-050);
  border-color: var(--red-100);
}

.result-status[data-state="not_evaluable"] {
  color: var(--red-800);
  background: var(--red-050);
  border-color: var(--red-100);
}

.result-status[data-state="incomplete"] {
  color: var(--amber-800);
  background: var(--amber-050);
  border-color: var(--amber-100);
}

.result-nav {
  display: flex;
  padding: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  background: rgb(255 255 255 / 78%);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  gap: 3px;
}

.result-nav a {
  padding: 8px 12px;
  color: var(--ink-700);
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.result-nav a:hover,
.result-nav a:focus-visible {
  color: var(--teal-800);
  background: var(--teal-050);
}

.result-section,
.filter-panel {
  margin-top: 14px;
}

.compact-heading {
  padding-bottom: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.compact-heading > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-index {
  margin: 0;
  color: var(--ink-500);
}

.section-summary {
  color: var(--ink-600);
  font-size: 0.73rem;
}

.section-help {
  max-width: 900px;
  margin: -7px 0 16px;
  color: var(--ink-600);
  font-size: 0.76rem;
}

.quality-summary-layout {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
}

.quality-status-card {
  display: grid;
  min-height: 160px;
  padding: 24px;
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--paper);
  background: var(--ink-900);
  border-radius: var(--radius-md);
  gap: 18px;
}

.quality-status-icon {
  display: grid;
  width: 54px;
  height: 54px;
  background: rgb(255 255 255 / 12%);
  border: 2px solid rgb(255 255 255 / 26%);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 850;
  place-items: center;
}

.quality-status-card strong {
  display: block;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.15;
}

.quality-status-card p {
  margin: 8px 0 0;
  color: #c4d7db;
  font-size: 0.76rem;
}

.quality-status-card[data-state="passed"] {
  background: #0a6259;
}

.quality-status-card[data-state="issues"] {
  background: #7c3036;
}

.quality-status-card[data-state="incomplete"] {
  background: #75450e;
}

.quality-status-card[data-state="not_evaluable"] {
  background: #66272c;
}

.configuration-summary {
  display: grid;
  gap: 10px;
}

.configuration-item {
  padding: 17px;
  background: var(--ink-050);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
}

.configuration-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.configuration-item-heading strong {
  color: var(--ink-900);
  font-size: 0.79rem;
}

.configuration-item p {
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 0.7rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-width: 0;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-top: 3px solid var(--ink-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.metric-card[data-tone="positive"] { border-top-color: var(--teal-600); }
.metric-card[data-tone="danger"] { border-top-color: var(--red-700); }
.metric-card[data-tone="warning"] { border-top-color: var(--amber-700); }
.metric-card[data-tone="info"] { border-top-color: var(--blue-700); }

.metric-card span {
  display: block;
  overflow: hidden;
  color: var(--ink-600);
  font-size: 0.69rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--ink-900);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-card small {
  display: block;
  color: var(--ink-500);
  font-size: 0.67rem;
}

.filter-panel {
  background: #f9fbfb;
}

.filter-title-row {
  display: flex;
  margin-bottom: 16px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.text-button {
  min-height: 36px;
  padding: 5px;
  color: var(--teal-700);
  background: transparent;
  border: 0;
  font-size: 0.74rem;
  font-weight: 760;
}

.text-button:hover {
  text-decoration: underline;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(160px, 0.75fr));
  align-items: end;
  gap: 11px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field > span:first-child {
  color: var(--ink-700);
  font-size: 0.71rem;
  font-weight: 750;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink-900);
  background: var(--paper);
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
}

.form-field input:focus,
.form-field select:focus,
.quality-rules-table input:focus,
.quality-rules-table select:focus {
  outline: 2px solid var(--teal-600);
  outline-offset: 1px;
}

.filter-result {
  margin: 11px 0 0;
  color: var(--ink-600);
  font-size: 0.71rem;
}

.findings-table th:nth-child(1) { min-width: 150px; }
.findings-table th:nth-child(2) { min-width: 210px; }
.findings-table th:nth-child(3) { min-width: 140px; }
.findings-table th:nth-child(4) { min-width: 210px; }
.findings-table th:nth-child(5) { min-width: 300px; }

.finding-object,
.finding-rule {
  display: grid;
}

.finding-object strong,
.finding-rule strong {
  color: var(--ink-900);
  font-size: 0.78rem;
}

.finding-object span,
.finding-rule span {
  max-width: 420px;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink-500);
  font-size: 0.68rem;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  align-items: center;
  color: var(--ink-700);
  background: var(--ink-100);
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 820;
  line-height: 1.25;
  white-space: nowrap;
}

.badge::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.badge-positive {
  color: var(--teal-800);
  background: var(--teal-100);
}

.badge-error,
.badge-danger {
  color: var(--red-800);
  background: var(--red-100);
}

.badge-warning {
  color: var(--amber-800);
  background: var(--amber-100);
}

.badge-info {
  color: var(--blue-700);
  background: var(--blue-100);
}

.empty-state {
  padding: 42px 20px 24px;
  color: var(--ink-600);
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 43px;
  height: 43px;
  margin: 0 auto 9px;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 850;
  place-items: center;
}

.empty-state strong {
  display: block;
  color: var(--ink-900);
}

.empty-state p {
  margin: 4px 0 0;
  font-size: 0.76rem;
}

.load-more {
  margin: 18px auto 0;
}

.inventory-grid {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inventory-item {
  display: grid;
  min-width: 0;
  padding: 13px 14px;
  grid-template-columns: minmax(125px, 0.45fr) minmax(0, 1fr);
  background: var(--ink-050);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  gap: 14px;
}

.inventory-item dt {
  color: var(--ink-600);
  font-size: 0.69rem;
  font-weight: 780;
}

.inventory-item dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-900);
  font-size: 0.75rem;
}

.report-section {
  border-top: 3px solid var(--teal-600);
}

.report-heading {
  align-items: center;
}

.report-count {
  display: inline-flex;
  padding: 6px 10px;
  color: var(--teal-800);
  background: var(--teal-050);
  border: 1px solid var(--teal-100);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 820;
  white-space: nowrap;
}

.report-copy p {
  max-width: 920px;
  margin: 0 0 7px;
  color: var(--ink-600);
  font-size: 0.8rem;
}

.report-button-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-actions {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100% - 44px));
  padding: 13px 16px;
  color: var(--paper);
  background: var(--ink-900);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
}

.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #e9f0f2, #f8fafb 52%, #e7eef0);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  margin-bottom: 28px;
  align-items: center;
  gap: 16px;
}

.login-brand .brand-mark {
  width: 52px;
  height: 48px;
  border-color: var(--ink-200);
}

.login-brand p {
  margin: 0 0 4px;
  color: var(--teal-700);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.login-brand h1 {
  font-size: 1.38rem;
}

.login-card .form-field {
  margin: 0 0 17px;
}

.login-button {
  width: 100%;
  margin-top: 4px;
}

.login-note {
  margin: 22px 0 0;
  color: var(--ink-600);
  font-size: 0.78rem;
  line-height: 1.5;
}

.admin-create-form {
  display: grid;
  margin: 24px 0;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
}

.inline-check {
  display: flex;
  min-height: 42px;
  padding: 9px 11px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 730;
  gap: 7px;
  white-space: nowrap;
}

.inline-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--teal-600);
}

.compact-action {
  min-height: 34px;
  padding: 6px 8px;
  margin: 2px 4px 2px 0;
  font-size: 0.72rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1040px) {
  .settings-card,
  .quality-summary-layout {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .admin-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .privacy-badge,
  .account-name {
    display: none;
  }

  .page-shell {
    padding-top: 32px;
  }

  .section-heading,
  .results-title-row,
  .form-actions,
  .report-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading > p {
    max-width: none;
    text-align: left;
  }

  .button-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .metric-grid,
  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .settings-card {
    padding: 14px;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .page-shell {
    width: min(calc(100% - 24px), var(--content));
  }

  .header-inner {
    min-height: 62px;
  }

  .brand-copy small,
  .header-meta .icon-button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .header-meta .icon-button {
    width: 40px;
    padding: 0;
  }

  .page-shell {
    padding: 25px 0 64px;
  }

  .input-panel,
  .settings-panel,
  .result-section,
  .filter-panel,
  .error-panel {
    padding: 19px 15px;
    border-radius: var(--radius-md);
  }

  .upload-card {
    padding: 17px 13px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .button-row {
    flex-direction: column;
  }

  .button-row .button {
    width: 100%;
  }

  .compact-heading,
  .filter-title-row {
    align-items: flex-start;
  }

  .quality-status-card {
    min-height: 0;
    padding: 19px;
    grid-template-columns: 1fr;
  }

  .inventory-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .status-dot,
  .badge::before,
  .quality-status-icon {
    forced-color-adjust: none;
  }

  .button,
  .file-picker,
  .panel,
  .badge {
    border: 1px solid ButtonText;
  }
}

@media print {
  .app-header,
  .input-panel,
  .settings-panel,
  .result-nav,
  .filter-panel,
  .report-section,
  .button,
  .toast {
    display: none !important;
  }

  body {
    background: white;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .results {
    padding-top: 0;
  }

  .panel,
  .metric-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
