:root {
  color-scheme: dark;
  --bg: #07090c;
  --panel: rgba(8, 10, 14, 0.84);
  --panel-strong: rgba(13, 16, 22, 0.94);
  --border: rgba(215, 220, 230, 0.14);
  --border-hot: rgba(255, 29, 47, 0.44);
  --text: #eef0f3;
  --muted: rgba(238, 240, 243, 0.64);
  --soft: rgba(238, 240, 243, 0.78);
  --red: #ff1d2f;
  --red-soft: rgba(255, 29, 47, 0.1);
  --green: #7ed7a8;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --font: "Segoe UI Variable Text", "Aptos", "Trebuchet MS", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
  --display: "Bahnschrift", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 29, 47, 0.12), transparent 18%, transparent 82%, rgba(255, 29, 47, 0.06)),
    radial-gradient(52rem 32rem at 96% 8%, rgba(180, 188, 204, 0.09), transparent 58%),
    radial-gradient(38rem 28rem at 4% 88%, rgba(255, 29, 47, 0.16), transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 86px),
    #07090c;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.carpo-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.45;
}

.carpo-shell-header,
.carpo-main,
.carpo-footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 24px), 1260px);
  margin: 0 auto;
}

.carpo-shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 29, 47, 0.055), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.015)),
    rgba(8, 10, 14, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.carpo-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 280px;
}

.carpo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border-hot);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 29, 47, 0.2), rgba(255, 255, 255, 0.035));
  overflow: hidden;
}

.carpo-mark img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.carpo-brand strong,
.carpo-eyebrow {
  display: block;
  color: var(--red);
  font: 700 11px/1.2 var(--mono);
  text-transform: uppercase;
}

.carpo-brand small {
  display: block;
  color: var(--muted);
  font: 700 11px/1.3 var(--mono);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carpo-nav,
.carpo-actions,
.carpo-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.carpo-inline-form {
  margin: 0;
}

.carpo-nav {
  justify-content: flex-end;
  margin-left: auto;
}

.carpo-nav a,
.carpo-button,
.carpo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font: 700 11px/1 var(--mono);
  text-transform: uppercase;
}

.carpo-button {
  border-color: rgba(255, 29, 47, 0.62);
  background: linear-gradient(90deg, #ff1d2f, #8d1018);
  cursor: pointer;
}

.carpo-button-ghost {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.carpo-badge {
  min-height: 28px;
  padding: 5px 9px;
  color: var(--soft);
}

.tone-ok {
  color: var(--green);
}

.tone-warn,
.tone-bad {
  color: #ffc2c7;
}

.carpo-main {
  display: grid;
  gap: 16px;
  padding: 16px 0 36px;
}

.carpo-hero,
.carpo-panel,
.carpo-table-card,
.carpo-alert {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 29, 47, 0.055), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
}

.carpo-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.carpo-hero h1,
.carpo-table-head h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.02;
}

.carpo-table-head h2 {
  font-size: 1.1rem;
}

.carpo-hero p {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--soft);
  line-height: 1.55;
}

.carpo-panel,
.carpo-alert {
  padding: 16px;
}

.carpo-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.carpo-panel-head h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.1;
}

.carpo-alert.tone-good {
  color: var(--green);
}

.carpo-filter,
.carpo-form,
.carpo-form-grid {
  display: grid;
  gap: 11px;
}

.carpo-filter {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
}

.carpo-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(6, 8, 11, 0.72);
  color: var(--text);
}

textarea {
  min-height: 106px;
  resize: vertical;
}

.carpo-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

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

.carpo-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

.carpo-table-compact {
  min-width: 420px;
}

.carpo-table th,
.carpo-table td {
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.carpo-table th {
  color: var(--muted);
  font: 700 10px/1.2 var(--mono);
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.035);
}

.carpo-table td small,
.carpo-muted {
  display: block;
  color: var(--muted);
}

.carpo-footer {
  padding: 0 0 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 820px) {
  .carpo-shell-header,
  .carpo-hero,
  .carpo-table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .carpo-nav {
    justify-content: flex-start;
    margin-left: 0;
  }

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

@media (max-width: 560px) {
  .carpo-shell-header,
  .carpo-main,
  .carpo-footer {
    width: min(calc(100% - 18px), 1260px);
  }

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