:root {
  color-scheme: light;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --page: #f5f8ff;
  --surface: #ffffff;
  --surface-blue: #e7efff;
  --ink: #18263b;
  --muted: #53647b;
  --line: #7d8da5;
  --blue: #174ea6;
  --focus: #1558c0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

.skip-link {
  position: absolute;
  z-index: 5;
  top: max(8px, env(safe-area-inset-top));
  inset-inline-start: 16px;
  padding: 11px 16px;
  transform: translateY(calc(-100% - 16px));
  border: 2px solid var(--focus);
  border-radius: 12px;
  background: #fff;
  color: #153d78;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 2px 8px rgb(20 42 74 / 16%);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #fff;
  outline-offset: 2px;
}

button,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 640px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 12px;
}

.brand:focus-visible,
.install-help summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #dce8ff;
  color: var(--blue);
}

.brand-mark {
  object-fit: cover;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.header-note {
  color: #40516a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#main-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.result-card {
  position: relative;
  isolation: isolate;
  min-height: 166px;
  overflow: hidden;
  padding: 20px 22px 18px;
  border: 1px solid #d5e1f6;
  border-radius: 26px;
  background: var(--surface-blue);
  box-shadow: 0 2px 6px rgb(32 60 104 / 7%), 0 1px 2px rgb(32 60 104 / 5%);
}

.result-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 22px;
}

.result-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #225eb7;
  box-shadow: 0 0 0 4px rgb(34 94 183 / 12%);
}

.result-topline h1 {
  margin: 0;
  color: #233c61;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.result-context {
  margin-inline-start: auto;
  color: #4c6281;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

#shoot-shutter {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: 66px;
  margin-top: 5px;
  color: #142c4d;
  font-size: clamp(48px, 15vw, 64px);
  font-weight: 750;
  letter-spacing: -0.07em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
  overflow-wrap: anywhere;
}

.result-detail {
  position: relative;
  z-index: 1;
  max-width: 38ch;
  margin: 5px 42px 0 0;
  color: #344d70;
  font-size: 13px;
  line-height: 1.45;
}

.result-sun {
  position: absolute;
  z-index: 0;
  inset-inline-end: 18px;
  bottom: 19px;
  width: 32px;
  height: 32px;
  color: #5477a8;
  opacity: 0.62;
}

.result-sun svg {
  display: block;
  width: 100%;
  height: 100%;
}

.settings h2 {
  margin: 0;
  color: #1d2d43;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.settings-intro {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.settings-fields {
  display: grid;
  gap: 15px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field label {
  color: #2d3c52;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.field-help {
  color: #56667c;
  font-size: 12px;
  line-height: 1.35;
}

.select-wrap {
  position: relative;
  min-width: 0;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  inset-inline-end: 18px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #435a79;
  border-bottom: 2px solid #435a79;
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap:has(select:disabled)::after {
  border-color: #8190a4;
}

.field select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 0 52px 0 16px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 17px;
  background-color: var(--surface);
  color: #17263c;
  font-size: 16px;
  font-weight: 560;
  line-height: 1.25;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgb(27 47 77 / 4%);
  -webkit-tap-highlight-color: transparent;
}

.field select:focus-visible {
  border-color: var(--focus);
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.field select:disabled {
  border-color: #cbd3de;
  background-color: #edf1f6;
  color: #6b7889;
  opacity: 1;
  -webkit-text-fill-color: #6b7889;
}

.install-help {
  margin-top: 1px;
  padding: 0 1px;
  color: #34465f;
}

.install-help summary {
  width: fit-content;
  min-height: 44px;
  padding: 10px 3px;
  color: #224f91;
  font-size: 13px;
  font-weight: 650;
  line-height: 24px;
  cursor: pointer;
  border-radius: 6px;
}

.install-help summary::marker {
  color: #42679b;
}

.install-copy {
  padding: 0 3px 4px;
}

.install-copy p {
  margin: 7px 0;
  color: #46566c;
  font-size: 13px;
  line-height: 1.45;
}

.install-copy strong {
  color: #25374e;
}

.noscript-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #b44d35;
  border-radius: 12px;
  background: #fff4ef;
  color: #702c1e;
  font-size: 14px;
  line-height: 1.45;
}

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

@media (max-width: 359px) {
  .app-shell {
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }

  .field-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  .result-card {
    padding-inline: 18px;
  }
}

@media (min-width: 560px) {
  .app-shell {
    padding-top: max(22px, env(safe-area-inset-top));
  }

  .app-header {
    margin-bottom: 24px;
  }

  #main-content {
    gap: 25px;
  }

  .result-card {
    min-height: 184px;
    padding: 24px 28px 20px;
    border-radius: 30px;
  }

  #shoot-shutter {
    margin-top: 9px;
    font-size: 68px;
  }
}

@media (forced-colors: active) {
  .select-wrap::after {
    display: none;
  }

  .field select {
    appearance: auto;
    padding-inline-end: 16px;
    border: 1px solid ButtonText;
    color: FieldText;
    background: Field;
    box-shadow: none;
  }

  .field select:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}

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