:root {
  --bg: #101418;
  --bg-2: #182027;
  --bg-3: #0d1116;
  --panel: rgba(249, 251, 250, 0.98);
  --surface: #ffffff;
  --surface-soft: #f2f6f5;
  --surface-tint: #edf8f6;
  --ink: #14201d;
  --muted: #61706c;
  --muted-2: #82908c;
  --line: #d8e2df;
  --line-strong: #bdccc8;
  --accent: #0f8b8d;
  --accent-ink: #075c5d;
  --accent-soft: #e2f6f4;
  --blue: #2f6fed;
  --blue-soft: #e8efff;
  --amber: #d97706;
  --amber-soft: #fff4df;
  --error: #c24132;
  --error-soft: #fff1ef;
  --ok: #0f7a4f;
  --shadow: 0 22px 54px rgba(2, 8, 14, 0.24);
  --shadow-soft: 0 10px 28px rgba(20, 32, 29, 0.1);
  --radius-lg: 14px;
  --radius: 8px;
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  text-rendering: optimizeLegibility;
}

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

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(47, 111, 237, 0.2) 0 12%, transparent 12% 100%),
    linear-gradient(165deg, var(--bg-2) 0%, #102521 43%, var(--bg-3) 100%);
}

.bg::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.76) 56%, transparent 100%);
}

.bg::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(15, 139, 141, 0.22), transparent 38%, rgba(217, 119, 6, 0.1)),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.16) 100%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 28px 22px 34px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
  color: #eef8f6;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.mark {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(145deg, #3dd6c6 0%, #0f8b8d 48%, #2f6fed 100%);
  box-shadow: 0 16px 30px rgba(2, 8, 14, 0.28);
}

.mark::before,
.mark::after {
  position: absolute;
  content: "";
}

.mark::before {
  width: 17px;
  height: 23px;
  left: 15px;
  top: 13px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 5px;
}

.mark::after {
  width: 10px;
  height: 2px;
  right: 10px;
  top: 23px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.92);
}

.brand-kicker {
  margin: 0 0 3px;
  color: rgba(194, 235, 231, 0.88);
  font-family: "DM Sans", var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: 0;
}

.tagline {
  margin: 6px 0 0;
  color: rgba(238, 248, 246, 0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}

.meta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(238, 248, 246, 0.84);
  font-size: 0.84rem;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.meta::before {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #37d8a2;
  content: "";
  box-shadow: 0 0 0 4px rgba(55, 216, 162, 0.14);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  display: flex;
  min-height: min(79vh, 790px);
  flex-direction: column;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: rise 360ms ease both;
}

.result-panel {
  animation-delay: 60ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

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

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.step-label {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0;
}

.panel-head h2 {
  margin: 0;
  color: #16231f;
  font-size: 1.1rem;
  font-weight: 760;
  line-height: 1.25;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dae5e2;
  border-radius: 10px;
  background: #edf3f1;
}

.tab {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(12, 24, 21, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 11px;
}

.field span {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.35;
}

.field.grow {
  flex: 1;
  min-height: 0;
}

.step-badge {
  display: inline-grid;
  width: 1.38rem;
  height: 1.38rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--accent), var(--blue));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 6px 12px rgba(15, 139, 141, 0.2);
}

.fetch-box {
  margin-bottom: 13px;
  padding: 12px 13px 13px;
  border: 1px solid #cfe0dc;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(242, 248, 246, 0.92)),
    linear-gradient(90deg, rgba(15, 139, 141, 0.1), rgba(47, 111, 237, 0.07));
  box-shadow: var(--shadow-soft);
}

.fetch-box > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
  list-style: none;
  user-select: none;
}

.fetch-box > summary::-webkit-details-marker {
  display: none;
}

.fetch-box > summary::after {
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.fetch-box[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.fetch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 12px;
  margin-top: 13px;
}

.fetch-grid > .field:first-child {
  grid-column: 1 / -1;
}

.fetch-box .field {
  margin-bottom: 10px;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-row select {
  min-width: 0;
  flex: 1;
}

.time-sep {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.fetch-actions {
  align-items: center;
  margin-top: 2px;
}

.fetch-actions .fetch-download {
  margin-left: auto;
}

.hint.inline {
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 13px;
  padding-left: 14px;
  color: var(--accent-ink);
  font-size: 0.88rem;
  font-weight: 760;
}

.section-divider::after {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  content: "";
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr);
  gap: 0 12px;
}

select,
textarea,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"] {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

select:hover,
textarea:hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover {
  border-color: var(--line-strong);
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.14);
}

select {
  cursor: pointer;
}

textarea {
  flex: 1;
  min-height: 294px;
  resize: vertical;
  background:
    linear-gradient(90deg, rgba(47, 111, 237, 0.045) 0 1px, transparent 1px 100%) 0 0 / 34px 34px,
    linear-gradient(var(--surface), var(--surface));
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.58;
  tab-size: 2;
}

textarea::placeholder,
input::placeholder {
  color: #9aa7a3;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 8px;
  padding-top: 11px;
  background: linear-gradient(180deg, rgba(249, 251, 250, 0), rgba(249, 251, 250, 0.98) 34%);
}

.btn,
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  appearance: none;
  cursor: pointer;
  font-weight: 760;
  line-height: 1.2;
  transition: transform 120ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.btn::before,
.file-btn::before {
  font-size: 1rem;
  line-height: 1;
}

.btn:active,
.file-btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.btn.primary {
  margin-left: auto;
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  box-shadow: 0 12px 20px rgba(15, 139, 141, 0.24);
}

.btn.primary:hover {
  box-shadow: 0 14px 26px rgba(15, 139, 141, 0.3);
}

.btn.accent {
  border-color: #a8d9d4;
  background: #fff;
  color: var(--accent-ink);
}

.btn.accent::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.12);
}

.btn.accent:hover,
.btn.ghost:hover,
.file-btn:hover {
  border-color: #98cac5;
  background: #f7fcfb;
  box-shadow: 0 8px 16px rgba(20, 32, 29, 0.08);
}

.btn.ghost,
.file-btn {
  border-color: #d4e2df;
  background: #edf4f2;
  color: var(--accent-ink);
}

.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn::before {
  content: "+";
  font-family: var(--mono);
  font-weight: 800;
}

.file-btn input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

.hint {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.48;
}

.empty,
.error {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 30px 22px;
  border: 1px dashed #c5d5d1;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(242, 246, 245, 0.7)),
    repeating-linear-gradient(135deg, rgba(15, 139, 141, 0.04) 0 8px, transparent 8px 16px);
  color: var(--muted);
  text-align: center;
}

.empty-illus {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border: 1px solid #c9dbd7;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.14), rgba(47, 111, 237, 0.12)),
    #fff;
  box-shadow: var(--shadow-soft);
}

.empty-illus::before,
.empty-illus::after {
  position: absolute;
  content: "";
}

.empty-illus::before {
  width: 21px;
  height: 28px;
  left: 18px;
  top: 14px;
  border: 2px solid rgba(15, 139, 141, 0.72);
  border-radius: 5px;
}

.empty-illus::after {
  width: 16px;
  height: 2px;
  right: 11px;
  top: 24px;
  background: rgba(47, 111, 237, 0.72);
  box-shadow: 0 7px 0 rgba(47, 111, 237, 0.72);
}

.empty-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 780;
}

.empty-steps {
  max-width: 350px;
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.75;
  text-align: left;
}

.empty[hidden],
.error[hidden],
#resultView[hidden] {
  display: none !important;
}

.error {
  align-content: start;
  justify-items: start;
  border-color: #f1b8af;
  border-style: solid;
  background: var(--error-soft);
  color: var(--error);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
}

#resultView {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding-right: 2px;
}

#resultView::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.report-pre::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#resultView::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.report-pre::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #b9c9c5;
  background-clip: padding-box;
}

.block {
  padding-top: 2px;
}

.block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: #1b2925;
  font-size: 0.92rem;
  font-weight: 780;
}

.block h3::before {
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--blue));
  content: "";
}

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

.card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fff, #fbfdfc);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card .label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.card .value {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card .value.ok {
  color: var(--ok);
}

.card .value.bad {
  color: var(--error);
}

.summary-text,
.result-points {
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #bfdeda;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(226, 246, 244, 0.9), rgba(238, 248, 247, 0.92));
  color: var(--accent-ink);
  font-size: 0.9rem;
  line-height: 1.72;
}

.result-points {
  white-space: pre-wrap;
}

.verdict-text {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #f5faf9;
  color: var(--accent-ink);
  font-weight: 780;
  line-height: 1.6;
}

.info-table {
  max-height: 420px;
  margin-top: 12px;
}

.table-wrap {
  overflow: auto;
  max-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.86rem;
}

th,
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #edf4f2;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

tbody tr:nth-child(even) {
  background: #fbfdfc;
}

tbody tr:hover {
  background: #f0f8f6;
}

th:nth-child(1),
td:nth-child(1) {
  width: 38%;
  min-width: 7.5em;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

th:nth-child(2),
td:nth-child(2) {
  width: 62%;
}

td:nth-child(2) {
  color: #25342f;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.48;
  word-break: break-all;
}

#warnList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#warnList li {
  padding: 9px 11px;
  border: 1px solid #f5d7a7;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.86rem;
  line-height: 1.5;
}

#warnList li.followup {
  border-color: #d5e1de;
  background: #f7faf9;
  color: var(--ink);
  font-weight: 760;
}

.cands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cand {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.cand strong {
  margin-left: 6px;
  color: var(--accent-ink);
  font-family: var(--mono);
}

.cand.ok {
  border-color: #bfe2d3;
  background: #f1fbf6;
}

.cand.bad {
  border-color: #f1b8af;
  background: var(--error-soft);
}

.order-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.order-pick {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.order-pick:hover {
  border-color: #9ccdc8;
  background: #f7fcfb;
  box-shadow: var(--shadow-soft);
}

.order-pick:active {
  transform: translateY(1px);
}

.order-pick strong {
  font-size: 0.92rem;
}

.order-pick span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.81rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-pre {
  overflow: auto;
  max-height: 520px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.86rem;
  line-height: 1.58;
  white-space: pre-wrap;
  word-break: break-word;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: rgba(238, 248, 246, 0.58);
  font-size: 0.8rem;
}

.foot-note {
  font-family: var(--mono);
  font-size: 0.76rem;
  opacity: 0.95;
}

.foot a {
  color: #93dcd5;
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }

  textarea {
    min-height: 250px;
  }

  #resultView {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 18px 12px 26px;
  }

  .top {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .brand {
    align-items: flex-start;
  }

  .mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .mark::before {
    left: 13px;
    top: 11px;
  }

  .mark::after {
    right: 8px;
    top: 20px;
  }

  .tagline {
    font-size: 0.86rem;
  }

  .meta {
    width: 100%;
    justify-content: center;
  }

  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  .panel-head {
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    padding-inline: 8px;
  }

  .fetch-grid,
  .filter-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .fetch-actions .fetch-download,
  .btn.primary {
    margin-left: 0;
  }

  .btn,
  .file-btn {
    flex: 1 1 auto;
  }

  .sticky-actions {
    position: static;
    background: none;
  }

  textarea {
    min-height: 220px;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 34%;
    white-space: normal;
  }

  .foot {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* C: clean analytics theme */
:root {
  --bg: #f4f7fb;
  --bg-2: #f4f7fb;
  --bg-3: #f4f7fb;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #eaf3ff;
  --ink: #20324a;
  --muted: #718096;
  --muted-2: #94a3b8;
  --line: #e3eaf2;
  --line-strong: #d3dfeb;
  --accent: #1769aa;
  --accent-ink: #0f3d5e;
  --accent-soft: #e8f2ff;
  --blue: #0f9f8c;
  --blue-soft: #e7f6f3;
  --amber: #c68417;
  --amber-soft: #fff7e6;
  --error: #c2413b;
  --error-soft: #fff2f0;
  --ok: #0c9b77;
  --shadow: 0 5px 16px rgba(43, 67, 99, 0.06);
  --shadow-soft: 0 3px 10px rgba(43, 67, 99, 0.05);
  --radius-lg: 8px;
  --radius: 8px;
}

.bg,
.bg::before,
.bg::after {
  display: none;
}

.top {
  color: var(--ink);
}

.brand-kicker,
.tagline {
  color: var(--muted);
}

.mark {
  border-color: #1769aa;
  border-radius: 8px;
  background: #1769aa;
  box-shadow: none;
}

.meta {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.meta::before {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(12, 155, 119, 0.11);
}

.panel {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head h2,
.block h3 {
  color: var(--ink);
}

.tabs {
  border-color: var(--line);
  border-radius: var(--radius);
  background: #f1f5f9;
}

.tab.active {
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(43, 67, 99, 0.08);
}

.fetch-box {
  border-color: #d8e6f0;
  background: #f8fbfe;
  box-shadow: none;
}

.step-badge,
.block h3::before,
.btn.primary {
  background: var(--accent);
}

.step-badge {
  box-shadow: none;
}

.section-divider::after {
  background: var(--line);
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12);
}

textarea {
  background: var(--surface);
}

.sticky-actions {
  background: var(--panel);
}

.btn.primary {
  border-color: var(--accent);
  box-shadow: 0 7px 14px rgba(23, 105, 170, 0.16);
}

.btn.primary:hover {
  background: #0f5e9e;
  box-shadow: 0 8px 17px rgba(23, 105, 170, 0.2);
}

.btn.accent {
  border-color: #b9d2e7;
  color: var(--accent);
}

.btn.accent::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 105, 170, 0.1);
}

.btn.accent:hover,
.btn.ghost:hover,
.file-btn:hover {
  border-color: #aac9e3;
  background: #f2f8fd;
  box-shadow: none;
}

.btn.ghost,
.file-btn {
  border-color: var(--line);
  background: #f1f5f9;
  color: var(--accent-ink);
}

.empty {
  border-color: #d3dfeb;
  background: #f8fafc;
}

.empty-illus {
  border-color: #c7daeb;
  border-radius: var(--radius);
  background: #eaf3ff;
  box-shadow: none;
}

.empty-illus::before {
  border-color: rgba(23, 105, 170, 0.72);
}

.empty-illus::after {
  background: rgba(15, 159, 140, 0.8);
  box-shadow: 0 7px 0 rgba(15, 159, 140, 0.8);
}

.card {
  background: var(--surface);
  box-shadow: none;
}

.summary-text,
.result-points {
  border-color: #c4e3dc;
  background: #effaf7;
  color: #087566;
}

.verdict-text {
  border-left-color: var(--accent);
  background: #f4f8fc;
  color: var(--accent-ink);
}

th {
  background: #f8fafc;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr:hover {
  background: #f2f8fd;
}

.foot {
  color: var(--muted);
}

.foot a {
  color: var(--accent);
}

.learning-box {
  margin-bottom: 14px;
  padding: 11px 13px 13px;
  border: 1px solid #cbdced;
  border-radius: var(--radius);
  background: #f8fbfe;
}

.learning-box > summary {
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 760;
}

.learning-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.36fr) minmax(160px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.learning-summary {
  grid-column: 3;
}

.learning-box textarea {
  min-height: 72px;
}

.learning-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 760;
}

.learning-fields {
  display: grid;
  gap: 7px;
  max-height: 158px;
  margin-top: 8px;
  padding-right: 2px;
  overflow: auto;
}

.learning-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(130px, 1.1fr) minmax(120px, 1fr) auto;
  gap: 7px;
}

.learning-field-guide {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(130px, 1.1fr) minmax(120px, 1fr) auto;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
}

.learning-field-guide span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0 2px;
}

.learning-field-guide strong {
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 760;
}

.learning-field-guide small {
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-field-row input {
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
}

.learning-field-remove {
  min-height: 34px;
}

@media (min-width: 1081px) and (min-height: 640px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app {
    width: min(100%, 1720px);
    height: 100vh;
    padding: 16px 22px 10px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .top {
    margin-bottom: 12px;
  }

  .layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1.13fr) minmax(0, 0.87fr);
    gap: 16px;
  }

  .panel {
    min-height: 0;
    height: 100%;
    padding: 14px;
    overflow: hidden;
  }

  .panel-head {
    margin-bottom: 10px;
  }

  .fetch-box {
    margin-bottom: 8px;
  }

  .section-divider {
    margin: 3px 0 9px;
  }

  .input-panel .field.grow {
    min-height: 0;
  }

  .input-panel textarea {
    min-height: 0;
    resize: none;
  }

  .result-panel #resultView {
    flex: 1;
    min-height: 0;
  }

  .learning-box[open] {
    max-height: 360px;
    overflow: auto;
  }

  .foot {
    margin-top: 6px;
  }
}

@media (max-width: 720px) {
  .learning-grid {
    grid-template-columns: 1fr;
  }

  .learning-summary {
    grid-column: auto;
  }

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

  .learning-field-guide {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 4px;
  }

  .learning-field-guide span {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
  }

  .learning-field-guide small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

/* Unified workflow step treatment. */
.fetch-box > summary,
.learning-box > summary,
.section-divider {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #d8e6f0;
  border-radius: var(--radius);
  background: #f8fbfe;
  color: var(--accent-ink);
  font-size: 0.86rem;
  font-weight: 760;
}

.fetch-box > summary,
.learning-box > summary {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.learning-box > summary {
  list-style: none;
}

.learning-box > summary::-webkit-details-marker {
  display: none;
}

.learning-box > summary::after {
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.learning-box[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.section-divider {
  gap: 8px;
  margin: 8px 0 10px;
  padding-left: 14px;
}

.section-divider::after {
  display: none;
}

.workflow-step-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  padding-left: 14px;
  color: var(--accent-ink);
  font-size: 0.86rem;
  font-weight: 760;
}

.workflow-step-label .step-badge {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 6px;
  font-size: 0.68rem;
}
