/* Арматурын тайралтын тооцоо (/armatur). Layout: a cutting bench — the cut sheet (inputs) sits as a fixed column on the left,
   the rack of cut bars (results) runs long on the right; on a phone they stack. */
:root {
  --bg: #eceff2;
  --surface: #ffffff;
  --sunken: #e1e6eb;
  --ink: #17202a;
  --muted: #566472;
  --line: #cbd3db;
  --steel: #34485c;
  --steel-ink: #ffffff;
  --marker: #f2b11f;
  --marker-ink: #231a02;
  --ok: #18704a; --ok-bg: #dcf0e5;
  --warn: #8c5300; --warn-bg: #fbeed5;
  --bad: #b3261e; --bad-bg: #fbe3e0;
  --rest-a: #c5ced8; --rest-b: #e9edf1;
  --focus: #1f66c2;
  --c0: #2c66a8; --c1: #2a7f52; --c2: #b8432c; --c3: #6f4aa6; --c4: #97601b;
  --c5: #1b7c88; --c6: #9c376b; --c7: #566f1d; --c8: #4656b0; --c9: #7d5038;
  --font-display: "Fira Sans Extra Condensed", "Arial Narrow", "Roboto Condensed", Inter, "Segoe UI", Arial, sans-serif;
  --font-body: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-body);
}
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right, 0px)) 32px max(24px, env(safe-area-inset-left, 0px)); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; margin: 0; text-wrap: balance; line-height: 1.1; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Masthead */
.masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 20px 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--steel); }
.btn:disabled { opacity: .5; cursor: not-allowed; border-color: var(--line); }
.btn.primary { background: var(--marker); border-color: var(--marker); color: var(--marker-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 14px; font-weight: 500; }
.btn.link { border-color: transparent; background: transparent; color: var(--muted); padding: 0 8px; }
.btn.link:hover { color: var(--ink); }
.btn kbd { font: 500 11px var(--font-mono); opacity: .7; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* Main grid */
.layout { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.input-panel { padding: 18px; display: grid; gap: 18px; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel-title h2 { font-size: 22px; }
.eyebrow { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field small { font-size: 12px; color: var(--muted); }
.input {
  width: 100%; min-height: 40px; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.input:hover { border-color: var(--muted); }
.input.num { text-align: right; }
.input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }

.parts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.parts-head h3 { font-size: 18px; }
.parts-head h3.missing { color: var(--muted); font-weight: 600; font-style: italic; }
.step { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 12px; }
.step + .step { padding-top: 16px; border-top: 1px solid var(--line); }
.step legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 10px; font: 700 17px var(--font-display); letter-spacing: .01em; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--steel); color: var(--steel-ink); font: 700 13px var(--font-body); }
.title-input { font-weight: 600; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips button { min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.chips button:hover { border-color: var(--steel); }
.doc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; padding: 16px 18px; }
.doc-head h2 { font-size: 30px; margin-top: 2px; }
.doc-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.doc-head .doc-meta { margin: 0; text-align: right; font-size: 12px; line-height: 1.5; }
.dim-field.is-auto .input { border-style: dashed; border-color: var(--steel); background: var(--sunken); font-weight: 600; }
.auto-tag { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--steel); color: var(--steel-ink); font-size: 11px; font-weight: 600; }
.shape-sum.bad { background: var(--bad-bg); color: var(--bad); }
.shape-card .poz { font-size: 13px; color: var(--muted); }
.shape-card .poz b { color: var(--ink); font-size: 15px; }
.shape-card.off { border-color: var(--bad); }
.off-note { font-size: 12px; color: var(--bad); }
.parts-head span { font-size: 13px; color: var(--muted); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 46vh; overflow-y: auto; }
.parts { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.parts th { position: sticky; top: 0; z-index: 1; background: var(--sunken); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 6px 6px; }
.parts th.r { text-align: right; }
.parts td { padding: 3px; border-top: 1px solid var(--line); }
.parts col.c-mark { width: 15%; } .parts col.c-d { width: 20%; } .parts col.c-len { width: 22%; } .parts col.c-qty { width: 15%; } .parts col.c-shape { width: 19%; } .parts col.c-del { width: 9%; }
.parts .input.poz { font-weight: 600; }
.shape-btn { width: 100%; min-height: 34px; display: grid; place-items: center; padding: 0; border: 1px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer; }
.shape-btn:hover { border-color: var(--steel); border-style: solid; background: var(--surface); }
.shape-btn svg { max-width: 100%; height: auto; }
.shape-svg { display: block; overflow: visible; }
.shape-svg text { fill: currentColor; font-family: var(--font-mono); font-weight: 500; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.parts .input { min-height: 34px; padding: 0 6px; border-color: transparent; background: transparent; }
.parts .input:hover, .parts .input:focus { border-color: var(--line); background: var(--surface); }
.parts .input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.parts select.input { padding: 0 2px; }
.row-del { width: 100%; min-height: 34px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: var(--radius); font-size: 18px; line-height: 1; }
.row-del:hover { color: var(--bad); background: var(--bad-bg); }
.parts-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.parts-tools .spacer { flex: 1; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.errors { display: grid; gap: 6px; }
.errors:empty { display: none; }
.errors p { margin: 0; padding: 8px 10px; border-radius: var(--radius); background: var(--bad-bg); color: var(--bad); font-size: 14px; }

/* Results */
.results, #resultBody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.results .panel { min-width: 0; }
#notes { display: grid; gap: 8px; }
#notes:empty { display: none; }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.note.example { background: var(--warn-bg); color: var(--warn); }
.note.stale { background: var(--sunken); color: var(--ink); border: 1px dashed var(--muted); }
.note .btn { min-height: 30px; }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 16px 18px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font: 600 30px/1.15 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat .value small { font: 500 15px var(--font-body); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat .sub { font-size: 13px; color: var(--muted); }
.stat.need .value { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip svg { flex: none; }

.order { padding: 4px 0 2px; }
.order h2, .group-head h2 { font-size: 22px; }
.order-head { padding: 12px 18px 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.order-head span { font-size: 13px; color: var(--muted); }
.data-scroll { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.data th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data th:first-child, .data td:first-child { text-align: left; padding-left: 18px; }
.data th:last-child, .data td:last-child { padding-right: 18px; }
.data tfoot td { font-weight: 600; border-bottom: 0; }
.data td.text { font-family: var(--font-body); }

.group { padding: 18px; display: grid; gap: 14px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.dia { display: inline-grid; place-items: center; min-width: 54px; height: 34px; padding: 0 8px; border-radius: var(--radius); background: var(--steel); color: var(--steel-ink); font: 700 20px var(--font-display); }
.group-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: 14px; color: var(--muted); }
.group-facts b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.group-facts b.red { color: var(--bad); }

.ruler { position: relative; height: 22px; margin-left: 0; font: 500 11px var(--font-mono); color: var(--muted); border-bottom: 1px solid var(--muted); }
.ruler span { position: absolute; bottom: 0; transform: translateX(-50%); padding-bottom: 6px; white-space: nowrap; }
.ruler span::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 5px; background: var(--muted); }
.ruler span.first { transform: none; }
.ruler span.first::after { left: 0; }
.ruler span.last { transform: translateX(-100%); }
.ruler span.last::after { left: auto; right: 0; }

.patterns { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pattern { display: grid; gap: 6px; }
.pattern-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 14px; }
.pattern-head .pid { font: 700 16px var(--font-display); }
.pattern-head .times { font: 600 15px var(--font-mono); color: var(--bad); }
.pattern-head .formula { font-family: var(--font-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.pattern-head .rest { color: var(--muted); margin-left: auto; }
.pattern-head .rest.reuse { color: var(--ok); font-weight: 600; }
.bar { position: relative; display: flex; height: 30px; border-radius: 3px; background: var(--steel); overflow: hidden; }
.seg { position: relative; flex: none; display: grid; place-items: center; min-width: 0; color: #fff; font: 600 12px var(--font-mono); overflow: hidden; white-space: nowrap; }
.seg + .seg, .seg + .rest-seg { box-shadow: inset 2px 0 0 var(--marker); }
.seg.narrow span { display: none; }
.rest-seg { flex: 1 1 auto; display: grid; place-items: center; min-width: 0; overflow: hidden; white-space: nowrap; font: 500 11px var(--font-mono); color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--rest-a) 0 6px, var(--rest-b) 6px 12px); }
.rest-seg.reuse { color: var(--ok); }
.rest-seg span { background: var(--surface); padding: 0 4px; border-radius: 3px; }
.rest-seg.narrow span { display: none; }
.c0 { background: var(--c0); } .c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); } .c4 { background: var(--c4); }
.c5 { background: var(--c5); } .c6 { background: var(--c6); } .c7 { background: var(--c7); } .c8 { background: var(--c8); } .c9 { background: var(--c9); }

.group-body { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 14px 20px; align-items: start; }
.group-cuts { display: grid; gap: 14px; min-width: 0; }
.shapes { display: grid; gap: 8px; min-width: 0; }
.shapes h3 { font-size: 16px; }
.shapes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shape-card { position: relative; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.shape-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.shape-card-head i { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.shape-card-head .shape-name { margin-left: auto; color: var(--muted); }
.shape-card svg { width: 100%; height: auto; max-width: 220px; max-height: 70px; justify-self: center; }
.shape-card-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.shape-cell { padding-block: 2px !important; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
details.check summary { cursor: pointer; font-size: 14px; color: var(--muted); }
details.check summary:hover { color: var(--ink); }
details.check .data { margin-top: 8px; min-width: 420px; }
details.check .data td:first-child, details.check .data th:first-child { padding-left: 4px; }
.ok-text { color: var(--ok); }

.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty svg { width: 120px; height: auto; opacity: .8; }
.empty h2 { font-size: 22px; color: var(--ink); }
.empty p { margin: 0; max-width: 48ch; }

.foot { margin-top: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); max-width: 90ch; }
.foot p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); z-index: 20;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--radius); background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

.print-only { display: none; }

dialog.shape-dialog { width: min(600px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.3); }
dialog.shape-dialog::backdrop { background: rgba(12, 17, 22, .45); }
.shape-form { display: grid; gap: 14px; padding: 18px; }
.shape-form header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shape-form header h2 { font-size: 22px; }
.shape-form header p { margin: 0; color: var(--muted); font-size: 14px; }
.shape-choices { display: grid; gap: 10px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.choice-group { display: grid; gap: 4px; }
.choice-title { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.shape-choice { position: relative; padding-top: 16px !important; }
.shape-choice .code { position: absolute; top: 3px; left: 5px; font: 700 11px var(--font-mono); color: var(--muted); }
.shape-choice .nm { line-height: 1.2; text-align: center; }
.shape-hooks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.shape-hooks[hidden] { display: none; }
.shape-btn { position: relative; }
.shape-btn .shape-code { position: absolute; top: 1px; left: 3px; font: 700 9px var(--font-mono); color: var(--muted); }
.shape-code { font-family: var(--font-mono); }
.dim-field label i { font-style: normal; color: var(--muted); font-size: 11px; }
.shape-about { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; padding: 8px 10px; border-left: 3px solid var(--marker); background: var(--sunken); border-radius: 0 var(--radius) var(--radius) 0; font-size: 13px; }
.shape-about .use { flex-basis: 100%; color: var(--muted); }
.shape-choice { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; }
.shape-choice:hover { border-color: var(--steel); }
.shape-choice[aria-checked="true"] { border: 2px solid var(--marker); background: var(--sunken); padding: 5px 3px; font-weight: 600; }
.shape-edit { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 14px; align-items: start; }
.shape-preview { display: grid; place-items: center; min-height: 140px; border-radius: var(--radius); background: var(--sunken); color: var(--ink); }
.shape-preview svg { max-width: 100%; height: auto; }
.shape-dims { display: grid; gap: 8px; }
.shape-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin: 0; padding: 8px 10px; border-radius: var(--radius); background: var(--sunken); font-size: 14px; }
.check-line { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--steel); }
.shape-form footer { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 520px) { .shape-edit, .shape-hooks { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
  .group-body { grid-template-columns: minmax(0, 1fr); }
  .shapes { order: -1; }
  .shapes ul { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}
@media (max-width: 1080px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .table-scroll { max-height: none; }
}
@media (max-width: 480px) {
      .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .btn kbd { display: none; }
  .fields { grid-template-columns: 1fr; }
  .stat { padding: 12px; }
  .stat .value { font-size: 24px; }
  .group, .input-panel { padding: 14px; }
  .pattern-head .rest { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; color: #000; padding: 0; font-size: 11pt; }
  .wrap { padding: 0; }
  .rc-header, .rc-hero, .rc-info, .rc-cta, .rc-footer, .masthead-note, .actions, .input-panel, .note, .toast, .foot, details.check summary, dialog { display: none !important; }
  .print-only { display: block; }
  .print-input .data { min-width: 0; }
  .panel.print-input { break-inside: auto; }
  .shape-card { break-inside: avoid; }
  .shapes ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .layout { display: block; }
  .panel { border-color: #bbb; break-inside: avoid; }
  .results { gap: 10px; }
  .group { break-inside: auto; }
  .pattern { break-inside: avoid; }
  .bar, .seg, .rest-seg, .dia, .chip, .c0, .c1, .c2, .c3, .c4, .c5, .c6, .c7, .c8, .c9 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { margin-bottom: 10px; font-size: 11pt; }
  .print-head b { font-weight: 600; }
}

/* EPC Pro page shell around the calculator. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rc-shell { max-width: 1320px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.rc-header { background: #102d4f; color: #fff; border-bottom: 1px solid #1f3f63; padding-top: env(safe-area-inset-top, 0px); }
.rc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 14px; }
.rc-logo { display: inline-flex; align-items: center; min-height: 44px; }
.wordmark { display: block; width: 112px; height: 33px; position: relative; overflow: hidden; flex-shrink: 0; }
.wordmark::before { content: ''; position: absolute; width: 148px; height: 99px; left: -18.3px; top: -21.8px; background: url('assets/epc-brand.png') 0 0 / 148px 99px no-repeat; filter: brightness(0) invert(1); }
.wordmark span { position: absolute; z-index: 1; width: 8px; height: 6.6px; background: #f47721; left: 0; top: 13.3px; }
.rc-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rc-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; color: #fff; font-weight: 700; text-decoration: none; }
.rc-link.outline { border: 1px solid #4d6f94; }
.rc-link.outline:hover { background: #ffffff14; }
.rc-link.orange { background: #f47721; color: #102d4f; font-weight: 800; }
.rc-link.orange:hover { background: #ff8a3d; }
.rc-hero { background: #102d4f; color: #fff; padding-block: 22px 34px; }
.rc-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: #a9bdd3; }
.rc-crumbs li + li::before { content: '/'; margin-right: 8px; }
.rc-crumbs a { color: #c9d7e6; }
.rc-crumbs [aria-current] { color: #fff; font-weight: 600; }
.rc-title { display: flex; align-items: center; gap: 16px; }
.rc-mark { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px #0412244d; }
.rc-mark img { display: block; width: 52px; height: 52px; }
.rc-hero h1 { font-size: 42px; line-height: 1.08; letter-spacing: -.005em; }
.rc-hero p { margin: 12px 0 0; max-width: 760px; color: #c9d7e6; font-size: 17px; line-height: 1.6; }
.masthead-note { margin: 0; color: var(--muted); font-size: 14px; }
.rc-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding-block: 12px 56px; }
.rc-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rc-card h2 { font-family: var(--font-body); font-size: 17px; letter-spacing: 0; color: #102d4f; }
.rc-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.rc-cta { background: #f47721; color: #102d4f; }
.rc-cta .rc-shell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 40px; padding-block: 44px; }
.rc-cta h2 { font-family: var(--font-body); font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.rc-cta p { margin: 6px 0 0; font-size: 16px; }
.rc-cta a { display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px; border-radius: 12px; background: #102d4f; color: #fff; font-weight: 800; text-decoration: none; }
.rc-footer { background: #0b2340; color: #a9bdd3; font-size: 13px; }
.rc-footer .rc-shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); }
.rc-footer a { color: #c9d7e6; }
.rc-header :focus-visible, .rc-hero :focus-visible, .rc-cta :focus-visible, .rc-footer :focus-visible { outline: 3px solid #fb923c; outline-offset: 3px; }
@media (max-width: 720px) {
  .rc-shell, .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .rc-link.orange { display: none; }
  .rc-hero h1 { font-size: 30px; }
  .rc-mark { width: 48px; height: 48px; border-radius: 12px; }
  .rc-mark img { width: 40px; height: 40px; }
  .rc-hero p { font-size: 15px; }
  .rc-cta h2 { font-size: 24px; }
}
