:root {
  color-scheme: light;
  --ink: #203238;
  --ink-soft: #66777b;
  --paper: #fffdf8;
  --canvas: #f3efe5;
  --line: #d9d4c8;
  --accent: #d96937;
  --accent-dark: #ad4724;
  --accent-soft: #fff0e6;
  --teal: #3f7775;
  --danger: #b23b3b;
  --shadow: 0 16px 40px rgba(48, 43, 31, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(217, 105, 55, .13), transparent 31rem),
    radial-gradient(circle at 92% 90%, rgba(63, 119, 117, .11), transparent 34rem),
    var(--canvas);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button { color: inherit; }

.app-shell {
  position: relative;
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 0 70px rgba(55, 48, 35, .12);
  overflow: hidden;
}

.view { display: none; min-height: 100vh; }
.view.active { display: block; }

.login-view {
  padding: clamp(44px, 10vh, 92px) 28px 40px;
}

.brand { text-align: center; margin-bottom: 34px; }
.brand-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 24px 24px 20px 20px;
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(217, 105, 55, .28);
}
.brand-icon svg { width: 38px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.brand h1, .topbar h1 { margin: 0; font-size: 30px; letter-spacing: .08em; }
.brand-copy { max-width: 340px; margin: 12px auto 0; color: var(--ink-soft); font-size: 13px; }

.login-card, .form-card {
  border: 1px solid rgba(190, 181, 164, .64);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-card { padding: 24px; border-radius: 22px; }

.field { margin-bottom: 18px; }
.field.no-margin { margin-bottom: 0; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.field small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 11px; }
input, select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #c9c5ba;
  border-radius: 12px;
  outline: none;
  background: white;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 105, 55, .14); }

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .02em;
  transition: transform .12s, background .12s;
}
.button:active { transform: translateY(1px); }
.button.primary { width: 100%; background: var(--accent); color: white; box-shadow: 0 7px 17px rgba(217, 105, 55, .22); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { border: 1px solid var(--line); background: transparent; }
.support-note { margin: 18px 12px 0; color: var(--ink-soft); text-align: center; font-size: 11.5px; }
.form-error { margin: 0 0 16px; color: var(--danger); font-size: 12.5px; font-weight: 700; }

.topbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  min-height: 84px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, .94);
}
.topbar > div:first-child { grid-column: 1 / 3; }
.topbar > .icon-button { grid-column: 3; }
.topbar.sticky { position: sticky; z-index: 5; top: 0; }
.topbar.sticky > .icon-button { grid-column: 1; }
.topbar.sticky > #graphRefreshButton { grid-column: 3; }
.topbar .center-title { grid-column: 2; text-align: center; }
.topbar .center-title h1 { font-size: 20px; letter-spacing: .03em; }
.topbar .topbar-spacer { grid-column: 3; }
.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
}
.icon-button svg { width: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.content { padding: 26px 22px 38px; }
.home-view { background: var(--canvas); }
.home-dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 30px 34px 26px;
}
.home-header { display: flex; align-items: center; justify-content: space-between; }
.home-header h1 { margin: 0; font-size: 24px; letter-spacing: .02em; }
.home-header p { margin: 2px 0 0; color: var(--ink-soft); font-size: 13px; }
.profile-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.profile-icon svg { width: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.weather-card {
  min-height: 138px;
  margin-top: 24px;
  padding: 25px 28px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--ink) 0%, #33474e 100%);
  color: white;
  box-shadow: 0 18px 30px -18px rgba(31, 46, 51, .58);
}
.weather-card p { margin: 0; }
.weather-card .place { margin-bottom: 8px; color: rgba(255,255,255,.74); font-size: 13px; font-weight: 700; }
.environment-values { display: grid; gap: 8px; }
.environment-values p { display: flex; gap: 5px; align-items: baseline; }
.environment-values span { min-width: 92px; color: rgba(255,255,255,.74); font-size: 13px; font-weight: 700; }
.environment-values strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.environment-values b { color: rgba(255,255,255,.66); font-size: 16px; }
.home-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.home-menu-item {
  display: flex;
  min-height: 142px;
  padding: 20px;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-menu-item:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -16px rgba(31,46,51,.38); }
.home-menu-item strong { margin-top: 2px; font-size: 17px; }
.home-menu-item small { color: var(--ink-soft); font-size: 12px; }
.home-menu-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #f6dcc9; color: var(--accent); }
.home-menu-item.cool .home-menu-icon { background: #d9e9f0; color: #3e7c9c; }
.home-menu-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.home-logout { margin-top: auto; padding-top: 24px; }
.home-logout .button { width: 100%; color: var(--ink-soft); }

.settings-content { padding-top: 20px; }
.lead { margin: 0 2px 18px; color: var(--ink-soft); font-size: 13px; }
.form-card { margin-bottom: 16px; padding: 20px; border-radius: 19px; box-shadow: 0 8px 22px rgba(48, 43, 31, .06); }
.section-heading { display: flex; gap: 11px; align-items: center; margin-bottom: 13px; }
.section-heading::before { content: ""; width: 5px; height: 21px; flex: 0 0 auto; border-radius: 999px; background: #ed713b; }
.section-heading h2 { margin: 0; font-size: 16px; }
.step-number { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 900; }

.toggle-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { margin-top: 2px; color: var(--ink-soft); font-size: 10.5px; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle { position: relative; grid-column: 2; grid-row: 1; width: 43px; height: 25px; border-radius: 999px; background: #c8c9c5; transition: background .18s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .18s; }
.toggle-row input:checked + .toggle { background: var(--teal); }
.toggle-row input:checked + .toggle::after { transform: translateX(18px); }
.toggle-row input:focus-visible + .toggle { box-shadow: 0 0 0 3px rgba(63, 119, 117, .2); }
.google-calendar-link {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.google-calendar-link strong, .google-calendar-link small { display: block; }
.google-calendar-link strong { font-size: 13px; }
.google-calendar-link small { max-width: 270px; margin-top: 2px; color: var(--ink-soft); font-size: 10.5px; }
.button.compact { min-height: 38px; flex: 0 0 auto; padding: 0 14px; font-size: 11px; }
.button:disabled { cursor: not-allowed; opacity: .52; }

.temperature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.temperature-grid .full { grid-column: 1 / -1; }
.number-input { position: relative; }
.number-input input { padding-right: 42px; }
.number-input span { position: absolute; top: 13px; right: 14px; color: var(--ink-soft); font-size: 13px; }
.info-card { display: flex; gap: 10px; margin: 4px 0 18px; padding: 14px; border: 1px solid #c9deda; border-radius: 14px; background: #eef7f5; color: #42605f; }
.info-card svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; }
.info-card p { margin: 0; font-size: 11px; }
.form-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; }

.graph-content { display: grid; min-width: 0; gap: 16px; }
.graph-tabs { display: flex; gap: 8px; }
.graph-tab { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.graph-tab.active { border-color: var(--ink); background: var(--ink); color: white; }
.graph-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.graph-search label { display: grid; gap: 5px; }
.graph-search label span { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.graph-search input { min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.graph-search input:focus { outline: 2px solid rgba(63,119,117,.22); border-color: var(--teal); }
.graph-search-separator { padding-bottom: 9px; color: var(--ink-soft); }
.graph-toolbar { display: flex; justify-content: flex-end; }
.graph-toolbar p { margin: 0; color: var(--ink-soft); font-size: 10.5px; }
.graph-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow); }
.latest-mode { min-height: 42px; margin-bottom: 16px; }
.latest-mode strong { display: block; font-size: 18px; }
.latest-mode span { display: block; color: var(--ink-soft); font-size: 11px; }
.timeline-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: scroll;
  padding-bottom: 5px;
  scrollbar-color: #708286 #e4e0d7;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  -webkit-overflow-scrolling: touch;
}
.timeline-scroll::-webkit-scrollbar { height: 14px; }
.timeline-scroll::-webkit-scrollbar-track { border-radius: 7px; background: #e4e0d7; }
.timeline-scroll::-webkit-scrollbar-thumb { border: 3px solid #e4e0d7; border-radius: 7px; background: #708286; }
.timeline { min-width: 0; }
.continuous-chart.five-day-chart { min-width: 1145px; }
.mode-chart-plot { position: relative; }
.mode-slots { display: grid; height: 230px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px 10px 0 0; background: #f0eee8; }
.mode-slot { min-width: 0; border-right: 1px solid rgba(255,255,255,.42); background: repeating-linear-gradient(135deg, #efede7, #efede7 4px, #e8e5de 4px, #e8e5de 8px); }
.mode-slot:nth-child(24n) { border-right: 3px solid rgba(32,50,56,.28); }
.mode-slot.mode-1 { background: #f2d34f; }
.mode-slot.mode-2 { background: #ed9a3c; }
.mode-slot.mode-3 { background: #e66e64; }
.mode-slot.mode-4 { background: #4da77a; }
.mode-slot.mode-5 { background: #4387c5; }
.mode-slot.mode-6 { background: #8061a8; }
.temperature-curve { position: absolute; inset: 0; width: 100%; height: 230px; overflow: visible; pointer-events: none; }
.temperature-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.temperature-point { fill: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.temperature-hit-target { fill: transparent; stroke: transparent; pointer-events: all; cursor: pointer; }
.outdoor-temperature-line, .outdoor-temperature-point { stroke: #d94f47; }
.indoor-temperature-line, .indoor-temperature-point { stroke: #0877c9; }
.temperature-tooltip {
  position: absolute;
  z-index: 6;
  min-width: 165px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(20, 25, 22, .92);
  color: #fff;
  pointer-events: none;
  transform: translate(9px, calc(-100% - 9px));
  box-shadow: 0 7px 18px rgba(0, 0, 0, .22);
}
.temperature-tooltip.align-right { transform: translate(calc(-100% - 9px), calc(-100% - 9px)); }
.temperature-tooltip.align-below { transform: translate(9px, 9px); }
.temperature-tooltip.align-below.align-right { transform: translate(calc(-100% - 9px), 9px); }
.temperature-tooltip strong { display: block; margin-bottom: 4px; font-size: 13px; }
.temperature-tooltip p { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.45; }
.temperature-tooltip-value { display: flex; gap: 5px; align-items: center; }
.temperature-tooltip-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  background: #d94f47;
}
.temperature-tooltip-swatch.indoor { background: #0877c9; }
.temperature-tooltip-swatch.di { background: #0877c9; }
.temperature-tooltip-mode { padding-left: 17px; }
.executed-plot-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: stretch; }
.temperature-axis-area {
  position: sticky;
  z-index: 3;
  left: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  height: 230px;
  background: var(--paper);
}
.temperature-axis-title {
  align-self: center;
  justify-self: center;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  transform: rotate(-90deg);
}
.temperature-y-axis {
  display: flex;
  height: 230px;
  padding: 0 7px 0 0;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink-soft);
  text-align: right;
  font-size: 10px;
}
.five-day-chart:has(.executed-plot-row) > .time-axis,
.five-day-chart:has(.executed-plot-row) > .date-axis,
.five-day-chart:has(.executed-plot-row) > .user-action-row { margin-left: 58px; }
.time-axis { position: relative; height: 29px; color: var(--ink-soft); font-size: 10px; }
.time-axis span { position: absolute; top: 7px; white-space: nowrap; transform: translateX(-50%); }
.date-axis { display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.date-axis span { padding: 9px; color: var(--ink-soft); text-align: center; font-size: 12px; }
.date-axis span + span { border-left: 1px solid var(--line); }
.user-action-row { border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.user-action-row > strong { display: block; padding: 7px 9px 4px; font-size: 10px; }
.user-action-row > div { display: grid; border-top: 1px solid var(--line); }
.user-action-row span { padding: 7px; text-align: center; font-size: 12px; }
.user-action-row span + span { border-left: 1px solid var(--line); }
.mode-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.legend-item { display: flex; gap: 6px; align-items: center; color: var(--ink-soft); font-size: 10.5px; }
.legend-color { width: 13px; height: 13px; border-radius: 4px; }
.legend-temperature-line { width: 22px; height: 0; border-top: 3px solid #d94f47; }
.legend-temperature-line.indoor { border-top-color: #0877c9; }
.legend-di-line { width: 22px; height: 0; border-top: 3px solid #0877c9; }
.legend-di-band { width: 22px; height: 12px; border-radius: 3px; background: rgba(95, 196, 103, .28); }
.legend-color.mode-1 { background: #f2d34f; }
.legend-color.mode-2 { background: #ed9a3c; }
.legend-color.mode-3 { background: #e66e64; }
.legend-color.mode-4 { background: #4da77a; }
.legend-color.mode-5 { background: #4387c5; }
.legend-color.mode-6 { background: #8061a8; }
.graph-note, .empty-message { margin: 0; color: var(--ink-soft); font-size: 11px; }
.empty-message { padding: 26px 0 10px; text-align: center; }

.di-plot-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: stretch; }
.di-axis-area {
  position: sticky;
  z-index: 3;
  left: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  height: 300px;
  background: var(--paper);
}
.di-axis-title {
  align-self: center;
  justify-self: center;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  transform: rotate(-90deg);
}
.di-y-axis {
  display: flex;
  height: 300px;
  padding: 0 7px 0 0;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink-soft);
  text-align: right;
  font-size: 10px;
}
.di-chart-plot {
  position: relative;
  height: 300px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background-color: #fff;
  background-image:
    repeating-linear-gradient(to right, transparent 0, transparent calc(2.5% - 1px), rgba(32, 50, 56, .10) calc(2.5% - 1px), rgba(32, 50, 56, .10) 2.5%),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(10% - 1px), rgba(32, 50, 56, .10) calc(10% - 1px), rgba(32, 50, 56, .10) 10%);
}
.di-index-curve { position: absolute; inset: 0; width: 100%; height: 300px; overflow: visible; }
.di-comfort-band { fill: rgba(95, 196, 103, .25); }
.di-index-line { fill: none; stroke: #0877c9; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.di-index-point { fill: #fff; stroke: #0877c9; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.di-index-hit-target { fill: transparent; stroke: transparent; pointer-events: all; cursor: pointer; }
.di-time-axis, .di-date-axis { margin-left: 58px; }

.mode-action-content { padding-top: 28px; }
.mode-action-intro {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 15px;
  align-items: start;
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 19px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}
.mode-action-intro h2 { margin: 0 0 6px; font-size: 18px; }
.mode-action-intro p:last-child { margin: 0; color: rgba(255,255,255,.76); font-size: 12px; }
.mode-action-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: rgba(255,255,255,.12);
  color: #ffd5bd;
}
.mode-action-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mode-action-card { display: grid; gap: 24px; }
.mode-action-card fieldset { margin: 0; padding: 0; border: 0; }
.mode-action-card legend { margin-bottom: 13px; padding-left: 38px; font-size: 15px; font-weight: 800; }
.action-step { position: relative; }
.action-step > .step-number { position: absolute; top: -4px; left: 0; }
.yes-no-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.yes-no-options label { cursor: pointer; }
.yes-no-options input, .mode-choice-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.yes-no-options span {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: white;
  font-weight: 800;
}
.yes-no-options input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.yes-no-options input:focus-visible + span { box-shadow: 0 0 0 3px rgba(217,105,55,.18); }
.mode-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mode-choice-grid label { cursor: pointer; }
.mode-choice {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  min-height: 54px;
  padding: 8px 11px;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f6f3ec;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}
.mode-choice b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: white; font-size: 14px; }
.mode-choice-1 b { background: #d6b721; }
.mode-choice-2 b { background: #e58a22; }
.mode-choice-3 b { background: #dc5f56; }
.mode-choice-4 b { background: #3f936b; }
.mode-choice-5 b { background: #347ab9; }
.mode-choice-6 b { background: #73539d; }
.mode-choice-grid input:checked + .mode-choice { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.mode-choice-grid input:focus-visible + .mode-choice { box-shadow: 0 0 0 3px rgba(217,105,55,.18); }
.mode-selection-step[disabled] { opacity: .46; }
.mode-selection-step[disabled] label { cursor: not-allowed; }
.mode-action-success { padding: 36px 24px; text-align: center; }
.mode-action-card[hidden], .mode-action-success[hidden] { display: none; }
.mode-action-success > span { display: grid; width: 58px; height: 58px; margin: 0 auto 16px; place-items: center; border-radius: 50%; background: #dceee3; color: #2e7b56; font-size: 28px; font-weight: 900; }
.mode-action-success h2 { margin: 0 0 6px; }
.mode-action-success p { margin: 0 0 22px; color: var(--ink-soft); font-size: 12px; }
.mode-action-success .button { width: 100%; }

.credential-guide, .settings-guide {
  margin: 0 0 18px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #dcecf3;
  color: #2f7898;
  font-size: 11px;
}
.mode-action-view { min-height: 100vh; padding: 32px 18px; background: linear-gradient(135deg, #fbf7ed, #f7eff3); }
.mode-action-content { display: grid; max-width: 620px; margin: auto; place-items: center; }
.mode-action-card {
  display: grid;
  width: 100%;
  gap: 20px;
  padding: 48px 42px 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: 0 24px 50px rgba(42, 47, 43, .14);
}
.mode-action-card h1 { margin: 10px 0 0; font-size: 28px; }
.mode-action-description { margin: 0; color: #63747a; font-size: 17px; line-height: 1.72; }
.mode-action-card .mode-action-icon { width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #ef713a, #f3a160); color: white; box-shadow: 0 12px 22px rgba(239,113,58,.22); }
.mode-action-card .mode-action-icon svg { width: 34px; }
.notification-time { width: fit-content; margin: 8px 0 2px; padding: 7px 12px; border-radius: 999px; background: #dcecf3; color: #317d9f; font-size: 12px; font-weight: 800; }
.mode-action-card .field label { margin-bottom: 10px; color: #566a70; font-size: 15px; }
.mode-action-card select { min-height: 66px; border: 2px solid #ee7a41; border-radius: 18px; background: #fbf8f0; font-size: 22px; font-weight: 800; }
.mode-action-card .field small { margin-top: 9px; color: #9aa8ac; font-size: 12px; }
.mode-action-card .button { min-height: 64px; border-radius: 16px; font-size: 18px; }
.mode-action-card .button.primary { background: #1d3036; color: white; box-shadow: none; }
.mode-action-card .button.primary:hover { background: #14252a; }
.mode-action-card .button.secondary { border-color: #ded8ca; background: white; color: #607177; }
.mode-action-footer { margin: 8px 0 0; color: #a9b5b8; text-align: center; font-size: 10px; }
.mode-action-success { width: 100%; }

@media (max-width: 520px) {
  .mode-action-view { padding: 18px 12px; }
  .mode-action-card { padding: 32px 22px 24px; border-radius: 22px; }
}

.loading {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 248, .78);
  color: var(--ink-soft);
  font-size: 12px;
  backdrop-filter: blur(3px);
}
.loading[hidden], .toast[hidden] { display: none; }
.spinner { width: 35px; height: 35px; border: 3px solid #e5ddd0; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 60; right: 20px; bottom: 22px; left: 20px; max-width: 480px; margin: auto; padding: 13px 16px; border-radius: 13px; background: var(--ink); color: white; text-align: center; box-shadow: var(--shadow); font-size: 13px; }

@media (min-width: 700px) {
  body { padding: 28px 0; }
  .app-shell { min-height: calc(100vh - 56px); border-radius: 28px; }
  .view { min-height: calc(100vh - 56px); }
  .login-view { border-radius: 28px; }
  body:has(.home-view.active) { padding: 0; }
  .app-shell:has(.home-view.active) { width: 100%; min-height: 100vh; border-radius: 0; box-shadow: none; }
  body:has(#graphView.active) { padding: 0; }
  .app-shell:has(#graphView.active) { width: 100%; min-height: 100vh; border-radius: 0; box-shadow: none; }
  #graphView.active { min-height: 100vh; }
  body:has(#settingsView.active) { padding: 0; background: var(--canvas); }
  .app-shell:has(#settingsView.active) { width: 100%; max-width: none; min-height: 100vh; border-radius: 0; background: var(--canvas); box-shadow: none; }
  #settingsView.active { min-height: 100vh; }
  #settingsView .topbar { min-height: 92px; border-bottom: 0; background: var(--canvas); }
  #settingsView .topbar .center-title h1 { font-size: 21px; }
  #settingsView .settings-content { padding: 0 14px 52px; }
  #settingsView .lead { margin: 0 0 24px; font-size: 13px; font-weight: 700; }
  #settingsView .form-card { margin-bottom: 24px; padding: 24px 22px 28px; border-radius: 21px; background: white; }
  #settingsView .section-heading h2 { font-size: 18px; }
  #settingsView .credential-guide,
  #settingsView .settings-guide { padding: 12px 15px; border-radius: 11px; font-size: 13px; }
  #settingsView .field { margin-bottom: 22px; }
  #settingsView .field label { font-size: 14px; }
  #settingsView input,
  #settingsView select { height: 62px; padding: 0 18px; border-radius: 14px; font-size: 16px; }
  #settingsView .number-input span { top: 20px; right: 20px; }
  #settingsView .form-actions { max-width: 720px; margin: 0 auto; }
  body:has(.mode-action-view.active) { padding: 0; }
  .app-shell:has(.mode-action-view.active) { width: 100%; max-width: none; min-height: 100vh; border-radius: 0; box-shadow: none; }
  #graphView .graph-content { padding: 28px 18px 44px; }
  .home-view { min-height: 100vh; }
  .home-dashboard { padding: 36px 42px 30px; }
}

@media (max-width: 390px) {
  .login-view { padding-right: 18px; padding-left: 18px; }
  .content { padding-right: 16px; padding-left: 16px; }
  .temperature-grid { grid-template-columns: 1fr; }
  .temperature-grid .full { grid-column: auto; }
  .form-actions { grid-template-columns: 1fr; }
  .form-actions .secondary { order: 2; }
  .home-dashboard { padding: 24px 18px; }
  .weather-card { min-height: 126px; padding: 22px; }
  .environment-values { gap: 14px; }
  .environment-values strong { font-size: 27px; }
  .graph-search { display: grid; grid-template-columns: 1fr 1fr; }
  .graph-search-separator { display: none; }
  .graph-search input { width: 100%; }
  .home-menu { grid-template-columns: 1fr; }
}

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