:root {
    color-scheme: light;
    --background: #f2f9fd;
    --paper: #fbfdff;
    --ink: #19364d;
    --muted: #42607a;
    --line: #c9dfec;
    --accent: #b7def3;
    --accent-soft: #e0f2fc;
    --soft-blue: #ebf6fc;
    --mint: #c4eadf;
    --focus: #296b95;
    --gift: #f5e5bc;
    --gift-ink: #574219;
    --brand-font: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
    --app-width: 480px;
    --nav-space: calc(108px + env(safe-area-inset-bottom, 0px));
    --shadow: 3px 4px 0 #19364d14;
    font: 16px/1.5 "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--background) radial-gradient(#6395b126 .7px, transparent .7px) 0 0 / 16px 16px;
    color: var(--ink);
    overflow-x: clip;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button[data-unavailable] { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: var(--ink); text-underline-offset: .2em; }
h1, h2, p { margin-block: 0; }
img { display: block; width: 100%; object-fit: cover; }

.site-header { padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--line); background: var(--paper); box-shadow: 0 3px 0 #19364d08; }
body:has(#loading:not([hidden]), #welcome:not([hidden])) > .site-header { display: none; }
.header-inner {
    width: min(var(--app-width), calc(100% - 28px));
    min-height: 56px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    color: var(--ink);
    font-size: 1.33rem;
    font-weight: 850;
    letter-spacing: -.035em;
    line-height: 1.15;
    text-decoration: none;
}
.brand, .welcome-brand { font-family: var(--brand-font); text-shadow: 0 2px 0 #d5ebf7; }
.brand-mark { width: 32px; height: 32px; flex: none; object-fit: contain; }
.header-inner > .quiet { padding-inline: 8px; border-color: var(--line); background: var(--soft-blue); font-size: .78rem; }
.shell { width: min(var(--app-width), calc(100% - 24px)); margin: 0 auto; }
#signed-in { padding-bottom: var(--nav-space); }
.site-footer {
    width: min(100%, var(--app-width));
    margin: auto auto 0;
    background: var(--paper);
    color: var(--muted);
    font-size: .75rem;
}
body:has(#signed-in[hidden]) .tabs { display: none; }
body:has(#signed-in:not([hidden])) .site-footer {
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 50%;
    box-shadow: 0 -4px 0 #19364d08;
    transform: translateX(-50%);
}
.footer-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 2vw, 12px);
    min-height: calc(36px + env(safe-area-inset-bottom, 0px));
    padding: 4px max(9px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(9px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
}
.footer-credit { display: flex; align-items: center; gap: 6px; }
.footer-credit img { width: 28px; height: 28px; object-fit: contain; }
.notice {
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--ink);
    font-size: .875rem;
    overflow-wrap: anywhere;
}
.notice[data-tone="error"] { border-color: #fac8c9; background: #fff0f0; color: #941a2f; }

.welcome {
    width: min(100%, 400px);
    margin: 0 auto;
    padding-block: calc(clamp(18px, 4vh, 36px) + env(safe-area-inset-top, 0px)) 30px;
}
.welcome-copy { display: grid; justify-items: center; text-align: center; }
.kicker, .welcome-kicker { color: #315e7f; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.welcome h1 { margin: 7px 0 11px; font-size: clamp(2.15rem, 10vw, 3.15rem); font-weight: 850; letter-spacing: -.05em; line-height: 1.15; }
.welcome-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 15px); }
.welcome-mark { width: clamp(54px, 16vw, 76px); height: clamp(54px, 16vw, 76px); flex: none; object-fit: contain; }
.intro { max-width: 36ch; color: var(--muted); font-size: .92rem; line-height: 1.7; text-wrap: balance; }
.auth {
    width: 100%;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--paper);
    box-shadow: var(--shadow);
    text-align: left;
}
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 14px; background: var(--soft-blue); }
.mode-switch button { min-height: 44px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 700; }
.mode-switch button[aria-pressed="true"] { color: var(--ink); background: var(--paper); box-shadow: 2px 2px 0 #19364d20; }
.auth form { display: grid; gap: 12px; margin-top: 14px; }
label { display: grid; gap: 5px; color: var(--ink); font-size: .85rem; font-weight: 700; }
input:not([type="file"]):not([type="checkbox"]), .name-panel select {
    width: 100%;
    min-height: 46px;
    padding: 8px 11px;
    border: 1px solid #6e91a7;
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 400;
}
.form-note { margin-top: 10px; color: var(--muted); font-size: .8rem; }
.email-field .form-note { margin-top: 4px; }
.auth-recovery { margin-top: 4px; padding-inline: 0; text-align: left; text-decoration: underline; text-underline-offset: .2em; }
.mail-screen { width: min(100%, 400px); margin: 0 auto; padding-block: 26px; }
.mail-panel { display: grid; gap: 12px; }
.mail-panel h1 { font-size: clamp(1.35rem, 6vw, 1.75rem); line-height: 1.2; text-align: center; text-wrap: balance; }
.mail-panel > p { color: var(--muted); font-size: .88rem; text-align: center; text-wrap: balance; }
.mail-panel form { display: grid; gap: 12px; }
.mail-back { justify-self: center; }
.profile-email-panel h2 { font-size: 1.08rem; }
.profile-email-panel form { display: grid; gap: 10px; margin-top: 12px; }
#profile-email-status, #profile-email-feedback { overflow-wrap: anywhere; white-space: pre-line; }
#profile-email-feedback[data-tone="error"] { color: #941a2f; }
.legal-agreement {
    display: grid;
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 8px 10px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft-blue);
}
.legal-agreement legend { padding-inline: 4px; color: var(--ink); font-size: .8rem; font-weight: 750; }
.legal-check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; }
.legal-check input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--ink); }
.legal-check label { display: block; cursor: pointer; }
.legal-check a { display: inline-block; margin-top: 2px; color: var(--muted); font-size: .76rem; }
.legal-consent { width: min(100%, 400px); margin: 0 auto; padding-block: 30px; }
.legal-consent-panel h1 { font-size: clamp(1.35rem, 6vw, 1.75rem); line-height: 1.2; text-align: center; text-wrap: balance; }
.legal-consent-panel > p { margin-top: 10px; color: var(--muted); font-size: .88rem; text-align: center; text-wrap: balance; }
.legal-consent-panel form { display: grid; gap: 12px; margin-top: 15px; }
.legal-page { width: min(760px, calc(100% - 24px)); margin: clamp(16px, 5vw, 36px) auto; }
.legal-document { padding: clamp(16px, 5vw, 32px); line-height: 1.75; overflow-wrap: anywhere; }
.legal-document h1 { font-size: clamp(1.45rem, 6vw, 2rem); line-height: 1.2; }
.legal-document h2 { margin-bottom: 6px; font-size: 1.08rem; line-height: 1.4; }
.legal-document section { margin-top: 20px; }
.legal-document p + p { margin-top: 8px; }
.legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 14px; }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; }

.primary, .secondary, .quiet { min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; }
.primary, .secondary { border-color: var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.primary { background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-soft); }
.secondary { background: var(--soft-blue); }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--accent-soft); }
.quiet { background: transparent; color: var(--ink); }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 5px max(9px, env(safe-area-inset-right, 0px)) 4px max(9px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
    background: var(--paper);
}
.tabs button {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 52px;
    gap: 3px;
    padding: 4px 3px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.18;
    text-align: center;
}
.tabs button[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 800; }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; inset: 0 18px auto; height: 2px; background: var(--ink); }
.tabs button:hover:not([aria-current="page"]) { background: var(--soft-blue); color: var(--ink); }
.tabs svg { display: block; width: 22px; height: 22px; flex: none; }
.tabs button > span[aria-hidden="true"] { font-size: 1.23rem; line-height: 22px; }
.match-tab-icon { position: relative; display: block; }
.unread-badge {
    display: inline-grid;
    min-width: 19px;
    min-height: 19px;
    place-items: center;
    padding-inline: 4px;
    border: 1px solid var(--paper);
    border-radius: 999px;
    background: #a62c65;
    color: #fff;
    font-size: .69rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.match-tab-icon .unread-badge { position: absolute; top: -5px; left: 16px; }
.page { margin: 18px auto 0; }
.page-heading { margin-bottom: 13px; text-align: center; }
.page-heading h1 { margin-block: 3px 4px; font-size: clamp(1.45rem, 5vw, 1.95rem); font-weight: 850; line-height: 1.16; overflow-wrap: anywhere; text-wrap: balance; }
.page-heading p:not(.kicker), .slot-panel > p { color: var(--muted); font-size: .85rem; }
.page-heading p:not(.kicker) { text-wrap: balance; }
.profile-checklist { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.profile-checklist li {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    color: var(--muted);
    font-size: .76rem;
}
.profile-checklist li[data-complete="true"] { border-color: #93c7b8; background: var(--mint); color: var(--ink); }
#discover { margin-top: 12px; }
#discover .page-heading { margin-bottom: 11px; }
.empty { min-height: 104px; padding: 22px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.empty p { text-wrap: balance; }
.empty .primary { margin-top: 11px; }
.discover-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 11px; }
.discover-options .primary { margin-top: 0; }
.reviewed-note { margin: 0 0 15px; text-align: center; text-wrap: balance; }
#loading { margin-top: 18px; }

.card-stack { width: min(100%, 390px); margin: 15px auto 0; }
body:has(#discover:not([hidden]) .is-tutorial) { background-color: #f6fbfe; }
.tutorial-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 3px 8px;
    margin-bottom: 16px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft-blue);
    box-shadow: 2px 2px 0 #19364d0e;
}
.tutorial-heading h2 { grid-area: 1 / 1; font-size: clamp(.85rem, 4vw, 1rem); line-height: 1.3; }
.tutorial-heading p:not(.tutorial-progress) { grid-column: 1 / -1; color: var(--muted); font-size: .77rem; text-wrap: balance; }
.tutorial-heading .tutorial-progress {
    grid-area: 1 / 2;
    justify-self: end;
    margin: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--ink);
    font-size: .73rem;
    font-weight: 800;
}
.tutorial-skip { display: block; margin-inline: auto; }
.cat-card {
    position: relative;
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid #b6d7e8;
    border-bottom-width: 4px;
    border-radius: 17px;
    background: var(--paper);
    box-shadow: var(--shadow);
    transform: translateX(var(--card-x, 0px)) rotate(var(--card-rotation, 0deg));
    transform-origin: center 72%;
    transition: transform .23s cubic-bezier(.2, .75, .25, 1);
}
.cat-card::before, .cat-card::after {
    content: "";
    position: absolute;
    top: -12px;
    width: 26px;
    height: 12px;
    background: #b6d7e8;
    clip-path: polygon(0 100%, 12% 0, 100% 100%);
    pointer-events: none;
}
.cat-card::before { left: 22px; }
.cat-card::after { right: 22px; transform: scaleX(-1); }
.is-tutorial .cat-card { border-color: #cae2ef; background: #fafdff; }
.is-tutorial .cat-card::before, .is-tutorial .cat-card::after { background: #cae2ef; }
.cat-card[data-dragging]:not([data-dragging="false"]) { transition: none; }
.card-photo {
    position: relative;
    isolation: isolate;
    height: clamp(156px, 42vh, 340px);
    height: clamp(156px, 42svh, 340px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--soft-blue);
    touch-action: pan-y;
    user-select: none;
}
.card-photo .card-image { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.photo-steps {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 50%;
    display: flex;
    gap: 5px;
    padding: 4px 6px;
    border-radius: 999px;
    background: #19364dcc;
    transform: translateX(-50%);
    pointer-events: none;
}
.photo-steps span { width: 6px; height: 6px; border-radius: 50%; background: #ffffff73; }
.photo-steps span.active, .photo-steps span[aria-current="true"] { background: var(--paper); }
.photo-edge {
    position: absolute;
    z-index: 1;
    inset-block: 0;
    display: flex;
    width: 26%;
    min-height: 44px;
    align-items: center;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--ink);
}
.photo-edge.prev { left: 0; justify-content: flex-start; }
.photo-edge.next { right: 0; justify-content: flex-end; }
.photo-edge::before, .photo-edge svg {
    width: 29px;
    height: 29px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fbfdffed;
}
.photo-edge::before {
    content: "›" / "";
    display: grid;
    place-items: center;
    font: 750 1.25rem/1 system-ui, sans-serif;
}
.photo-edge.prev::before { content: "‹" / ""; }
.photo-edge[aria-disabled="true"]::before, .photo-edge[aria-disabled="true"] svg { visibility: hidden; }
.photo-edge:has(svg)::before { content: none; }
.photo-edge svg { padding: 5px; }
.photo-edge:focus-visible { outline-offset: -4px; border-radius: 9px; }
.card-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink); }
.card-caption h2 {
    min-width: 0;
    font-size: clamp(1.32rem, 5.8vw, 1.88rem);
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.cat-details { display: inline-flex; align-items: baseline; gap: .42em; font-size: .78em; font-weight: 650; white-space: nowrap; }
.cat-sex { padding: 0 .36em; border-radius: .5em; }
.cat-sex[data-sex="male"] { color: #1d5184; background: #dbefff; }
.cat-sex[data-sex="female"] { color: #96364a; background: #ffe6ec; }
.tutorial-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--soft-blue);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}
.card-photo-count { color: var(--muted); font-size: .72rem; font-weight: 750; }
.card-choices .action-pass, .swipe-stamp.pass {
    --choice-plate: #f8e9ee;
    --choice-edge: #a45b72;
    --choice-ink: #85354d;
}
.card-choices .action-like, .swipe-stamp.like {
    --choice-plate: var(--mint);
    --choice-edge: #548777;
    --choice-ink: #265d4f;
}
.card-choices .action-voice {
    --choice-plate: #e5f2ff;
    --choice-edge: #6587ae;
    --choice-ink: #305580;
}
.card-choices .action-voice[aria-pressed="true"] {
    --choice-plate: #c9e6fb;
}
.card-choices .action-gift {
    --choice-plate: #efeafb;
    --choice-edge: #8871a4;
    --choice-ink: #614482;
}
.card-choices .action-gift[data-gifted="true"] {
    --choice-plate: var(--mint);
}
.choice-mark { position: relative; display: inline-grid; flex: none; place-items: center; color: var(--choice-ink); }
.choice-mark svg { display: block; width: 26px; height: 26px; }
.choice-symbol {
    position: absolute;
    right: -3px;
    bottom: -2px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--choice-edge);
    border-radius: 50%;
    background: var(--paper);
    font: 800 1rem/1 system-ui, sans-serif;
}
.swipe-stamp {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 12px 6px 8px;
    border: 1px solid var(--choice-edge);
    border-radius: 999px;
    background: var(--choice-plate);
    color: var(--ink);
    font-size: .87rem;
    font-weight: 800;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.swipe-stamp .choice-mark { width: 29px; height: 26px; justify-items: start; }
.swipe-stamp .choice-mark svg { width: 19px; height: 19px; }
.swipe-stamp .choice-symbol { right: 0; bottom: 0; width: 15px; height: 15px; font-size: .7rem; }
.cat-card[data-swipe="like"] .swipe-stamp.like,
.cat-card[data-swipe="pass"] .swipe-stamp.pass { opacity: 1; }
.card-choices {
    display: grid;
    width: min(100%, 310px);
    margin-inline: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.is-reviewed .card-choices {
    width: min(100%, 150px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.is-preview .card-choices {
    width: min(100%, 72px);
    grid-template-columns: minmax(0, 1fr);
}
.card-choices button {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 78px;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: var(--ink);
    font-size: .83rem;
    font-weight: 800;
    line-height: 1.25;
}
.card-choices button:hover:not(:disabled) { background: var(--soft-blue); }
.card-choices .choice-mark {
    width: min(100%, 54px);
    aspect-ratio: 1;
    border: 1px solid var(--choice-edge);
    border-radius: 50%;
    background: var(--choice-plate);
    box-shadow: 0 2px 0 var(--line);
}
.card-choices :is(.action-voice, .action-gift) .choice-mark svg {
    width: 31px;
    height: 31px;
}
.choice-label { white-space: nowrap; }
.card-choices .action-gift[data-gifted="true"]:disabled { opacity: .8; }
audio { display: block; width: 100%; min-width: 0; height: 44px; }
.hint { margin: 10px 0 8px; color: var(--muted); font-size: .77rem; text-align: center; text-wrap: balance; }
.avatar-placeholder { display: grid; height: 100%; min-width: 50px; place-items: center; background: var(--soft-blue); color: var(--ink); font-size: 1.45rem; }
.card-photo .avatar-placeholder { font-size: 2.15rem; }

.match-list { display: grid; gap: 8px; }
.match-row {
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: 55px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
    text-align: left;
    font-weight: 800;
}
.match-row:hover { border-color: #83abc3; }
.match-row img, .match-row .avatar-placeholder { width: 55px; height: 55px; border-radius: 50%; }
.match-row span { overflow-wrap: anywhere; }
.match-row-meta { display: flex; align-items: center; gap: 8px; }
.match-arrow { color: var(--muted); font-size: 1.4rem; }
.match-dialog {
    width: min(410px, calc(100% - 24px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: clamp(20px, 6vw, 30px) 18px 18px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #99c3db;
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 10px 40px #102a3e40, inset 0 6px 0 var(--accent);
    text-align: center;
}
.match-dialog::backdrop { background: #173d5966; }
.greeting-seal {
    display: flex;
    width: 72px;
    height: 64px;
    margin: 0 auto 10px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 2px dashed #83aac3;
    border-radius: 18px;
    background: var(--soft-blue);
    color: #315e7f;
    transform: rotate(-6deg);
}
.greeting-seal svg { width: 25px; height: 25px; flex: none; }
.greeting-seal svg:first-child { transform: translateY(5px) rotate(-8deg); }
.greeting-seal svg:last-child { transform: translateY(-5px) rotate(8deg); }
.match-dialog .greeting-kicker {
    color: #315e7f;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
}
.match-dialog h2 {
    margin: 3px 0 7px;
    font-size: clamp(1.25rem, 6vw, 1.7rem);
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.match-dialog p { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; text-wrap: balance; }
.match-dialog .greeting-names { margin-bottom: 7px; color: var(--ink); font-weight: 800; }
.match-actions { display: grid; gap: 7px; margin: 15px auto 0; max-width: 310px; }

@media (prefers-reduced-motion: no-preference) {
    .match-dialog[open] .greeting-seal { animation: greeting-seal-in .34s ease-out; }
}
@keyframes greeting-seal-in {
    from { opacity: .45; transform: translateY(-9px) rotate(-11deg) scale(1.13); }
    to { opacity: 1; transform: rotate(-6deg); }
}
.conversation { margin-top: 10px; }
.conversation-heading {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--paper);
    box-shadow: var(--shadow);
}
.conversation-heading-title { min-width: 0; font-size: 1rem; line-height: 1.2; }
.conversation-back { width: 44px; min-height: 44px; padding: 0; font-size: 1.9rem; line-height: 1; }
.conversation-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: 44px;
    padding: 3px 7px 3px 3px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--ink);
    font-weight: 800;
    text-align: start;
}
.conversation-profile:hover { background: var(--soft-blue); }
#conversation-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-chevron { flex: none; color: var(--muted); font-size: 1.24rem; }
.conversation-avatar, .message-avatar {
    display: block;
    flex: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
}
.message-avatar { width: 44px; height: 44px; padding: 4px; }
.conversation-avatar img, .message-avatar img,
.conversation-avatar .avatar-placeholder, .message-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 1rem;
}
.message-list { display: grid; align-content: start; gap: 10px; min-height: 112px; padding-block: 2px; }
.message-row { display: flex; min-width: 0; align-items: center; gap: 5px; }
.message-row.mine { flex-direction: row-reverse; }
.bubble {
    display: grid;
    flex: 0 1 208px;
    min-width: 0;
    min-height: 60px;
    grid-template-columns: 44px minmax(0, 1fr) 3em;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 17px 17px 17px 6px;
    background: var(--paper);
    box-shadow: var(--shadow);
}
.message-row.mine .bubble { border-radius: 17px 17px 6px 17px; background: var(--accent-soft); }
.message-play {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--soft-blue);
    color: var(--ink);
    font-size: .9rem;
    font-weight: 800;
}
.message-play:hover, .message-play[aria-pressed="true"] { background: var(--mint); }
.message-progress {
    display: block;
    width: 100%;
    min-width: 0;
    height: 6px;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--line);
    color: var(--focus);
    overflow: hidden;
}
.message-progress::-webkit-progress-bar { border-radius: 999px; background: var(--line); }
.message-progress::-webkit-progress-value { border-radius: 999px; background: var(--focus); }
.message-progress::-moz-progress-bar { border-radius: 999px; background: var(--focus); }
.message-duration { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.recorder { display: grid; gap: 8px; margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow); }
.recorder p { color: var(--muted); font-size: .87rem; }
.recorder .quiet { justify-self: start; }
.conversation-record-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.conversation-record-actions button { min-width: 0; padding-inline: 4px; font-size: .86rem; }
#send-button { grid-column: 1 / -1; }

.panel { margin-bottom: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.name-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 8px; }
.name-panel > label { min-width: 0; }
.name-panel > label:first-child { grid-column: 1 / -1; }
.name-panel select { min-width: 0; }
.name-panel > .form-note, .name-panel > button { grid-column: 1 / -1; }
.name-panel > .form-note { margin-top: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.section-heading h2 { font-size: 1.1rem; }
.pill { flex: none; padding: 3px 8px; border-radius: 8px; background: var(--soft-blue); color: var(--ink); font-size: .75rem; font-weight: 800; }
.slots { margin-top: 10px; display: grid; gap: 7px; }
.photo-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slot { min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.slot h3 { margin: 0 0 4px; color: var(--muted); font-size: .75rem; }
.photo-slots .slot img { aspect-ratio: 4 / 5; border-radius: 7px; background: var(--soft-blue); object-fit: contain; }
.photo-empty { display: grid; place-items: center; aspect-ratio: 4 / 5; border: 1px dashed var(--line); border-radius: 7px; color: var(--ink); background: var(--soft-blue); font-size: 1.3rem; }
.slot-tools { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.slot-tools button { min-height: 44px; padding: 5px 6px; font-size: .75rem; overflow-wrap: anywhere; }
.voice-slot-status { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
#profile-discover { margin-top: 10px; }
.profile-preview-panel {
    display: grid;
    justify-items: center;
    gap: 8px;
    background: var(--soft-blue);
    text-align: center;
}
.profile-preview-panel h2 { font-size: 1.08rem; line-height: 1.3; text-wrap: balance; }
.profile-preview-panel p { color: var(--muted); font-size: .85rem; text-wrap: balance; }
.profile-preview-dialog {
    width: min(440px, calc(100% - 20px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: auto;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 12px 40px #102a3e59;
}
.profile-preview-dialog::backdrop { background: #102a3e9c; }
.profile-preview-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--soft-blue);
}
.profile-preview-heading h2 { grid-column: 2; min-width: 0; font-size: clamp(1rem, 5vw, 1.24rem); line-height: 1.3; overflow-wrap: anywhere; text-align: center; text-wrap: balance; }
.profile-preview-heading form { grid-column: 3; }
.profile-preview-heading button { padding-inline: 6px; font-size: .82rem; }
#profile-preview-status { padding: 10px 14px 0; color: var(--muted); font-size: .83rem; text-align: center; text-wrap: balance; }
#profile-preview-sex-note { margin: 7px 14px 0; color: var(--muted); font-size: .83rem; text-align: center; text-wrap: balance; }
#profile-preview-card, #matched-profile-card { padding: 10px clamp(10px, 3vw, 16px) 18px; }
#profile-preview-feedback, #matched-profile-feedback { margin: 0; padding: 0 14px 12px; text-align: center; text-wrap: balance; }
.profile-preview-dialog .card-stack.is-preview { width: min(100%, 330px); }
.matched-voices { display: grid; gap: 6px; margin: 12px auto 0; width: min(100%, 330px); color: var(--muted); font-size: .84rem; }
.audio-trim-dialog, .voice-recording-dialog {
    width: min(calc(100% - 24px), 420px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 12px 40px #102a3e59;
    overflow: auto;
}
.audio-trim-dialog::backdrop, .voice-recording-dialog::backdrop { background: #102a3e9c; }
.audio-trim-content, .voice-recording-content { display: grid; gap: 12px; padding: clamp(14px, 5vw, 22px); }
.audio-trim-content h2, .voice-recording-content h2 { font-size: clamp(1.15rem, 5vw, 1.42rem); line-height: 1.25; text-align: center; }
.audio-trim-content p { color: var(--muted); font-size: .85rem; }
.audio-trim-range { display: grid; gap: 4px; }
.audio-trim-range input[type="range"] { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--focus); }
.audio-trim-position { justify-self: center; color: var(--ink); font-size: .95rem; font-variant-numeric: tabular-nums; font-weight: 750; }
.audio-trim-preview { max-width: 100%; }
.audio-trim-actions, .voice-recording-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.audio-trim-actions button, .voice-recording-actions button { min-width: 0; min-height: 48px; padding-inline: 4px; font-size: .88rem; }

.voice-recording-content { text-align: center; }
#voice-recording-time {
    font-size: clamp(1.8rem, 9vw, 2.65rem);
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    line-height: 1.06;
    white-space: nowrap;
}
#voice-recording-state { min-height: 1.5em; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
#voice-recording-cancel { grid-column: 1 / -1; justify-self: center; padding-inline: 18px; }

.voice-waveform, #voice-recording-waveform:empty {
    position: relative;
    min-width: 0;
    height: clamp(84px, 18vh, 128px);
    isolation: isolate;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--soft-blue);
    overflow: hidden;
}
#voice-recording-waveform:empty::before, .voice-waveform::before {
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    background: var(--line);
    content: "";
}
.voice-waveform.is-live { height: clamp(98px, 23vh, 148px); }
.voice-waveform-bars {
    position: absolute;
    z-index: 2;
    inset: 8px 0;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: center;
    gap: clamp(1px, .48vw, 3px);
    pointer-events: none;
}
.voice-waveform-bar {
    display: block;
    min-height: 3px;
    max-height: 100%;
    height: calc(var(--voice-level, 0) * 100%);
    border-radius: 999px;
    background: #759ab2;
}
.voice-waveform.is-live .voice-waveform-bar, .voice-waveform-bar.is-selected { background: var(--focus); }
.voice-waveform-selection {
    position: absolute;
    z-index: 1;
    inset-block: 0;
    inset-inline-start: var(--wave-start, 0%);
    inline-size: var(--wave-width, 0%);
    border-inline: 2px solid #5d8da9;
    background: #c1e2f6b8;
    pointer-events: none;
}
.voice-waveform-playhead {
    position: absolute;
    z-index: 3;
    inset-block: 0;
    inset-inline-start: clamp(0px, var(--wave-playhead, 0%), calc(100% - 2px));
    inline-size: 2px;
    background: var(--ink);
    pointer-events: none;
}
.sample-credits {
    margin: 16px 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--muted);
    font-size: .8rem;
    overflow-wrap: anywhere;
}
.sample-credits summary { min-height: 44px; padding-block: 12px; color: var(--ink); font-weight: 750; cursor: pointer; }
.sample-credits[open] { padding-bottom: 10px; }
.sample-credits ul { margin: 0; padding-inline-start: 1.35em; }
.sample-credits li + li { margin-top: .25em; }

.ranking-header {
    margin-bottom: 15px;
    padding: 21px clamp(6px, 2vw, 15px) 17px;
    border: 1px solid #a8cade;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--soft-blue), var(--accent));
    box-shadow: var(--shadow);
    color: var(--ink);
    text-align: center;
}
.ranking-header .ranking-eyebrow {
    color: #315e7f;
    font: 700 .72rem/1.4 Georgia, serif;
    letter-spacing: .24em;
}
.ranking-header h1 {
    margin-block: 6px;
    font: 800 clamp(1.35rem, 6vw, 1.85rem)/1.2 "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
    letter-spacing: .03em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.ranking-header p:not(.ranking-eyebrow) {
    color: var(--muted);
    font-size: clamp(.625rem, 3.1vw, .8rem);
    letter-spacing: -.025em;
    line-height: 1.55;
    text-wrap: balance;
}
.ranking-note { text-align: center; text-wrap: balance; }
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.rank-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 2px 3px 0 #19364d12;
}
.rank-portrait {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--soft-blue);
}
.rank-portrait img { width: 100%; height: 100%; object-fit: contain; }
.rank-profile-button {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}
.rank-profile-button:focus-visible { outline-offset: -4px; }
.rank-profile-label {
    position: absolute;
    inset: auto 4px 6px;
    width: fit-content;
    max-width: calc(100% - 8px);
    margin-inline: auto;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
    color: var(--ink);
    font-size: .68rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.rank-profile-button:hover .rank-profile-label { background: var(--accent-soft); }
.rank-number {
    position: absolute;
    inset: 7px auto auto 7px;
    display: grid;
    min-width: 33px;
    min-height: 30px;
    padding: 3px 5px;
    place-items: center;
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: var(--ink);
    color: var(--paper);
    font: 800 .85rem/1 Georgia, "Yu Mincho", serif;
    pointer-events: none;
}
.rank-meta { min-width: 0; padding: 8px 8px 4px; }
.rank-meta :is(h2, h3) { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.ranking-unranked { margin-top: 15px; }
.ranking-unranked > h2 { margin-bottom: 8px; color: var(--muted); font-size: .9rem; text-align: center; text-wrap: balance; }
.rank-count { margin-top: 3px; color: var(--gift-ink); font-size: .77rem; font-weight: 800; }
.rank-gift {
    min-height: 44px;
    margin: 4px 7px 7px;
    padding: 4px 5px;
    border: 1px solid #9a7a3f;
    border-radius: 7px;
    background: var(--gift);
    color: var(--gift-ink);
    font-size: .76rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.rank-gift:hover:not(:disabled) { background: #f8edcf; }
.rank-gift[data-gifted="true"] { background: var(--soft-blue); }

@media (min-width: 510px) {
    .header-inner { min-height: 62px; }
    .tabs { border-inline: 1px solid var(--line); border-radius: 15px 15px 0 0; }
    .name-panel { grid-template-columns: minmax(0, 1fr) 6rem 8rem; }
    .name-panel > label:first-child { grid-column: auto; }
}

@media (max-width: 340px) {
    .shell, .header-inner { width: calc(100% - 18px); }
    .cat-card { padding: 8px; }
    .card-choices { gap: 6px; }
    .photo-slots { gap: 4px; }
    .slot { padding: 4px; }
    .ranking-grid { gap: 8px; }
}

@media (max-height: 620px) {
    .is-tutorial .card-photo {
        height: clamp(142px, 29vh, 195px);
        height: clamp(142px, 29svh, 195px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cat-card { transition: none; }
}
