@import url("../css/typography.css");
:root {
  --bg: #f5f7fa;
  --card: #fff;
  --text: #102a43;
  --muted: #486581;
  --weak: #6f8399;
  --line: #d9e2ec;
  --cyan: #0a5382;
  --blue: #1565c0;
}

body {
  min-width: 960px;
  margin: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(147, 197, 216, 0.28), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f3f7fa 100%);
  color: var(--text);
  font-family:var(--font-app);
}

.cad-page {
  max-width: min(1540px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.cad-hero,
.cad-card,
.mode-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(16, 42, 67, 0.08);
}

.cad-hero {
  padding: 24px 28px;
}

.back {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  border: 1px solid #c9d9e8;
  border-radius: 999px;
  background: #fff;
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  padding: 7px 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.cad-hero h1 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.25;
}

.lead {
  margin: 0;
  max-width: 920px;
  color: var(--muted);
  line-height: 1.65;
}

.cad-principles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.cad-principles span {
  border: 1px solid #c9d9e8;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
}

.cad-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.mode-panel,
.cad-card {
  padding: 18px;
}

.mode-panel h2,
.card-title h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
}

.card-title p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.mode {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 1px solid #c9d9e8;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.mode.is-active {
  border-color: var(--cyan);
  background: #eaf5fb;
}

.mode strong,
.mode span {
  display: block;
}

.mode span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.layer-input span,
.manual-field label,
.path-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid #c9d9e8;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: 14px/1.55 var(--font-app);
}

textarea {
  min-height: 190px;
  resize: vertical;
  padding: 10px 12px;
}

select {
  height: 36px;
  padding: 6px 10px;
}

input {
  height: 38px;
  box-sizing: border-box;
  padding: 7px 10px;
}

.file-import {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid #d6e7f4;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(234, 245, 251, 0.92), rgba(255, 255, 255, 0.96));
  padding: 14px;
  margin-bottom: 12px;
}

.file-import .primary,
.file-import .secondary {
  min-height: 38px;
  white-space: nowrap;
}

.path-field {
  min-width: 0;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

button,
.link-button {
  border-radius: 9px;
  font: 800 14px var(--font-app);
  padding: 8px 16px;
  cursor: pointer;
}

.primary {
  border: 1px solid var(--cyan);
  background: var(--cyan);
  color: #fff;
}

.secondary,
.link-button {
  border: 1px solid #c9d9e8;
  background: #fff;
  color: var(--cyan);
  text-decoration: none;
}

.notice {
  margin-top: 14px;
  border-left: 6px solid var(--blue);
  border-radius: 10px;
  background: #f0f7ff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}

.mapping-table {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mapping-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 80px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(217, 226, 236, 0.95);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.mapping-row b {
  font-family:var(--font-app);
  font-size: 13px;
}

.mapping-row span {
  color: var(--muted);
  font-size: 13px;
}

.confidence {
  justify-self: end;
  border-radius: 999px;
  background: #eaf5fb;
  color: var(--cyan);
  font-family:var(--font-app);
  padding: 4px 8px;
}

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

@media (max-width: 1180px) {
  .cad-layout {
    grid-template-columns: 1fr;
  }
  .manual-grid {
    grid-template-columns: 1fr;
  }
  .file-import {
    grid-template-columns: 1fr;
  }
}
