/* Standalone Sallang web UI. Theme tokens are supplied from mobile/src/lib/theme.ts. */
:root {
	color-scheme: light;
	--paper: var(--color-background, #fff4f0);
	--card: var(--color-card, #fffdfb);
	--ink: var(--color-foreground, #333333);
	--muted: var(--color-muted-foreground, #725d50);
	--line: var(--color-border, #ebd9cf);
	--primary: var(--color-primary, #f4633d);
	--secondary: var(--color-secondary, #fff9f5);
	--accent: var(--color-accent, #ffebdf);
	--gutter: clamp(16px, 4.5vw, 24px);
	font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink);
	background: var(--paper);
	-webkit-text-size-adjust: 100%;
}
* {
	box-sizing: border-box;
}
[hidden] {
	display: none !important;
}
html,
body {
	margin: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
body {
	position: fixed;
	inset: 0;
	background: #f2e8e1;
}
button,
input,
select,
textarea {
	font: inherit;
}
button,
a {
	-webkit-tap-highlight-color: transparent;
}
button {
	cursor: pointer;
}
button:disabled {
	cursor: default;
	background: var(--color-disabled, #e4deda);
	color: var(--color-disabled-foreground, #695f59);
}
a {
	color: inherit;
}
.shell {
	position: relative;
	top: var(--app-top, 0px);
	width: 100%;
	max-width: 480px;
	height: var(--app-height, 100dvh);
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	background: var(--paper);
	box-shadow: 0 0 40px #64432a0d;
	overflow: hidden;
}
.app-header,
.shell > header {
	flex: none;
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: calc(62px + env(safe-area-inset-top, 0px));
	padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 8px;
	background: var(--paper);
}
.brand {
	display: flex;
	align-items: flex-start;
	flex: 1;
	min-width: 0;
	min-height: 42px;
	padding-top: 6px;
	text-decoration: none;
	font-size: 20px;
	line-height: 29px;
	font-weight: 600;
	letter-spacing: -1.3px;
	white-space: nowrap;
}
.brand-flower {
	flex: none;
	width: 15px;
	height: 15px;
	stroke: #f5a41b;
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
}
.header-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-height: 42px;
	padding: 0 13px;
	border: 0;
	border-radius: 24px;
	background: var(--secondary);
	color: var(--ink);
	font-size: var(--type-label-size, 13px);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.header-back {
	border: 0;
	background: transparent;
	min-height: 42px;
	padding: 7px;
	color: var(--ink);
	display: grid;
	place-items: center;
}
.header-back svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.coin-icon {
	width: 16px;
	height: 16px;
	flex: none;
}
.coin-icon circle {
	fill: var(--color-coin, #f8d26f);
	stroke: var(--color-coin-border, #e8b650);
}
.coin-icon path {
	fill: none;
	stroke: var(--muted);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}
main {
	flex: 1;
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 20px var(--gutter) 28px;
	scrollbar-width: thin;
}
main:focus-visible {
	outline: none;
}
h1 {
	font-size: var(--type-title-size, 22px);
	line-height: var(--type-title-line, 31px);
	font-weight: 700;
	letter-spacing: -0.44px;
	margin: 0 0 16px;
	color: var(--ink);
	overflow-wrap: anywhere;
}
h2 {
	font-size: var(--type-subheading-size, 17px);
	line-height: var(--type-subheading-line, 25.5px);
	font-weight: 600;
	margin: 0 0 12px;
	color: var(--ink);
}
h3 {
	font-size: var(--type-action-size, 15px);
	line-height: var(--type-action-line, 22.5px);
	font-weight: 600;
	margin: 14px 0 8px;
}
p {
	font-size: var(--type-body-size, 14px);
	line-height: var(--type-body-line, 21px);
	color: var(--muted);
	margin: 8px 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
small,
.muted {
	font-size: var(--type-caption-size, 12px);
	line-height: var(--type-caption-line, 16.5px);
	color: var(--muted);
}
.eyebrow {
	font-size: var(--type-body-size, 14px);
	line-height: var(--type-body-line, 21px);
	color: var(--muted);
	font-weight: 400;
	margin: 0 0 8px;
}
.card {
	background: var(--color-name-background, #fffdfbd9);
	border: 1px solid #ffffffac;
	border-radius: var(--radius-card, 18px);
	padding: 20px;
	margin: 16px 0;
	box-shadow: 0 5px 15px #a9674312;
}
.card > :first-child {
	margin-top: 0;
}
.card > :last-child {
	margin-bottom: 0;
}
.stack {
	display: grid;
	gap: 12px;
}
.row {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: space-between;
	flex-wrap: wrap;
}
.button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 51px;
	margin-top: 10px;
	padding: 10px 15px;
	border: 0;
	border-radius: var(--radius-button, 13px);
	background: var(--primary);
	color: var(--color-primary-foreground, #fff);
	font-size: var(--type-action-size, 15px);
	line-height: var(--type-action-line, 22.5px);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}
.secondary {
	background: var(--secondary);
	border: 1px solid var(--line);
	color: var(--ink);
}
.text-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	background: transparent;
	border: 0;
	padding: 10px 4px;
	font-size: var(--type-label-size, 13px);
	color: var(--muted);
	text-decoration: underline;
	text-underline-offset: 4px;
}
.danger {
	color: var(--color-destructive, #ef4444);
}
.empty {
	padding: 36px 10px;
	text-align: center;
	color: var(--muted);
}
.badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 10px;
	font-size: 12px;
	line-height: 17px;
	background: var(--accent);
	color: var(--color-accent-foreground, #803e27);
}
label {
	display: block;
	font-size: 14px;
	line-height: 21px;
	font-weight: 600;
	margin: 14px 0 6px;
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea,
.select-trigger {
	width: 100%;
	min-width: 0;
	min-height: 44px;
	border: 1px solid var(--color-input, #d9b9aa);
	border-radius: var(--radius-button, 13px);
	padding: 10px 12px;
	background: var(--color-popover, #fffcf9);
	color: var(--ink);
	font-size: 16px;
	line-height: 24px;
	font-weight: 400;
}
label > :is(input, select, textarea, .select-control) {
	margin-top: 6px;
}
input[type='date'],
input[type='time'] {
	display: block;
	max-width: 100%;
	appearance: none;
}
input::-webkit-date-and-time-value {
	text-align: left;
}
.select-control {
	min-width: 0;
}
.select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	text-align: left;
}
.select-trigger span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.select-trigger svg,
.select-option svg {
	width: 18px;
	height: 18px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.select-trigger[aria-expanded='true'] {
	border-color: var(--color-ring, #936052);
}
.select-trigger[aria-expanded='true'] svg {
	transform: rotate(180deg);
}
.select-trigger.is-placeholder {
	color: var(--muted);
}
.select-menu {
	position: fixed;
	inset: auto;
	z-index: 20;
	margin: 0;
	padding: 5px;
	border: 1px solid var(--line);
	border-radius: var(--radius-button, 13px);
	background: var(--color-popover, #fffcf9);
	color: var(--ink);
	box-shadow: 0 8px 24px #64432a24;
	overflow: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}
.select-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 44px;
	padding: 10px;
	border-radius: 9px;
	font-size: var(--type-body-size, 14px);
	line-height: var(--type-body-line, 21px);
	font-weight: 400;
	cursor: pointer;
}
.select-option span {
	min-width: 0;
	overflow-wrap: anywhere;
}
.select-option svg {
	visibility: hidden;
}
.select-option[aria-selected='true'] {
	font-weight: 600;
}
.select-option[aria-selected='true'] svg {
	visibility: visible;
}
.select-option.is-highlighted,
.select-option:not([aria-disabled='true']):hover {
	background: var(--accent);
	color: var(--color-accent-foreground, #803e27);
}
.select-option[aria-disabled='true'] {
	color: var(--muted);
	cursor: default;
}
.select-trigger[aria-invalid='true'] {
	border-color: var(--color-destructive, #ef4444);
}
.field-error {
	font-size: 12px;
	line-height: 18px;
	color: var(--ink);
}
textarea {
	min-height: 92px;
	resize: vertical;
}
input[type='checkbox'],
input[type='radio'] {
	width: 20px;
	height: 20px;
	margin: 0 7px 0 0;
	vertical-align: middle;
	accent-color: var(--primary);
}
input:disabled {
	color: var(--muted);
	background: var(--secondary);
}
fieldset {
	min-width: 0;
	border: 1px solid #ffffffac;
	border-radius: 18px;
	background: var(--color-name-background, #fffdfbd9);
	padding: 20px;
	margin: 18px 0;
	box-shadow: 0 5px 15px #a9674312;
}
.birth-fields {
	border: 0;
	border-radius: 22px;
	background: #fffcf7;
	box-shadow: 0 4px 18px #725d500b;
	padding: clamp(14px, 4vw, 20px);
	margin: 20px 0;
}
.birth-fields > h2 {
	margin: 0 0 20px;
}
.birth-group + .birth-group {
	margin-top: 24px;
}
.birth-group > label,
.birth-label {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
}
.birth-group > label {
	display: block;
}
.birth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}
.birth-row .birth-label {
	margin: 0;
	flex-shrink: 0;
}
.birth-date-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.9fr));
	gap: 8px;
}
.birth-time-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}
.birth-date-grid .select-trigger {
	padding-inline: 8px;
	gap: 4px;
	font-size: 14px;
}
.birth-date-grid .select-trigger svg {
	width: 14px;
	height: 14px;
}
.birth-segment {
	display: flex;
	flex-shrink: 0;
	border-radius: 24px;
	background: #f8eee7;
	padding: 3px;
}
.birth-segment label {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 38px;
	padding: 6px 12px;
	margin: 0;
	border-radius: 22px;
	font-size: 13px;
	font-weight: 400;
	color: var(--muted);
	cursor: pointer;
}
.birth-segment input,
.birth-unknown input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.birth-segment label:has(:checked) {
	background: #fffcf9;
	color: var(--ink);
	font-weight: 600;
	box-shadow: 0 1px 4px #725d5010;
}
.birth-segment label:has(:focus-visible),
.birth-unknown:has(:focus-visible) {
	outline: 2px solid var(--color-ring);
	outline-offset: 2px;
}
.birth-fields label.birth-unknown {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin: 0;
	padding: 6px 9px;
	min-height: 44px;
	border: 1px solid var(--color-input);
	border-radius: 24px;
	font-size: 12px;
	white-space: nowrap;
}
.birth-unknown svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
}
.birth-unknown:has(:checked) {
	background: var(--accent);
	border-color: var(--color-ring);
	color: var(--color-accent-foreground);
}
.birth-hint {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 18px;
	color: var(--muted);
}
.unknown-hint {
	padding: 12px;
	border: 1px dashed var(--line);
	border-radius: 12px;
}
.birth-leap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-top: 10px;
	font-size: 12px;
	color: var(--muted);
}
.birthplace-control,
.place-entry {
	position: relative;
}
.place-menu {
	position: relative;
	inset: auto;
	width: 100%;
	max-height: 240px;
	margin: 6px 0 0;
	box-shadow: 0 4px 12px #64432a12;
}
.birth-fields .birthplace-control input {
	padding-left: 36px;
	padding-right: 40px;
}
.place-pin {
	position: absolute;
	top: 14px;
	left: 12px;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: var(--muted);
	stroke-width: 1.7;
	pointer-events: none;
}
.place-toggle {
	position: absolute;
	right: 0;
	top: 0;
	height: 100%;
	width: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 0 13px 13px 0;
	background: transparent;
	color: var(--muted);
}
.place-toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
}
.place-group-label {
	padding: 8px 10px 4px;
	font-size: 12px;
	color: var(--muted);
	font-weight: 600;
}
.place-empty {
	padding: 10px;
	margin: 0;
	font-size: 13px;
}
.birth-intro {
	margin: 0 0 24px;
	color: var(--muted);
}
.birth-intro p {
	margin: 0;
	line-height: 1.65;
}
.birth-policy {
	font-size: 12px;
	color: var(--muted);
}
.birth-form .form-actions {
	flex-direction: column;
}
.birth-form .form-actions .button {
	flex: none;
	width: 100%;
}
.birth-form > .legal {
	margin-left: 35px;
	text-align: left;
}
.birth-form > label {
	word-break: keep-all;
	line-height: 1.6;
}
legend {
	font-size: 17px;
	font-weight: 600;
	padding: 0 5px;
}
.columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}
.columns > div {
	min-width: 0;
}
:focus-visible {
	outline: 2px solid var(--color-ring, #936052);
	outline-offset: 3px;
}
.mine {
	background: var(--accent);
	border-radius: 18px;
	margin: 16px 0 10px 24px;
	padding: 16px;
}
.reply {
	background: var(--color-name-background, #fffdfbd9);
	border: 1px solid #ffffffac;
	border-radius: 18px;
	padding: 20px;
	margin: 0 0 16px;
	box-shadow: 0 5px 15px #a9674312;
}
.reply p {
	white-space: pre-wrap;
}
.questions {
	display: grid;
	gap: 8px;
	margin: 16px 0;
}
.questions button {
	border: 1px solid var(--line);
	border-radius: 13px;
	background: var(--secondary);
	min-height: 51px;
	padding: 10px 15px;
	color: var(--ink);
	text-align: center;
	font-size: var(--type-action-size, 15px);
	line-height: var(--type-action-line, 22.5px);
	font-weight: 600;
}
.composer {
	padding-top: 12px;
	margin-top: 12px;
}
#notice {
	flex: none;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 var(--gutter) 8px;
	padding: 10px 12px 10px 16px;
	background: #3b2e29;
	color: white;
	border-radius: 14px;
	font-size: 14px;
	line-height: 21px;
}
#notice-message {
	flex: 1;
	min-width: 0;
	padding: 5px 0;
	overflow-wrap: anywhere;
}
#notice-close {
	flex: none;
	width: 36px;
	min-height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: white;
	font-size: 22px;
}

details {
	margin: 14px 0;
	border-bottom: 1px solid var(--line);
	padding-bottom: 12px;
}
summary {
	cursor: pointer;
	min-height: 44px;
	font-weight: 600;
	padding: 10px 0;
	font-size: var(--type-subheading-size, 17px);
	line-height: var(--type-subheading-line, 25.5px);
}
.month-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 18px 0;
	padding: 0;
	list-style: none;
}
.month-grid li {
	min-height: 44px;
	display: grid;
	place-items: center;
	text-decoration: none;
	background: var(--secondary);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 9px;
	font-weight: 500;
}
.legal {
	margin-top: 18px;
	text-align: center;
	font-size: 12px;
	line-height: 18px;
	color: var(--muted);
}
.legal a {
	margin: 0 6px;
}
.app-dock {
	flex: none;
	padding: 9px var(--gutter) max(12px, env(safe-area-inset-bottom, 0px));
	background: var(--paper);
}
.dock {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	padding: 5px 7px;
	border: 1px solid #ffffffac;
	border-radius: 50px;
	background: var(--color-name-background, #fffdfbd9);
	box-shadow: 0 5px 15px #a9674312;
}
.dock a {
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: 45px;
	color: var(--color-tab-inactive, #767370);
	font-size: 12px;
	line-height: 16.5px;
	font-weight: 500;
	text-decoration: none;
}
.dock svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.65;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.dock a[aria-current='page'] {
	color: var(--color-tab-active, #302e2d);
}
.dock a[aria-current='page'] svg {
	stroke-width: 1.95;
}
.dock-highlight {
	position: absolute;
	top: 5px;
	left: 7px;
	width: calc((100% - 14px) / 4);
	height: calc(100% - 10px);
	border-radius: 18px;
	background: white;
	box-shadow: 0 3px 9px #a9674312;
	transform: translateX(calc(var(--active-tab, 0) * 100%));
	transition: transform 220ms ease-out;
	pointer-events: none;
}
main.home-view {
	padding: 20px var(--gutter) 28px;
}
.home-content {
	display: grid;
	gap: 20px;
}
.home-layout {
	display: flex;
	flex-direction: column;
	min-height: 0;
	gap: 12px;
}
.home-side {
	flex: none;
	min-width: 0;
	display: grid;
	align-content: center;
	gap: 16px;
}
.home-heading {
	text-align: center;
}
.home-heading h1 {
	margin: 3px 0 9px;
}
.home-heading .eyebrow {
	margin: 0 0 8px;
}
.home-chip {
	display: inline-block;
	font-size: 14px;
	line-height: 21px;
	font-weight: 600;
	padding: 4px 16px;
	border-radius: 22px;
	background: var(--secondary);
	margin-bottom: 3px;
}
.home-scene {
	display: block;
	flex: 0 1 auto;
	align-self: center;
	width: auto;
	max-width: 100%;
	min-height: 120px;
	max-height: 251px;
	aspect-ratio: 1068/699;
	border-radius: 24px;
	overflow: hidden;
	margin: 0 auto;
	background: var(--paper);
	line-height: 0;
}
.home-scene img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
.scene-link {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 5px;
	min-height: 44px;
	padding: 0 4px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
}
.scene-link svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.home-card {
	margin: 0;
	padding: 14px 18px;
}
.home-card h2 {
	margin: 0 0 12px;
}
.home-card p {
	margin: 0;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}
.home-card .row {
	margin-bottom: 10px;
}
.home-card .row h2 {
	margin: 0;
}
.home-actions {
	display: grid;
	gap: 4px;
}
.home-actions .button {
	margin: 0;
}
.home-actions .text-button {
	justify-self: center;
}
.home-links {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px 16px;
}
.home-links .scene-link {
	justify-content: center;
}
.profile-identity {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.profile-identity h1 {
	font-size: 26px;
	line-height: 35px;
	margin: 0 0 6px;
}
.profile-identity img {
	width: 80px;
	height: 80px;
	object-fit: contain;
	flex: none;
}
.wallet-card {
	background: var(--accent);
}
.wallet-amount {
	color: var(--ink);
	font-size: 26px;
	line-height: 35px;
	font-weight: 700;
	margin: 0;
}
.wallet-card .button {
	width: auto;
	min-height: 44px;
	padding: 10px 15px;
	margin: 0;
}
.menu-row {
	display: flex;
	gap: 12px;
	align-items: center;
	min-height: 62px;
	border-radius: 18px;
	padding: 10px 13px;
	background: var(--card);
	color: var(--ink);
	text-decoration: none;
	margin: 8px 0;
}
.menu-row > svg {
	width: 22px;
	height: 22px;
	flex: none;
	fill: none;
	stroke: var(--muted);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.menu-row > span {
	flex: 1;
	font-size: 14px;
	font-weight: 600;
}
.menu-row small {
	display: block;
	margin-top: 3px;
	font-weight: 400;
}
.menu-row .chevron {
	width: 14px;
	height: 14px;
	flex: none;
}
@media (prefers-reduced-motion: reduce) {
	.dock-highlight {
		transition: none;
	}
}
@media (hover: hover) {
	.button:hover {
		opacity: 0.85;
	}
	.header-pill:hover {
		filter: brightness(0.98);
	}
}

/* The composer stays outside the reading pane, above the mobile keyboard. */
#composer {
	flex: none;
	margin: 0;
	padding: 8px var(--gutter) max(10px, env(safe-area-inset-bottom, 0px));
	background: var(--paper);
	border-top: 1px solid var(--line);
}
.composer-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 28px;
	margin-bottom: 4px;
}
#composer label {
	margin: 0;
	font-size: 12px;
	font-weight: 500;
}
#composer .jump-latest {
	flex: none;
	border: 0;
	background: transparent;
	color: var(--color-accent-foreground);
	min-height: 28px;
	padding: 2px 0 2px 8px;
	font-size: 12px;
}
.composer-entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: end;
}
#composer textarea {
	min-height: 44px;
	height: 44px;
	max-height: 88px;
	resize: none;
}
#composer .button {
	width: auto;
	min-width: 66px;
	min-height: 44px;
	margin: 0;
	padding: 10px 12px;
}
.shell.keyboard-open #composer {
	padding-bottom: 10px;
}
.shell.keyboard-open .app-dock {
	display: none;
}
main {
	scroll-padding: 16px 0;
}

/* Shared page rhythm and action hierarchy. Existing palette tokens are unchanged. */
.page-heading {
	margin: 0 0 22px;
}
.page-heading h1 {
	margin: 0;
}
.page-heading > p:last-child:not(.eyebrow) {
	margin: 8px 0 0;
}
.list-heading {
	display: grid;
	gap: 10px;
	margin-bottom: 20px;
}
.list-heading-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.list-heading .page-heading {
	margin: 0;
}
.list-heading > p {
	margin: 0;
}
.button-inline {
	width: auto;
	margin-top: 0;
	min-height: 44px;
}
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: 520px;
	margin: 20px auto 0;
	padding: 28px 22px;
	text-align: center;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--secondary);
}
.empty-state > svg {
	width: 36px;
	height: 36px;
	fill: none;
	stroke: var(--muted);
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	margin-bottom: 4px;
}
.empty-state h2,
.empty-state p {
	margin: 0;
}
.empty-state .button {
	margin: 4px 0 0;
}
.account-note {
	display: flex;
	align-items: center;
	gap: 8px 16px;
	flex-wrap: wrap;
	max-width: 520px;
	margin: 16px auto 0;
	padding: 12px 4px;
}
.account-note p {
	flex: 1 1 230px;
	margin: 0;
	font-size: 12px;
	line-height: 19px;
}
.account-note .text-button {
	flex: 1 1 auto;
	padding: 4px 0;
	font-size: 13px;
	justify-content: flex-start;
}
.consultation-grid {
	display: grid;
	gap: 16px;
}
.consultation-card {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.consultation-card h2 {
	margin: 12px 0 4px;
}
.consultation-preview {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}
.entry-footer {
	align-self: stretch;
	display: grid;
	gap: 12px;
	padding-top: 16px;
	margin-top: auto;
}
.entry-footer p {
	margin: 0;
}
.entry-footer .button {
	width: 100%;
	margin: 0;
}
.info-note {
	border-left: 3px solid var(--line);
	padding: 4px 0 4px 14px;
	margin: 0 0 24px;
}
.info-note p {
	font-size: 13px;
	line-height: 20px;
	margin: 0 0 8px;
}
.info-note p:last-child {
	margin-bottom: 0;
}
.form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 16px;
	margin: 24px 0 0;
}
.form-actions .button {
	flex: 1 1 220px;
	margin: 0;
}
.form-actions .text-button {
	flex: 0 1 auto;
}
label:has(> input[type='checkbox']) {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	min-height: 44px;
	padding-block: 8px;
	font-weight: 400;
}
label > input[type='checkbox'] {
	flex: none;
	margin: 1px 0 0;
}
.conversation-tools,
.context-actions,
.support-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin: 0 0 16px;
}
.conversation-tools .text-button {
	padding-inline: 0;
}
.support-actions {
	justify-content: flex-start;
	margin-top: 20px;
}
.summary-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 12px;
}
.summary-actions p {
	flex: 1 1 160px;
	margin: 0;
}
.summary-actions .button {
	width: auto;
	margin: 0 0 0 auto;
	min-height: 44px;
}
.related-offer {
	margin-top: 20px;
}
.related-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 14px;
	margin-top: 14px;
}
.related-actions .button {
	flex: 1 1 180px;
	margin: 0;
}
.related-actions .text-button {
	flex: 1 1 180px;
	padding: 4px 0;
}
.product-layout {
	display: grid;
	gap: 20px;
	align-items: start;
}
.product-layout #preview {
	margin: 0;
}
.product-layout .purchase-panel {
	margin: 0;
}
.preview-return {
	margin-top: 12px;
}
.purchase-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}
.purchase-links .button {
	flex: 1 1 140px;
	margin: 0;
	min-height: 44px;
}
.product-overview > p:first-child {
	margin-top: 0;
}
.purchase-panel {
	margin-top: 24px;
}
.order-card > small {
	display: block;
	overflow-wrap: anywhere;
}
.order-card h2 {
	margin: 12px 0 8px;
}
.profile-identity {
	margin-top: 0;
	padding: 18px;
	gap: 12px;
}
.profile-identity h1 {
	font-size: 22px;
	line-height: 31px;
}
.profile-identity img {
	width: 64px;
	height: 64px;
}
.profile-identity > div {
	min-width: 0;
}
.wallet-prompt {
	font-size: 17px;
	line-height: 25.5px;
}
.profile-menu {
	margin: 24px 0;
}
.profile-menu .menu-row {
	margin: 8px 0 0;
}
.profile-app-section {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
}
.profile-app-section h2 {
	margin-bottom: 8px;
}
.profile-app-section .button {
	margin-top: 14px;
}
.profile-footer {
	margin-top: 24px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
	text-align: center;
}
.profile-footer .legal {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 14px;
	margin: 8px 0;
}
.profile-footer .legal a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin: 0;
}
.wallet-card .row {
	flex-wrap: nowrap;
}
.wallet-card .row > div {
	min-width: 0;
}
.wallet-card .button {
	flex: none;
}
.wallet-amount {
	overflow-wrap: anywhere;
}
.wallet-balance {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 18px 20px;
	border-radius: 18px;
	background: var(--accent);
	margin-bottom: 16px;
}
.wallet-balance p {
	margin: 0;
}
.wallet-balance strong {
	font-size: 28px;
	font-weight: 700;
}
.wallet-balance strong span {
	font-size: 14px;
	margin-left: 6px;
}
.pack-fieldset {
	border: 0;
	padding: 0;
	margin: 24px 0 18px;
	background: transparent;
	box-shadow: none;
}
.pack-fieldset legend {
	padding: 0;
	margin-bottom: 14px;
}
.pack-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}
.pack-option {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 16px 12px;
	min-height: 84px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--secondary);
}
.pack-option input {
	flex: none;
	margin: 0;
}
.pack-option span {
	min-width: 0;
}
.pack-option strong,
.pack-option small {
	display: block;
}
.pack-option small {
	margin-top: 3px;
	font-weight: 400;
}
.pack-option:has(input:checked) {
	border-color: var(--primary);
	box-shadow: inset 0 0 0 1px var(--primary);
}
.phone-entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
	gap: 10px;
}
.phone-entry .button {
	width: auto;
	min-height: 48px;
	margin: 0;
	font-size: 13px;
	padding-inline: 12px;
	white-space: nowrap;
}
.phone-entry .button:disabled {
	cursor: not-allowed;
	background: var(--color-disabled, #e4deda);
	color: var(--color-disabled-foreground, #695f59);
	border-color: transparent;
}
.mode-switch,
.signup-gender,
.signup-fields {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}
.mode-switch,
.signup-gender {
	margin: 0 0 24px;
}
.mode-switch legend,
.signup-gender legend {
	padding: 0;
	margin-bottom: 10px;
	font-size: 14px;
}
.mode-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--secondary);
}
.mode-options label {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 8px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 20px;
	font-weight: 500;
	text-align: center;
	color: var(--muted);
	cursor: pointer;
}
.mode-options input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: inherit;
}
.mode-options label:has(:checked) {
	background: var(--card);
	color: var(--ink);
	font-weight: 600;
	box-shadow: 0 2px 6px #64432a14;
}
.mode-options label:has(:focus-visible) {
	outline: 2px solid var(--color-ring, #936052);
	outline-offset: 2px;
}
.mode-options label:has(:disabled) {
	cursor: default;
}
.signup-fields {
	margin: 0 0 24px;
}
.signup-fields > fieldset {
	margin-top: 0;
}
.signup-agreement {
	margin-bottom: 0;
}
.signup-agreement a {
	text-underline-offset: 3px;
}
.form-field + .form-field {
	margin-top: 20px;
}
.form-field > label {
	margin: 0 0 8px;
}
#login .form-field input {
	min-height: 48px;
}
.field-hint,
.captcha-note {
	font-size: var(--type-caption-size, 12px);
	line-height: var(--type-caption-line, 18px);
	font-weight: 400;
	color: var(--muted);
}
.field-hint {
	margin: 8px 0 0;
}
.captcha-note {
	margin: 16px 0 0;
	text-align: center;
}
.captcha-note a {
	text-underline-offset: 3px;
}
.dock {
	max-width: 540px;
	margin-inline: auto;
}
/* Keep the same app-sized column on tablets and desktops. */
@media (min-width: 512px) {
	.shell {
		width: calc(100% - 32px);
		height: calc(var(--app-height, 100dvh) - 32px);
		max-height: 900px;
		margin: 16px auto;
		border-radius: 24px;
	}
}
@media (max-width: 360px) {
	.phone-entry {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}
	.phone-entry .button {
		width: 100%;
	}
	.columns {
		grid-template-columns: minmax(0, 1fr);
	}
	.pack-option {
		gap: 7px;
		padding-inline: 10px;
	}
	.empty-state {
		padding: 24px 18px;
	}
}

/* Keep the main home action available even when the viewport is short. */
main.home-view {
	padding: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.home-content {
	flex: 0 1 auto;
	min-height: 0;
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 12px var(--gutter) 8px;
}
.home-heading {
	flex: none;
	margin-bottom: 12px;
}
.home-actions {
	flex: none;
	align-content: start;
	padding: 8px var(--gutter) 12px;
}
/* Match the existing SalonChat header, transcript, question strip and composer. */
.chat-view > .app-header {
	display: none;
}
.shell > .chat-heading {
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px;
	border: 0;
	gap: 10px;
}
.chat-heading .header-back {
	flex: none;
	width: 44px;
	min-height: 44px;
}
.chat-title {
	flex: 1;
	min-width: 0;
}
.chat-avatar {
	flex: none;
	width: 38px;
	height: 38px;
	object-fit: contain;
}
.chat-title h1 {
	font-size: 17px;
	line-height: 25.5px;
	font-weight: 600;
	margin: 0;
}
.chat-title p {
	font-size: 12px;
	line-height: 18px;
	margin: 2px 0 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.chat-menu-button {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	font-size: 26px;
}
.chat-menu-button svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}
main[data-view='chat'] {
	padding: 16px;
	scroll-padding: 16px 0;
}
.chat-memory {
	margin: 0 0 20px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--secondary);
}
.chat-memory summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 46px;
	font-size: 13px;
	font-weight: 500;
	list-style: none;
}
.chat-memory summary::-webkit-details-marker {
	display: none;
}
.chat-memory[open] summary span {
	transform: rotate(180deg);
}
.chat-memory p {
	margin: 0 0 8px;
}
.chat-memory .text-button {
	padding-inline: 0;
	font-size: 13px;
}
.chat-view #messages {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}
.chat-view .message {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	width: fit-content;
	max-width: 87%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}
.chat-view .message.mine {
	align-self: flex-end;
	margin-left: auto;
}
.chat-view .message-bubble {
	min-width: 0;
	max-width: 100%;
	padding: 12px;
	border-radius: 15px;
	background: var(--card);
}
.chat-view .mine .message-bubble {
	background: var(--accent);
}
.chat-view .message-bubble > p {
	margin: 0;
}
.chat-view .message-bubble > p + p {
	margin-top: 8px;
}
.chat-pending {
	display: contents;
}
.chat-view .thinking p {
	font-size: 12px;
}
.chat-view .summary-card {
	margin-top: 12px;
}
.chat-view .summary-card h2 {
	font-size: 14px;
	line-height: 21px;
	margin: 0 0 8px;
}
.summary-editor {
	margin: 8px 0;
	padding: 0;
	border: 0;
}
.summary-editor summary {
	font-size: 12px;
	font-weight: 500;
	min-height: 44px;
}
.summary-editor label {
	font-size: 12px;
}
.chat-action {
	min-height: 44px;
	padding: 8px 12px;
	margin-top: 8px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--secondary);
	color: var(--ink);
	font-size: 13px;
	font-weight: 600;
}
.chat-view #composer {
	padding: 6px 16px 5px;
	border: 0;
}
.chat-view .questions {
	display: flex;
	gap: 8px;
	margin: 0 -3px 3px;
	padding: 3px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}
.chat-view .questions::-webkit-scrollbar {
	display: none;
}
.chat-view .questions:empty {
	display: none;
}
.chat-view .questions button {
	flex: none;
	min-height: 44px;
	padding: 6px 9px;
	border: 0;
	border-radius: 14px;
	background: var(--card);
	font-size: 12px;
	line-height: 18px;
	font-weight: 400;
	white-space: nowrap;
	color: var(--muted);
	text-align: left;
}
.chat-view .questions button:active {
	background: var(--accent);
}
.chat-view .composer-entry {
	gap: 6px;
}
.chat-view #composer .chat-send {
	display: grid;
	place-items: center;
	width: 44px;
	min-width: 44px;
	height: 44px;
	padding: 12px;
	border-radius: 20px;
}
.chat-send svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.chat-view #composer .chat-send:disabled {
	background: var(--primary);
	color: var(--color-primary-foreground);
	opacity: 0.55;
}
.chat-view.keyboard-open #composer {
	padding-bottom: 10px;
}
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
.chat-settings {
	width: min(400px, calc(100% - 32px));
	max-height: calc(100dvh - 48px);
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background: var(--paper);
	color: var(--ink);
}
.chat-settings::backdrop {
	background: var(--color-overlay);
}
.chat-settings-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.chat-settings-heading h2 {
	margin: 0;
}
.chat-settings-actions {
	margin-top: 16px;
}
.chat-settings .menu-row {
	min-height: 48px;
	font-weight: 500;
}
.chat-settings .danger {
	margin-top: 8px;
}
@media (max-height: 650px) {
	.home-content {
		padding-top: 8px;
	}
	.home-heading {
		margin-bottom: 12px;
	}
	.home-card {
		padding: 14px 18px;
	}
	.home-actions {
		padding-top: 6px;
		padding-bottom: 8px;
	}
}
@media (max-height: 650px) {
	.has-history .home-layout {
		display: flex;
		flex-direction: column;
	}
	.has-history .home-side {
		order: -1;
	}
}

/* Touch forms use the browser's normal keyboard scroll, including their header. */
@media (pointer: coarse) {
	html.document-form {
		overflow-y: auto;
		overflow-x: hidden;
	}
	.document-form body {
		position: static;
		height: auto;
		min-height: 100%;
		overflow: visible;
	}
	.document-form .shell {
		top: 0;
		height: auto;
		min-height: 100svh;
		max-height: none;
		overflow: visible;
	}
	.document-form main {
		flex: none;
		overflow: visible;
	}
	.document-form .app-dock {
		position: sticky;
		bottom: 0;
		z-index: 4;
		margin-top: auto;
	}
	.document-form .shell.keyboard-open .app-dock {
		display: block;
		visibility: hidden;
		pointer-events: none;
	}
}
@media (pointer: coarse) and (min-width: 512px) {
	.document-form .shell {
		min-height: calc(100svh - 32px);
	}
}

/* Annual product navigation remains inside the current consultation. */
.annual-offer {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}
.annual-offer > p {
	margin-top: 8px;
}
.annual-offer-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	margin-top: 12px;
}
.annual-offer-actions .chat-action {
	display: inline-block;
	text-decoration: none;
}
.product-price {
	font-size: 24px;
	font-weight: 800;
}
.product-price .muted {
	font-size: 14px;
	font-weight: 400;
}

.birth-heading {
	margin-bottom: 12px;
}
.birth-heading h1 {
	font-size: 26px;
	line-height: 35px;
}
