:root {
    --bg: #dce8f2;
    --header-bg: #ffffff;
    --text: #18222d;
    --muted: #73879a;
    --bubble-in: #ffffff;
    --bubble-out: #efffde;
    --bubble-out-border: #d4edc3;
    --accent: #3390ec;
    --accent-dark: #2f7fcb;
    --shadow: 0 10px 28px rgba(44, 73, 100, 0.08);
    --auth-bg1: #f7f4ff;
    --auth-bg2: #eaf9ff;
    --auth-card-bg: rgba(255,255,255,.78);
    --auth-text: #293241;
    --auth-muted: #6c7a89;
    --auth-accent: #a3bffa;
    --page-gutter: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    color: var(--text);
    background: var(--bg);
    margin: 0;
}

.app-auth {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 20% 10%, #fff6, transparent),
        linear-gradient(145deg, var(--auth-bg1), var(--auth-bg2));
    color: var(--auth-text);
    overflow: hidden;
}

.app-auth-wizard {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.yin-yang-bg{
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 0;
    pointer-events: none;
    opacity: .18;
    filter: blur(.3px) drop-shadow(0 30px 60px rgba(0,0,0,.08));
    animation: slow-float 18s ease-in-out infinite alternate;
}

.yin-yang-bg svg{ width: 72vmin; height: 72vmin; }

@keyframes slow-float{
    from{ transform: translateY(-6px);}
    to{ transform: translateY(6px);}
}

.glass{
    background: var(--auth-card-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 20px 60px rgba(31, 38, 135, 0.08);
}

.auth-card{
    max-width: 560px;
    width: 100%;
}

.auth-card-wizard {
    max-width: 640px;
}

.auth-main,
.auth-shell {
    min-height: 100vh;
}

.app-auth-register .auth-shell-register {
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

.app-auth-register {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-auth-register .auth-card-register {
    max-width: 520px;
    padding: 1.35rem 1.25rem 1.15rem;
}

.app-auth-register .auth-head {
    margin-bottom: 0.85rem !important;
}

.app-auth-register .auth-tabs {
    margin-bottom: 0.85rem !important;
}

.app-auth-register .brand-mark {
    width: 56px;
    height: 56px;
    margin-bottom: 0.7rem !important;
}

.app-auth-register .brand-mark svg {
    width: 32px;
    height: 32px;
}

.app-auth-register .leadish {
    font-size: 0.88rem;
    line-height: 1.35;
}

.app-auth-register .auth-form .mb-3 {
    margin-bottom: 0.75rem !important;
}

.app-auth-register .form-label {
    margin-bottom: 0.3rem;
}

.app-auth-register .form-text {
    font-size: 0.8rem;
    line-height: 1.35;
}

.app-auth-register .form-text.mb-3 {
    margin-bottom: 0.75rem !important;
}

.app-auth-register .form-control {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.app-auth-register .btn-accent {
    min-height: 44px;
}

.app-auth-register .small-muted {
    line-height: 1.3;
}

.brand-mark{
    width: 64px; height: 64px; border-radius: 999px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #ffffff, #f0f4ff);
    border: 1px solid rgba(0,0,0,.05);
    box-shadow: inset 0 0 0 6px #fff, 0 6px 20px rgba(0,0,0,.06);
}

.brand-mark svg{ width: 36px; height: 36px; }

.small-muted{ font-size: .9rem; color: var(--auth-muted); }
.leadish{ color: var(--auth-muted); margin-bottom: 0; }

.auth-info-card {
    padding: 14px 15px;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(223, 231, 255, .95);
    box-shadow: 0 10px 26px rgba(163, 191, 250, .12);
}

.auth-info-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #223554;
    margin-bottom: 8px;
}

.auth-info-steps {
    margin: 0 0 12px;
    padding-left: 1.15rem;
    color: #516275;
    font-size: 0.9rem;
}

.auth-info-steps li + li {
    margin-top: 4px;
}

.auth-info-text {
    color: #516275;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-info-note {
    margin-top: 10px;
    font-size: 0.82rem;
    color: #6a7890;
}

.nav-pills .nav-link{
    border-radius: 999px;
    color: #2b3a55;
}

.nav-pills .nav-link.active{
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(163,191,250,.25);
    border: 1px solid #e7ecff;
    color: #20304a;
}

.btn-accent{
    --bs-btn-color: #20304a;
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #e7ecff;
    --bs-btn-hover-color: #18263d;
    --bs-btn-hover-bg: #f8faff;
    --bs-btn-hover-border-color: #dfe7ff;
    --bs-btn-active-bg: #eef3ff;
    --bs-btn-active-border-color: #d6e0ff;
    border-width: 1px;
    box-shadow: 0 6px 16px rgba(163,191,250,.25);
}

.app-auth .form-control{
    border-radius: 12px;
}

@media (max-height: 720px){
    .app-auth{ overflow: auto; }
    .yin-yang-bg{ position: absolute; }
}

@media (max-width: 768px) {
    .app-auth-register .auth-shell-register {
        align-items: flex-start !important;
        padding-top: 8px !important;
        padding-bottom: 10px !important;
    }

    .app-auth-register .auth-card-register {
        padding: 1rem 1rem 0.9rem;
    }

    .app-auth-register .auth-head {
        margin-bottom: 0.65rem !important;
    }

    .app-auth-register .brand-mark {
        width: 48px;
        height: 48px;
        margin-bottom: 0.55rem !important;
    }

    .app-auth-register .brand-mark svg {
        width: 28px;
        height: 28px;
    }

    .app-auth-register .leadish {
        display: block;
        font-size: 0.83rem;
        line-height: 1.35;
    }

    .app-auth-register .nav-pills {
        gap: 0.5rem !important;
    }

    .app-auth-register .nav-pills .nav-link {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    .app-auth-register .auth-form .mb-3 {
        margin-bottom: 0.65rem !important;
    }

    .app-auth-register .form-text {
        font-size: 0.77rem;
    }

    .auth-info-card {
        padding: 12px 13px;
        border-radius: 14px;
    }

    .auth-info-steps,
    .auth-info-text {
        font-size: 0.84rem;
    }

    .auth-info-note {
        font-size: 0.76rem;
    }
}

.name-suggestions {
    position: relative;
}

.name-suggestions .list {
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 20;
    max-height: 200px;
    overflow-y: auto;
}

.name-suggestions .item {
    padding: 10px 12px;
    cursor: pointer;
}

.name-suggestions .item:hover {
    background: #f3f4f6;
}

.field-inline-warning {
    display: none;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #b42318;
    line-height: 1.35;
}

.field-inline-warning.is-visible {
    display: block;
}

.city-suggestions {
    position: relative;
}

.city-suggestions .search_result {
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
}

.city-suggestions .search_result li {
    padding: 8px 12px;
    cursor: pointer;
}

.city-suggestions .search_result li:hover {
    background: #f3f4f6;
}

.city-suggestions .search_city_id {
    display: none;
}

.city-suggestions .city-error {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    color: #9f1239;
    font-size: 0.85rem;
}

.chat-shell {
    min-height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
}

.app-update-banner-shell {
    padding: 10px 12px 0;
}

.app-update-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff7e8;
    border: 1px solid #f2d28b;
    box-shadow: 0 10px 24px rgba(77, 57, 15, 0.06);
}

.app-update-banner-force {
    background: #fff1f2;
    border-color: #f5b4bc;
    box-shadow: 0 10px 24px rgba(120, 20, 40, 0.08);
}

.app-update-copy {
    min-width: 0;
}

.app-update-title {
    font-size: 15px;
    font-weight: 700;
    color: #7a4b00;
    margin-bottom: 4px;
}

.app-update-banner-force .app-update-title {
    color: #9f1239;
}

.app-update-text {
    font-size: 14px;
    line-height: 1.45;
    color: #5f4a1b;
}

.app-update-banner-force .app-update-text {
    color: #7f1d1d;
}

.app-update-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #8a6b2a;
}

.app-update-banner-force .app-update-meta {
    color: #9f4557;
}

.app-update-button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #ebc76e;
    color: #7a4b00;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.app-update-banner-force .app-update-button {
    border-color: #ecb2bd;
    color: #9f1239;
}

.app-update-button:hover {
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.82);
}

@media (max-width: 640px) {
    .app-update-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .app-update-button {
        width: 100%;
    }
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px var(--page-gutter) 88px;
    background:
        linear-gradient(180deg, rgba(238, 245, 251, 0.95), rgba(220, 232, 242, 0.98)),
        radial-gradient(rgba(74, 120, 160, 0.08) 1px, transparent 1px);
    background-size: auto, 26px 26px;
}

.chat-body-page {
    padding: 0 0 88px;
}

.chat-page-wrap {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 16px var(--page-gutter) 24px;
}

.chat-page-wrap-wide {
    width: min(100%, 980px);
}

.chat-inline-alert {
    margin: 0 0 10px;
}

.chat-request-panel {
    margin: 0 0 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dde7f0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.chat-request-head {
    margin-bottom: 10px;
}

.chat-request-title {
    font-size: 14px;
    font-weight: 700;
    color: #133f66;
}

.chat-request-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #698197;
}

.chat-request-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-request-form .form-control {
    flex: 1;
    min-width: 0;
    border-radius: 12px;
}

.chat-request-disabled {
    font-size: 13px;
    color: #6b7280;
}

.chat-empty {
    text-align: center;
    color: var(--muted);
    margin-top: 40px;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    max-width: 100%;
}

.message.incoming {
    align-self: stretch;
    width: 100%;
}

.message.outgoing {
    align-self: flex-end;
    max-width: min(88%, 720px);
}

.bubble {
    padding: 10px 12px;
    border-radius: 14px;
    box-shadow: none;
    position: relative;
    border: 0;
}

.message.incoming .bubble {
    background: var(--bubble-in);
}

.message.outgoing .bubble {
    background: var(--bubble-out);
}

.message.has-rating .bubble {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.message.unread .bubble {
    box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.16);
}

.message-text {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.52;
    color: var(--text);
}

.message-meta {
    font-size: 11px;
    color: #7e93a7;
    margin-top: 8px;
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.message.incoming .message-meta {
    justify-content: flex-end;
}

.message-check {
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: -2.5px;
}

.message-check.read {
    color: var(--accent-dark);
}

.message-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.message-rating {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(234, 242, 249, 0.9);
    border: 0;
    border-top: 0;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    box-shadow: none;
}

.rating-stars {
    display: inline-flex;
    gap: 6px;
}

.rating-stars .star {
    border: none;
    background: transparent;
    font-size: 28px;
    width: 34px;
    height: 34px;
    line-height: 34px;
    color: #b8cbe0;
    padding: 0;
    cursor: pointer;
}

.rating-stars .star.active {
    color: #f59e0b;
}

.rating-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rating-tags .tag {
    border: 1px solid #d6e4f0;
    background: rgba(255,255,255,0.88);
    border-radius: 999px;
    font-size: 14px;
    padding: 7px 14px;
    cursor: pointer;
    color: #567189;
}

.rating-tags .tag.active {
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.reaction-chip {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.reaction-chip.active {
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.message.message-focused .bubble {
    box-shadow:
        0 0 0 2px rgba(51, 144, 236, 0.28),
        0 14px 30px rgba(51, 144, 236, 0.18);
    transform: translateY(-1px);
}

.message.message-focused .message-rating {
    box-shadow: 0 12px 24px rgba(51, 144, 236, 0.16);
}

.forecast-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forecast-head {
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
}

.forecast-kicker {
    display: block;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    color: #5f7992;
    letter-spacing: 0.01em;
}

.forecast-date {
    display: block;
    min-height: 0;
    margin-top: 4px;
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
    font-size: 12px;
    font-weight: 700;
    color: #7a90a5;
    text-transform: none;
    letter-spacing: 0.01em;
}

.forecast-title {
    margin-top: 6px;
    padding: 0;
    border-radius: 0;
    background: none;
    border-left: 0;
    font-size: 19px;
    line-height: 1.34;
    font-weight: 800;
    color: #133f66;
    box-shadow: none;
}

.forecast-lead {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forecast-paragraph {
    margin: 0;
    color: #253646;
}

.forecast-sections {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.forecast-item {
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
}

.forecast-label {
    display: inline;
    min-height: 0;
    margin: 0 4px 0 0;
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
    font-size: 14px;
    font-weight: 700;
    color: #225f8f;
}

.forecast-value {
    display: inline;
    color: #263748;
    line-height: 1.48;
}

.forecast-clothes,
.forecast-nutrition {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forecast-clothes-title,
.forecast-nutrition-title {
    font-size: 14px;
    font-weight: 700;
    color: #225f8f;
}

.forecast-clothes-item,
.forecast-nutrition-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.forecast-clothes-item.is-inline,
.forecast-nutrition-item.is-inline {
    display: block;
}

.forecast-clothes-label,
.forecast-nutrition-label {
    font-size: 13px;
    font-weight: 700;
    color: #133f66;
}

.forecast-clothes-item.is-inline .forecast-clothes-label,
.forecast-nutrition-item.is-inline .forecast-nutrition-label {
    display: inline;
    margin-right: 4px;
}

.forecast-clothes-inline-value,
.forecast-nutrition-inline-value {
    display: inline;
    color: #263748;
    line-height: 1.52;
}

.forecast-clothes-content,
.forecast-nutrition-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.forecast-clothes-line,
.forecast-nutrition-line {
    color: #263748;
    line-height: 1.52;
}

.forecast-clothes-line.is-bullet,
.forecast-nutrition-line.is-bullet {
    padding-left: 12px;
    position: relative;
}

.forecast-clothes-line.is-bullet::before,
.forecast-nutrition-line.is-bullet::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #6b8aa5;
    font-weight: 700;
}

.chat-input {
    position: sticky;
    bottom: 48px;
    background: #fff;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
}

.chat-input .form-control {
    border-radius: 16px;
    padding: 10px 14px;
}

.chat-input-disabled {
    position: sticky;
    bottom: 48px;
    background: #fff;
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
    color: var(--muted);
    text-align: center;
}

.chat-tabs {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: stretch;
    gap: 4px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
    padding: 8px var(--page-gutter) calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-tabs .tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 52px;
    padding: 8px 6px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.chat-tabs .tab:hover {
    background: rgba(51, 144, 236, 0.06);
    color: var(--text);
}

.chat-tabs .tab:active {
    transform: translateY(1px);
}

.chat-tabs .tab.active {
    color: var(--accent-dark);
    background: rgba(51, 144, 236, 0.1);
}

.chat-tabs .tab-label {
    display: block;
    max-width: 100%;
    white-space: normal;
}

.chat-tabs .tab-icon {
    font-size: 1rem;
    line-height: 1;
}

.chat-tabs.has-admin-tab .tab {
    font-size: 0.78rem;
    line-height: 1.15;
}

.cards-body {
    background: #f8fafc;
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cards-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.card-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.card-name {
    font-size: 1.05rem;
}

.card-meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.card-actions {
    margin-top: 10px;
}

.card-settings {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.settings-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.settings-item {
    font-size: 0.9rem;
    color: var(--muted);
}

.settings-item span {
    color: #1f2937;
    font-weight: 500;
}

.card-edit {
    margin-top: 10px;
}

.card-edit summary {
    list-style: none;
}

.card-edit summary::-webkit-details-marker {
    display: none;
}

.card-edit-form {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.card-edit-form .card-daily-options[hidden] {
    display: none;
}

.summary-list {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    padding: 8px 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 0.95rem;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--muted);
}

.summary-value {
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

.wizard-panel[data-step="7"] {
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 6px;
}


.mode-tip {
    font-size: 0.95rem;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
}

.cards-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-image: none;
}

.cards-empty .empty-cta {
    padding: 24px;
}

.reaction-bar {
    position: fixed;
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: var(--shadow);
    z-index: 50;
    gap: 8px;
}

.reaction-bar button {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.profile-card {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.profile-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.profile-row .label { color: var(--muted); }

.profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.profile-note {
    margin-top: 12px;
    color: #92400e;
    background: #fef3c7;
    padding: 10px 12px;
    border-radius: 10px;
}

.profile-page {
    max-width: none;
}

.profile-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #d7e4ef;
    border-radius: 22px;
    padding: 22px 20px;
    box-shadow: 0 12px 28px rgba(47, 88, 126, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.profile-hero-panel {
    background:
        linear-gradient(180deg, rgba(247, 251, 255, 0.97), rgba(255, 255, 255, 0.95)),
        radial-gradient(circle at top right, rgba(51, 144, 236, 0.10), transparent 35%);
}

.profile-hero-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.profile-hero-action {
    flex-shrink: 0;
}

.profile-brand-mark {
    flex: 0 0 64px;
}

.profile-page-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #17324a;
}

.profile-page-subtitle {
    color: #6f8396;
    font-size: 0.98rem;
    line-height: 1.45;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-summary-card {
    background: linear-gradient(180deg, #f6fbff, #fdfefe);
    border: 1px solid #dde9f4;
    border-radius: 18px;
    padding: 14px 15px;
}

.profile-summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7690a7;
    margin-bottom: 6px;
}

.profile-summary-value {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1d3347;
}

.profile-summary-value-sm {
    font-size: 0.95rem;
    word-break: break-word;
}

.profile-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.profile-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #18334b;
}

.profile-section-subtitle {
    margin-top: 4px;
    color: #73879a;
    font-size: 0.95rem;
    line-height: 1.45;
}

.profile-panel .form-label {
    font-weight: 600;
    color: #24415c;
}

.profile-panel .form-control,
.profile-panel .form-select {
    border-radius: 14px;
    border-color: #d5e2ee;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    box-shadow: none;
}

.profile-panel .form-control:focus,
.profile-panel .form-select:focus {
    border-color: #86bdf2;
    box-shadow: 0 0 0 0.2rem rgba(51, 144, 236, 0.14);
}

.profile-panel .form-text {
    color: #73879a;
}

.profile-debug-panel {
    background: linear-gradient(180deg, #eef7ff, #f7fbff);
    border-color: #cfe1f0;
}

.profile-debug-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #36506a;
    word-break: break-word;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-link-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #d7e4ef;
    color: #2d628f;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(51, 144, 236, 0.06);
}

.profile-link-chip:hover {
    color: #245276;
    background: #fff;
    border-color: #c4d9ea;
}

.admin-chats-body {
    padding-bottom: 24px;
}

.admin-chats-grid {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.admin-sidebar,
.admin-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-panel {
    background: rgba(255,255,255,0.92);
    border: 1px solid #d7e4ef;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(51, 144, 236, 0.06);
}

.admin-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #20364d;
}

.admin-panel-note {
    font-size: 12px;
    color: #6c8398;
}

.admin-mode-tabs {
    display: inline-flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #d8e5ef;
    background: rgba(255,255,255,0.82);
    color: #335b7c;
    font-weight: 600;
    text-decoration: none;
}

.admin-mode-tab:hover,
.admin-mode-tab.active {
    background: #fff;
    border-color: #c6d9e8;
    color: #214667;
}

.admin-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #f2c55f;
    color: #4d3400;
    font-size: 11px;
    font-weight: 700;
}

.admin-mode-badge.hidden {
    display: none;
}

.admin-search-form .form-control,
.admin-compose-textarea {
    border-radius: 14px;
}

.admin-filter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #d8e5ef;
    background: #f7fbfe;
    color: #335b7c;
    font-weight: 600;
    text-decoration: none;
}

.admin-filter-link:hover,
.admin-filter-link.active {
    background: #fff;
    border-color: #c6d9e8;
    color: #214667;
}

.admin-events-list,
.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.admin-event-item,
.admin-user-link {
    display: block;
    padding: 12px 13px;
    border-radius: 16px;
    text-decoration: none;
    background: #f8fbfe;
    border: 1px solid #dfeaf2;
    color: #20364d;
}

.admin-event-item:hover,
.admin-user-link:hover,
.admin-user-link.active {
    background: #ffffff;
    border-color: #c9dcea;
    color: #16334f;
}

.admin-event-item.is-fresh {
    animation: adminEventPulse 2s ease;
}

.admin-event-top,
.admin-user-top,
.admin-summary-head,
.admin-compose-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-event-title,
.admin-user-name,
.admin-summary-title {
    font-weight: 700;
    color: #1f3448;
}

.admin-event-meta,
.admin-user-email,
.admin-user-meta,
.admin-summary-subtitle {
    font-size: 13px;
    color: #647a8f;
}

.admin-user-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-event-time {
    font-size: 12px;
    color: #7f94a6;
    white-space: nowrap;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-badge-user {
    background: #e8f1ff;
    color: #235ea2;
}

.admin-badge-card {
    background: #eefbf2;
    color: #256947;
}

.admin-badge-reply {
    background: #fff4df;
    color: #946200;
}

.admin-summary-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.admin-stat-chip,
.admin-card-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f5f9fc;
    border: 1px solid #d8e5ef;
    font-size: 12px;
    color: #3a5b77;
}

.admin-thread-switch {
    display: inline-flex;
    gap: 8px;
    margin-top: 14px;
}

.admin-thread-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f5f9fc;
    border: 1px solid #d8e5ef;
    color: #335b7c;
    text-decoration: none;
    font-weight: 600;
}

.admin-thread-link.active,
.admin-thread-link:hover {
    background: #fff;
    border-color: #c6d9e8;
    color: #214667;
}

.admin-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.admin-conversation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-empty-note {
    color: #6f8598;
    font-size: 14px;
}

@keyframes adminEventPulse {
    0% {
        border-color: #f2c55f;
        box-shadow: 0 0 0 0 rgba(242, 197, 95, 0.28);
    }
    100% {
        border-color: #dfeaf2;
        box-shadow: 0 0 0 14px rgba(242, 197, 95, 0);
    }
}

.admin-compose-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-mobile-switch-form {
    display: none;
    margin-bottom: 14px;
}

.admin-mobile-switch-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #5d7388;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-mobile-switch-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-mobile-switch-row .form-select {
    border-radius: 14px;
}

@media (max-width: 980px) {
    .admin-chats-grid {
        grid-template-columns: 1fr;
    }

    .admin-main {
        order: 1;
    }

    .admin-sidebar {
        order: 2;
    }

    .admin-summary-head,
    .admin-event-top,
    .admin-user-top,
    .admin-compose-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-summary-stats {
        justify-content: flex-start;
    }

    .admin-mobile-switch-form {
        display: block;
    }

    .admin-events-list,
    .admin-users-list {
        max-height: 220px;
    }

    .chat-tabs.has-admin-tab .tab {
        font-size: 0.72rem;
    }
}

.dress-preview-page {
    max-width: 1240px;
}

.dress-preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.dress-preview-hint {
    font-size: 0.92rem;
    color: #73879a;
}

.dress-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.dress-preview-grid.is-single {
    grid-template-columns: minmax(0, 820px);
}

.dress-preview-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #d7e4ef;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(47, 88, 126, 0.08);
}

.dress-preview-card-head {
    margin-bottom: 12px;
}

.dress-preview-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #17324a;
}

.dress-preview-card-meta {
    margin-top: 4px;
    font-size: 0.88rem;
    color: #73879a;
}

.dress-preview-message {
    margin: 0;
}

.dress-preview-message .bubble {
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid #e5eef5;
}

.dress-preview-raw {
    margin-top: 14px;
    border-top: 1px solid #e4edf5;
    padding-top: 12px;
}

.dress-preview-raw summary {
    cursor: pointer;
    color: #2d628f;
    font-weight: 600;
    list-style: none;
}

.dress-preview-raw summary::-webkit-details-marker {
    display: none;
}

.dress-preview-raw pre {
    margin: 12px 0 0;
    padding: 12px;
    border-radius: 14px;
    background: #f6fafc;
    border: 1px solid #dde9f4;
    color: #274055;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.5;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
}

.wizard-steps .step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    display: grid;
    place-items: center;
    font-weight: 600;
}

.wizard-steps .step.active {
    background: #ffffff;
    border: 2px solid #c7d2fe;
    box-shadow: 0 6px 16px rgba(163,191,250,.25);
}

.wizard-panel {
    min-height: 220px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.relation-row {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}

.relation-row::-webkit-scrollbar {
    height: 4px;
}

.relation-row::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 999px;
}

.relation-option {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    background: #ffffff;
    white-space: nowrap;
}

.relation-option input {
    margin: 0;
}

.calendar-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
}

.calendar-panel-head {
    padding: 16px 16px 0;
}

.calendar-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.calendar-panel-subtitle {
    margin-top: 4px;
    font-size: 0.92rem;
    color: var(--muted);
}

.calendar-surface {
    margin: 0 12px 12px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.calendar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.calendar-control {
    min-width: 0;
}

.calendar-control-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.calendar-selected-card {
    margin: 0;
    padding: 12px 16px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.calendar-frame-wrap {
    flex: 1 1 auto;
    min-height: 72vh;
    padding: 0;
}

.calendar-frame {
    width: 100%;
    min-height: 72vh;
    height: calc(100vh - 250px);
    border: 0;
    display: block;
    background: #ffffff;
}

.app-calendar-page {
    background: #eef2f6;
}

.chat-body-calendar {
    padding: 0 0 88px;
    background: #eef2f6;
}

.chat-body-calendar .chat-inline-alert {
    margin: 8px var(--page-gutter) 10px;
}

.calendar-proxy-host {
    min-height: 100%;
}

.calendar-proxy-host .wrap {
    padding: 8px var(--page-gutter) 18px;
}

.calendar-fallback-card {
    max-width: 720px;
    margin: 16px auto;
    padding: 24px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #dde7f0;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.calendar-fallback-title {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.2;
    color: #0f172a;
}

.calendar-fallback-text {
    margin: 0 0 16px;
    color: #475569;
    line-height: 1.5;
}

.media-placeholder {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

@media (max-width: 600px) {
    :root {
        --page-gutter: 8px;
    }

    .auth-card {
        box-shadow: none;
        border-radius: 0;
        min-height: 100vh;
    }

    .app-auth-wizard .auth-card-wizard {
        min-height: auto;
        border-radius: 24px;
        box-shadow: 0 14px 32px rgba(31, 38, 135, 0.08);
    }

    .app-auth-register .auth-card-register {
        min-height: auto;
        border-radius: 24px;
        box-shadow: 0 14px 32px rgba(31, 38, 135, 0.08);
    }

    .chat-body {
        padding: 6px var(--page-gutter) 88px;
    }
    .chat-body-page {
        padding: 0 0 78px;
    }
    .chat-request-form {
        flex-direction: column;
        align-items: stretch;
    }
    .message.outgoing {
        max-width: 92%;
    }
    .calendar-controls {
        grid-template-columns: 1fr;
    }
    .calendar-surface {
        margin: 0 4px 12px;
        border-radius: 18px;
    }
    .calendar-frame-wrap {
        min-height: 68vh;
        padding: 0;
    }
    .calendar-frame {
        min-height: 68vh;
        height: calc(100vh - 310px);
    }
    .chat-body-calendar {
        padding-bottom: 78px;
    }
    .chat-body-calendar .chat-inline-alert {
        margin: 6px var(--page-gutter) 10px;
    }
    .calendar-fallback-card {
        margin: 12px;
        padding: 18px;
        border-radius: 18px;
    }
    .chat-page-wrap {
        padding: 12px var(--page-gutter) 18px;
    }
    .profile-panel {
        padding: 18px 16px;
        border-radius: 18px;
    }
    .profile-hero-top {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .profile-hero-action {
        width: 100%;
    }
    .profile-summary-grid {
        grid-template-columns: 1fr;
    }
    .profile-page-title {
        font-size: 1.25rem;
    }
    .dress-preview-grid {
        grid-template-columns: 1fr;
    }
.dress-preview-card {
        padding: 16px;
        border-radius: 18px;
    }
}

.pwa-prompt-slot {
    margin-bottom: 14px;
}

.pwa-prompt-card {
    border-radius: 22px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(16, 24, 32, 0.96), rgba(48, 64, 81, 0.92));
    color: #f8f3e8;
    box-shadow: 0 18px 40px rgba(16, 24, 32, 0.18);
}

.pwa-prompt-card.is-standalone {
    background: linear-gradient(135deg, rgba(247, 244, 236, 1), rgba(239, 234, 222, 0.96));
    color: #1a2732;
    border: 1px solid rgba(16, 24, 32, 0.08);
}

.pwa-prompt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
}

.pwa-prompt-card.is-standalone .pwa-prompt-badge {
    background: rgba(16, 24, 32, 0.08);
}

.pwa-prompt-badge.is-success {
    background: rgba(24, 129, 88, 0.14);
    color: #188158;
}

.pwa-prompt-badge.is-warning {
    background: rgba(177, 116, 31, 0.14);
    color: #b1741f;
}

.pwa-prompt-badge.is-danger {
    background: rgba(191, 73, 60, 0.14);
    color: #bf493c;
}

.pwa-prompt-badge.is-muted {
    background: rgba(16, 24, 32, 0.08);
    color: #6b7680;
}

.pwa-prompt-title {
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.pwa-prompt-text {
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: inherit;
    opacity: 0.94;
}

.pwa-prompt-steps {
    margin: 12px 0 0;
    padding-left: 1.1rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.pwa-prompt-steps li + li {
    margin-top: 6px;
}

.pwa-prompt-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pwa-prompt-note {
    font-size: 0.84rem;
    line-height: 1.45;
    color: #5b6772;
}
