:root {
  color-scheme: light;
  --bg: #edf3f8;
  --panel: rgba(255, 255, 255, 0.56);
  --panel-border: rgba(50, 84, 114, 0.12);
  --text: #173042;
  --muted: #62798a;
  --brand: #1d7fa8;
  --brand-strong: #155c86;
  --chip-bg: rgba(255, 255, 255, 0.76);
  --chip-border: rgba(50, 84, 114, 0.12);
  --shadow: 0 20px 60px rgba(35, 76, 104, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 127, 168, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(131, 196, 218, 0.22), transparent 32%),
    linear-gradient(135deg, #eef6fb 0%, #e7f0f7 46%, #dde8f1 100%);
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero,
.panel {
  backdrop-filter: blur(10px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 32px;
  margin-bottom: 20px;
}

.panel {
  padding: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

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

.hero-copy,
.muted {
  color: var(--muted);
}

.button-row,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.status-row {
  justify-content: space-between;
}

.button-link,
.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.toolbar-grid,
.segment-grid {
  display: grid;
  gap: 16px;
}

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

.segment-grid {
  grid-template-columns: 1.05fr 1.05fr 1.5fr 1.5fr auto;
}

.toolbar-grid label,
.segment-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

.segment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid rgba(70, 58, 44, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: rgba(29, 127, 168, 0.34);
  box-shadow: 0 0 0 4px rgba(29, 127, 168, 0.08);
}

button {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 14px 18px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 16px 34px rgba(29, 127, 168, 0.08);
}

.btn:hover,
.button-link:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
}

.btn-secondary,
.button-link {
  color: var(--text);
  background: var(--chip-bg);
  border-color: var(--chip-border);
}

.button-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(29, 127, 168, 0.1);
  color: var(--brand-strong);
  font-weight: 700;
  white-space: nowrap;
}

.status-copy,
.meta-copy {
  margin-bottom: 0;
}

.progress-shell {
  width: 100%;
  height: 16px;
  background: rgba(60, 47, 32, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #59b6d1);
  transition: width 0.25s ease;
}

.table-scroll {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(70, 58, 44, 0.12);
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(70, 58, 44, 0.08);
  font-size: 0.92rem;
}

th {
  position: sticky;
  top: 0;
  background: #edf5fb;
}

.result-box {
  overflow: auto;
  margin: 0;
  border-radius: 16px;
  padding: 18px;
  background: #11202c;
  color: #edf7ff;
  min-height: 220px;
}

.row-remove-button {
  align-self: end;
  min-width: 90px;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 960px);
    padding: 20px 0;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 18px;
  }

  .toolbar-grid,
  .segment-grid {
    grid-template-columns: 1fr;
  }
}
