:root {
  --ink: #16152b;
  --muted: #706f86;
  --paper: #f6f5ff;
  --card: rgba(255,255,255,.92);
  --line: #e7e4f2;
  --green: #24204d;
  --green-2: #6457e8;
  --mint: #dff8f4;
  --orange: #ff765f;
  --orange-soft: #fff0e9;
  --violet: #7658ff;
  --aqua: #40d7c8;
  --gold: #f3bb55;
  --red: #d54856;
  --shadow: 0 22px 55px rgba(49, 39, 116, .10);
  font-family: "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 80% -10%, #e4ddff 0, transparent 32%), radial-gradient(circle at 5% 30%, #ddfbf6 0, transparent 25%), var(--paper); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 10px; color: var(--orange); font-size: .72rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.25fr .75fr; }
.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 130px); color: white; background: linear-gradient(90deg,rgba(27,21,65,.96),rgba(53,33,101,.84) 48%,rgba(53,33,101,.2)),url("/assets/medallions-hero.webp") center/cover; }
.brand-panel::after { content: ""; position: absolute; width: 460px; height: 460px; right: -120px; bottom: -220px; border: 70px solid rgba(255,255,255,.08); border-radius: 50%; }
.brand-logo { display:block; object-fit:cover; border-radius:22px; }
.hero-logo { width:88px; height:88px; margin-bottom:28px; border:1px solid rgba(255,255,255,.25); box-shadow:0 16px 40px rgba(0,0,0,.28); }
.brand-panel h1 { font-size: clamp(2.25rem, 4vw, 4.2rem); line-height: 1.12; margin: 0 0 24px; max-width: 760px; }
.brand-panel > p:not(.eyebrow) { max-width: 630px; color: #e8e4ff; font-size: 1.08rem; line-height: 1.8; }
.brand-stat { margin-top: 38px; display: flex; gap: 16px; align-items: center; }
.brand-stat strong { font: 800 2rem Georgia, serif; color: #ffd682; }
.brand-stat span { color: #e8e4ff; border-left: 1px solid rgba(255,255,255,.28); padding-left: 16px; }
.login-card { width: min(420px, 84%); align-self: center; justify-self: center; padding: 42px; background: var(--card); border: 1px solid var(--line); border-radius: 22px 8px 22px 8px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 28px; font-size: 1.8rem; }
label { display: grid; gap: 7px; font-size: .86rem; font-weight: 700; color: #425a54; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: white; border: 1px solid #cfd4ce; border-radius: 8px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(40,98,84,.12); }
textarea { min-height: 88px; resize: vertical; }
.login-card label + label { margin-top: 16px; }
.login-card button { width: 100%; margin-top: 24px; }
.login-card small { display: block; color: var(--muted); line-height: 1.6; margin-top: 18px; }
.form-error { color: var(--red); min-height: 1.4em; font-size: .85rem; }
.primary, .secondary, .danger { min-height: 42px; padding: 9px 17px; border-radius: 8px; border: 0; font-weight: 800; }
.primary { color: white; background: linear-gradient(135deg,var(--violet),#5145cd); box-shadow:0 8px 22px rgba(101,80,230,.24); }
.primary:hover { filter:brightness(1.07); transform:translateY(-1px); }
.secondary { color: #383173; background: linear-gradient(135deg,#e8e5ff,#d9faf5); }
.danger { color: white; background: var(--red); }
.text-button { padding: 5px; color: inherit; background: transparent; border: 0; text-decoration: underline; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; color: white; background: linear-gradient(165deg,#1c193a 0%,#282153 58%,#313a71 100%); display: flex; flex-direction: column; z-index: 10; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-logo { width:46px; height:46px; border-radius:14px; }
.side-brand strong, .side-brand small { display: block; }
.side-brand small { color: #bdb8e8; }
.sidebar nav { display: grid; gap: 4px; margin-top: 22px; }
.sidebar nav button { display: flex; gap: 11px; align-items: center; padding: 11px 12px; color: #d3cff5; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.sidebar nav button:hover, .sidebar nav button.active { color: white; background: linear-gradient(90deg,rgba(118,88,255,.45),rgba(64,215,200,.16)); }
.sidebar nav button.active { box-shadow: inset 3px 0 #ff8b6f; }
.side-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #d3cff5; }
.main-column { min-width:0; }
#user-chip strong, #user-chip small { display: block; }
.mobile-header { display: none; }
#content { min-width: 0; padding: 34px clamp(22px, 4vw, 62px) 70px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.page-head p { margin: 7px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; }
.stat-card, .card { background: var(--card); border: 1px solid rgba(255,255,255,.75); box-shadow: var(--shadow); backdrop-filter:blur(14px); }
.stat-card { position: relative; overflow: hidden; padding: 20px; border-radius: 14px 5px 14px 5px; }
.stat-card::after { content: ""; position: absolute; width: 64px; height: 64px; right: -22px; top: -22px; border-radius: 50%; background: linear-gradient(135deg,#ddd5ff,var(--mint)); }
.stat-card strong { display: block; margin-top: 8px; font: 800 1.8rem Georgia, serif; }
.stat-card span { color: var(--muted); font-size: .82rem; }
.stat-card.highlight { color: white; background: linear-gradient(135deg,#ff765f,#ff9a62); border-color: transparent; }
.stat-card.highlight span { color: #fff0e8; }
.card { padding: 22px; border-radius: 20px; margin-top: 18px; }
.dashboard-hero { position:relative; min-height:270px; overflow:hidden; display:flex; align-items:center; padding:34px; border-radius:26px; color:white; background:linear-gradient(90deg,rgba(25,19,65,.96),rgba(72,45,126,.72) 52%,rgba(72,45,126,.05)),url("/assets/medallions-hero.webp") 70% center/cover; box-shadow:0 24px 60px rgba(63,41,127,.22); margin-bottom:18px; }
.dashboard-hero-content { max-width:520px; position:relative; z-index:1; }
.dashboard-hero h2 { margin:0 0 10px; font-size:clamp(1.65rem,3vw,2.8rem); line-height:1.15; }
.dashboard-hero p { color:#eae7ff; line-height:1.65; }
.edition-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.edition-chips span { padding:7px 11px; border:1px solid rgba(255,255,255,.22); border-radius:999px; background:rgba(255,255,255,.12); backdrop-filter:blur(6px); font-size:.78rem; }
.illustration-note { opacity:.72; font-size:.69rem !important; }
.card h2, .card h3 { margin: 0 0 16px; }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { padding: 10px 11px; color: var(--muted); border-bottom: 2px solid var(--line); text-align: left; white-space: nowrap; }
td { padding: 12px 11px; border-bottom: 1px solid #e8e5de; vertical-align: top; }
tr.clickable:hover td { background: #f7f3ea; cursor: pointer; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 100px; font-size: .73rem; font-weight: 800; }
.badge-draft { color: #596963; background: #e7ebe8; }
.badge-pending { color: #86511f; background: #ffe5b8; }
.badge-approved { color: #1f604f; background: var(--mint); }
.badge-rejected { color: #8b302a; background: #f6d7d2; }
.paper-state { display:inline-flex; padding:4px 8px; border-radius:100px; font-size:.72rem; font-weight:800; white-space:nowrap; }
.paper-state-new { color:#80501b; background:#ffe1ad; }
.paper-state-missing { color:#555; background:#e4e4e4; }
.paper-actions { white-space:nowrap; }
.paper-action { min-height:30px; padding:5px 9px; margin:2px; font-size:.78rem; }
.paper-delete-warning { padding:14px 16px; color:#7d302a; background:#fff0ed; border-left:4px solid var(--red); border-radius:6px; line-height:1.6; }
.toolbar { display: flex; gap: 10px; margin: 0 0 16px; }
.toolbar input { max-width: 460px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 18px; }
.pager button { border: 1px solid var(--line); background: white; padding: 7px 12px; border-radius: 7px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.span-12 { grid-column: span 12; }.span-8 { grid-column: span 8; }.span-6 { grid-column: span 6; }.span-4 { grid-column: span 4; }.span-3 { grid-column: span 3; }.span-2 { grid-column: span 2; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 28px 0 12px; }
.section-title::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.cost-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; align-items: end; padding: 11px; margin-bottom: 8px; background: #f6f3ec; border-radius: 10px; }
.cost-line.easycal_plan, .cost-line.easycal_after_print { border: 1px solid #cfc5ff; background: linear-gradient(145deg,#faf8ff,#effbf8); }
.override-field { color: #79520b; }
.override-field input { border-color: #d8b75a; background: #fffaf0; }
.override-flag { color: #9a5a00 !important; font-weight: 700; }
.icon-button { width: 36px; height: 40px; border: 0; border-radius: 7px; color: var(--red); background: #f5dcd7; }
.result-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; margin-top: 20px; }
.result-card { padding: 17px; border: 1px solid #d8d1ff; border-radius: 15px; background: linear-gradient(145deg,#f1efff,#eafaf7); }
.result-card strong { display: block; margin: 5px 0; font-size: 1.35rem; }
.result-card small { display: block; color: var(--muted); }
.notice { padding: 14px 16px; border-left: 4px solid var(--orange); background: linear-gradient(90deg,var(--orange-soft),#f3efff); border-radius: 5px 13px 13px 5px; color: #684255; line-height: 1.6; }
.material-overlap-list { display:grid; gap:10px; margin:18px 0; }
.material-overlap-choice { display:flex; gap:12px; align-items:flex-start; padding:13px 14px; border:1px solid #e0d8c8; border-radius:10px; background:#fffdf8; cursor:pointer; }
.material-overlap-choice input { width:18px; height:18px; margin-top:2px; accent-color:var(--orange); }
.material-overlap-choice span { min-width:0; }
.material-overlap-choice small { display:block; margin-top:4px; color:var(--muted); }
.material-overlap-choice.automatic { background:#f2f0fb; cursor:default; }
.material-auto-close { flex:0 0 auto; padding:4px 8px; border-radius:100px; color:#55458b; background:#ded8f5; font-size:.72rem; font-weight:800; }
.material-confirm-actions { margin-top:16px; }
.material-overlap-alert { color:#85511b; border-color:#e1a85f; background:#fff2d9; font-weight:800; }
.material-overlap-alert.active { color:white; background:#9a5b20; }
.material-overlap-row td { background:#fffaf0; }
.overlap-text { color:#9a5b20; font-weight:800; }
.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 9px 18px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.empty { padding: 34px; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 25px; bottom: 25px; max-width: 360px; padding: 13px 17px; color: white; background: linear-gradient(135deg,#282153,#6457e8); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s; z-index: 40; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,16,53,.68); z-index: 30; }
.modal-card { position: relative; width: min(940px, 96vw); max-height: 90vh; overflow: auto; padding: 28px; background: var(--card); border-radius: 18px 7px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 1.7rem; }
code { padding: 2px 5px; border-radius: 4px; background: #e8e4dc; }
pre { white-space: pre-wrap; word-break: break-word; max-height: 350px; overflow: auto; padding: 14px; background: #142a25; color: #dcebe5; border-radius: 9px; font-size: .76rem; }
.copyright { padding:22px 24px 32px; color:var(--muted); text-align:center; font-size:.78rem; }
.layout-workspace { display:grid; grid-template-columns:minmax(320px, .78fr) minmax(480px, 1.22fr); gap:18px; align-items:start; }
.layout-controls,.layout-preview { margin-top:0; }
.layout-controls { position:sticky; top:18px; }
.layout-controls > label + label,.layout-controls > .grid-2 + h3,.layout-controls > h3 + .grid-2 { margin-top:14px; }
.layout-controls h3 { margin:20px 0 5px; font-size:.92rem; color:#4e477d; }
.compact-grid { gap:10px; }
.check-label { display:flex; grid-template-columns:auto 1fr; align-items:center; gap:9px; margin-top:16px; padding:11px 12px; border-radius:10px; background:#f1efff; }
.check-label input { width:18px; min-height:18px; accent-color:var(--violet); }
.layout-actions { margin-top:18px; }
.layout-actions button[disabled] { cursor:not-allowed; opacity:.45; box-shadow:none; }
.form-help { display:block; margin-top:14px; color:var(--muted); line-height:1.6; }
.live-chip { padding:5px 9px; border-radius:999px; color:#126c61; background:#dff8f4; font-size:.72rem; font-weight:800; }
.layout-preview { min-height:660px; overflow:hidden; background:linear-gradient(150deg,rgba(255,255,255,.98),rgba(241,239,255,.92)); }
.layout-empty { min-height:600px; display:grid; place-content:center; justify-items:center; text-align:center; color:var(--muted); }
.layout-empty span { display:grid; place-items:center; width:86px; height:86px; border-radius:24px; color:white; background:linear-gradient(135deg,var(--violet),var(--aqua)); box-shadow:0 18px 38px rgba(100,87,232,.25); font-size:2.5rem; }
.layout-empty h2 { margin:18px 0 3px; color:var(--ink); }
.layout-result-head { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.layout-result-head > div:first-child { min-width:150px; }
.layout-result-head small,.layout-result-head span { display:block; color:var(--muted); }
.layout-result-head strong { display:inline-block; margin:3px 7px 0 0; color:#5546da; font:900 clamp(2.5rem,5vw,4.4rem) Georgia,serif; line-height:1; }
.layout-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; min-width:min(390px,60%); }
.layout-metrics span { padding:11px; border-radius:12px; background:white; border:1px solid var(--line); }
.layout-metrics b { display:block; margin-top:4px; color:var(--ink); font-size:1rem; }
.layout-alternatives { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:17px 0; }
.layout-alternatives button { padding:11px 10px; border:1px solid #ddd8fb; border-radius:12px; color:var(--ink); background:#fff; text-align:left; }
.layout-alternatives button:hover,.layout-alternatives button.active { color:#4036a6; border-color:#7869ee; background:linear-gradient(135deg,#eeebff,#e7fcf8); box-shadow:0 8px 20px rgba(93,76,213,.12); }
.layout-alternatives small,.layout-alternatives strong { display:block; }
.layout-alternatives small { min-height:2.6em; color:var(--muted); }
.layout-alternatives strong { margin-top:3px; font-size:1.03rem; }
.layout-canvas { display:grid; place-items:center; min-height:420px; padding:22px; overflow:hidden; border-radius:18px; background:radial-gradient(circle at 50% 30%,#333067,#17152d 72%); box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); }
.layout-svg { width:100%; height:500px; max-height:58vh; filter:drop-shadow(0 16px 16px rgba(0,0,0,.28)); }
.layout-sheet { fill:#fffdf7; stroke:#b9b3d8; }
.layout-usable { fill:none; stroke:#7567e8; stroke-dasharray:1.4 1; opacity:.7; }
.layout-gripper { fill:#ff805f; opacity:.82; }
.layout-piece { fill:#55ddd0; stroke:#157f76; }
.layout-piece.rotated { fill:#ffd369; stroke:#b77914; }
.layout-piece-label { fill:#232044; font-weight:900; text-anchor:middle; dominant-baseline:middle; pointer-events:none; }
.layout-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:16px; margin:13px 0; color:var(--muted); font-size:.78rem; }
.layout-legend span { display:flex; align-items:center; gap:6px; }
.layout-legend i { width:13px; height:13px; border-radius:3px; }
.legend-normal { background:#55ddd0; border:1px solid #157f76; }
.legend-rotated { background:#ffd369; border:1px solid #b77914; }
.legend-gripper { background:#ff805f; }
.layout-detail { display:grid; grid-template-columns:180px 1fr; gap:8px 15px; margin:16px 0 0; padding-top:16px; border-top:1px solid var(--line); font-size:.82rem; }
.layout-detail dt { color:var(--muted); }
.layout-detail dd { margin:0; font-weight:700; }
.layout-render-note { display:block; margin-top:12px; color:var(--muted); }
.layout-linked { margin-bottom:18px; border-left-color:var(--aqua); }
@media (max-width: 1050px) {
  .stat-grid { grid-template-columns: repeat(3,1fr); }
  .cost-line { grid-template-columns: repeat(3, 1fr); }
  .cost-line .icon-button { align-self: end; }
  .layout-workspace { grid-template-columns:1fr; }
  .layout-controls { position:static; }
  .layout-preview { min-height:auto; }
}
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .brand-panel { min-height: 42vh; padding: 40px 28px; }
  .brand-panel h1 { font-size: 2.15rem; }
  .brand-stat, .brand-panel > p:not(.eyebrow) { display: none; }
  .hero-logo { width:64px; height:64px; margin-bottom:18px; }
  .login-card { margin: 35px auto; padding: 28px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -260px; width: 240px; transition: .2s; }
  .sidebar.open { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .mobile-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; min-height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; color: white; background: linear-gradient(90deg,#211b49,#584bd3); z-index: 9; }
  .mobile-header button { border: 0; color: white; background: transparent; font-size: 1.3rem; }
  #content { padding: 24px 15px calc(60px + env(safe-area-inset-bottom)); }
  .page-head { align-items: start; flex-direction: column; }
  .stat-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  [class*="span-"] { grid-column: span 1; }
  .cost-line { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .dashboard-hero { min-height:380px; align-items:flex-end; padding:24px; background:linear-gradient(0deg,rgba(27,21,65,.98),rgba(53,33,101,.18)),url("/assets/medallions-hero.webp") 67% center/cover; }
  .layout-result-head { align-items:flex-start; flex-direction:column; }
  .layout-metrics { width:100%; min-width:0; }
  .layout-alternatives { grid-template-columns:1fr; }
  .layout-alternatives small { min-height:auto; }
  .layout-canvas { min-height:330px; padding:12px; }
  .layout-svg { height:390px; max-height:55vh; }
  .layout-detail { grid-template-columns:1fr; gap:3px; }
  .layout-detail dd { margin-bottom:7px; }
}
@media print {
  .sidebar,.mobile-header,.page-head .actions,.no-print { display:none !important; }
  .app-shell { display:block; }
  #content { padding:0; }
  body,.card { background:white; }
  .card { box-shadow:none; border:0; }
  body.printing-layout #content > *:not(.layout-workspace) { display:none !important; }
  body.printing-layout .layout-workspace { display:block; }
  body.printing-layout .layout-controls { display:none !important; }
  body.printing-layout .layout-preview { display:block; margin:0; padding:0; }
  body.printing-layout .layout-canvas { background:white; }
  body.printing-layout .layout-svg { height:190mm; max-height:190mm; }
}
.material-price-table { min-width: 1040px; }
.muted-row { opacity: .58; }
.tier-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tier-chip { border: 1px solid #c9d8d2; border-radius: 999px; background: #f4f8f6; color: #214f45; padding: 5px 9px; cursor: pointer; }
.tier-chip:hover { background: #e4f0eb; }
.material-match-state { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:.72rem; font-weight:800; }
.material-match-state.matched { color:#17685d; background:#daf5ef; }
.material-match-state.waiting { color:#8b5519; background:#fff0cf; }
.material-match-reason { display:block; max-width:320px; margin:6px 0; color:var(--muted); line-height:1.45; }
.material-comparison-form { margin-top:16px; align-items:end; }
.material-comparison-summary { background:linear-gradient(145deg,#fbfaff,#effbf8); }
.material-recommendation-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; margin-top:16px; }
.material-recommendation { padding:16px; border:1px solid #d9d4ef; border-radius:14px; background:white; }
.material-recommendation.winner { border-color:#84d8c9; box-shadow:0 10px 26px rgba(30,130,112,.11); }
.material-recommendation.single { border-color:#e4c98e; background:#fffaf0; }
.material-recommendation small,.material-recommendation span { color:var(--muted); }
.material-recommendation h3 { margin:7px 0; }
.material-recommendation p { margin:0 0 8px; line-height:1.55; }
.material-equivalence-list { display:grid; gap:12px; margin-top:16px; }
.material-equivalence-question { padding:16px; border:1px solid #e1c98c; border-radius:14px; background:#fffaf0; }
.material-equivalence-question p { margin:0 0 10px; }
.material-equivalence-question > small { display:block; margin:9px 0 13px; color:#805924; }
.material-spec-pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.material-spec-pair span { padding:10px; border-radius:9px; background:white; border:1px solid #eee4cf; }
.material-comparison-table { min-width:1280px; }
.material-comparison-table th:first-child { min-width:145px; }
.comparison-winner-row td { background:#effbf7; }
.material-relation { display:inline-flex; margin-bottom:5px; padding:3px 7px; border-radius:999px; font-size:.69rem; font-weight:800; }
.material-relation.main { color:#5142b1; background:#ebe8ff; }
.material-relation.substitute { color:#197061; background:#dff8f2; }
.comparison-tier-list { display:flex; flex-wrap:wrap; gap:5px; min-width:330px; }
.comparison-tier { padding:4px 7px; border:1px solid #ddd8ca; border-radius:7px; background:#faf9f5; font-size:.72rem; white-space:nowrap; }
.comparison-tier.selected { color:white; border-color:#594bd0; background:#6658dd; font-weight:800; }
@media (max-width: 900px) {
  .material-spec-pair { grid-template-columns:1fr; }
  .material-recommendation-grid { grid-template-columns:1fr; }
}
