main { max-width: 480px; margin: 0 auto; padding: 20px 16px 48px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

h1 { margin: 28px 0 6px; }

.tabs { display: flex; gap: 6px; margin: 20px 0 0; align-items: flex-end;
  /* tabs and the THEM match count stay at the top; the questions scroll underneath */
  position: sticky; top: 0; z-index: 3; background: var(--page-bg); padding-top: 8px; }
.tab { flex: 1; min-height: 50px; border: 1.5px solid var(--tab-border); border-radius: 14px 14px 0 0; background: var(--tab-bg); color: var(--tab-text); font-weight: 600; font-size: 16px; letter-spacing: 0.1em; }
.tab:not(.on) { border-bottom: none; } /* the line under the tabs (.tabs::after) is its bottom edge */
.tab.on { background: var(--tab-active-bg); color: var(--tab-active-text); min-height: 58px; border-bottom: none;
  /* hangs over the line under the tabs, so it opens into the panel */
  position: relative; z-index: 1; margin-bottom: -1.5px; padding-bottom: 1.5px; }
/* One outline around tabs + panel: line under the tabs, panel outlined on the other three sides */
.tabs::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--tab-border); }
.tab[aria-disabled="true"] { opacity: .55; }
.tab small { display: block; font-size: 12px; letter-spacing: 0; font-weight: 400; line-height: 1.2; opacity: .85; }
.panel { background: var(--panel-bg); border: 1.5px solid var(--tab-border); border-top: none; border-radius: 0 0 16px 16px; padding: 12px 12px 12px; }
.tabs:has(.tab.on:first-child) + .panel { border-top-left-radius: 0; }


.q { background: var(--card-bg); color: var(--card-text); border: 1.5px dashed var(--card-border); border-radius: 16px; padding: 14px 16px 8px; margin: 0 0 10px; }
.qh { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; min-height: 28px; }
.qt { font-weight: 600; font-size: 16px; line-height: 1.3; flex: 1; }
.qn { font-size: 14px; font-weight: 600; color: var(--question-number-text); }
.note-after { margin: 2px 0 8px; }
.note { font-size: 14px; line-height: 1.4; margin: 0 0 8px; color: var(--note-text); }

.ch { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px dotted var(--chip-border); background: var(--chip-bg); color: var(--chip-text); font-size: 14px; margin: 0 6px 8px 0; }
.ch.sel { background: var(--chip-selected-bg); color: var(--chip-selected-text); border: 1.5px solid var(--chip-selected-border); }
.must { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--must-border); background: var(--must-bg); color: var(--must-text); font-size: 13px; font-weight: 600; }
.must.on { background: var(--must-on-bg); color: var(--must-on-text); }

.dob { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 8px; }
.dob select { width: 100%; min-width: 0; height: 44px; border-radius: 12px; border: 1.5px solid var(--input-border); background-color: var(--input-bg); color: var(--input-text); font: 16px var(--font-base); padding: 0 28px 0 10px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 19px, calc(100% - 10px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.dlabel { font-size: 12px; font-weight: 600; color: var(--note-text); margin: 4px 0 6px; }
.dgrid { display: grid; gap: 6px; margin: 0 0 10px; }
.dgrid-d { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dgrid-m { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dc { min-width: 0; min-height: 40px; padding: 0; border-radius: 10px; border: 1.5px dotted var(--chip-border); background: var(--chip-bg); color: var(--chip-text); font-size: 14px; }
.dc.sel { background: var(--chip-selected-bg); color: var(--chip-selected-text); border: 1.5px solid var(--chip-selected-border); }
.err { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--error-text); }
.pool { color: var(--pool-text); font-size: 16px; line-height: 1.4; margin: -12px -12px 12px; padding: 12px 16px; position: sticky; top: calc(var(--tabs-height, 66px) - 2px); z-index: 2; background: var(--panel-bg); } /* tucks 2px under the tabs, so no sliver of content shows between them */
.pool b { font-weight: 600; }
.next { display: block; width: 100%; min-height: 52px; margin: 4px 0 2px; border: none; border-radius: 999px; background: var(--next-button-bg); color: var(--next-button-text); font-weight: 600; font-size: 16px; }
.next[aria-disabled="true"] { opacity: .45; }
.tab-hint { color: var(--panel-note-text); font-size: 14px; text-align: center; margin: 2px 0 12px; }
.q.need { animation: need 1.2s ease-out; }
@keyframes need { 0%, 40% { border-color: var(--chip-selected-border); border-style: solid; } 100% { border-color: var(--card-border); } }
.next-hint { color: var(--panel-note-text); font-size: 14px; text-align: center; margin: 8px 0 0; min-height: 0; }
.next-hint:empty { display: none; }

.confirm { border: none; border-radius: 16px; padding: 24px 20px 20px; width: min(340px, calc(100% - 32px)); background: var(--dialog-bg); color: var(--dialog-text); font-family: var(--font-base); }
.confirm::backdrop { background: var(--dialog-backdrop); }
.confirm form { margin: 0; }
.confirm p { margin: 0 0 20px; font-weight: 600; font-size: 18px; line-height: 1.4; text-align: center; }
.confirm .confirm-note { font-weight: 400; font-size: 15px; line-height: 1.5; margin: -8px 0 20px; color: var(--note-text); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; min-height: 48px; border-radius: 999px; font-weight: 600; font-size: 16px; }
.btn-yes { background: var(--button-primary-bg); color: var(--button-primary-text); border: none; }
.btn-no { background: var(--button-secondary-bg); color: var(--button-secondary-text); border: 1.5px solid var(--button-secondary-border); }

.login { border: none; border-radius: 16px; padding: 22px 20px 8px; width: min(400px, calc(100% - 32px)); background: var(--dialog-bg); color: var(--dialog-text); font-family: var(--font-base); }
.login::backdrop { background: var(--dialog-backdrop); }
.login form { margin: 0; }
.login-title { margin: 0 0 16px; font-weight: 600; font-size: 20px; line-height: 1.3; text-align: center; }

.ask { margin: 18px 4px 4px; }
.ask-title { display: block; color: var(--pool-text); font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0 0 8px; }
.ask textarea { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1.5px solid var(--input-border); background: var(--input-bg); color: var(--input-text); font: 16px/1.5 var(--font-base); padding: 10px 12px; margin: 0 0 10px; resize: vertical; }

.intro { margin: 18px 0 0; color: var(--note-text); font-size: 15px; line-height: 1.5; }
.intro p { margin: 0 0 10px; }
.feedback-btn { min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--button-secondary-bg); color: var(--button-secondary-text); border: 1.5px solid var(--button-secondary-border); font-weight: 600; font-size: 14px; }
.feedback-title { display: block; font-weight: 600; font-size: 20px; text-align: center; margin: 0 0 12px; }
#feedback-dialog .ask { margin: 0; }
#feedback-dialog textarea::placeholder { color: var(--input-placeholder); }
.feedback-status { font-size: 14px; text-align: center; color: var(--note-text); margin: 10px 0 4px; min-height: 1em; }

.save-status { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--message-bg); color: var(--message-text); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 5; }
.save-status.show { opacity: 1; transform: translate(-50%, 0); }

.age-range { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; }
.age-range select { width: 100%; min-width: 0; height: 44px; border-radius: 12px; border: 1.5px solid var(--input-border); background: var(--input-bg); color: var(--input-text); font: 16px var(--font-base); padding: 0 10px; }
.cost { font-size: 13px; color: var(--note-text); margin: 2px 0 8px; }
.cost:empty { display: none; }
.pool-fit { font-weight: 400; font-size: 14px; color: var(--panel-note-text); }

.ask-sub { color: var(--panel-note-text); font-size: 14px; margin: -4px 0 10px; }
.ask-label { display: block; color: var(--pool-text); font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.ideas { display: grid; gap: 8px; }
.idea { position: relative; display: block; width: 100%; text-align: left; padding: 12px 14px 12px 48px; border-radius: 14px; border: 1.5px dashed var(--card-border); background: var(--card-bg); color: var(--card-text); font-size: 14px; line-height: 1.4; }
.idea b { display: block; font-size: 15px; margin-bottom: 2px; }
.idea span:last-child { color: var(--note-text); }
.idea .rank { position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; border: 1.5px dotted var(--chip-border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.idea.sel { border-style: solid; border-color: var(--chip-selected-border); }
.idea.sel .rank { background: var(--chip-selected-bg); color: var(--chip-selected-text); border: 1.5px solid var(--chip-selected-border); }

#feedback-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
.feedback-sub { font-size: 14px; color: var(--note-text); text-align: center; margin: -4px 0 12px; }
.feedback-label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
#feedback-dialog .idea { border-color: var(--card-border); }
.next-arrow { display: inline-block; margin-left: 6px; }

/* Propose a design: small floating panel */
.intro .feedback-btn + .feedback-btn { margin-left: 6px; }
.designer { position: fixed; right: 12px; bottom: 12px; z-index: 50; width: 264px; max-width: calc(100vw - 24px); background: var(--dialog-bg); color: var(--dialog-text); border: 1.5px solid var(--grey-700); border-radius: 14px; padding: 10px 12px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: 13px; line-height: 1.3; }
.designer[hidden] { display: none; }
.d-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font-size: 14px; }
.d-x { border: none; background: none; font-size: 20px; line-height: 1; padding: 0 2px; color: inherit; }
.d-row { display: block; margin: 0 0 6px; }
.d-row span { display: flex; justify-content: space-between; }
.d-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.d-row input[type=range] { width: 100%; margin: 2px 0 0; accent-color: var(--grey-700); }
.d-color { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-color span { flex: 1; }
.d-color input { width: 40px; height: 26px; padding: 0; border: 1px solid var(--input-border); border-radius: 6px; background: none; }
.d-comment { width: 100%; height: 32px; border-radius: 8px; border: 1.5px solid var(--input-border); background: var(--input-bg); color: var(--input-text); padding: 0 8px; font: 13px var(--font-base); margin: 2px 0 6px; }
.d-actions { display: flex; gap: 6px; }
.d-actions button { flex: 1; min-height: 32px; border-radius: 999px; font-weight: 600; font-size: 13px; border: 1.5px solid var(--button-secondary-border); background: var(--button-secondary-bg); color: var(--button-secondary-text); }
.d-actions .d-send { background: var(--button-primary-bg); color: var(--button-primary-text); border-color: var(--button-primary-bg); }
.d-status { margin: 6px 0 0; min-height: 0; color: var(--note-text); text-align: center; }
.d-status:empty { display: none; }
.d-sub { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--divider); margin: 8px 0 4px; padding-top: 6px; font-size: 13px; }
.d-logo svg { width: 44px; height: 35px; display: block; }
.designer { max-height: calc(100vh - 24px); overflow-y: auto; }
.d-hue { accent-color: auto; background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); height: 6px; border-radius: 3px; -webkit-appearance: none; appearance: none; }
.d-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--grey-700); }
.d-hue::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--grey-700); }

/* Groups card (YOU, optional) */
.grow { border-top: 1px solid var(--divider); padding: 10px 0 8px; }
.note + .grow { border-top: none; }
.gname { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.gbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.gb { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1.5px dotted var(--chip-border); background: var(--chip-bg); color: var(--chip-text); font-size: 13px; }
.gb.sel { background: var(--chip-selected-bg); color: var(--chip-selected-text); border: 1.5px solid var(--chip-selected-border); }
.gwhy, .gsuggest input { width: 100%; height: 40px; border-radius: 10px; border: 1.5px solid var(--input-border); background: var(--input-bg); color: var(--input-text); padding: 0 10px; font: 14px var(--font-base); margin: 8px 0 0; }
.gwhy::placeholder, .gsuggest input::placeholder { color: var(--input-placeholder); }
.gsuggest { border-top: 1px solid var(--divider); padding: 10px 0 4px; }
.gsuggest label { display: block; font-weight: 600; font-size: 15px; }
.gsuggest-row { display: flex; gap: 6px; align-items: flex-end; }
.gsuggest-row input { flex: 1; }
.gsuggest-row button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--button-secondary-border); background: var(--button-secondary-bg); color: var(--button-secondary-text); font-weight: 600; font-size: 14px; }
.gsuggest-status { font-size: 14px; color: var(--note-text); margin: 6px 0 0; }
.gsuggest-status:empty { display: none; }
