:root {
  --accent: #80ff04;
  --accent-soft: rgb(128 255 4 / 12%);
  --canvas: #0c0e0e;
  --surface: #0c0e0e;
  --surface-high: #18191a;
  --surface-hover: #202223;
  --field: #18191a;
  --field-hover: #222425;
  --ink: rgb(254 254 254 / 89%);
  --muted: rgb(244 248 254 / 51%);
  --subdued: rgb(250 253 254 / 80%);
  --disabled: rgb(239 254 254 / 29%);
  --line: rgb(234 250 250 / 19%);
  --line-soft: rgb(233 233 233 / 9%);
  --danger: #ff6571;
  --danger-soft: rgb(168 15 18 / 20%);
  --warning: #fee564;
  --warning-soft: rgb(254 229 100 / 12%);
  --action-default: rgb(213 227 241 / 9%);
  --action-icon: rgb(250 253 254 / 80%);
  --action-label: rgb(250 253 254 / 80%);
  --action-positive: rgb(32 187 0 / 20%);
  --action-positive-ink: #80ff04;
  --action-critical: rgb(168 15 18 / 20%);
  --action-critical-ink: #ff7a84;
  --shadow: 0 20px 50px rgb(0 0 0 / 38%);
}

body:not(.dark-mode) {
  --canvas: #f4f5f2;
  --surface: #f9faf7;
  --surface-high: #ffffff;
  --surface-hover: #eef0eb;
  --field: #e8ebe5;
  --field-hover: #e0e4dc;
  --ink: rgb(12 14 14 / 89%);
  --muted: rgb(12 14 14 / 55%);
  --subdued: rgb(12 14 14 / 78%);
  --disabled: rgb(12 14 14 / 30%);
  --line: rgb(12 14 14 / 20%);
  --line-soft: rgb(12 14 14 / 10%);
  --danger: #b9232f;
  --danger-soft: rgb(185 35 47 / 12%);
  --action-default: rgb(28 46 48 / 5%);
  --action-icon: rgb(2 14 15 / 62%);
  --action-label: rgb(1 8 8 / 71%);
  --action-positive: rgb(51 225 17 / 20%);
  --action-positive-ink: #006f13;
  --action-critical: rgb(255 171 177 / 20%);
  --action-critical-ink: #7c0604;
  --shadow: 0 20px 50px rgb(29 39 28 / 14%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

html:not(.dark-mode) {
  background: #f4f5f2;
}

body {
  min-height: 100vh;
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.dark-mode {
  color-scheme: dark;
}

button,
input,
textarea {
  font: inherit;
}

button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-high);
  color: var(--subdued);
  cursor: pointer;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
  line-height: 16px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

button:hover {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--ink);
}

button:active,
button.pressed {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
  outline: 0;
}

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

h1,
h2 {
  font-weight: 680;
  letter-spacing: -.02em;
}

.shell {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding-bottom: 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 16px 0;
}

.brand,
.topbar-actions,
.entry-head,
.list-head,
.asset-card,
.result-card {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 22px;
  letter-spacing: .08em;
}

.tagline {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  gap: 12px;
}

.entry {
  border-bottom: 1px solid var(--line);
  padding: 32px 16px 42px;
}

.entry-head {
  justify-content: space-between;
  margin-bottom: 24px;
}

.entry h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
}

input,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  padding: 0 16px;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

input {
  height: 52px;
}

input:hover,
textarea:hover {
  background: var(--field-hover);
}

input:focus,
textarea:focus {
  border: 2px solid rgb(128 255 4 / 40%);
  background: var(--field);
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--disabled);
  opacity: 1;
}

input:disabled,
textarea:disabled {
  border-color: var(--line-soft);
  color: var(--disabled);
  cursor: not-allowed;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding-block: 16px;
}

.search-input-wrap input {
  padding-inline: 48px;
}

.search-leading {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-leading svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.clear-query svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-input-wrap:focus-within .search-leading {
  color: var(--accent);
}

.clear-query {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  transform: translateY(-50%);
}

.clear-query:hover {
  background: var(--surface-hover);
}

.clear-query:active,
.clear-query.pressed {
  transform: translateY(-50%);
}

.search-row > button[type="submit"] {
  min-width: 112px;
  height: 52px;
  border-color: var(--accent);
  background: var(--accent);
  color: #0c0e0e;
}

.search-row > button[type="submit"]:hover {
  border-color: #a0ff47;
  background: #a0ff47;
  color: #0c0e0e;
}

.notice {
  margin-top: 16px;
  border: 1px solid var(--danger);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--ink);
  padding: 14px 16px;
  font-weight: 600;
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.result-card,
.asset-card {
  min-width: 0;
  justify-content: space-between;
  gap: 16px;
  border-radius: 14px;
  background: transparent;
  padding: 16px;
  transition: background 120ms ease;
}

.result-card {
  min-height: 72px;
}

.result-card:hover,
.asset-card:hover {
  background: var(--surface-hover);
}

.result-main,
.asset-card > div:first-child {
  min-width: 0;
  overflow: hidden;
}

.asset-name {
  display: block;
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 520;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  display: flex;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.meta-field {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  margin-right: 12px;
}

.meta-label {
  color: var(--muted);
}

.missing-id {
  color: var(--danger);
  font-weight: 650;
}

.row-actions,
.form-actions,
.item-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions {
  flex-wrap: wrap;
}

.result-action {
  min-width: 0;
  height: 36px;
  min-height: 36px;
  gap: 8px;
  border: 0;
  border-radius: 2px;
  background: #313434;
  color: rgb(254 254 254 / 89%);
  padding: 9px 16px 11px;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
}

.result-action:hover {
  border: 0;
  background: #494d4d;
  color: rgb(254 254 254 / 89%);
}

.result-action-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 12px;
}

.result-action.has-status {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.result-action.has-status .result-action-status {
  color: var(--accent);
}

.result-action.is-rejected {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.result-action.is-rejected .result-action-status {
  color: var(--danger);
}

.result-action:disabled,
.result-action:disabled:hover {
  border: 0;
  background: #313434;
  color: rgb(239 254 254 / 29%);
  cursor: default;
  transform: none;
}

.result-action:disabled .result-action-status {
  color: currentColor;
}

.result-inline-error {
  order: 2;
  flex: 1 0 100%;
  max-width: 220px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.asset-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
  padding-top: 24px;
}

.field-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  padding: 48px 16px 0;
}

.workflow-column {
  display: grid;
  align-content: start;
  gap: 40px;
}

article {
  min-width: 0;
}

.list-head {
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px 24px;
}

.list-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 28px;
}

.list-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.asset-list {
  display: grid;
  gap: 0;
}

.asset-card {
  min-height: 72px;
}

.item-controls {
  min-width: 0;
}

.icon-button {
  width: auto;
  min-width: 52px;
  height: 64px;
  min-height: 64px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
}

.icon-button:hover,
.icon-button:active,
.icon-button.pressed {
  background: transparent;
}

.action-shape {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border: 0;
  border-radius: 999px;
  background: var(--action-default);
  color: var(--action-icon);
}

.icon-button:hover .action-shape {
  background: color-mix(in srgb, var(--action-default) 76%, var(--ink));
  color: var(--ink);
}

.action-label {
  max-width: none;
  padding-inline: 8px;
  color: var(--action-label);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
}

.icon-button:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 3px;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar .action-shape {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
}

.topbar .icon-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  gap: 0;
}

.topbar .action-label {
  display: none;
}

.done-button .action-shape {
  color: var(--action-positive-ink);
  background: var(--action-positive);
}

.done-button:hover .action-shape {
  background: color-mix(in srgb, var(--action-positive) 78%, var(--action-positive-ink));
}

.reject-button .action-shape {
  color: var(--action-critical-ink);
  background: var(--action-critical);
}

.reject-button:hover .action-shape {
  background: color-mix(in srgb, var(--action-critical) 78%, var(--action-critical-ink));
}

.count-menu,
.reason-menu {
  position: relative;
}

.count-shape {
  font-size: 14px;
  font-weight: 600;
}

.reason-options,
.count-options {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.count-options {
  right: auto;
  left: 0;
}

.reason-options {
  align-items: flex-end;
}

.reason-options button,
.count-options button {
  width: auto;
  height: 36px;
  min-height: 36px;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 2px;
  background: #c9cccc;
  color: rgb(2 3 4 / 91%);
  padding: 9px 16px 11px;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  text-align: left;
  white-space: nowrap;
}

.reason-options button:hover,
.count-options button:hover {
  border: 0;
  background: #b3b5b5;
  color: rgb(2 3 4 / 91%);
}

.copy-isin {
  display: inline-flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.copy-isin:hover,
.copy-isin.copied {
  background: var(--accent-soft);
  color: var(--ink);
}

.copy-isin-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  opacity: 0;
}

.copy-isin:hover .copy-isin-icon,
.copy-isin:focus-visible .copy-isin-icon,
.copy-isin.copied .copy-isin-icon {
  opacity: 1;
}

.copy-isin-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.archived-card .remove-button {
  opacity: 0;
}

.archived-card:hover .remove-button,
.archived-card:focus-within .remove-button {
  opacity: 1;
}

.rejected-card {
  min-height: 72px;
  height: auto;
}

.remove-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 20px;
  transition: opacity 120ms ease, background 120ms ease;
}

.remove-button:hover {
  background: var(--surface-high);
}

.empty {
  display: grid;
  min-height: 96px;
  place-items: center;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.results > .empty {
  grid-column: 1 / -1;
}

.hidden,
.reason-options.hidden,
.count-options.hidden {
  display: none;
}

@media (max-width: 980px) {
  .results,
  .lists {
    grid-template-columns: 1fr;
  }

  .lists {
    gap: 48px;
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
  }

  .tagline {
    display: none;
  }

  .entry {
    padding-inline: 20px;
  }

  .search-row,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .search-row > button[type="submit"] {
    width: 100%;
  }

  .lists {
    padding-inline: 4px;
  }

  .result-card,
  .asset-card {
    align-items: flex-start;
  }

  .result-card {
    display: grid;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .result-inline-error {
    max-width: none;
    text-align: left;
  }

}
