:root {
  color-scheme: light;
  --bg: #eef4f7;
  --ink: #172026;
  --muted: #65727c;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(23, 32, 38, 0.12);
  --teal: #0f8b8d;
  --teal-dark: #0b686a;
  --coral: #f25f5c;
  --yellow: #ffe066;
  --shadow: 0 24px 80px rgba(39, 71, 83, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 224, 102, 0.42), transparent 25rem),
    linear-gradient(135deg, #f8fbfc 0%, var(--bg) 50%, #dfecef 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 24px;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom));
}

.calculator,
.side-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.calculator {
  border-radius: 28px;
  padding: clamp(22px, 5vw, 52px);
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.brand-row {
  display: flex;
  min-width: 0;
  gap: 18px;
  align-items: center;
}

.washer-mark {
  width: 78px;
  height: 88px;
  flex: 0 0 auto;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: #ffffff;
  position: relative;
  box-shadow: inset 0 10px 0 rgba(15, 139, 141, 0.08);
}

.washer-mark::before,
.washer-mark::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--coral);
}

.washer-mark::before {
  left: 12px;
}

.washer-mark::after {
  right: 12px;
  background: var(--teal);
}

.washer-window {
  width: 46px;
  height: 46px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  overflow: hidden;
  background: #d9f4f3;
}

.washer-window span {
  position: absolute;
  inset: 21px -10px auto;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.install-button {
  min-height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 139, 141, 0.24);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--teal-dark);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(39, 71, 83, 0.12);
  white-space: nowrap;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field,
.duration-box {
  display: grid;
  gap: 10px;
}

.field span,
.duration-box legend {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 18px;
  color: var(--ink);
  background: #ffffff;
  font-size: 1.35rem;
  font-weight: 750;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.16);
}

.duration-box {
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border: 0;
  padding: 0;
}

.duration-box legend {
  grid-column: 1 / -1;
  padding: 0;
}

.primary-action {
  min-height: 62px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(15, 139, 141, 0.28);
}

.primary-action:active,
.install-button:active {
  transform: translateY(1px);
}

.result-panel {
  margin-top: 24px;
  border: 1px solid rgba(15, 139, 141, 0.2);
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.09), rgba(255, 224, 102, 0.28));
}

.now-line,
.result-label,
.result-note,
.install-help {
  margin: 0;
}

.now-line,
.result-note,
.install-help {
  color: var(--muted);
  font-weight: 600;
}

.result-main {
  margin: 22px 0;
}

.result-label {
  color: var(--teal-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.delay-value {
  margin: 6px 0 0;
  font-size: clamp(2.3rem, 8vw, 5.2rem);
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
}

.install-help {
  margin-top: 16px;
  font-size: 0.92rem;
}

.side-panel {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.time-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: #ffffff;
}

.time-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.time-card strong {
  display: block;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.install-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 38, 0.38);
  backdrop-filter: blur(10px);
}

.install-dialog[hidden] {
  display: none;
}

.install-card {
  width: min(560px, 100%);
  max-height: min(720px, calc(100svh - 36px));
  overflow: auto;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.install-card h2 {
  margin: 0;
  font-size: clamp(1.65rem, 8vw, 2.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.install-reason {
  margin: 14px 0 20px;
  color: var(--muted);
  font-weight: 650;
}

.install-steps {
  display: grid;
  gap: 12px;
}

.install-steps section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #f8fbfc;
}

.install-steps h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.install-steps ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 650;
}

.install-steps li + li {
  margin-top: 8px;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

@media (display-mode: standalone) {
  .install-help,
  .install-button {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at 12% 6%, rgba(255, 224, 102, 0.46), transparent 18rem),
      linear-gradient(160deg, #f8fbfc 0%, var(--bg) 58%, #dfecef 100%);
  }

  .app-shell {
    width: min(100% - 20px, 1120px);
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .calculator {
    border-radius: 24px;
    padding: 20px;
  }

  .top-bar {
    margin-bottom: 22px;
  }

  .brand-row {
    align-items: flex-start;
    gap: 12px;
  }

  .washer-mark {
    width: 58px;
    height: 68px;
    border-width: 3px;
    border-radius: 15px;
  }

  .washer-mark::before,
  .washer-mark::after {
    top: 8px;
    width: 8px;
    height: 8px;
  }

  .washer-window {
    width: 34px;
    height: 34px;
    border-width: 3px;
    bottom: 9px;
  }

  .duration-box {
    grid-template-columns: 1fr 1fr;
  }

  .side-panel {
    grid-template-columns: 1fr;
    border-radius: 20px;
    padding: 12px;
  }

  .time-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(2rem, 12vw, 3.05rem);
  }

  .top-bar {
    display: grid;
  }

  .install-button {
    width: 100%;
    min-height: 52px;
  }

  .field input,
  .primary-action {
    min-height: 58px;
  }

  .duration-box {
    gap: 12px;
  }

  .result-panel {
    padding: 18px;
  }

  .delay-value {
    overflow-wrap: anywhere;
  }
}
