.perception-app,
.perception-app * { box-sizing: border-box; }

.perception-app {
    --p-bg: #f7f9fc;
    --p-surface: #ffffff;
    --p-soft: #f0f3f7;
    --p-muted-surface: #e6eaf0;
    --p-text: #111318;
    --p-sub: #69707a;
    --p-muted: #a1a8b2;
    --p-line: rgba(17, 19, 24, .075);
    --p-black: #13151a;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: var(--p-text);
    background: var(--p-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.perception-page {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 100%;
    margin: 0 auto;
    padding: calc(20px + env(safe-area-inset-top)) 18px calc(98px + env(safe-area-inset-bottom));
    overflow-y: auto;
    scrollbar-width: none;
}

.perception-page::-webkit-scrollbar,
.perception-weather-strip::-webkit-scrollbar { display: none; }

.perception-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.perception-topbar > div > span,
.perception-kicker {
    display: block;
    color: var(--p-muted);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 1.8px;
}

.perception-topbar > div > strong {
    display: block;
    margin-top: 4px;
    font-size: 23px;
    line-height: 1;
    letter-spacing: -.7px;
}

.perception-brand-lockup { display: flex; align-items: center; gap: 9px; }
.perception-brand-lockup > div > span { display: block; color: var(--p-muted); font-size: 9px; font-weight: 650; letter-spacing: 1.8px; }
.perception-brand-lockup > div > strong { display: block; margin-top: 4px; font-size: 23px; line-height: 1; letter-spacing: -.7px; }
.perception-back { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid var(--p-line); border-radius: 50%; background: var(--p-surface); color: var(--p-text); cursor: pointer; }
.perception-back i { font-size: 11px; }

.perception-status {
    border: 0;
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--p-soft);
    color: var(--p-sub);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.perception-status i { margin-right: 5px; font-size: 6px; }
.perception-status.is-on { background: var(--p-black); color: #fff; }

.perception-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 4px 0 18px;
}

.perception-avatar-pair { display: flex; align-items: center; justify-content: center; }

.perception-avatar-button {
    position: relative;
    z-index: 1;
    width: 58px;
    height: 58px;
    margin: 0 -3px;
    padding: 3px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
}

.perception-avatar-button.is-active { z-index: 2; border-color: var(--p-black); transform: translateY(-2px); }
.perception-avatar-button:active { transform: scale(.97); }

.perception-avatar-edit {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    border: 2px solid var(--p-bg);
    border-radius: 50%;
    background: var(--p-black);
    color: #fff;
    pointer-events: none;
}

.perception-avatar-edit i { font-size: 6px; }

.perception-avatar {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--p-bg);
    border-radius: 50%;
    background: var(--p-muted-surface);
    color: var(--p-text);
    font-size: 16px;
    font-weight: 650;
}

.perception-avatar img { width: 100%; height: 100%; object-fit: cover; }

.perception-identity-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 88px;
    margin-top: 8px;
    padding: 2px;
    border: 1px solid var(--p-line);
    border-radius: 999px;
    background: var(--p-surface);
}

.perception-identity-tabs button {
    height: 21px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--p-muted);
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}

.perception-identity-tabs button.is-active { background: var(--p-black); color: #fff; }

.perception-time-hero,
.perception-weather-hero { text-align: center; }

.perception-time-hero { padding: 22px 0 18px; }

.perception-big-time {
    display: block;
    margin: 10px 0 2px;
    font-size: clamp(72px, 22vw, 96px);
    line-height: .96;
    font-weight: 610;
    letter-spacing: -6px;
    font-variant-numeric: tabular-nums;
}

.perception-big-date { margin-top: 12px; font-size: 13px; font-weight: 600; }

.perception-time-place,
.perception-weather-location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: var(--p-sub);
    font-size: 11px;
}

.perception-time-place i,
.perception-weather-location i { font-size: 9px; }

.perception-gap-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 13px;
    padding: 10px 13px;
    border-top: 1px solid var(--p-line);
    border-bottom: 1px solid var(--p-line);
    color: var(--p-sub);
    font-size: 10px;
}

.perception-gap-line strong { color: var(--p-text); text-align: right; font-size: 11px; }

.perception-settings-card,
.perception-prompt-card {
    margin-bottom: 14px;
    padding: 17px;
    border: 1px solid var(--p-line);
    border-radius: 24px;
    background: var(--p-surface);
    box-shadow: 0 6px 22px rgba(34, 46, 64, .035);
}

.perception-config-state { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.perception-config-state span { display: block; color: var(--p-muted); font-size: 9px; }
.perception-config-state strong { display: block; margin-top: 3px; font-size: 11px; }
.perception-config-state button { height: 27px; padding: 0 9px; border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-bg); color: var(--p-sub); font: inherit; font-size: 9px; cursor: pointer; }

.perception-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin-bottom: 16px;
    padding: 3px;
    border-radius: 14px;
    background: var(--p-soft);
}

.perception-mode-switch button {
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--p-sub);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.perception-mode-switch button.is-active { background: var(--p-surface); color: var(--p-text); box-shadow: 0 2px 8px rgba(27, 36, 49, .055); font-weight: 650; }

.perception-field { display: block; min-width: 0; margin-top: 12px; }
.perception-field:first-of-type { margin-top: 0; }
.perception-field > span { display: block; margin: 0 0 7px 2px; color: var(--p-sub); font-size: 10px; }
.perception-field > span small { color: var(--p-muted); font-size: 9px; font-weight: 400; }

.perception-field select,
.perception-field input {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    border: 1px solid var(--p-line);
    border-radius: 14px;
    background-color: var(--p-bg);
    color: var(--p-text);
    font: inherit;
    font-size: 12px;
}

.perception-field select {
    padding-right: 28px;
    background-image: linear-gradient(45deg, transparent 50%, #7a818b 50%), linear-gradient(135deg, #7a818b 50%, transparent 50%);
    background-position: calc(100% - 15px) 19px, calc(100% - 11px) 19px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

.perception-field input::placeholder { color: var(--p-muted); }
.perception-field-hint { display: block; margin: 6px 2px 0; color: var(--p-muted); font-size: 9px; line-height: 1.45; }
.perception-custom-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 9px; }
.perception-field--clock { min-width: 112px; }
.perception-field--temperature { min-width: 92px; }
.perception-settings-note { margin: 13px 2px 0; color: var(--p-muted); font-size: 10px; line-height: 1.5; }

.perception-weather-hero { padding: 8px 0 24px; }
.perception-weather-icon { display: block; margin: 18px auto 10px; font-size: 42px; }

.perception-temperature {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 102px;
    line-height: 1;
}

.perception-temperature strong { font-size: 104px; font-weight: 540; letter-spacing: -8px; font-variant-numeric: tabular-nums; }
.perception-temperature span { margin: 7px 0 0 5px; font-size: 31px; font-weight: 500; }
.perception-weather-title { font-size: 18px; font-weight: 650; }
.perception-weather-hero p { max-width: 260px; margin: 12px auto 0; color: var(--p-sub); font-size: 11px; line-height: 1.5; }

.perception-card-caption { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.perception-card-caption span { font-size: 12px; font-weight: 650; }
.perception-card-caption small { color: var(--p-muted); font-size: 9px; }

.perception-weather-mode { margin-bottom: 18px; }
.perception-city-search { margin: 0; }
.perception-search-control { display: flex; gap: 7px; }
.perception-search-control input { flex: 1; min-width: 0; }
.perception-search-control button {
    flex: 0 0 66px;
    height: 43px;
    border: 0;
    border-radius: 14px;
    background: var(--p-black);
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.perception-search-control button:disabled,
.perception-real-weather-meta button:disabled { cursor: default; opacity: .52; }

.perception-weather-error {
    margin-top: 10px;
    padding: 9px 11px;
    border: 1px solid var(--p-line);
    border-radius: 12px;
    background: var(--p-bg);
    color: #515761;
    font-size: 10px;
    line-height: 1.45;
}

.perception-city-results { margin-top: 13px; overflow: hidden; border: 1px solid var(--p-line); border-radius: 16px; }
.perception-city-results > span { display: block; padding: 10px 12px 7px; color: var(--p-muted); font-size: 9px; letter-spacing: .7px; }
.perception-city-results button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    padding: 10px 31px 10px 12px;
    position: relative;
    border: 0;
    border-top: 1px solid var(--p-line);
    background: #fff;
    color: var(--p-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.perception-city-results button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.perception-city-results button small { grid-column: 1; margin-top: 3px; color: var(--p-muted); font-size: 9px; }
.perception-city-results button i { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--p-muted); font-size: 9px; }

.perception-real-weather-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding: 11px 12px; border-radius: 15px; background: var(--p-soft); }
.perception-real-weather-meta span { display: block; color: var(--p-muted); font-size: 9px; }
.perception-real-weather-meta strong { display: block; margin-top: 3px; font-size: 11px; }
.perception-real-weather-meta div small { display: block; margin-top: 3px; color: var(--p-muted); font-size: 8px; }
.perception-real-weather-meta button { height: 31px; padding: 0 11px; border: 1px solid var(--p-line); border-radius: 999px; background: #fff; color: var(--p-text); font: inherit; font-size: 10px; cursor: pointer; }
.perception-real-weather-meta button i { margin-right: 5px; font-size: 9px; }
.perception-weather-credit { margin: 10px 2px 0; color: var(--p-muted); font-size: 8px; letter-spacing: .5px; }

.perception-weather-strip {
    display: flex;
    gap: 7px;
    margin: 0 -17px 14px;
    padding: 0 17px 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.perception-weather-strip button {
    flex: 0 0 54px;
    height: 62px;
    padding: 8px 4px;
    border: 1px solid var(--p-line);
    border-radius: 17px;
    background: var(--p-bg);
    color: var(--p-sub);
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}

.perception-weather-strip button i { display: block; margin-bottom: 7px; color: var(--p-text); font-size: 16px; }
.perception-weather-strip button.is-active { border-color: var(--p-black); background: var(--p-black); color: #fff; }
.perception-weather-strip button.is-active i { color: #fff; }

.perception-prompt-hero { padding: 26px 3px 20px; }
.perception-prompt-hero h1 { margin: 8px 0; font-size: 34px; letter-spacing: -1.5px; }
.perception-prompt-hero p { margin: 0; color: var(--p-sub); font-size: 12px; line-height: 1.6; }

.perception-toggle {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
    padding: 9px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--p-muted-surface);
    color: var(--p-sub);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.perception-toggle span { width: 7px; height: 7px; border-radius: 50%; background: var(--p-muted); }
.perception-toggle.is-on { background: var(--p-black); color: #fff; }
.perception-toggle.is-on span { background: #fff; }

.perception-prompt-card pre {
    max-height: 330px;
    margin: 0;
    padding: 13px;
    overflow: auto;
    border-radius: 15px;
    background: var(--p-bg);
    color: #464c55;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    line-height: 1.65;
}

.perception-floating-dock {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 5;
    display: flex;
    width: 152px;
    height: 56px;
    gap: 3px;
    padding: 5px;
    transform: translateX(-50%);
    border: 1px solid rgba(17, 19, 24, .09);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 30px rgba(25, 35, 49, .14);
    backdrop-filter: blur(16px);
}

.perception-floating-dock button {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--p-muted);
    font: inherit;
    font-size: 8px;
    cursor: pointer;
}

.perception-floating-dock button i { display: block; margin-bottom: 3px; font-size: 13px; }
.perception-floating-dock button.is-active { background: var(--p-black); color: #fff; }

.perception-picker {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
}

.perception-picker-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(17, 19, 24, .24);
    backdrop-filter: blur(5px);
}

.perception-picker-sheet {
    position: relative;
    width: min(430px, 100%);
    max-height: min(68vh, 560px);
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--p-line);
    border-radius: 28px;
    background: var(--p-surface);
    box-shadow: 0 18px 50px rgba(25, 35, 49, .13);
    animation: perception-picker-in .22s ease-out;
}

.perception-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 2px 14px;
    border-bottom: 1px solid var(--p-line);
}

.perception-picker-header div > span {
    display: block;
    color: var(--p-muted);
    font-size: 8px;
    font-weight: 650;
    letter-spacing: 1.5px;
}

.perception-picker-header div > strong { display: block; margin-top: 4px; font-size: 20px; letter-spacing: -.4px; }
.perception-picker-header > button { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid var(--p-line); border-radius: 50%; background: var(--p-bg); color: var(--p-text); }
.perception-picker-header > button i { font-size: 12px; }

.perception-picker-list {
    display: grid;
    gap: 7px;
    max-height: calc(min(68vh, 560px) - 86px);
    padding-top: 12px;
    overflow-y: auto;
    scrollbar-width: none;
}

.perception-picker-list::-webkit-scrollbar { display: none; }

.perception-picker-option {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 62px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: var(--p-bg);
    color: var(--p-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.perception-picker-option:active { transform: scale(.98); }
.perception-picker-option.is-selected { border-color: var(--p-black); background: var(--p-surface); }
.perception-picker-option > i { color: transparent; font-size: 11px; text-align: center; }
.perception-picker-option.is-selected > i { color: var(--p-text); }

.perception-picker-avatar {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--p-muted-surface);
    font-size: 13px;
    font-weight: 650;
}

.perception-picker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.perception-picker-copy { min-width: 0; }
.perception-picker-copy strong,
.perception-picker-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perception-picker-copy strong { font-size: 13px; font-weight: 620; }
.perception-picker-copy small { margin-top: 4px; color: var(--p-muted); font-size: 9px; }
.perception-picker-empty { padding: 34px 12px; color: var(--p-muted); text-align: center; font-size: 11px; }

@keyframes perception-picker-in {
    from { opacity: 0; transform: translateY(7px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 360px) {
    .perception-page { padding-right: 14px; padding-left: 14px; }
    .perception-big-time { font-size: 76px; letter-spacing: -5px; }
    .perception-temperature strong { font-size: 92px; }
    .perception-settings-card { padding: 15px; }
    .perception-weather-strip { margin-right: -15px; margin-left: -15px; padding-right: 15px; padding-left: 15px; }
}
