:root {
  color-scheme: light;
  font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #163041;
  background: #f5f8fa;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f5f8fa;
}

body {
  min-height: 100%;
  margin: 0;
  background: #f5f8fa;
  line-height: 1.45;
}

button,
input,
select {
  min-height: 48px;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #f4b942;
  outline-offset: 3px;
}

.entry-flow {
  position: fixed;
  inset: 0;
  z-index: 20;
  min-width: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #f8fcfe, #eaf4f8);
}

.brand-splash {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}

.brand-lockup {
  text-align: center;
  animation: brand-arrival 2s ease-out both;
}

.brand-lockup img {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
}

.brand-lockup h1,
.brand-lockup p {
  margin: 0;
}

.brand-lockup h1 {
  color: #123a52;
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 800;
}

.brand-lockup p {
  margin-top: 0.5rem;
  color: #557181;
  font-size: 1.15rem;
}

.campaign-intro {
  min-height: 100%;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  background: linear-gradient(135deg, #f7fbfd, #e6f3f7);
}

.campaign-shell {
  display: grid;
  gap: 0.9rem;
  width: min(100%, 45rem);
  min-height: calc(100vh - 3rem);
  margin: 0 auto;
  align-content: center;
}

.campaign-brand,
.campaign-shell h1,
.campaign-shell h2,
.campaign-shell p,
.campaign-shell ul {
  margin: 0;
}

.campaign-brand {
  color: #0e7490;
  font-size: 1.25rem;
  font-weight: 800;
}

.campaign-shell h1 {
  color: #123a52;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.15;
}

.campaign-support {
  margin-bottom: 0.5rem !important;
  color: #557181;
  font-size: 1.2rem;
}

.capability-card {
  padding: 1.1rem;
  border: 1px solid #d7e5eb;
  border-radius: 1rem;
  background: rgb(255 255 255 / 86%);
}

.capability-card h2 {
  color: #123a52;
  font-size: 1rem;
}

.capability-card ul {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding-inline-start: 1.3rem;
}

.capability-now li::marker {
  color: #0e7490;
}

.capability-future li::marker {
  color: #5b5f97;
}

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: #fff;
  background: #163041;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid #d9e3e8;
  color: #123a52;
  background: #f5f8fa;
}

.site-header h1,
.screen-header h2,
.screen-header p,
.panel h2,
.panel h3,
.inquiry-dialog h2,
.inquiry-dialog p {
  margin: 0;
}

.site-header h1 {
  font-size: 1.35rem;
}

.language-control {
  display: grid;
  gap: 0.2rem;
  min-width: min(13rem, 54vw);
}

.language-control span {
  font-size: 0.78rem;
  font-weight: 700;
}

.page-shell {
  display: grid;
  gap: 0.75rem;
  width: min(100% - 2rem, 45rem);
  margin: 0 auto;
  padding: 0.75rem 0 max(1.5rem, env(safe-area-inset-bottom));
}

.screen-header {
  padding: 0.25rem 0;
}

.screen-header h2 {
  color: #163041;
  font-size: clamp(1.65rem, 5vw, 2rem);
}

.screen-header p {
  margin-top: 0.15rem;
  color: #617884;
}

#calculator-form {
  display: grid;
  gap: 0.75rem;
}

.panel {
  padding: clamp(1rem, 3vw, 1.25rem);
  border: 1px solid #d9e3e8;
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: 0 0.2rem 0.8rem rgb(22 48 65 / 5%);
}

.field-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.field-stack > label,
.surplus-field {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid #8ba0aa;
  border-radius: 0.55rem;
  color: #102d3c;
  background: #f8fafb;
  padding: 0.65rem 0.75rem;
}

.segmented-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-field legend {
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #8ba0aa;
  border-radius: 0.6rem;
  background: #fff;
}

.segmented-control label {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 48px;
  place-items: center;
  cursor: pointer;
}

.segmented-control label + label {
  border-inline-start: 1px solid #8ba0aa;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  width: 100%;
  min-height: 48px;
  place-items: center;
  padding: 0.55rem 0.75rem;
  text-align: center;
  font-weight: 700;
}

.mode-selector .segmented-control span {
  align-content: center;
  gap: 0.2rem;
  min-height: 5rem;
}

.mode-selector small {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
}

.choice-grid {
  display: grid;
  gap: 0.75rem;
}

.choice-card {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  color: #163041;
  text-align: start;
  cursor: pointer;
}

.choice-card strong {
  font-size: 1.1rem;
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: #0e7490;
  background: #eef8fa;
}

.warning-panel {
  border-inline-start: 0.35rem solid #a15c00;
  background: #fff7e8;
}

.readiness-panel {
  display: grid;
  gap: 0.35rem;
  border-inline-start: 0.35rem solid #0e7490;
}

.readiness-panel p {
  margin: 0;
}

.segmented-control input:checked + span {
  color: #fff;
  background: #0e7490;
}

.segmented-control input:focus-visible + span {
  outline: 3px solid #f4b942;
  outline-offset: -3px;
}

.input-with-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.primary-action,
.secondary-action,
.danger-action {
  min-width: 9rem;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.7rem 1rem;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: #0e7490;
}

.primary-action:hover {
  background: #0b647d;
}

.secondary-action {
  color: #123746;
  background: #dcecf1;
}

.danger-action {
  color: #fff;
  background: #a53125;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.language-button,
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #8ba0aa;
  border-radius: 0.55rem;
  color: #123746;
  background: #fff;
  font-weight: 800;
}

.language-button {
  min-width: 5.5rem;
  padding: 0.55rem 0.8rem;
}

.icon-action {
  width: 48px;
  min-width: 48px;
  padding: 0;
  font-size: 1.45rem;
}

.app-screen {
  display: grid;
  gap: 0.75rem;
}

.quantity-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.stepper output {
  min-width: 3.5rem;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 1.45rem;
}

input[type="range"] {
  min-height: 48px;
  padding: 0;
}

.add-confirmation {
  position: fixed;
  inset-block-start: max(0.5rem, env(safe-area-inset-top));
  inset-inline: 1rem;
  z-index: 30;
  width: min(calc(100% - 2rem), 40rem);
  margin-inline: auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #0e7490;
  border-radius: 0.75rem;
  color: #163041;
  background: #dff3f6;
  box-shadow: 0 0.7rem 1.7rem rgb(22 48 65 / 20%);
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-18%) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.add-confirmation[data-phase="hold"] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.add-confirmation[data-phase="exit"] {
  opacity: 0;
  transform: translateY(18%) scale(0.98);
}

.add-confirmation-icon {
  display: inline-grid;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0e7490;
  font-size: 1.2rem;
  line-height: 1;
}

.result-flask-lines,
#preparation-commands,
#completion-commands {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 0;
  padding-inline-start: 1.35rem;
}

.result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.chip {
  min-height: 40px;
  border: 1px solid #8ba0aa;
  border-radius: 99rem;
  padding: 0.4rem 0.8rem;
  color: #123746;
  background: #eef6f8;
  font-weight: 700;
}

.disclosure summary {
  cursor: pointer;
  font-weight: 800;
}

.disclosure p {
  overflow-wrap: anywhere;
}

.disclosure-values {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.disclosure-values > div {
  display: grid;
  gap: 0.15rem;
}

.disclosure-values dt,
.disclosure-section h4 {
  color: #617884;
  font-size: 0.8rem;
  font-weight: 800;
}

.disclosure-values dd,
.disclosure-section h4,
.disclosure-section p {
  margin: 0;
}

.disclosure-section {
  margin-top: 1rem;
}

.disclosure-section p {
  margin-top: 0.2rem;
}

.screen-actions {
  display: grid;
  gap: 0.65rem;
}

.screen-actions > * {
  width: 100%;
}

.countdown-panel {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.countdown-panel strong {
  font-family: ui-monospace, monospace;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1;
}

#timer-preparation {
  border: 2px solid #0e7490;
  background: #f5fbfc;
  box-shadow: 0 0.45rem 1.2rem rgb(14 116 144 / 13%);
}

#timer-preparation h3 {
  color: #123746;
  font-size: clamp(1.55rem, 5vw, 2rem);
}

#preparation-commands {
  list-style-position: outside;
  gap: 0.75rem;
  padding-inline-start: 1.65rem;
}

#preparation-commands li {
  padding: 0.8rem 0.9rem;
  border-inline-start: 0.32rem solid #0e7490;
  border-radius: 0.5rem;
  color: #102d3c;
  background: #fff;
  font-size: clamp(1.5rem, 5.4vw, 2rem);
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.timer-prestart .countdown-panel strong {
  font-size: clamp(1.15rem, 4vw, 1.6rem);
}

.timer-active .command-panel strong {
  font-size: clamp(1.7rem, 5vw, 2.2rem);
}

.timer-active .countdown-panel strong {
  font-size: clamp(1.45rem, 4.2vw, 1.9rem);
}

.command-panel,
.next-panel {
  display: grid;
  gap: 0.45rem;
}

.command-panel strong {
  font-size: clamp(1.25rem, 4vw, 1.7rem);
}

#timer-alert-settings {
  display: grid;
  gap: 0.65rem;
}

#timer-alert-settings label,
#vibration-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

#timer-alert-settings input,
#vibration-option input {
  width: 1.3rem;
  min-height: 1.3rem;
}

.timer-capability-warning {
  margin: 0;
  padding: 0.8rem 1rem;
  border-inline-start: 0.3rem solid #a15c00;
  border-radius: 0.45rem;
  color: #663c00;
  background: #fff2d7;
  font-weight: 700;
}

.picker-dialog,
.confirm-dialog {
  width: min(calc(100% - 2rem), 35rem);
  max-height: min(88dvh, 46rem);
  overflow: auto;
  border: 1px solid #cbd9df;
  border-radius: 1rem;
  padding: 1rem;
  color: #163041;
  background: #fff;
}

.picker-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgb(16 45 60 / 55%);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-heading h2 {
  margin: 0;
}

.picker-list {
  display: grid;
  max-height: min(65dvh, 35rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0.75rem;
  padding-block: 0.25rem;
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid #e0e8ec;
  padding: 0.65rem 0.75rem;
  color: #163041;
  background: #fff;
  text-align: start;
}

.language-option[aria-selected="true"] {
  color: #0b647d;
  background: #e9f6f8;
  font-weight: 800;
}

.picker-dialog > label {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-weight: 700;
}

.input-panel > .primary-action {
  width: 100%;
  margin-top: 1rem;
}

.batch-lines ul,
.batch-lines p {
  margin: 0.7rem 0 0;
}

.batch-lines ul {
  display: grid;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
}

.batch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #e0e8ec;
}

.batch-line:last-child {
  border-bottom: 0;
}

.batch-line .secondary-action {
  flex: 0 0 auto;
  min-width: auto;
}

.muted {
  color: #617884;
}

.settings-panel {
  display: grid;
  gap: 1rem;
}

.form-error {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 0.6rem;
  color: #8a1f11;
  background: #fff0ed;
  font-weight: 700;
}

.sticky-action {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-inline: -0.25rem;
  padding: 0.5rem 0.25rem max(0.5rem, env(safe-area-inset-bottom));
  background: linear-gradient(rgb(245 248 250 / 0%), #f5f8fa 30%);
}

.sticky-action .primary-action {
  width: 100%;
  box-shadow: 0 0.3rem 1rem rgb(14 116 144 / 20%);
}

.sticky-action .form-error {
  margin-block-end: 0.5rem;
}

.result-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.result-card dl div {
  padding: 1rem;
  border-radius: 0.7rem;
  background: #eef6f8;
}

.result-card dt {
  font-weight: 700;
}

.result-card dd {
  margin: 0.25rem 0 0;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
}

.advertising-slot {
  min-width: 0;
  overflow: hidden;
  border-radius: 0.65rem;
  background: #edf5f8;
}

.ad-banner {
  width: 100%;
  min-height: 0;
  aspect-ratio: 6.4 / 1;
  border: 1px solid #d9e1e6;
  border-radius: 0.65rem;
}

.house-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  color: #0f1720;
  background: #edf5f8;
  text-align: start;
}

.house-icon {
  display: grid;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0e7490;
  font-weight: 900;
}

.ad-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.ad-copy strong,
.ad-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-copy span {
  color: #4b5f68;
  font-size: 0.78rem;
}

.ad-cta {
  flex: 0 0 auto;
  color: #0e7490;
  font-size: 0.78rem;
  font-weight: 800;
}

.advertiser-banner {
  display: block;
  overflow: hidden;
  background: #080d10;
}

.advertiser-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inquiry-dialog {
  width: min(calc(100% - 2rem), 31rem);
  max-height: min(90vh, 46rem);
  overflow: auto;
  border: 1px solid #cbd9df;
  border-radius: 1rem;
  padding: 1.25rem;
  color: #163041;
  background: #fff;
  box-shadow: 0 1.2rem 3rem rgb(22 48 65 / 24%);
}

.inquiry-dialog::backdrop {
  background: rgb(16 45 60 / 55%);
}

.inquiry-dialog > form > p {
  margin-top: 0.75rem;
}

.notice {
  padding: 0.75rem;
  border-radius: 0.55rem;
  background: #eef6f8;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@keyframes brand-arrival {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

[dir="rtl"] .site-header,
[dir="rtl"] .screen-header,
[dir="rtl"] .panel,
[dir="rtl"] .campaign-shell,
[dir="rtl"] .inquiry-dialog {
  text-align: right;
}

@media (max-width: 560px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .language-button { align-self: flex-end; }

  .page-shell {
    width: min(100% - 1.5rem, 45rem);
  }

  .house-icon {
    display: none;
  }

  .ad-copy span {
    display: none;
  }

  .ad-cta {
    max-width: 34%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .batch-line { align-items: center; }

  .result-card dl {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}

@media (min-width: 834px) {
  .page-shell {
    width: min(100% - 3rem, 52rem);
  }

  .field-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-stack > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
