:root {
  color-scheme: light;
  --ink: #221b34;
  --muted: #625a73;
  --purple: #6044d2;
  --purple-dark: #4c33b1;
  --line: #e8e3ef;
  --lavender: #f0eaff;
  --mint: #e2f5ea;
  --mint-ink: #226648;
  --paper: #f9f8fc;
  font-family: 'DM Sans', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; line-height: 1.52; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled, fieldset:disabled button { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #8061e9; outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.045em; overflow-wrap: anywhere; }
.symbols { display: none; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.container { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.055em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--purple); border-radius: 11px; }
.brand-accent { color: var(--purple); }
.top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
#account-name { color: var(--muted); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.top-actions .button { flex: 0 0 auto; }

.button { min-height: 44px; border-radius: 10px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid transparent; font-weight: 700; font-size: 14px; line-height: 1.3; text-align: center; }
.button .icon { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--purple); }
.button-primary:hover { background: var(--purple-dark); }
.button-outline { color: var(--purple-dark); background: #fff; border-color: #ddd4ef; }
.button-outline:hover { background: #f7f3ff; }
.full-button { display: flex; width: 100%; }

.hero { position: relative; display: grid; grid-template-columns: 1.09fr 1fr; min-height: 308px; margin-top: 29px; overflow: hidden; border: 1px solid #e8ddfd; border-radius: 24px; background: #eee6ff; }
.hero-copy { position: relative; z-index: 2; padding: 35px 0 35px 42px; align-self: center; }
.hero h1 { font-size: clamp(32px, 4.25vw, 56px); line-height: 1.15; font-weight: 800; letter-spacing: -.065em; }
.hero p { margin: 15px 0 19px; color: #51436e; font-size: 15px; word-break: keep-all; }
.hero .button { box-shadow: 0 4px 10px #593ac926; }
.hero-art { position: relative; min-width: 0; align-self: stretch; margin-right: 35px; }
.orbit { border: 1px solid #c8b6f2; border-radius: 50%; position: absolute; inset: 50% auto auto 50%; width: 395px; height: 205px; transform: translate(-50%, -50%) rotate(-15deg); }
.orbit-small { width: 340px; height: 168px; border-style: dashed; }
.art-card { --art: #a58aee; --art-dark: #704bd4; width: 112px; aspect-ratio: 5 / 7; position: absolute; left: 50%; top: 50%; padding: 8px; border: 1px solid #fff; border-radius: 13px; background: #fffafc; box-shadow: 0 11px 22px #52338a2f; }
.art-card-a { --art: #c9b5f5; --art-dark: #8965dc; transform: translate(-137%, -48%) rotate(-22deg); }
.art-card-b { --art: #f6c6dd; --art-dark: #da7fac; transform: translate(-50%, -57%) rotate(-4deg); z-index: 1; }
.art-card-c { --art: #bde9d4; --art-dark: #69bda5; transform: translate(47%, -43%) rotate(20deg); }
.art-window { height: 80%; background-color: var(--art); display: block; position: relative; overflow: hidden; border-radius: 7px; background-image: repeating-linear-gradient(135deg, #ffffff57 0 1px, transparent 1px 6px); }
.art-window i { position: absolute; display: block; border: 1px solid #fff9; background: var(--art-dark); }
.art-window i:first-child { width: 64%; aspect-ratio: 1; border-radius: 50%; inset: 16% 0 auto 18%; }
.art-window i:last-child { width: 74%; height: 48%; border-radius: 50% 50% 0 0; background: #ffffff82; inset: auto 0 0 13%; }
.art-caption { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 0; color: #44335f; font-size: 16px; font-weight: 800; }
.art-caption span { color: var(--art-dark); font-size: 14px; }
.art-spark { color: #8463d9; position: absolute; width: 25px; height: 25px; }
.art-spark-one { left: calc(50% - 182px); top: calc(50% - 75px); }
.art-spark-two { left: calc(50% + 160px); top: calc(50% + 54px); width: 19px; height: 19px; }

.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.step { display: flex; align-items: flex-start; gap: 12px; padding: 18px; }
.step h2 { font-size: 17px; }
.step p { margin-top: 5px; color: var(--muted); font-size: 13px; word-break: keep-all; }
.workspace { margin-top: 31px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; padding: 22px 24px; border: 1px solid #e8ddfd; border-radius: 17px; background: #eee6ff; }
.workspace-heading h1 { font-size: 31px; }
.workspace-heading p { margin-top: 5px; color: #51436e; font-size: 14px; word-break: keep-all; }
.room-grid { display: grid; grid-template-columns: minmax(285px, .83fr) minmax(0, 1.4fr); align-items: start; gap: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.entry-panel, .results-panel { padding: 22px; }
.panel-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 21px; }
.heading-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; flex: 0 0 auto; }
.lavender { background: var(--lavender); color: var(--purple-dark); }
.mint { background: var(--mint); color: var(--mint-ink); }
.panel-heading h2 { font-size: 20px; }
.panel-heading p { margin-top: 3px; color: var(--muted); font-size: 13px; word-break: keep-all; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
label { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-weight: 700; font-size: 13px; }
input { width: 100%; min-height: 43px; border: 1px solid #ddd6e8; border-radius: 8px; background: #fcfbfe; color: var(--ink); padding: 10px 11px; font-size: 14px; }
input::placeholder { color: #716882; }
.stack-form input + label, .stack-form input + div { margin-top: 13px; }
#nickname-field:not([hidden]) + label { margin-top: 13px; }
.label-dot { width: 7px; height: 7px; border-radius: 50%; }
.owned-dot { background: #418a69; }
.wanted-dot { background: #9a5bbb; }
.field-message { margin-top: 10px; color: var(--mint-ink); font-size: 13px; }
.field-message.error { color: #96264c; }
.text-button { border: 0; background: transparent; color: #8d2d51; min-height: 44px; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.segments { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 9px; background: #f4effa; }
.segments button { min-height: 40px; padding: 6px 10px; flex: 1 1 auto; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 7px; font-weight: 700; font-size: 13px; }
.segments button[aria-pressed="true"] { color: var(--purple-dark); background: #fff; border-color: #e8ddfa; }
.segments button span { margin-left: 3px; font-size: 12px; }
.match-tabs { margin-bottom: 13px; }
.profile-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.profile-card + .profile-card { margin-top: 9px; }
.profile-card-heading, .snapshot-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.profile-card-heading h3, .snapshot-heading h4 { font-size: 15px; }
.profile-actions, .match-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-actions { margin-top: 9px; }
.profile-actions .button { padding-inline: 10px; font-size: 13px; }
.profile-card details, .snapshots { margin-top: 7px; }
summary { cursor: pointer; color: var(--purple-dark); font-size: 13px; font-weight: 700; padding: 10px 0; overflow-wrap: anywhere; }
.card-list { padding: 0; margin: 3px 0 8px; list-style: none; }
.card-list li { padding: 3px 0; overflow-wrap: anywhere; }
.card-identity { display: flex; align-items: center; gap: 7px; min-width: 0; }
.card-identity-text { min-width: 0; }
.card-thumbnail { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 34px; aspect-ratio: 5 / 7; border: 1px solid var(--line); border-radius: 5px; background: #f7f3fb; overflow: hidden; }
.card-thumbnail .icon { color: var(--purple); width: 15px; height: 15px; }
.card-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #f7f3fb; }
.card-label, .card-meta { display: block; }
.card-label { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.card-meta, .card-group { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.card-group { font-weight: 700; margin-top: 5px; }
.badge { flex: 0 0 auto; padding: 3px 8px; background: var(--lavender); color: var(--purple-dark); font-size: 11px; font-weight: 700; border-radius: 5px; }
.badge.success { background: var(--mint); color: var(--mint-ink); }
.badge.muted { background: #f1eef4; color: var(--muted); }
.cycle { border: 1px solid #e6dff1; border-radius: 12px; overflow: hidden; }
.cycle + .cycle { margin-top: 11px; }
.cycle-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px; background: #faf8ff; border-bottom: 1px solid #eee8f5; }
.cycle-heading h3 { font-size: 15px; }
.exchange-list { list-style: none; margin: 0; padding: 0 13px 5px; }
.exchange, .exchange-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; gap: 6px; }
.exchange { font-size: 13px; padding: 8px 0; border-top: 1px solid #eeeaf3; overflow-wrap: anywhere; }
.exchange-columns { color: var(--muted); font-size: 11px; padding: 9px 13px 5px; }
.exchange-columns > :nth-child(2) { text-align: center; }
.exchange > :last-child, .exchange-columns > :last-child { text-align: right; }
.exchange-card { color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 5px; text-align: center; }
.exchange-card .card-thumbnail { width: 39px; }
.exchange-card .card-identity { text-align: left; }
.cycle-body { padding: 0 13px 13px; }
.snapshots { border-top: 1px solid var(--line); }
.snapshot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; margin-bottom: 10px; }
.snapshot { background: #fbf9fe; padding: 8px; border-radius: 8px; }
.snapshot-name { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.match-note { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.link-result { display: inline-flex; justify-content: flex-start; text-align: left; overflow-wrap: anywhere; }
.link-result .card-meta { margin-top: 3px; font-weight: 400; }
.quiet { font-size: 13px; color: var(--muted); padding: 12px 0; overflow-wrap: anywhere; }
.no-matches { padding: 22px 15px; background: #fbf9fe; border: 1px dashed #dfd5ef; border-radius: 12px; text-align: center; }
.no-matches h3 { font-size: 16px; margin-bottom: 5px; }
.no-matches p { color: var(--muted); font-size: 13px; word-break: keep-all; }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 28px; padding: 16px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer a { font-weight: 800; }
.footer-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px 14px; text-align: right; }
.policy-link { color: var(--purple-dark); text-decoration: underline; text-underline-offset: 3px; }
.signup-privacy { color: var(--muted); font-size: 13px; margin-top: 10px; }
.privacy-page { max-width: 780px; padding-block: 24px; }
.privacy-policy { margin-top: 12px; padding: clamp(16px, 4vw, 32px); overflow-wrap: anywhere; }
.privacy-policy h1 { font-size: clamp(23px, 4vw, 30px); margin-bottom: 10px; }
.privacy-policy h2 { font-size: 17px; margin-bottom: 5px; }
.privacy-policy section { margin-top: 18px; }
.privacy-policy section p + p, .privacy-policy li + li { margin-top: 6px; }
.privacy-policy p, .privacy-policy li { color: var(--muted); font-size: 14px; }
.privacy-policy ul { padding-left: 19px; margin: 0; }
dialog { width: min(440px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 18px 50px #221b3435; }
dialog::backdrop { background: #23183875; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.dialog-heading h2 { font-size: 22px; }
dialog > p { color: var(--muted); font-size: 14px; margin-bottom: 13px; }
dialog .full-button { margin-top: 15px; }
dialog .full-button + .full-button { margin-top: 8px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 9px; background: var(--lavender); color: var(--purple-dark); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:has(.profile-dialog[open]) { overflow: hidden; }
.profile-dialog { width: min(1200px, calc(100% - 40px)); height: min(900px, calc(100dvh - 40px)); max-width: none; max-height: none; padding: 0; overflow: hidden; }
.profile-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.profile-dialog .dialog-heading { margin: 0; padding: 12px 22px; border-bottom: 1px solid var(--line); }
#profile-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.profile-editor { display: grid; grid-template-columns: minmax(220px, .31fr) minmax(0, 1fr); align-content: start; align-items: start; gap: 22px; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 18px 20px 24px 22px; }
.profile-settings { min-width: 0; border: 1px solid var(--line); padding: 14px; border-radius: 12px; }
.profile-tip { margin-top: 11px; padding: 9px 11px; background: var(--lavender); border-radius: 8px; color: var(--purple-dark); font-size: 13px; word-break: keep-all; }
.selection-review { margin-top: 8px; }
.selection-review summary { min-height: 44px; }
.selection-review summary span { color: var(--muted); margin-left: 5px; font-weight: 400; }
.selected-cards { display: grid; gap: 8px; }
.selected-cards section { border: 1px solid var(--line); border-radius: 9px; padding: 8px; }
.selected-cards h3 { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.selected-cards h3 span:last-child { color: var(--muted); font-size: 11px; }
.selected-cards ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; list-style: none; margin: 6px 0 0; padding: 0; gap: 6px; }
.selected-cards li { color: var(--muted); font-size: 12px; }
.selected-cards li:only-child:not(.selection) { grid-column: 1 / -1; }
.selection { position: relative; min-width: 0; }
.selection .icon-button { position: absolute; z-index: 1; top: 0; right: 0; color: var(--purple-dark); background: transparent; }
.selection .icon-button .icon { box-sizing: content-box; padding: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #221b3440; }
.selection .icon { width: 15px; height: 15px; }
.catalog-sides button { min-height: 44px; }
.catalog-sides .side-count { display: inline-block; min-width: 20px; padding: 0 4px; border-radius: 5px; background: var(--lavender); color: var(--purple-dark); }
.catalog-picker input { margin-top: 9px; }
.catalog-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 7px; margin-top: 9px; }
.catalog-filters label { font-size: 12px; }
.catalog-filters select { width: 100%; min-height: 44px; padding: 6px; border: 1px solid #ddd6e8; border-radius: 8px; background: #fcfbfe; color: var(--ink); font-size: 13px; }
.catalog-detail-field { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.catalog-detail-field label { margin-bottom: 0; }
.catalog-summary { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.catalog-status { color: var(--muted); font-size: 12px; }
.filter-reset { min-height: 38px; padding: 4px 2px; border: 0; background: transparent; color: var(--purple-dark); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.catalog-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 146px), 1fr)); align-items: start; gap: 10px; }
.card-option { position: relative; width: 100%; min-width: 0; padding: 5px; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.card-option:hover { border-color: #b8a2ed; }
.card-option[aria-pressed="true"] { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); background: #f5f0fe; }
.card-option:focus-visible { outline-offset: 1px; }
.card-option .card-identity, .selection .card-identity { display: grid; width: 100%; align-content: start; gap: 5px; }
.card-option .card-thumbnail, .selection .card-thumbnail { width: 100%; }
.card-option .card-identity-text, .selection .card-identity-text { padding: 2px 3px; }
.tile-choice { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--purple-dark); box-shadow: 0 1px 5px #221b3440; font-weight: 800; font-size: 16px; line-height: 1; }
.card-option[aria-pressed="true"] .tile-choice { background: var(--purple); color: #fff; }
.catalog-results > .button { grid-column: 1 / -1; justify-self: center; }
.profile-footer { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 10px 22px; border-top: 1px solid var(--line); background: #fff; }
.profile-footer .field-message { margin: 0 auto 0 0; }
.profile-footer .button { flex: 0 0 auto; min-width: 145px; }
.announcement { position: fixed; z-index: 4; bottom: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 36px); padding: 10px 17px; border-radius: 9px; background: var(--ink); color: white; font-size: 14px; }

@media (max-width: 920px) {
  .profile-editor { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .selected-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-cards ul { grid-template-columns: repeat(auto-fill, minmax(min(100%, 95px), 1fr)); }
}

@media (max-width: 700px) {
  .profile-dialog { inset: 0; width: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .profile-dialog .dialog-heading { padding: max(6px, env(safe-area-inset-top)) 12px 6px; }
  .profile-dialog .dialog-heading h2 { font-size: 20px; }
  .profile-editor { padding: 10px 12px 17px; scrollbar-gutter: auto; }
  .profile-settings { padding: 0; border: 0; }
  .profile-tip { margin-top: 7px; padding: 6px 8px; font-size: 12px; }
  .selection-review { margin-top: 3px; }
  .selection-review summary { min-height: 36px; padding: 8px 0; }
  .selected-cards { grid-template-columns: minmax(0, 1fr); }
  .selected-cards ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .card-option { padding: 2px; border-radius: 7px; }
  .tile-choice { top: 6px; right: 6px; }
  .profile-dialog .has-photo .card-identity-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .profile-dialog .card-identity:not(.has-photo) { min-height: 100px; aspect-ratio: 5 / 7; padding: 12px 7px; align-content: center; justify-items: center; text-align: center; background: #f7f3fb; border-radius: 5px; }
  .profile-dialog .card-identity:not(.has-photo) .card-thumbnail { width: 34px; aspect-ratio: 1; border: 0; background: transparent; }
  .profile-footer { flex-direction: column; align-items: stretch; gap: 5px; padding: 7px 12px max(7px, env(safe-area-inset-bottom)); }
}

@media (max-width: 860px) {
  .container { width: calc(100% - 40px); }
  .hero-copy { padding-left: 28px; }
  .hero-art { margin-right: 5px; }
  .orbit { width: 320px; height: 160px; }
  .orbit-small { width: 270px; height: 132px; }
  .art-card { width: 91px; }
  .art-spark-one { left: calc(50% - 141px); }
  .art-spark-two { left: calc(50% + 124px); top: calc(50% + 37px); }
  .entry-panel, .results-panel { padding: 17px; }
}

@media (max-width: 660px) {
  .container { width: calc(100% - 28px); }
  .topbar-inner { min-height: 62px; }
  .wordmark { font-size: 17px; gap: 7px; }
  .brand-icon { width: 32px; height: 32px; border-radius: 10px; }
  .top-actions { gap: 5px; }
  .top-actions .button { padding-inline: 7px; font-size: 12px; }
  #account-name { display: none; }
  .hero { min-height: 227px; position: relative; display: block; margin-top: 16px; border-radius: 17px; }
  .hero-copy { padding: 21px 15px; }
  .hero h1 { font-size: clamp(28px, 6.7vw, 43px); }
  .hero p { margin: 10px 0 13px; font-size: 13px; max-width: 260px; }
  .hero-art { position: absolute; right: -10px; top: 27px; width: 164px; height: 142px; opacity: .55; transform: scale(.71); transform-origin: right top; }
  .landing-steps { grid-template-columns: 1fr; }
  .workspace-heading { padding: 15px; align-items: start; flex-direction: column; }
  .workspace-heading h1 { font-size: 25px; }
  .workspace { margin-top: 23px; }
  .room-grid { grid-template-columns: 1fr; gap: 12px; }
  .exchange-card .card-identity { flex-direction: column; align-items: center; text-align: center; }
  .panel-heading p { font-size: 12px; }
  input { font-size: 16px; }
}

@media (max-width: 390px) {
  .hero-art { opacity: .35; transform: scale(.58); right: -12px; }
  .entry-panel, .results-panel { padding: 14px; }
}
