:root{
  /* SafariMatcher "trust" palette (Apple-clean, safari-warm) */
  --bg-top: #ffffff;
  --bg-mid: #fbfaf7;
  --bg-bottom: #f6f1e6;

  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.70);

  --text: #1f2933;
  --muted: rgba(31, 41, 51, 0.70);

  --border: rgba(17, 24, 39, 0.10);
  --border-strong: rgba(17, 24, 39, 0.16);

  --shadow-lg: 0 24px 70px rgba(17, 24, 39, 0.14);
  --shadow-md: 0 14px 40px rgba(17, 24, 39, 0.10);
  --shadow-sm: 0 8px 24px rgba(17, 24, 39, 0.08);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius: 14px;

  --brand: #8e7a47;
  --brand-dark: #6f5c33;
  --brand-ink: rgba(142, 122, 71, 0.18);

  --focus: rgba(142, 122, 71, 0.22);

  --yes: #2e7d32;
  --no: #c62828;
  --depends: #f57c00;

  --yes-tint: rgba(46, 125, 50, 0.08);
  --no-tint: rgba(198, 40, 40, 0.08);
  --depends-tint: rgba(245, 124, 0, 0.10);

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 28px;
  --space-6: 40px;

  --container: 1100px;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(142, 122, 71, 0.10), transparent 60%),
    radial-gradient(1200px 700px at 85% 0%, rgba(46, 125, 50, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 38%, var(--bg-bottom) 100%);
  min-height: 100%;
}

body{
  min-height: 100vh;
}

/* Layout container */
.container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}

@media (min-width: 860px){
  .container{ padding: 0 34px; }
}

@media (min-width: 1100px){
  .container{ padding: 0 42px; }
}

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(255, 255, 255, 0.70);
  border-bottom: 1px solid var(--border);
}

.topbar-inner{
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px 0;
}

.logo-slot{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(142, 122, 71, 0.22);
  background:
    radial-gradient(120px 60px at 30% 30%, rgba(142, 122, 71, 0.18), transparent 60%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 22px rgba(142, 122, 71, 0.10);
  color: rgba(31, 41, 51, 0.85);
  letter-spacing: 0.2px;
  font-weight: 650;
}

.tagline{
  font-size: 13px;
  font-weight: 600;
  color: rgba(31, 41, 51, 0.62);
  text-align: right;
}

@media (max-width: 820px){
  .topbar-inner{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tagline{ text-align: left; }
  .logo-slot{ width: 100%; }
}

/* Main spacing */
main.container{
  padding: 26px 0 90px;
}

/* Wizard shell */
.wizard{
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Wizard header */
.wizard-header{
  padding: 26px 22px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.86) 100%),
    radial-gradient(1200px 500px at 20% 0%, rgba(142, 122, 71, 0.10), transparent 55%),
    radial-gradient(900px 450px at 80% 0%, rgba(46, 125, 50, 0.08), transparent 55%);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px){
  .wizard-header{ padding: 30px 30px 20px; }
}

.wizard-title-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.wizard-titles{
  min-width: 0;
}

.wizard-title{
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 760;
}

.wizard-subtitle{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 62ch;
}

.wizard-meta{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.chip, .save-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
  font-size: 13px;
  font-weight: 650;
  color: rgba(31,41,51,0.78);
  white-space: nowrap;
}

.save-chip{
  position: relative;
  padding-left: 30px;
}

.save-chip::before{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  position: absolute;
  left: 12px;
  background: rgba(46,125,50,0.55);
  box-shadow: 0 0 0 4px rgba(46,125,50,0.12);
}

.save-chip.is-saving::before{
  background: rgba(245,124,0,0.70);
  box-shadow: 0 0 0 4px rgba(245,124,0,0.14);
}

.save-chip.is-saved::before{
  background: rgba(46,125,50,0.72);
  box-shadow: 0 0 0 4px rgba(46,125,50,0.14);
}

@media (max-width: 820px){
  .wizard-title-row{
    flex-direction: column;
    align-items: flex-start;
  }
  .wizard-meta{ align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Stepper */
.wizard-stepper{
  margin-top: 18px;
}

.stepper-list{
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stepper-item{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.62);
  cursor: pointer;
  user-select: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.stepper-item:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.78);
  border-color: rgba(17,24,39,0.16);
}

.stepper-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(31,41,51,0.24);
}

.stepper-item.is-complete .stepper-dot{
  background: rgba(46,125,50,0.70);
}

.stepper-item.is-current{
  border-color: rgba(142, 122, 71, 0.35);
  background: rgba(142, 122, 71, 0.10);
}

.stepper-item.is-current .stepper-dot{
  background: rgba(142, 122, 71, 0.78);
}

.stepper-label{
  font-size: 13px;
  font-weight: 700;
  color: rgba(31,41,51,0.78);
}

.stepper-bar{
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(17,24,39,0.08);
  overflow: hidden;
}

.stepper-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(142, 122, 71, 0.9), rgba(46, 125, 50, 0.65));
  transition: width 260ms ease;
}

/* Wizard body */
.wizard-form{
  padding: 0;
}

.wizard-body{
  padding: 22px;
}

@media (min-width: 900px){
  .wizard-body{ padding: 30px; }
}

.wizard-step{
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.wizard-step.is-active{
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: stepIn 240ms ease;
}

@keyframes stepIn{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

.step-card{
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(900px 500px at 30% 10%, rgba(142, 122, 71, 0.07), transparent 55%),
    rgba(255,255,255,0.86);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

@media (min-width: 900px){
  .step-card{ padding: 26px; }
}

.step-head{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.step-title{
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.step-hint{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 75ch;
}

/* Tip */
.step-footer{
  margin-top: 18px;
}

.tip{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(142, 122, 71, 0.20);
  background: rgba(142, 122, 71, 0.06);
}

.tip-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(142,122,71,0.78);
  margin-top: 6px;
  flex-shrink: 0;
}

.tip-text{
  font-size: 13px;
  color: rgba(31,41,51,0.78);
  font-weight: 600;
}

/* Form grid + fields */
.form-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

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

.field label{
  font-size: 13px;
  font-weight: 750;
  color: rgba(31,41,51,0.80);
}

.field-help{
  font-size: 12px;
  color: rgba(31,41,51,0.62);
}

.field input,
.field textarea,
.mode-select,
.prob-select,
#languageSelect{
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.92);
  color: rgba(31,41,51,0.92);
  padding: 12px 12px;
  font-size: 15px;
  line-height: 1.25;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 120ms ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.field input,
.mode-select,
.prob-select,
#languageSelect{
  height: 46px;
}

.field textarea{
  min-height: 112px;
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.mode-select:hover,
.prob-select:hover,
#languageSelect:hover{
  border-color: rgba(17,24,39,0.22);
}

.field input:focus,
.field textarea:focus,
.mode-select:focus,
.prob-select:focus,
#languageSelect:focus{
  outline: none;
  border-color: rgba(142,122,71,0.70);
  box-shadow: 0 0 0 5px var(--focus), inset 0 1px 0 rgba(255,255,255,0.75);
}

.is-invalid{
  border-color: rgba(198,40,40,0.65) !important;
  box-shadow: 0 0 0 5px rgba(198,40,40,0.12) !important;
}

.field input:disabled,
.field textarea:disabled,
.mode-select:disabled,
.prob-select:disabled,
#languageSelect:disabled{
  background: rgba(17,24,39,0.05);
  color: rgba(31,41,51,0.45);
  cursor: not-allowed;
}

/* Select chevron */
.mode-select,
.prob-select,
#languageSelect{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236F5C33' d='M5.75 7.5 10 11.75 14.25 7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

/* Matrix */
.matrix-top{
  margin: 10px 0 10px;
}

.small-note{
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pill-inline{
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid rgba(17,24,39,0.12);
  background: rgba(255,255,255,0.80);
  box-shadow: 0 8px 20px rgba(17,24,39,0.08);
  margin: 0 2px;
}

.pill-inline.pill-yes{
  border-color: rgba(46,125,50,0.18);
  background: rgba(46,125,50,0.10);
  color: rgba(20, 60, 30, 0.88);
}

.pill-inline.pill-no{
  border-color: rgba(198,40,40,0.18);
  background: rgba(198,40,40,0.10);
  color: rgba(80, 20, 20, 0.88);
}

.matrix-wrapper{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
  overflow: auto;
}

.matrix-table{
  width: 100%;
  min-width: 740px;
  border-collapse: separate;
  border-spacing: 0;
}

.matrix-table thead th{
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: rgba(31,41,51,0.70);
  text-align: center;
  padding: 12px 12px;
}

.matrix-table th,
.matrix-table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(17,24,39,0.08);
  vertical-align: top;
  white-space: nowrap;
}

.matrix-table th:first-child,
.matrix-table td:first-child{
  text-align: left;
}

.sticky-col{
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 280px;
  background: rgba(255,255,255,0.92);
  box-shadow: 1px 0 0 rgba(17,24,39,0.08);
}

.row-label{
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-name{
  font-weight: 760;
  color: rgba(31,41,51,0.90);
}

.mode-wrap{
  display: flex;
  align-items: center;
  gap: 10px;
}

.months-btn{
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(142,122,71,0.26);
  background: rgba(142,122,71,0.08);
  color: rgba(31,41,51,0.82);
  font-weight: 750;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.months-btn:hover{
  transform: translateY(-1px);
  background: rgba(142,122,71,0.12);
  border-color: rgba(142,122,71,0.34);
}

.months-btn:active{
  transform: translateY(0);
}

.badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,0.12);
  background: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 800;
}

.months-meta{
  margin-top: 6px;
  max-width: 320px;
}

.months-summary{
  font-size: 12px;
  color: rgba(31,41,51,0.64);
  font-weight: 650;
  line-height: 1.35;
}

/* Row mode tints */
tr.row-mode-yes td,
tr.row-mode-yes th.sticky-col{ background: var(--yes-tint); }

tr.row-mode-no td,
tr.row-mode-no th.sticky-col{ background: var(--no-tint); }

tr.row-mode-depends td,
tr.row-mode-depends th.sticky-col{ background: var(--depends-tint); }

tr.row-disabled{ opacity: 0.65; }

.matrix-table tbody tr[data-main="1"]:hover td,
.matrix-table tbody tr[data-main="1"]:hover th{
  background: rgba(255,255,255,0.74);
}

/* Hidden detail rows (host only) */
tr.expand-row.is-hidden{ display: none; }

/* Month panel (used inside sheet) */
.month-panel{
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-sm);
}

.panel-title{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title .t{
  font-size: 13px;
  font-weight: 800;
  color: rgba(31,41,51,0.80);
}

.panel-title .hint{
  font-size: 12px;
  color: rgba(31,41,51,0.55);
}

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

@media (max-width: 980px){
  .month-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px){
  .month-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.month-cell{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-label{
  font-size: 12px;
  font-weight: 800;
  color: rgba(31,41,51,0.70);
}

/* Probability color accents */
.prob-select.prob-100{ border-color: rgba(46,125,50,0.40); background: rgba(46,125,50,0.10); }
.prob-select.prob-75{  border-color: rgba(46,125,50,0.28); background: rgba(46,125,50,0.08); }
.prob-select.prob-50{  border-color: rgba(142,122,71,0.32); background: rgba(142,122,71,0.08); }
.prob-select.prob-25{  border-color: rgba(245,124,0,0.30); background: rgba(245,124,0,0.08); }
.prob-select.prob-0{   border-color: rgba(198,40,40,0.30); background: rgba(198,40,40,0.08); }

/* Wizard nav */
.wizard-nav{
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.nav-spacer{ flex: 1; }

.btn-primary,
.btn-secondary{
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 780;
  cursor: pointer;
  border: 1px solid rgba(17,24,39,0.14);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.btn-secondary{
  background: rgba(255,255,255,0.72);
  color: rgba(31,41,51,0.84);
  box-shadow: 0 10px 22px rgba(17,24,39,0.08);
}

.btn-secondary:hover:not([disabled]){
  transform: translateY(-1px);
  background: rgba(255,255,255,0.86);
  border-color: rgba(17,24,39,0.18);
}

.btn-primary{
  border-color: rgba(142,122,71,0.32);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(142,122,71,0.98), rgba(111,92,51,0.98));
  box-shadow: 0 16px 34px rgba(142,122,71,0.22);
}

.btn-primary:hover:not([disabled]){
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(142,122,71,0.26);
}

.btn-primary:active:not([disabled]),
.btn-secondary:active:not([disabled]){
  transform: translateY(0);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible{
  outline: none;
  box-shadow: 0 0 0 5px var(--focus), 0 14px 34px rgba(17,24,39,0.10);
}

.btn-primary[disabled],
.btn-secondary[disabled]{
  opacity: 0.60;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.is-hidden{ display: none !important; }

/* Status */
.form-status-wrap{
  padding: 14px 22px 22px;
}

.form-status{
  min-height: 1.2em;
  font-size: 14px;
  color: rgba(31,41,51,0.65);
  font-weight: 650;
}

.form-status.ok{ color: rgba(46,125,50,0.86); }
.form-status.error{ color: rgba(198,40,40,0.86); }

/* Review */
.review-grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
}

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

.review-card{
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.82);
  box-shadow: 0 12px 34px rgba(17,24,39,0.08);
  padding: 16px;
}

.review-card-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-card-title{
  margin: 0;
  font-size: 14px;
  font-weight: 850;
  color: rgba(31,41,51,0.80);
}

.link-btn{
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(142,122,71,0.96);
  font-weight: 800;
}

.link-btn:hover{
  background: rgba(142,122,71,0.10);
}

.review-dl{
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-row{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: baseline;
}

.review-row dt{
  font-size: 12px;
  font-weight: 850;
  color: rgba(31,41,51,0.62);
}

.review-row dd{
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  color: rgba(31,41,51,0.84);
  word-break: break-word;
}

.review-stats{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat{
  flex: 1;
  min-width: 90px;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,0.10);
  background: rgba(255,255,255,0.70);
  padding: 12px;
}

.stat-num{
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.stat-label{
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(31,41,51,0.62);
}

.submit-box{
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid rgba(142,122,71,0.20);
  background: rgba(142,122,71,0.06);
  padding: 14px 16px;
}

.submit-box-title{
  font-size: 14px;
  font-weight: 900;
  color: rgba(31,41,51,0.80);
}

.legal-links{
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 750;
}

.legal-links a{
  color: rgba(31,41,51,0.72);
  text-decoration: none;
  border-bottom: 1px solid rgba(31,41,51,0.18);
}

.legal-links a:hover{
  color: rgba(31,41,51,0.88);
  border-bottom-color: rgba(31,41,51,0.28);
}

.legal-links .dot{
  color: rgba(31,41,51,0.40);
}

/* Language switcher */
#langSwitcher{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--shadow-sm);
}

#langSwitcherLabel{
  font-size: 12px;
  font-weight: 850;
  color: rgba(31,41,51,0.68);
}

#languageSelect{
  min-width: 160px;
  height: 40px;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 560px){
  #langSwitcher{
    right: 10px;
    bottom: 10px;
    padding: 8px 10px;
  }
  #languageSelect{ min-width: 140px; }
}

/* Sheet overlay */
.sheet-overlay{
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.sheet-overlay.is-hidden{ display: none; }

.sheet-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet{
  position: relative;
  height: 100%;
  width: min(520px, 92vw);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-left: 1px solid rgba(17,24,39,0.12);
  box-shadow: -24px 0 70px rgba(17,24,39,0.18);
  display: flex;
  flex-direction: column;
  outline: none;
}

.sheet-header{
  padding: 18px 18px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(17,24,39,0.10);
}

.sheet-kicker{
  font-size: 12px;
  font-weight: 900;
  color: rgba(142,122,71,0.92);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sheet-title{
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: rgba(31,41,51,0.90);
}

.sheet-subtitle{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(31,41,51,0.62);
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,0.12);
  background: rgba(255,255,255,0.78);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(31,41,51,0.70);
  transition: transform 180ms ease, background-color 180ms ease;
}

.icon-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.90);
}

.sheet-body{
  padding: 16px 18px;
  overflow: auto;
}

.sheet-footer{
  padding: 14px 18px;
  border-top: 1px solid rgba(17,24,39,0.10);
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.78);
}

/* Sheet-specific polish: header already explains it */
.sheet .month-panel{
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.sheet .panel-title{ display: none; }

/* Prevent background scroll when sheet open */
body.sheet-open{
  overflow: hidden;
}

/* RTL support */
body.rtl .tagline{ text-align: left; }
body.rtl .wizard-title-row{ direction: rtl; }
body.rtl .wizard-meta{ align-items: flex-start; }
body.rtl .stepper-list{ direction: rtl; }
body.rtl .sticky-col{
  left: auto;
  right: 0;
  box-shadow: -1px 0 0 rgba(17,24,39,0.08);
}
body.rtl .matrix-table th,
body.rtl .matrix-table td{ text-align: right; }
body.rtl .matrix-table th:nth-child(2),
body.rtl .matrix-table th:nth-child(3),
body.rtl .matrix-table td:nth-child(2),
body.rtl .matrix-table td:nth-child(3){ text-align: center; }
body.rtl .row-label{ justify-content: flex-end; }
body.rtl .sheet{
  border-left: none;
  border-right: 1px solid rgba(17,24,39,0.12);
}
body.rtl .sheet-overlay{ justify-content: flex-start; }

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
