/* Compact site framing. Form fields retain their readable text and touch targets. */
.site-header {
  --header-control-width: 164px;
  display: grid;
  grid-template-columns: minmax(215px, 1fr) auto minmax(160px, 1fr);
  grid-template-areas: "brand navigation account";
  gap: 10px 20px;
  padding: 12px clamp(20px, 4vw, 64px);
  background: linear-gradient(115deg, #101c2c, #1a2b40);
  border-bottom: 1px solid #b79b6047;
}
.site-header .brand { grid-area: brand; gap: 10px; min-width: 0; }
.brand-logo { display: block; width: 56px; height: 54px; object-fit: contain; flex-shrink: 0; }
.legal-header .brand-logo { width: 46px; height: 44px; }
.site-header .brand-mark { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 7px; background: #d0ac6409; }
.site-header .brand-text { min-width: 0; }
.site-header .brand-title { font-size: .91rem; gap: 8px; letter-spacing: .11em; }
.site-header .brand-subtitle { font-size: .55rem; margin-top: 2px; letter-spacing: .11em; }
.site-header .version-badge { font-size: .59rem; padding: 2px 5px; border-color: #b79b6066; background: #d0ac640c; }
.site-header .view-switch { grid-area: navigation; order: initial; padding: 3px; border-color: #acbbcd3b; border-radius: 10px; background: #070f1b26; }
.site-header .view-switch button { min-height: 44px; padding: 7px 17px; border-radius: 7px; font-size: .82rem; }
.site-header .view-switch button.selected { background: #f5f4ee; box-shadow: 0 1px 4px #0002; }
.site-header .access-bar { grid-area: account; justify-self: end; justify-content: flex-end; width: auto; gap: 8px; flex-wrap: nowrap; }
.site-header #access-status { font-size: .68rem; max-width: 110px; line-height: 1.35; text-align: right; }
.site-header .access-bar .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 1px solid #b79b6066; border-radius: 8px; padding: 8px 11px; color: #f0ddb6; text-decoration: none; font-size: .78rem; white-space: nowrap; }
.site-header .access-bar .text-button:hover { background: #d0ac6414; }
.site-header .access-bar .text-button,
.site-header .header-controls .language-switch { width: var(--header-control-width); flex-shrink: 0; }
.site-header .header-controls .language-switch button { flex: 1; }
.access-bar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand links" "company links";
  gap: 3px 24px;
  padding: 14px 28px 16px;
  width: calc(100% - 48px);
  max-width: 1220px;
  border-top: 1px solid #cbd4de;
  align-items: center;
  background: transparent;
}
.footer-brandline { grid-area: brand; display: flex; align-items: center; gap: 8px; min-width: 0; }
.footer-brand { color: var(--text); font-size: .79rem; font-weight: 650; letter-spacing: .03em; }
.footer-version { font-size: .63rem; color: #667181; font-variant-numeric: tabular-nums; }
.footer-company { grid-area: company; font-size: .7rem; line-height: 1.6; letter-spacing: .02em; color: #596675; }
.footer-company sup { font-size: .7em; }
.footer-company small { font-size: 1em; font-weight: 400; color: inherit; letter-spacing: 0; white-space: nowrap; }
.site-footer nav { grid-area: links; display: flex; align-items: center; justify-content: flex-end; gap: 2px 17px; }
.site-footer nav a, .site-footer nav .text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 6px 0; font-size: .73rem; line-height: 1.4; text-decoration: none; text-underline-offset: 4px; white-space: nowrap; }
.site-footer nav a:hover, .site-footer nav .text-button:hover { color: var(--gold-dark); text-decoration: underline; }
.site-footer nav a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: underline; }

.legal-header { padding: 10px max(20px, calc((100vw - 960px) / 2)); background: linear-gradient(115deg, #101c2c, #1a2b40); border-bottom: 1px solid #b79b6047; }
.legal-header > a:last-child { color: #f0ddb6; font-size: .8rem; text-underline-offset: 4px; }
.privacy-contact { margin-top: 26px; padding: 18px 20px; background: #eaf0f5; border-left: 3px solid #b7a271; border-radius: 0 8px 8px 0; }
.privacy-contact h2 { margin: 0 0 10px; }
.privacy-contact address { font-style: normal; font-size: .94rem; line-height: 1.75; }
.privacy-contact p:last-child { margin-bottom: 0; }
.legal-toc { display: flex; gap: 8px 20px; flex-wrap: wrap; margin: 18px 0 28px; font-size: .87rem; }
.legal-toc a { display: inline-flex; align-items: center; min-height: 44px; }
.legal-page h2, .legal-page section { scroll-margin-top: 20px; }
.rights-link { padding: 12px 14px; background: #eef3f4; border-radius: 8px; margin: 14px 0 22px; font-size: .83rem; line-height: 1.6; }
.rights-link a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.rights-link span { display: block; font-size: .77rem; color: var(--muted); }
.privacy-summary { padding: 15px 18px; background: #eef3f4; border-radius: 8px; }
.privacy-summary ul { padding-left: 20px; line-height: 1.65; font-size: .92rem; }
.privacy-summary li { margin: 7px 0; }

@media (max-width: 1050px) {
  .site-header { grid-template-columns: minmax(200px, 1fr) auto auto; gap: 12px; padding-inline: 22px; }
  .site-header #access-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-footer { width: calc(100% - 32px); padding-inline: 8px; gap: 3px 14px; }
}
@media (max-width: 760px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand account" "navigation navigation"; gap: 7px 10px; padding: 10px 16px; }
  .site-header .brand { gap: 9px; }
  .site-header .brand-logo { width: 48px; height: 46px; }
  .site-header .brand-mark { width: 34px; height: 34px; font-size: 1rem; border-radius: 6px; flex-shrink: 0; }
  .site-header .brand-title { font-size: .81rem; letter-spacing: .09em; gap: 6px; }
  .site-header .brand-subtitle { font-size: .48rem; letter-spacing: .075em; }
  .site-header .version-badge { font-size: .54rem; padding: 2px 4px; }
  .site-header .access-bar .text-button { font-size: .75rem; padding: 8px 9px; gap: 5px; }
  .site-header .view-switch { width: 100%; padding: 2px; border-radius: 9px; gap: 3px; }
  .site-header .view-switch button { flex: 1; font-size: .81rem; padding: 6px 8px; }
  .seller-layout { padding: 20px 16px 24px; }
  .intro .company-line { font-size: .68rem; letter-spacing: .08em; margin-bottom: 8px; }
  .intro-copy { font-size: .96rem; line-height: 1.5; margin: 11px 0 13px; }
  .intro .journey-note { font-size: .8rem; line-height: 1.55; margin: 12px 0; padding: 10px 12px; background: #e8edf2; border-left: 2px solid #b7a271; border-radius: 0 7px 7px 0; }
  .site-footer { width: calc(100% - 32px); grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "company" "links"; gap: 3px; padding: 11px 0 max(10px, env(safe-area-inset-bottom)); }
  .footer-brandline { justify-content: space-between; }
  .footer-brand { font-size: .76rem; }
  .footer-version { font-size: .62rem; }
  .footer-company { font-size: .69rem; line-height: 1.55; letter-spacing: 0; }
  .site-footer nav { justify-content: flex-start; gap: 2px 18px; flex-wrap: wrap; }
  .site-footer nav a, .site-footer nav .text-button { font-size: .72rem; }
  .privacy-contact { padding: 16px; }
}
@media (max-width: 359px) {
  .site-header { padding-inline: 12px; }
  .site-header .brand-title { font-size: .75rem; }
  .site-header .brand-subtitle { font-size: .44rem; }
  .site-footer nav { gap: 2px 12px; }
  .site-footer nav a, .site-footer nav .text-button { font-size: .68rem; }
}
@media print {
  .site-header, .legal-header, .site-footer { display: none; }
}
/* The language control stays beside the section control when space permits. */
.header-controls { grid-area:navigation; display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.site-header .header-controls .view-switch { grid-area:auto; }
.language-switch { display:inline-flex; align-items:center; padding:3px; gap:2px; border:1px solid #acbbcd3b; border-radius:9px; background:#070f1b26; }
.language-switch button { min-height:44px; padding:7px 10px; border:0; border-radius:6px; background:transparent; color:#d3dbe5; font-size:.73rem; line-height:1.2; white-space:nowrap; }
.language-switch button.selected { background:#d2b57622; color:#f5dfb4; box-shadow:inset 0 0 0 1px #b79b6055; }
.language-switch button:hover { background:#d2b57630; }
.language-switch button:focus-visible { outline:2px solid #f5dfb4; outline-offset:3px; }
.language-code { display:none; }
.legal-header { gap:12px; flex-wrap:wrap; }
.legal-header > a:not(.legal-brand) { color:#f0ddb6; font-size:.8rem; margin-left:auto; }
.draft-note { display:block; margin-top:14px; line-height:1.65; }
.draft-note p { margin:0; line-height:inherit; }
.draft-note .text-button { display:block; width:fit-content; margin-top:4px; padding:4px 0; line-height:1.4; }
.submit-reassurance { display:grid; grid-template-columns:auto minmax(0,1fr); gap:9px; }
#reassurance-text { font-weight:400; text-align:left; line-height:1.65; hyphens:none; overflow-wrap:break-word; }
.industry-other-field { padding:14px 16px; background:#eef3f6; border-left:3px solid #b7a271; border-radius:0 8px 8px 0; }
.industry-native { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.industry-trigger { width:100%; min-height:48px; padding:12px; border:1px solid #aab5c3; border-radius:8px; background:white; color:var(--ink); text-align:left; font:inherit; }
.industry-trigger[data-empty="true"] { color:#737f8b; }
.industry-dialog { width:min(460px,calc(100vw - 28px)); padding:20px; max-height:90dvh; }
.industry-dialog h2 { font-size:1.2rem; }
.industry-scroll-help { color:var(--muted); font-size:.85rem; margin:8px 0; }
.industry-list { overflow-y:auto; overscroll-behavior:contain; max-height:min(280px,45dvh); border-block:1px solid #dce2e7; scrollbar-gutter:stable; }
.industry-option { display:block; width:100%; min-height:48px; padding:12px; border:0; border-radius:6px; text-align:left; background:white; font:inherit; font-size:.95rem; }
.industry-option:hover,.industry-option:focus-visible { background:#edf2f6; outline:2px solid #8c7849; outline-offset:-2px; }
.industry-option[aria-selected="true"] { background:#f6f0df; color:#6c511a; }
.industry-scroll { display:block; width:100%; min-height:44px; border:0; background:#f3f6f8; color:#5c491f; font:inherit; font-size:.85rem; }
.industry-scroll:disabled { opacity:.4; }
.account-role,.internal-boundary { padding:12px 16px; border-left:3px solid #b7a271; border-radius:0 8px 8px 0; background:#f5f0e4; color:#604b1f; font-size:.85rem; line-height:1.6; }
.cockpit > .internal-boundary { margin:0 0 24px; }
/* Keep case sections separate even when optional notes or mail states are present. */
.deal-detail { --case-section-gap:28px; overflow-wrap:anywhere; }
.deal-detail > .section-title,
.deal-detail > section:not(.next-action):not(.draft-panel) { margin-top:var(--case-section-gap); }
.deal-detail .section-title { margin-bottom:14px; line-height:1.45; }
.deal-detail .detail-note + .section-title { margin-top:24px; }
.deal-detail > .mail-status { margin:var(--case-section-gap) 0 12px; }
.deal-detail > .demo-note { margin:12px 0 0; }
.deal-detail .export-actions { gap:12px; margin:16px 0; }
.deal-detail .export-actions a { min-width:0; max-width:100%; white-space:normal; }
.deal-detail .follow-up-list { margin:0; padding-left:24px; }
.deal-detail .follow-up-list li { padding-left:2px; margin-bottom:12px; }
.deal-detail .follow-up-list li:last-child { margin-bottom:0; }
.detail-questionnaire > p { font-size:.9rem; line-height:1.65; margin-bottom:18px; }
.detail-questionnaire .question-card { margin:12px 0 0; }
.detail-questionnaire .question-card:first-of-type { margin-top:0; }
.deal-detail .internal-form { margin-top:var(--case-section-gap); padding-top:24px; }
.internal-form .section-title { margin-bottom:20px; }
.internal-form .field { margin-bottom:20px; }
.internal-form .save-bar { gap:12px; margin-top:24px; align-items:flex-start; }
.internal-form .save-bar .demo-note { flex-basis:100%; }
.deal-detail .field :is(input,select,textarea) { min-width:0; max-width:100%; box-sizing:border-box; }
/* Safari date controls otherwise retain an intrinsic width in narrow flex columns. */
.deal-detail input[type="date"] { display:block; appearance:none; -webkit-appearance:none; width:100%; min-width:0; max-width:100%; min-height:48px; }
.deal-detail input[type="date"]::-webkit-date-and-time-value { min-width:0; text-align:left; }
.deal-detail .fact-grid > div { min-width:0; }
.deal-detail .fact-grid dd { min-width:0; overflow-wrap:anywhere; }
.deal-detail .detail-title > div { min-width:0; }
@media (max-width:760px) {
  .deal-detail .detail-title > .status { display:inline-flex; margin-top:12px; }
  .deal-detail .question-card > summary { flex-wrap:wrap; gap:6px 12px; }
  .internal-form .save-bar .primary { width:100%; max-width:100%; white-space:normal; }
}
.account-note { font-size:.85rem; line-height:1.6; color:var(--muted); }
.danger { min-height:44px; padding:12px 16px; border:1px solid #a83d33; border-radius:8px; background:#9f352b; color:white; font:inherit; }
html[lang="en"] .intro h1 { letter-spacing:-.04em; }
@media (min-width:761px) and (max-width:1180px) {
  .site-header { grid-template-columns:minmax(210px,1fr) auto; grid-template-areas:"brand account" "navigation navigation"; }
  .header-controls { justify-content:center; }
}
@media (max-width:760px) {
  /* Two deliberate rows: brand/account, then sections/language. No orphan row. */
  .site-header { --header-control-width:96px; gap:8px 10px; padding-top:10px; padding-bottom:10px; }
  .site-header .brand-logo { width:44px; height:44px; }
  .site-header .brand { gap:8px; }
  .header-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:stretch; min-width:0; }
  .site-header .header-controls .view-switch { width:auto; min-width:0; gap:2px; }
  .site-header .view-switch button { padding-inline:7px; font-size:.75rem; white-space:nowrap; }
  .site-header .header-controls .language-switch { padding:2px; gap:2px; }
  .site-header .language-switch button { width:44px; min-width:44px; min-height:44px; padding:0; font-size:.72rem; font-weight:600; letter-spacing:.02em; }
  .site-header .language-label { display:none; }
  .site-header .language-code { display:inline; }
  .language-switch button { padding-inline:8px; font-size:.7rem; }
  .legal-header { padding:10px 16px; }
}
@media (max-width:359px) {
  .site-header .brand-logo { width:38px; height:40px; }
  .site-header .brand { gap:6px; }
  .site-header .access-bar .text-button { padding-inline:7px; }
  .site-header .access-bar svg { display:none; }
  .header-controls { gap:6px; }
  .site-header .view-switch button { padding-inline:5px; font-size:.72rem; }
}
/* A short, deliberate acknowledgement step; each complete row is a touch target. */
.process-notice{margin:24px 0;padding:22px;border:1px solid #d6e1df;border-top:3px solid #8eaaa1;border-radius:12px;background:#f3f7f5}
.process-notice h2{margin:0 0 10px;font-family:inherit;font-size:1.12rem;line-height:1.4;color:#233e38}
.process-introduction{margin:0 0 16px;font-size:.9rem;line-height:1.6;color:#53646a}
.process-notice .process-confirmation{margin:0;padding:16px 0;border-top:1px solid #dce6e1;align-items:start;font-size:.94rem;line-height:1.65;font-weight:500;cursor:pointer;gap:12px}
.process-notice .process-confirmation input{margin-top:5px;flex:0 0 20px;width:20px;height:20px;accent-color:#31594d}
.process-explanation{margin:8px 0 0;padding-top:12px;border-top:1px solid #dce6e1;font-size:.86rem;line-height:1.65;color:#53646a}
.process-explanation summary{padding:8px 0;min-height:44px;color:#31594d;font-weight:600;cursor:pointer}
.process-explanation p{margin:10px 0}
.process-outlook{margin:14px 0 0;padding-top:14px;border-top:1px solid #dce6e1;color:#31594d;font-size:.9rem;line-height:1.6}
@media(max-width:520px){.process-notice{padding:16px}.process-notice .process-confirmation{font-size:.9rem}}
