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

.perception-app {
    --p-bg: #f6f6f3;
    --p-surface: #ffffff;
    --p-soft: #ededea;
    --p-text: #171717;
    --p-sub: #777773;
    --p-muted: #a6a6a2;
    --p-line: rgba(20, 20, 18, .08);
    --p-black: #161616;
    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(21px + env(safe-area-inset-top)) 18px calc(106px + env(safe-area-inset-bottom));
    overflow-y: auto;
    scrollbar-width: none;
}

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

.perception-topbar,
.perception-switchers,
.perception-section-heading,
.perception-place-top,
.perception-field-row { display: flex; align-items: center; }

.perception-topbar { justify-content: space-between; margin-bottom: 18px; }

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

.perception-brand strong { display: block; margin-top: 4px; font-size: 24px; line-height: 1; letter-spacing: -.7px; }

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

.perception-status i { margin-right: 5px; font-size: 7px; }
.perception-status.is-on { background: #202020; color: #fff; }

.perception-switchers { gap: 8px; margin-bottom: 26px; }
.perception-switchers label { position: relative; flex: 1; min-width: 0; }
.perception-switchers label > span { display: block; margin: 0 0 5px 2px; color: var(--p-muted); font-size: 9px; letter-spacing: 1.1px; }

.perception-switchers select,
.perception-field select,
.perception-field input {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    border: 1px solid var(--p-line);
    border-radius: 14px;
    background: var(--p-surface);
    color: var(--p-text);
    font: inherit;
}

.perception-switchers select {
    height: 42px;
    padding: 0 25px 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 600;
    background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%);
    background-position: calc(100% - 14px) 18px, calc(100% - 10px) 18px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

.perception-intro { margin: 2px 2px 22px; }
.perception-intro h1,
.perception-prompt-hero h1 { margin: 8px 0 9px; font-size: 31px; line-height: 1.16; letter-spacing: -1.4px; font-weight: 690; }
.perception-intro p,
.perception-prompt-hero p { margin: 0; color: var(--p-sub); font-size: 13px; line-height: 1.6; }
.perception-intro--compact { margin-bottom: 22px; }

.perception-time-grid { display: grid; grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); gap: 8px; align-items: center; }

.perception-place-card {
    min-height: 210px;
    padding: 15px 14px;
    border: 1px solid var(--p-line);
    border-radius: 25px;
    background: var(--p-surface);
    box-shadow: 0 8px 26px rgba(17, 17, 17, .035);
    overflow: hidden;
}

.perception-place-card--role { background: #e9e9e5; }
.perception-place-top { justify-content: space-between; color: var(--p-sub); font-size: 9px; font-weight: 650; letter-spacing: .9px; }
.perception-place-top i { color: var(--p-text); font-size: 15px; }
.perception-place-name { margin-top: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; }
.perception-place-clock { margin-top: 4px; font-size: 30px; line-height: 1; letter-spacing: -1.6px; font-weight: 680; font-variant-numeric: tabular-nums; }
.perception-place-meta { min-height: 32px; margin-top: 9px; color: var(--p-sub); font-size: 10px; line-height: 1.45; }
.perception-weather-chip { display: flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 10px; white-space: nowrap; overflow: hidden; }
.perception-weather-chip span { overflow: hidden; text-overflow: ellipsis; }

.perception-difference { padding: 8px 0; text-align: center; }
.perception-difference span { display: block; color: var(--p-muted); font-size: 8px; letter-spacing: 1.2px; }
.perception-difference strong { display: block; margin: 7px 0 6px; font-size: 18px; letter-spacing: -.8px; }
.perception-difference small { display: block; color: var(--p-sub); font-size: 9px; line-height: 1.4; }

.perception-callout { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 20px; padding: 13px 14px; border-radius: 18px; background: #e9e9e6; }
.perception-callout i { margin-top: 2px; font-size: 12px; }
.perception-callout strong { display: block; font-size: 12px; }
.perception-callout span { display: block; margin-top: 3px; color: var(--p-sub); font-size: 11px; }

.perception-editor-card,
.perception-prompt-card { margin: 0 0 14px; padding: 18px; border: 1px solid var(--p-line); border-radius: 25px; background: var(--p-surface); }
.perception-section-heading { justify-content: space-between; margin-bottom: 17px; }
.perception-section-heading h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.5px; }
.perception-section-heading b { min-width: 30px; padding: 6px 8px; border-radius: 999px; background: var(--p-soft); color: var(--p-sub); text-align: center; font-size: 10px; font-weight: 600; }
.perception-heading-icon { color: var(--p-sub); }

.perception-field { display: block; 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: 11px; }
.perception-field select,
.perception-field input { height: 44px; padding: 0 12px; font-size: 13px; }
.perception-field select { padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%); background-position: calc(100% - 14px) 19px, calc(100% - 10px) 19px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.perception-field input::placeholder { color: #b5b5b1; }
.perception-field-row { gap: 10px; }
.perception-field-row .perception-field { flex: 1; }
.perception-field--temp { max-width: 94px; }

.perception-weather-preview { display: flex; align-items: center; gap: 12px; margin: -3px 0 17px; padding: 13px; border-radius: 18px; background: var(--p-soft); }
.perception-weather-preview > i { width: 20px; text-align: center; font-size: 20px; }
.perception-weather-preview strong { display: block; font-size: 13px; }
.perception-weather-preview span { display: block; margin-top: 3px; color: var(--p-sub); font-size: 11px; }

.perception-prompt-hero { margin: 3px 2px 21px; }
.perception-toggle { display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; padding: 9px 12px; border: 0; border-radius: 999px; background: #e5e5e1; color: var(--p-sub); font: inherit; font-size: 12px; cursor: pointer; }
.perception-toggle span { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.perception-toggle.is-on { background: var(--p-black); color: #fff; }
.perception-toggle.is-on span { background: #fff; }
.perception-prompt-card pre { max-height: 320px; margin: 0; padding: 13px; overflow: auto; border-radius: 16px; background: #f1f1ee; color: #42423f; 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-footnote { margin: 4px 5px; color: var(--p-muted); font-size: 11px; line-height: 1.55; }

.perception-floating-dock { position: absolute; right: 18px; bottom: calc(17px + env(safe-area-inset-bottom)); left: 18px; z-index: 2; display: flex; gap: 3px; padding: 5px; border: 1px solid rgba(18, 18, 18, .08); border-radius: 23px; background: rgba(255, 255, 255, .93); box-shadow: 0 14px 32px rgba(18, 18, 18, .13); backdrop-filter: blur(15px); }
.perception-floating-dock button { flex: 1; min-height: 48px; border: 0; border-radius: 18px; background: transparent; color: #8c8c87; font: inherit; font-size: 10px; cursor: pointer; }
.perception-floating-dock button i { display: block; margin-bottom: 4px; font-size: 14px; }
.perception-floating-dock button.is-active { background: var(--p-black); color: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .14); }

@media (max-width: 360px) {
    .perception-page { padding-right: 14px; padding-left: 14px; }
    .perception-time-grid { grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); }
    .perception-place-card { padding: 13px 11px; }
    .perception-place-clock { font-size: 26px; }
    .perception-floating-dock { right: 14px; left: 14px; }
}
