:root {
    color-scheme: light;
    --navy-950: #04264d;
    --navy-900: #07386f;
    --blue-700: #0867c8;
    --blue-600: #0878e2;
    --blue-100: #e7f2ff;
    --ice-50: #f7fbff;
    --ice-100: #edf6fc;
    --slate-900: #10243e;
    --slate-700: #3e536d;
    --slate-500: #708297;
    --slate-300: #cbd6e1;
    --slate-200: #dce5ed;
    --white: #ffffff;
    --green: #20a24a;
    --green-soft: #e8f7ed;
    --amber: #dfa10b;
    --amber-soft: #fff5d8;
    --red: #cc3b38;
    --red-soft: #fff0ef;
    --shadow-soft: 0 12px 34px rgba(9, 46, 87, 0.10);
    --shadow-card: 0 8px 24px rgba(9, 46, 87, 0.08);
    --radius-large: 24px;
    --radius-card: 18px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ice-100);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--slate-900);
    background:
        radial-gradient(circle at 10% -20%, rgba(90, 181, 242, 0.24), transparent 35%),
        radial-gradient(circle at 100% 20%, rgba(8, 120, 226, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fcff 0%, #eef6fb 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

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

[hidden] {
    display: none !important;
}

.app-shell {
    position: relative;
    width: min(100%, 760px);
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: calc(94px + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 60px rgba(4, 38, 77, 0.08);
    backdrop-filter: blur(18px);
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 22px 12px;
    color: var(--white);
    background: linear-gradient(135deg, var(--navy-950), var(--navy-900));
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 0;
    font-size: clamp(0.82rem, 3.8vw, 1.02rem);
    font-weight: 850;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.brand-home {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.brand-avatar-button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: zoom-in;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    color: inherit;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    place-items: center;
    font-size: 1.25rem;
}

.icon-button:focus-visible,
.brand-avatar-button:focus-visible,
.brand-home:focus-visible,
.button:focus-visible,
.nav-item:focus-visible,
.mountain-card:focus-visible,
.text-button:focus-visible {
    outline: 3px solid rgba(8, 120, 226, 0.35);
    outline-offset: 3px;
}

.avatar-dialog {
    width: min(92vw, 580px);
    padding: 18px;
    color: var(--slate-900);
    border: 0;
    border-radius: 24px;
    background: var(--white);
    box-shadow: 0 28px 80px rgba(4, 38, 77, 0.32);
}

.avatar-dialog::backdrop {
    background: rgba(4, 24, 48, 0.72);
    backdrop-filter: blur(5px);
}

.avatar-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.avatar-dialog-header h2 {
    margin: 0;
}

.avatar-dialog-close {
    color: var(--navy-900);
    background: var(--ice-100);
}

.avatar-dialog-image {
    display: block;
    width: min(82vw, 520px);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.connection-banner {
    padding: 10px 20px;
    color: #6e4a00;
    background: var(--amber-soft);
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

main {
    padding: 28px 20px 20px;
}

.page-heading,
.onboarding-copy {
    margin-bottom: 24px;
}

.page-heading.compact {
    margin-bottom: 20px;
}

.page-heading-with-action {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.view-back {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    color: var(--blue-700);
    border: 1px solid rgba(8, 103, 200, 0.22);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--blue-700);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 620px;
    margin-bottom: 8px;
    font-size: clamp(2rem, 7vw, 3.15rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 4px;
    font-size: 1.12rem;
    line-height: 1.25;
}

.page-heading > p:last-child,
.page-heading > div > p:last-child,
.onboarding-copy > p:last-child,
.updated-label {
    margin-bottom: 0;
    color: var(--slate-500);
    line-height: 1.55;
}

.onboarding {
    max-width: 620px;
    margin: 0 auto;
}

.bot-tagline {
    color: var(--navy-900);
    font-weight: 750;
}

.onboarding-question {
    margin-top: 26px;
    margin-bottom: 6px;
    font-size: 1.3rem;
}

.mountain-picker {
    display: grid;
    gap: 12px;
}

.profile-field {
    display: grid;
    gap: 7px;
    margin-bottom: 20px;
}

.profile-field label {
    color: var(--navy-900);
    font-weight: 800;
}

.profile-field input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    color: var(--navy-900);
    border: 1.5px solid var(--slate-200);
    border-radius: 14px;
    background: var(--white);
    font: inherit;
}

.profile-field input:focus {
    border-color: var(--blue-600);
    outline: 3px solid rgba(8, 120, 226, 0.18);
    outline-offset: 1px;
}

.profile-field small {
    color: var(--slate-500);
    line-height: 1.4;
}

.settings-profile-field {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--slate-200);
}

.mountain-option {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr 28px;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px 16px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 5px 18px rgba(9, 46, 87, 0.04);
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.mountain-option:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.mountain-option:has(input:checked) {
    border-color: var(--blue-600);
    box-shadow: 0 7px 22px rgba(8, 120, 226, 0.13);
}

.mountain-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
}

.option-name {
    font-size: 1.08rem;
    font-weight: 800;
}

.option-check {
    display: grid;
    width: 26px;
    height: 26px;
    border: 2px solid var(--slate-300);
    border-radius: 50%;
    place-items: center;
}

.mountain-option input:checked + .option-check {
    border-color: var(--blue-600);
    background: var(--blue-600);
}

.mountain-option input:checked + .option-check::after {
    width: 6px;
    height: 11px;
    content: "";
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}

.onboarding-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.button {
    min-height: 52px;
    padding: 12px 18px;
    border: 1.5px solid transparent;
    border-radius: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.button:not(:disabled):active {
    transform: translateY(1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-primary {
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
    box-shadow: 0 10px 22px rgba(8, 103, 200, 0.22);
}

.button-secondary {
    color: var(--blue-700);
    border-color: var(--blue-600);
    background: var(--white);
}

.button-reset {
    color: var(--red);
    border-color: rgba(204, 59, 56, 0.45);
    background: var(--white);
}

.full-width {
    width: 100%;
}

.notice-card,
.lake-card,
.install-card,
.settings-card {
    border: 1px solid rgba(203, 214, 225, 0.75);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-card);
}

.notice-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 16px;
    margin-bottom: 28px;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.notice-card.has-warning {
    border-color: rgba(223, 161, 11, 0.45);
    background: linear-gradient(135deg, var(--white), var(--amber-soft));
}

.notice-card.has-critical {
    border-color: rgba(204, 59, 56, 0.42);
    background: linear-gradient(135deg, var(--white), var(--red-soft));
}

.notice-icon,
.lake-icon {
    display: grid;
    width: 48px;
    height: 48px;
    color: var(--blue-700);
    border-radius: 15px;
    background: var(--blue-100);
    place-items: center;
    font-size: 1.35rem;
    font-weight: 900;
}

.notice-card p {
    margin-bottom: 0;
    color: var(--slate-500);
    line-height: 1.4;
}

.notice-copy {
    min-width: 0;
}

.notice-summary-title {
    overflow: hidden;
    color: var(--slate-700) !important;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-summary-text {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 3px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.status-dot {
    display: block;
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 5px var(--green-soft);
}

.notice-card.has-warning .status-dot {
    background: var(--amber);
    box-shadow: 0 0 0 5px var(--amber-soft);
}

.notice-card.has-critical .status-dot {
    background: var(--red);
    box-shadow: 0 0 0 5px var(--red-soft);
}

.notice-tail {
    display: grid;
    grid-template-columns: 11px 14px;
    gap: 9px;
    align-items: center;
    justify-items: center;
    align-self: center;
}

.notice-arrow {
    display: block;
    width: 9px;
    height: 9px;
    color: var(--slate-500);
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    font-size: 0;
    transform: rotate(-45deg);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.28rem;
}

.text-button {
    padding: 8px 4px;
    color: var(--blue-700);
    border: 0;
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.mountain-grid {
    display: grid;
    gap: 14px;
}

.mountain-card {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 15px;
    align-items: center;
    width: 100%;
    min-height: 112px;
    padding: 17px;
    color: inherit;
    text-align: left;
    border: 1px solid rgba(203, 214, 225, 0.75);
    border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.mountain-card:hover {
    border-color: rgba(8, 120, 226, 0.35);
}

.mountain-symbol {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
}

.mountain-card h3 {
    margin: 0 0 8px;
    font-size: 1.3rem;
}

.status-line {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    color: var(--slate-700);
    font-size: 0.91rem;
}

.mini-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--slate-300);
}

.mini-dot.open {
    background: var(--green);
}

.mini-dot.closed {
    background: var(--red);
}

.mini-dot.unknown {
    background: var(--slate-300);
}

.card-arrow {
    color: var(--slate-500);
    font-size: 1.7rem;
    font-weight: 400;
}

.lake-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px;
    margin-top: 24px;
}

.card-label {
    margin-bottom: 3px;
    color: var(--slate-500);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lake-temperature {
    margin-bottom: 0;
    font-size: 1.4rem;
    font-weight: 850;
}

.message-list {
    display: grid;
    gap: 14px;
}

.message-card,
.empty-state {
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: var(--shadow-card);
}

.message-card.priority-high {
    border-left: 5px solid var(--red);
}

.message-card h2 {
    margin-bottom: 8px;
}

.message-card p {
    color: var(--slate-700);
    line-height: 1.55;
}

.message-card a {
    color: var(--blue-700);
    font-weight: 800;
}

.message-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tag {
    padding: 5px 9px;
    color: var(--navy-900);
    border-radius: 999px;
    background: var(--ice-100);
    font-size: 0.72rem;
    font-weight: 800;
}

.empty-state {
    color: var(--slate-500);
    text-align: center;
}

.settings-card,
.install-card {
    padding: 18px;
}

.settings-card .button {
    margin-top: 18px;
}

.settings-card .button-reset {
    margin-top: 10px;
}

.reset-help {
    margin: 8px 2px 0;
    color: var(--slate-500);
    font-size: 0.78rem;
    line-height: 1.45;
}

.install-card {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.install-card p:last-child {
    margin-bottom: 0;
    color: var(--slate-500);
    line-height: 1.5;
}

.powered-by {
    margin: 28px 2px 0;
    color: var(--slate-500);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-align: right;
}

.dialog-powered-by {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid var(--slate-200);
}

.bottom-nav {
    position: fixed;
    z-index: 25;
    right: max(0px, calc((100vw - 760px) / 2));
    bottom: 0;
    left: max(0px, calc((100vw - 760px) / 2));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px 8px calc(8px + var(--safe-bottom));
    border-top: 1px solid rgba(203, 214, 225, 0.85);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -8px 30px rgba(9, 46, 87, 0.08);
    backdrop-filter: blur(18px);
}

.nav-item {
    position: relative;
    display: grid;
    gap: 3px;
    min-height: 58px;
    padding: 6px;
    color: var(--slate-500);
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    place-items: center;
    font-size: 0.73rem;
    font-weight: 750;
}

.nav-item.active {
    color: var(--blue-700);
    background: var(--ice-50);
}

.nav-item.active::before {
    position: absolute;
    top: -9px;
    width: 46px;
    height: 3px;
    content: "";
    border-radius: 999px;
    background: var(--blue-600);
}

.nav-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
}

.nav-icon-overview::before {
    position: absolute;
    inset: 3px;
    content: "";
    border: 2px solid currentColor;
    border-radius: 5px;
    box-shadow: inset 7px 0 0 transparent;
}

.nav-icon-overview::after {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 11px;
    width: 2px;
    content: "";
    background: currentColor;
}

.nav-icon-messages::before {
    position: absolute;
    inset: 2px 4px 5px;
    display: grid;
    content: "!";
    border: 2px solid currentColor;
    border-radius: 7px;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 900;
}

.nav-icon-messages::after {
    position: absolute;
    right: 5px;
    bottom: 2px;
    width: 7px;
    height: 7px;
    content: "";
    border-right: 2px solid currentColor;
    transform: rotate(25deg);
}

.nav-icon-mountains {
    border-radius: 8px;
    background: url('icons/icon-192.png') center / cover no-repeat;
}

.nav-item:not(.active) .nav-icon-mountains {
    filter: grayscale(1);
    opacity: 0.72;
}

.nav-item.active .nav-icon-mountains {
    box-shadow: 0 0 0 2px rgba(8, 120, 226, 0.18);
}

.nav-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.mountain-dialog {
    width: min(calc(100% - 28px), 680px);
    max-height: calc(100vh - 40px);
    padding: 0;
    color: var(--slate-900);
    border: 0;
    border-radius: 24px;
    background: var(--ice-50);
    box-shadow: 0 24px 80px rgba(4, 38, 77, 0.3);
}

.mountain-dialog::backdrop {
    background: rgba(4, 24, 47, 0.55);
    backdrop-filter: blur(5px);
}

.dialog-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--slate-200);
    background: rgba(255, 255, 255, 0.96);
}

.dialog-header h2 {
    margin: 0;
    font-size: 1.55rem;
}

.dialog-close {
    color: var(--navy-900);
    background: var(--ice-100);
    font-size: 1.7rem;
}

#dialog-content {
    padding: 18px;
}

.object-list {
    display: grid;
    gap: 8px;
}

.operation-panel {
    padding: 15px;
    margin-bottom: 18px;
    border: 1px solid rgba(8, 120, 226, 0.2);
    border-radius: 15px;
    background: var(--blue-100);
}

.operation-panel h3 {
    margin-bottom: 10px;
    color: var(--navy-900);
    text-align: center;
}

.operation-group {
    display: grid;
    gap: 7px;
    padding: 12px 0;
    border-top: 1px solid rgba(8, 103, 200, 0.14);
}

.operation-group:first-of-type {
    border-top: 0;
}

.operation-group h4 {
    margin: 0;
    color: var(--navy-900);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.operation-period {
    margin: 0;
    color: var(--slate-700);
    font-size: 0.84rem;
    line-height: 1.45;
}

.weather-panel {
    margin-bottom: 18px;
    text-align: center;
}

.weather-panel h3 {
    margin: 0 0 10px;
    color: var(--navy-900);
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.weather-card {
    display: grid;
    gap: 3px;
    padding: 13px;
    border: 1px solid rgba(8, 120, 226, 0.18);
    border-radius: 14px;
    background: var(--white);
}

.weather-card strong {
    color: var(--navy-900);
}

.weather-card span {
    color: var(--slate-700);
    font-size: 0.84rem;
}

.object-group {
    margin-top: 22px;
}

.object-group summary {
    position: relative;
    margin: 0 0 10px 2px;
    padding-right: 28px;
    color: var(--navy-900);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.object-group summary::-webkit-details-marker {
    display: none;
}

.object-group summary::after {
    position: absolute;
    right: 5px;
    content: "+";
    color: var(--blue-700);
    font-size: 1.35rem;
    line-height: 1;
}

.object-group[open] summary::after {
    content: "−";
}

.object-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 13px;
    border: 1px solid var(--slate-200);
    border-radius: 13px;
    background: var(--white);
}

.object-name {
    min-width: 0;
    font-weight: 750;
}

.object-type {
    color: var(--slate-500);
    font-size: 0.75rem;
}

.lift-list {
    display: grid;
    gap: 12px;
}

.lift-row {
    padding: 15px;
    border: 1px solid var(--slate-200);
    border-radius: 15px;
    background: var(--white);
}

.lift-row h4 {
    margin: 0 0 9px;
    color: var(--navy-900);
    font-size: 0.94rem;
    line-height: 1.4;
}

.lift-status.open {
    color: var(--green);
}

.lift-status.closed {
    color: var(--red);
}

.ride-line {
    margin: 3px 0;
    color: var(--slate-700);
    font-size: 0.84rem;
    line-height: 1.45;
}

.lift-notes {
    margin: 11px 0 0;
    padding-top: 10px;
    color: var(--slate-500);
    border-top: 1px solid var(--slate-200);
    font-size: 0.8rem;
    line-height: 1.5;
}

.lift-notes p {
    margin: 0;
}

.lift-notes p + p {
    margin-top: 2px;
}

@media (max-width: 430px) {
    .page-heading-with-action {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .view-back {
        padding-inline: 9px;
        font-size: 0.75rem;
    }
}

@media (min-width: 680px) {
    main {
        padding: 36px 36px 28px;
    }

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

    .install-card {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

@media (max-width: 390px) {
    .app-header {
        padding-inline: 16px;
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 50px;
        height: 50px;
    }

    main {
        padding-inline: 14px;
    }

    .onboarding-actions {
        grid-template-columns: 1fr;
    }

    .mountain-card {
        grid-template-columns: 50px 1fr auto;
        padding: 14px;
    }

    .mountain-symbol {
        width: 50px;
        height: 50px;
    }
}

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