}

.declaration-form-table {
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--white);
}

.declaration-form-table th,
.declaration-form-table td {
  padding: 0.78rem 0.85rem;
}

.declaration-form-table th:nth-child(1),
.declaration-form-table td:nth-child(1) {
  width: 6.5rem;
  color: var(--teal-dark);
  font-weight: 900;
}

.declaration-form-table .declaration-form-number {
  text-align: right;
  font-weight: 500;
}

.declaration-form-table th.declaration-form-number {
  font-weight: 800;
}

.declaration-review-strip {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.85rem 0;
  border: 1px dashed rgba(217, 164, 65, 0.52);
  border-radius: 18px;
  padding: 0.72rem 0.9rem;
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.declaration-review-strip strong {
  font-weight: 600;
}

.declaration-format-controls {
  display: flex;
  justify-content: flex-start;
  margin: -0.15rem 0 0.8rem;
}

.declaration-format-toggle {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 800;
  min-height: 2.1rem;
  padding: 0.34rem 0.72rem;
  text-decoration: none;
}

.declaration-format-toggle:hover,
.declaration-format-toggle-pressed {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 14%, transparent);
}

.declaration-format-toggle-pressed {
  background: color-mix(in srgb, var(--teal) 12%, var(--white));
}

.declaration-summary-cards {
  margin-bottom: 1rem;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.manual-create-error {
  display: block;
  margin-top: 0.2rem;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
}

.currency-code {
  color: var(--muted);
  font-size: 0.62em;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.currency-code-inline {
  display: inline-block;
  margin: 0.18rem 0 0 0.18rem;
}

.column-currency-code {
  font-size: 0.58em;
}

.sort-arrow {
  min-width: 1ch;
  color: var(--teal);
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-cards-polished {
  align-items: stretch;
}

.document-filter-chips {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin: -0.15rem 0 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.document-filter-chip {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.28rem 0.62rem;
  text-decoration: none;
  white-space: nowrap;
}

.document-filter-chip:hover,
.document-filter-chip-active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 14%, transparent);
}

.document-filter-chip-disabled {
  cursor: default;
  opacity: 0.64;
  pointer-events: none;
}

.document-filter-chip-processing {
  border-color: color-mix(in srgb, var(--warning) 65%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 18%, transparent);
}

.document-filter-chip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.document-filter-chip strong {
  font-size: 0.86rem;
  font-weight: 700;
}

.processing-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid color-mix(in srgb, var(--navy) 24%, transparent);
  border-top-color: var(--navy);
  border-right-color: var(--navy);
  border-radius: 999px;
  animation: processing-spin 0.8s linear infinite;
}

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

.summary-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.05rem;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.92)),
    var(--white);
  box-shadow: var(--shadow-soft);
}

.summary-card h2 {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.summary-card p {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.save-state {
  font-size: 0.72rem;
}

.save-state:empty {
  display: none;
}

.quiet-save-button {
  margin-top: 0.35rem;
  min-height: 1.75rem;
  border-color: rgba(100, 116, 139, 0.22);
  padding: 0.2rem 0.48rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.quiet-save-button:hover {
  background: rgba(100, 116, 139, 0.10);
  color: var(--ink);
}

.compact-cell {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.compact-cell-source,
.compact-cell-filename,
.compact-cell-match {
  max-width: clamp(7.5rem, 12vw, 14rem);
}

.compact-cell-problem {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-problem-helper {
  vertical-align: baseline;
}

.compact-cell-source {
  display: -webkit-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.25;
  white-space: normal;
}

.two-line-cell {
  display: grid;
  gap: 0.16rem;
  max-width: clamp(10rem, 22vw, 22rem);
  overflow: hidden;
}

.two-line-cell > span,
.two-line-cell > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.description-display {
  display: block;
  max-width: clamp(10rem, 22vw, 22rem);
}

.description-display-textarea {
  width: 100%;
  min-height: 3.3rem;
  border-style: dotted;
  background: transparent;
  line-height: 1.25;
  resize: vertical;
}

.two-line-cell > small {
  color: var(--muted);
  font-size: 0.72rem;
}

.document-invoice-cell {
  display: grid;
  gap: 0.16rem;
  max-width: clamp(8rem, 13vw, 15rem);
  min-width: 0;
}

.document-invoice-cell .editable-cell {
  min-width: 0;
}

.document-invoice-cell .compact-cell,
.document-file-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-file-hint {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  line-height: 1.25;
}

.vat-pill {
  margin: 0 0.35rem 0.35rem 0;
}

.vat-pill-affects {
  background: var(--success-bg);
  color: var(--success-ink);
}

.vat-pill-no-vat {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

.vat-pill-unclear {
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.document-status-pill-ready {
  background: var(--success-bg);
  color: var(--success-ink);
}

.document-status-pill-pending {
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.document-status-pill-couldnt-process {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  background: var(--warning-bg);
  color: var(--warning-ink);
  overflow: hidden;
  padding: 0.2rem 0.66rem 0.2rem 0.56rem;
}

.document-retry-label {
  display: inline-block;
  line-height: 1;
}

.document-retry-inline-button {
  --icon-action-size: 1em;
  --icon-action-font-size: 0.95em;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  color: currentColor;
  overflow: hidden;
  flex: 0 0 auto;
  font: inherit;
  cursor: pointer;
}

.document-retry-icon {
  display: inline-block;
  line-height: 1;
  transform: translateY(-0.03em);
}

.document-retry-inline-button:hover,
.document-retry-inline-button:focus-visible {
  background: transparent;
  color: var(--warning-ink);
  outline: none;
  box-shadow: none;
}

.document-status-pill-invalid {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.document-warning-helper {
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.narrow-panel {
  width: min(100%, 760px);
}

.public-upload-card {
  position: relative;
  padding: 2rem;
}

.public-upload-company {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.98;
}

.public-upload-subtitle {
  margin: 0.9rem 0 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.public-upload-ai-link {
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.public-upload-divider {
  height: 1px;
  margin: 1.25rem 0 0.9rem;
  background: var(--line);
}

.public-upload-powered {
  position: absolute;
  right: 1.1rem;
  bottom: 0.86rem;
  margin: 0;
  color: rgba(108, 113, 119, 0.72);
  font-size: 0.72rem;
}

.public-upload-powered a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.public-upload-state-success {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
}

.public-upload-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 170, 145, 0.22);
  background: rgba(13, 170, 145, 0.1);
  color: var(--teal-dark);
  font-size: 1.15rem;
  font-weight: 900;
}

.not-found-panel {
  padding: 2rem;
}

.not-found-path {
  display: inline-block;
  margin: 0.4rem 0 1.4rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
}
.declarations-help {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.05rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.declarations-help summary { cursor: pointer; font-weight: 800; }
.declarations-help dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 0.9rem 0 0; }
.declarations-help div { border: 1px solid var(--line); border-radius: 16px; padding: 0.82rem; background: var(--panel-soft); }
.declarations-help dt { margin-bottom: 0.32rem; font-weight: 900; }
.declarations-help dd { margin: 0; color: var(--muted); line-height: 1.38; }
.declaration-form-panel { display: grid; gap: 0.85rem; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; padding: 1rem; background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-soft); }
.declaration-form-meta { display: flex; justify-content: space-between; gap: 0.8rem; color: var(--muted); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
