@font-face {
    font-family: MyCustomFont;

    src: url("/static/mainpages/fonts/LexendDeca-VariableFont_wght.4f51bfcbfd2b.ttf")
        format("truetype");
}

@font-face {
    font-family: MyCustomFontJP;

    src: url("/static/mainpages/fonts/NotoSansJP-VariableFont_wght.3ea383cdd041.ttf")
        format("truetype");
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: MyCustomFontKR;

    src: url("/static/mainpages/fonts/NotoSansKR-VariableFont_wght.138709011225.ttf")
        format("truetype");
    font-weight: 100 900;
    font-style: normal;
}

:root {
    --nav-margin: 20px;
    --firstcolor: #ffffff;
    --secondcolor: #ea8144;
    --thirdcolor: #763cac;
    --forthcolor: #462871;
    --fifthcolor: lightseagreen;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.75rem;
    --space-4xl: 3.5rem;
    --space-page-x: clamp(1.25rem, 4vw, 2.5rem);
    --content-max: 52em;
    --content-wide: 72em;
    --fs-body: 1.125rem;
    --fs-600: clamp(1.875rem, 4.5vw, 2.5rem);
    --fs-500: 1.5rem;
    --fs-400: 1.25rem;
    --fs-300: 1.0625rem;
    --surface: #ffffff;
    --surface-muted: #f7f6fa;
    --text: #1a1a2e;
    --text-muted: #555577;
    --kf-purple: #462871;
    --kf-purple-mid: #763cac;
    --kf-orange: #ea8144;
    --kf-text: #462871;
    --brand-gradient: linear-gradient(95.3deg, var(--thirdcolor) 40%, var(--secondcolor) 90%);
    --control-height: 2.75rem;
    --control-height-lg: 3.25rem;
    --control-padding-x: 1.125rem;
    --control-padding-x-lg: 1.5rem;
    --control-radius: 8px;
    --control-font-size: 1rem;
    --control-font-size-lg: 1.125rem;
    --nav-hover-bg: var(--secondcolor);
    --nav-hover-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    --btn-primary-hover-shadow: 0 3px 10px rgba(118, 60, 172, 0.28);

    /* Dashboard tokens (light mode — gradient/glass surface) */
    --dashboard-text: var(--firstcolor);
    --dashboard-panel-bg: rgba(255, 255, 255, 0.1);
    --dashboard-panel-border: none;
    --dashboard-panel-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --dashboard-section-bg: rgba(255, 255, 255, 0.1);
    --dashboard-section-border: none;
    --dashboard-bar-bg: rgba(255, 255, 255, 0.18);
    --dashboard-bar-border: rgba(255, 255, 255, 0.2);
    --dashboard-row-bg: transparent;
    --dashboard-row-border: none;
    --dashboard-row-padding: 0;
    --dashboard-subtle-text: rgba(255, 255, 255, 0.75);
    --dashboard-divider: rgba(255, 255, 255, 0.34);
}

h1 {
    font-size: var(--fs-600);
}

h2 {
    font-size: var(--fs-500);
}

h3 {
    font-size: var(--fs-400);
}

html {
    background: var(--forthcolor);
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: MyCustomFont, MyCustomFontJP, MyCustomFontKR, sans-serif;
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--text);
    background: var(--surface-muted);
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--forthcolor);
    color: var(--firstcolor);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-page-x);
    --control-font-size: 1.125rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.logo {
    max-width: 50px;
    max-height: 50px;
    padding: 3px;
    background-color: #ffffff;
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
    border-radius: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--nav-margin);
    flex-shrink: 0;
}

.brandname {
    font-size: var(--fs-500);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

nav {
    background-color: var(--forthcolor);
    font-size: var(--control-font-size);
    display: flex;
    justify-content: center;
    align-items: center;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 0;
    gap: var(--space-md);
    padding: 0;
    list-style: none;
}

nav li {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    border-radius: var(--control-radius);
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: var(--control-font-size);
    font-weight: 500;
    line-height: 1.2;
}

nav a:hover:not(.btn-primary),
nav a.active:not(.btn-primary) {
    background-color: var(--nav-hover-bg);
    box-shadow: var(--nav-hover-shadow);
}

nav a.nav-logout:hover {
    background-color: var(--fifthcolor);
}

.content {
    width: 100%;
    color: var(--text);
}

.content > div {
    margin: 20px;
}

.backgroundgradient {
    text-align: center;
    width: 100%;
    padding: var(--space-xl) 0;
    color: var(--firstcolor);
    background-image: var(--brand-gradient);
}

.backgroundtext {
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.backgroundtext h1 {
    margin: 0 0 var(--space-sm);
    font-size: var(--fs-500);
    line-height: 1.2;
}

.backgroundtext p {
    margin: 0;
    font-size: var(--fs-300);
    line-height: 1.5;
    opacity: 0.95;
}


.header-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    width: 100%;
}

.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-switcher select {
    font: inherit;
    font-size: var(--control-font-size);
    box-sizing: border-box;
    min-height: var(--control-height);
    height: var(--control-height);
    width: 100%;
    max-width: 350px;
    min-width: 8em;
    padding: 0 2rem 0 var(--control-padding-x);
    border: 1px solid transparent;
    border-radius: var(--control-radius);
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.6rem center / 1em;
    color: var(--firstcolor);
    appearance: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-switcher select:focus {
    border-color: var(--secondcolor);
    outline: none;
}

.lang-switcher select option {
    background-color: var(--forthcolor);
    color: var(--firstcolor);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    background: var(--brand-gradient);
    color: var(--firstcolor);
    border-radius: var(--control-radius);
    font-family: inherit;
    font-size: var(--control-font-size);
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.92;
    box-shadow: var(--btn-primary-hover-shadow);
}

.btn-primary.btn-danger {
    /* Soft danger red (#dc3545) — same as validation / missing-resource chrome */
    background-color: #dc3545;
    background-image: none;
}

.btn-primary.btn-danger:hover {
    opacity: 0.92;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.28);
}

.home-hero-actions .btn-primary,
.home-download .btn-primary {
    min-height: var(--control-height-lg);
    padding: 0 var(--control-padding-x-lg);
    font-size: var(--control-font-size-lg);
}

.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xl);
    padding: var(--space-3xl) var(--space-page-x) var(--space-2xl);
    max-width: var(--content-wide);
    margin-inline: auto;
}

.home-hero-copy {
    flex: 1;
    text-align: center;
}

.home-hero h1 {
    color: var(--text);
    margin: 0 0 var(--space-md);
    font-size: var(--fs-600);
    line-height: 1.15;
}

.home-tagline {
    color: var(--thirdcolor);
    font-size: var(--fs-400);
    font-weight: 600;
    margin: 0 0 var(--space-lg);
    line-height: 1.35;
}

.home-lead {
    color: var(--text-muted);
    font-size: var(--fs-body);
    margin: 0 0 var(--space-xl);
    max-width: 48ch;
    line-height: 1.65;
    margin-inline: auto;
}

.home-hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.home-hero-visual img {
    width: 100%;
    max-width: 36em;
    max-height: 28em;
    object-fit: contain;
    display: block;
    margin-inline: auto;
}

.home-features {
    background: var(--surface);
    padding: var(--space-3xl) var(--space-page-x);
    scroll-margin-top: var(--space-lg);
}

.home-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl) var(--space-xl);
    max-width: var(--content-max);
    margin-inline: auto;
}

.home-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.home-feature-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.home-feature-label {
    color: var(--text);
    font-size: var(--fs-300);
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.home-feature-desc {
    color: var(--text-muted);
    font-size: var(--fs-body);
    line-height: 1.55;
    margin: 0;
    max-width: 28ch;
}

.home-details {
    padding-inline: var(--space-page-x);
    max-width: var(--content-max);
    margin-inline: auto;
}

.home-features + .home-details {
    padding-top: var(--space-3xl);
}

.home-details + .home-details {
    padding-top: var(--space-2xl);
}

.home-details h2 {
    color: var(--text);
    margin: 0 0 var(--space-md);
    font-size: var(--fs-500);
    line-height: 1.25;
}

.home-details p {
    color: var(--text-muted);
    font-size: var(--fs-body);
    margin: 0 0 var(--space-lg);
    line-height: 1.65;
}

.home-details p:last-child {
    margin-bottom: 0;
}

.home-details ul {
    color: var(--text-muted);
    font-size: var(--fs-body);
    padding-left: 1.25rem;
    margin: 0;
    line-height: 1.65;
}

.home-details li + li {
    margin-top: var(--space-sm);
}

.home-feedback.home-details {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-lg);
}

.home-details a:not(.btn-primary),
.home-feedback a:not(.btn-primary) {
    color: var(--thirdcolor);
}

.content > .home-details {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-3xl);
}

.home-details .account-form {
    margin-bottom: var(--space-xl);
}

.form-field {
    margin-bottom: var(--space-lg);
}

.form-field label {
    display: block;
    color: var(--text);
    font-size: var(--fs-300);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.form-field input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    font: inherit;
    font-size: var(--fs-body);
    color: var(--text);
    border: 1px solid #ccc;
    border-radius: var(--control-radius);
    appearance: none;
}

.form-field input:focus {
    border-color: var(--thirdcolor);
    outline: none;
}

.home-details .form-field input {
    max-width: 24em;
}

.password-field input::-ms-reveal,
.password-field input::-ms-clear {
    display: none;
}

.password-field input::-webkit-inner-spin-button,
.password-field input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.password-toggle svg {
    width: 1.375rem;
    height: 1.375rem;
}

.password-toggle .icon-eye-slash {
    display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye {
    display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-slash {
    display: block;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: 2.75rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--thirdcolor);
    outline-offset: -2px;
    border-radius: var(--control-radius);
}

.home-details .password-field {
    max-width: 24em;
}

.home-details .password-field input {
    max-width: none;
}

.home-details .form-errors {
    color: #c0392b;
    margin: var(--space-sm) 0 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: var(--space-xl);
}

.home-details .form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.home-details .form-feedback {
    color: var(--fifthcolor);
    font-size: var(--fs-300);
}

.home-details .form-note {
    padding-top: var(--space-lg);
    border-top: 1px solid #e0dfe8;
    font-size: var(--fs-300);
    line-height: 1.6;
}

.home-pricing {
    max-width: var(--content-wide);
    scroll-margin-top: var(--space-2xl);
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.pricing-tier {
    background: var(--surface);
    border: 1px solid #e0dfe8;
    border-radius: var(--control-radius);
    padding: var(--space-xl);
}

.pricing-tier h3 {
    margin: 0 0 var(--space-sm);
    color: var(--text);
    font-size: var(--fs-400);
}

.pricing-tagline {
    color: var(--text) !important;
    font-weight: 500;
    margin-bottom: var(--space-md) !important;
}

.pricing-price {
    color: var(--text) !important;
    font-size: var(--fs-400);
    margin-bottom: var(--space-md) !important;
}

.pricing-tier ul {
    margin-bottom: var(--space-md);
}

.pricing-tier .btn-primary {
    margin-top: var(--space-sm);
}

.pricing-beta {
    font-size: var(--fs-300);
    margin-bottom: 0;
}

.home-download {
    display: flex;
    justify-content: center;
    padding: var(--space-3xl) var(--space-page-x) var(--space-4xl);
    max-width: var(--content-wide);
    margin-inline: auto;
    scroll-margin-top: var(--space-lg);
}

@media (min-width: 60em) {
    header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: var(--space-lg);
    }

    .brand {
        flex: 0 1 auto;
        min-width: min-content;
    }

    .header-end {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        flex: 0 1 auto;
        min-width: min-content;
        margin-left: auto;
    }

    nav ul {
        flex-wrap: wrap;
    }

    .lang-switcher select {
        width: auto;
        max-width: none;
    }
}

@media (min-width: 42em) {
    .home-hero {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3xl);
        padding: var(--space-4xl) var(--space-page-x) var(--space-2xl);
    }

    .home-hero-copy {
        text-align: left;
    }

    .home-lead {
        margin-inline: 0;
    }

    .home-hero-actions {
        justify-content: flex-start;
    }

    .home-features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2xl) var(--space-lg);
    }

    .home-feature-desc {
        max-width: none;
    }

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

footer {
    background-color: var(--forthcolor);
    color: var(--firstcolor);
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-md) var(--space-page-x);
    margin-top: auto;
    flex-shrink: 0;
}

.footer-inner {
    max-width: var(--content-wide);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.footer-company {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    font-size: var(--fs-300);
    opacity: 0.9;
}

footer .footer-nav {
    background: transparent;
    font-size: var(--fs-300);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

footer .footer-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    border-radius: var(--control-radius);
    text-decoration: none;
    color: var(--firstcolor);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

footer .footer-nav a:hover {
    background-color: var(--secondcolor);
    color: var(--firstcolor);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.app-theme-form {
    margin: 0;
    flex-shrink: 0;
}

.app-theme-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    max-width: 22rem;
    padding: 0.25rem;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--control-radius);
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.app-theme-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: calc(var(--control-height) - 0.5rem);
    padding: 0 var(--control-padding-x);
    box-sizing: border-box;
    border: none;
    border-radius: calc(var(--control-radius) - 0.125rem);
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.app-theme-option:hover,
.app-theme-option:focus-visible {
    color: #ffffff;
    outline: none;
}

.app-theme-option.is-selected {
    background: var(--secondcolor);
    color: #ffffff;
}

.app-theme-option-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
    opacity: 0.75;
}

.app-theme-option.is-selected .app-theme-option-icon {
    opacity: 1;
}

.app-settings-label {
    display: block;
    font-size: var(--fs-300);
    color: var(--dashboard-subtle-text, var(--text-muted));
    margin-bottom: var(--space-sm);
}

.account-settings-details {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.account-settings-details dt {
    margin: 0 0 var(--space-xs);
    font-size: var(--fs-300);
    color: var(--dashboard-subtle-text);
    font-weight: 500;
}

.account-settings-details dd {
    margin: 0;
    color: var(--dashboard-text);
}

.account-settings-details p {
    margin: var(--space-sm) 0 0;
    font-size: var(--fs-300);
    color: var(--dashboard-subtle-text);
    line-height: 1.5;
}

.account-settings-details a {
    color: var(--dashboard-text);
    text-decoration: underline;
}

/* App / SmartHome sticky header (purple bar) */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    box-sizing: border-box;
    width: 100%;
    background-color: var(--forthcolor);
    color: var(--firstcolor);
    padding: var(--space-md) var(--space-page-x);
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: var(--nav-margin);
    min-width: 0;
}

.app-header-brandname {
    font-size: var(--fs-500);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--control-height);
    min-height: var(--control-height);
    padding: 0;
    border-radius: var(--control-radius);
    background: transparent;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.app-header-action:hover,
.app-header-action:focus-visible {
    background-color: var(--nav-hover-bg);
    outline: none;
}

.app-header-icon {
    width: 1.5rem;
    height: 1.5rem;
    filter: brightness(0) invert(1);
}

/* Dark mode tokens — companion html or smarthome html.
   html[data-theme] beats :root (same specificity otherwise; dashboard.css loads later). */
html[data-theme="dark"] {
    --firstcolor: #ffffff;
    --surface: #1e1a2a;
    --surface-muted: #14111c;
    --text: #ffffff;
    --text-muted: #c8c4d6;
    --kf-text: #ffffff;
    --kf-purple: #ffffff;
    --kf-purple-mid: #d4c8ec;

    --dashboard-text: var(--text);
    --dashboard-panel-bg: rgba(30, 26, 42, 0.72);
    --dashboard-panel-border: 1px solid rgba(255, 255, 255, 0.12);
    --dashboard-panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --dashboard-section-bg: rgba(255, 255, 255, 0.04);
    --dashboard-section-border: 1px solid rgba(255, 255, 255, 0.1);
    --dashboard-bar-bg: rgba(255, 255, 255, 0.06);
    --dashboard-bar-border: rgba(255, 255, 255, 0.1);
    --dashboard-row-bg: rgba(255, 255, 255, 0.05);
    --dashboard-row-border: 1px solid rgba(255, 255, 255, 0.12);
    --dashboard-row-padding: 0.75rem;
    --dashboard-subtle-text: var(--text-muted);
    --dashboard-divider: rgba(255, 255, 255, 0.1);

    color: var(--text);
    color-scheme: dark;
}

html[data-theme="dark"] .app-theme-toggle {
    border-color: rgba(255, 255, 255, 0.18);
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html[data-theme="dark"] .app-theme-option-icon {
    opacity: 0.55;
}

html[data-theme="dark"] .app-theme-option.is-selected .app-theme-option-icon {
    opacity: 1;
}

