/* Public account and store pages use the same paper, ink and orange as the homepage. */
:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --surface: #fdfdf9;
  --ink: #191919;
  --muted: #62625a;
  --line: #252521;
  --soft-line: #d6d5cc;
  --orange: #ff6827;
  --orange-ink: #a93a08;
  --orange-light: #fff1e3;
  --hover: #ffebd6;
  --border: 1.5px solid var(--line);
  --shadow: 4px 4px 0 var(--ink);
  --gutter: clamp(16px, 4vw, 40px);
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, 'Liberation Mono', 'Hiragino Sans GB', 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', 'WenQuanYi Zen Hei', monospace;
}
:root:lang(ja) {
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, 'Liberation Mono', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Yu Gothic', Meiryo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--mono); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
a { color: inherit; text-underline-offset: 4px; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, dl, figure { margin: 0; }
h1 { font-size: clamp(28px, 3.3vw, 40px); line-height: 1.25; letter-spacing: -.04em; font-weight: 500; margin-bottom: 28px; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 500; margin-bottom: 18px; overflow-wrap: anywhere; }
h3 { font-size: 17px; line-height: 1.5; font-weight: 600; }
p, dd, label { overflow-wrap: anywhere; }
p + p { margin-top: 12px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 3px; }
#title:focus { outline: none; }

/* One shared hierarchy: brand, three primary destinations, language. */
#header { border-bottom: 1px solid var(--soft-line); background: var(--surface); }
.header { max-width: 1280px; min-height: 76px; margin: auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: clamp(24px, 4vw, 52px); }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; min-height: 44px; }
.brand .wordmark { height: 28px; width: auto; }
.header nav { display: flex; align-items: stretch; gap: 12px; flex: 1; min-width: 0; }
.header-tools { display: flex; align-items: center; flex: none; padding-left: 16px; border-left: 1px solid var(--soft-line); }
.nav-link { position: relative; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 10px 8px; text-decoration: none; font-size: 14px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.nav-link:hover { color: var(--orange-ink); }
.nav-link[aria-current=page] { color: var(--orange-ink); font-weight: 600; }
.nav-link[aria-current=page]::after { content: ''; position: absolute; height: 2px; background: var(--orange); bottom: 0; left: 8px; right: 8px; }
.header select { appearance: none; min-height: 44px; max-width: 144px; color: var(--muted); font-size: 12px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%2362625a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center / 12px; border: 1px solid transparent; border-radius: 0; padding: 8px 28px 8px 8px; cursor: pointer; }
.header select:hover { background-color: var(--paper); color: var(--ink); }

/* Common controls and feedback; native disabled states stay intact. */
.btn { min-height: 44px; max-width: 100%; border: var(--border); border-radius: 0; background: var(--surface); padding: 12px 20px; font-size: 15px; line-height: 1.4; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: normal; overflow-wrap: anywhere; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary { background: var(--orange); color: var(--ink); box-shadow: var(--shadow); }
.btn.primary:hover:not(:disabled) { background: #ff7a3f; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.actions:empty { display: none; }
input[type=text], input[type=search], select { min-height: 44px; border: var(--border); border-radius: 0; background: var(--surface); padding: 10px 12px; max-width: 100%; }
form > input { display: block; width: 100%; margin: 10px 0; }
label { display: block; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 24px 0; }
.check input { flex: none; width: 18px; height: 18px; margin-top: 4px; accent-color: var(--orange-ink); }
.panel, .notice { background: var(--surface); border: var(--border); padding: clamp(20px, 3vw, 28px); margin: 24px 0; }
.panel > p { margin: 12px 0; }
.panel > .btn { margin-top: 6px; }
.notice { font-size: 13px; line-height: 1.6; padding: 16px 20px; }
.notice.error { border-color: #a12b23; color: #a12b23; background: #fff1e8; margin-top: 0; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.lede { color: var(--muted); margin: -12px 0 28px; max-width: 64ch; }
.store-environment { color: var(--orange-ink); font-size: 12px; margin: 12px 0; }
.supporting-copy { color: var(--muted); font-size: 13px; line-height: 1.65; }
.store-price-note { margin-top: 24px; color: var(--muted); font-size: 12px; }
.reference-note { font-size: 13px; line-height: 1.65; color: var(--muted); }
.supporting-copy { margin-top: 20px; }
.pill { display: inline-block; padding: 4px 9px; border: 1px solid; font-size: 12px; }
.pill.good { color: #285b3c; background: #eef3e8; }
.identity { font-size: 16px; overflow-wrap: anywhere; user-select: text; }
.account-id { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; user-select: text; }
dt { font-size: 12px; color: var(--muted); }
dd { margin: 0 0 20px; }

/* Login and account verification share the existing Orange Mech artwork. */
#content { width: min(1180px, 100% - 2 * var(--gutter)); margin: clamp(28px, 5vw, 60px) auto 72px; }
#content.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: var(--border); background: var(--surface); box-shadow: var(--shadow); max-width: 1060px; }
.auth-aside { min-width: 0; padding: clamp(28px, 4vw, 44px); background: radial-gradient(ellipse at 50% 56%, #ffe2c7, transparent 65%), var(--orange-light); border-right: var(--border); display: flex; flex-direction: column; gap: 32px; }
.auth-aside h2 { margin: 12px 0 0; font-size: clamp(24px, 2.7vw, 32px); line-height: 1.35; letter-spacing: -.03em; }
.welcome-cast { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.welcome-cast img { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.welcome-cast figcaption { color: var(--orange-ink); font-size: 13px; padding-top: 16px; border-top: 1px solid #dfc5b0; }
.auth-body { padding: clamp(28px, 4vw, 44px); min-width: 0; align-self: center; }
.auth-body > .btn { margin-top: 16px; }
.auth-body h1 { font-size: clamp(26px, 2.6vw, 32px); }
.auth-body > p:not(.lede):not(.supporting-copy) { font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-body .actions > .primary { width: 100%; }
.provider-buttons { display: grid; gap: 12px; margin: 28px 0 20px; }
.provider { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.provider.apple { border: 0; padding: 0; background: #000; border-radius: 4px; }
.provider.apple img { height: 44px; width: auto; max-width: 100%; }
.provider.google { font-family: 'Google Sans', Arial, sans-serif; background: #fff; border: 1px solid #747775; border-radius: 4px; color: #1f1f1f; letter-spacing: .25px; }
.provider.google:hover:not(:disabled) { background: #fff; }
.provider.google img { width: 20px; height: 20px; }
@font-face { font-family: 'Google Sans'; src: url('GoogleSans-Medium.ttf') format('truetype'); font-style: normal; font-weight: 500; font-display: swap; }

/* Confirmations, privacy and the native Passkey handoff keep a focused reading width. */
#content.task-layout { max-width: 680px; min-height: 55vh; display: flex; align-items: flex-start; }
.task-layout .page-body { width: 100%; padding: clamp(24px, 4vw, 44px); border: var(--border); background: var(--surface); box-shadow: var(--shadow); }
.task-layout .page-body > .btn { margin: 24px 12px 0 0; }
.task-layout .page-body > .actions { display: inline-flex; vertical-align: top; margin-top: 24px; }
.task-layout .page-body > .actions:empty { display: none; }
#content[data-view=privacy] { max-width: 840px; }
#content[data-view=privacy] p { margin-bottom: 24px; line-height: 1.9; }
.bridge-brand { width: 120px; height: 40px; object-fit: contain; margin-bottom: 32px; }
.passkey-page .eyebrow { margin-bottom: 12px; }
.passkey-page #status:empty { display: none; }
.passkey-page #status:not(:empty) { padding: 16px; border-left: 3px solid var(--orange); background: var(--orange-light); margin: 24px 0; }

/* Account categories follow a sidebar and content layout. */
#content.account-layout { max-width: 1180px; }
.account-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; min-height: 520px; }
.account-sidebar { min-width: 0; position: sticky; top: 28px; }
.account-sidebar nav { display: grid; gap: 6px; }
.account-category { min-height: 44px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid transparent; border-radius: 0; background: transparent; padding: 11px 14px; line-height: 1.4; font-size: 14px; }
.account-category span { min-width: 0; overflow-wrap: anywhere; }
.account-category:hover:not(:disabled) { background: var(--hover); }
.account-category[aria-current=page] { background: var(--orange-light); border-color: var(--orange); color: var(--orange-ink); font-weight: 600; }
.account-category .icon { stroke-linecap: round; stroke-linejoin: round; }
.account-sidebar-session { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--soft-line); }
.account-sidebar-session .btn { width: 100%; justify-content: flex-start; text-align: left; }
.account-content { min-width: 0; display: grid; gap: 20px; }
.account-content > .panel { margin: 0; padding: clamp(20px, 2.5vw, 28px); border: var(--border); border-radius: 0; background: var(--surface); }
.account-content h2 { margin-bottom: 20px; }

.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 20px; }
.panel-header h2 { margin: 0; }
.panel-header .btn { margin: 0; }

.account-content .account-settings > dl { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--soft-line); }
.account-content dd { margin: 6px 0 0; }
.method { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--soft-line); padding: 16px 0; }
.method:last-of-type { padding-bottom: 0; }
.method-provider { display: inline-flex; align-items: center; gap: 12px; min-width: 0; font-weight: 500; }
.provider-mark { display: block; width: 20px; height: 20px; flex: none; object-fit: contain; fill: currentColor; }
.method > span:last-child { font-size: 12px; color: var(--muted); }
.device-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.device-summary > div { flex: 1; min-width: 120px; }
.device-summary h3 { font-size: 16px; }
.device-summary p { margin-top: 4px; }
.device-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 0; background: var(--paper); color: var(--muted); }
.device-icon .icon { width: 28px; height: 28px; }
.device-policy > p { font-size: 13px; color: var(--muted); }
.account-content > .danger-card { border-color: #e4ccc6; }
.danger-card .btn { color: #a12b23; border-color: #d4b4ad; }
.commerce-work { border-top: 1px solid var(--soft-line); padding: 20px 0; margin-top: 20px; }
.commerce-work h3 { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; overflow-wrap: anywhere; }
.commerce-work p { margin: 8px 0; }
.commerce-work .actions { margin-top: 16px; }
.commerce-work details { margin: 12px 0; overflow-wrap: anywhere; }
.account-content .commerce-work { border: var(--border); border-radius: 0; padding: 18px; margin-top: 16px; background: var(--paper); }
.account-content .commerce-work h3 { font-size: 17px; }
.account-content .commerce-work > p:not(.account-id) { font-size: 13px; }
.cast-work-header { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.cast-work-info { flex: 1; min-width: 100px; }
.cast-work-info .owned-label, .cast-work-info .purchase-status { font-size: 12px; margin-bottom: 0; }
.cast-work-info .purchase-status { color: var(--muted); }
.owned-portrait { width: 72px; height: 72px; object-fit: contain; }
.purchase-record { border-top: 1px solid var(--soft-line); padding-top: 16px; margin-top: 16px; }
.purchase-toolbar { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px 16px; }
.commerce-work .order-details { flex: 1 1 120px; min-width: 0; margin: 0; font-size: 12px; color: var(--muted); }
.order-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.order-details summary::-webkit-details-marker { display: none; }
.order-details summary::before { content: '+'; font-size: 16px; flex: none; }
.order-details[open] summary::before { content: '−'; }
.order-details p { overflow-wrap: anywhere; }
.commerce-work .purchase-actions { margin: 0; gap: 8px; }
.cast-library > .supporting-copy { margin-top: 24px; }

/* Browse and preview retain the original controls, prices and ownership states. */
#content.store-layout { margin-top: 36px; }
.store-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px 24px; margin-bottom: 24px; }
.store-tools h1 { margin: 0; }
.currency-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; }
.currency-menu select { appearance: none; min-width: 102px; color: var(--ink); border-radius: 0; padding: 10px 38px 10px 14px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%2362625a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center / 12px; cursor: pointer; }
.store-search { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 220px; color: var(--muted); font-size: 13px; }
.store-search input { flex: 1; min-width: 0; color: var(--ink); }
.store-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; padding: 16px 0; border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); }
.store-filters .btn { gap: 12px; padding: 9px 14px; font-size: 13px; border-color: transparent; background: transparent; }
.store-filters .btn span { color: var(--muted); font-size: 12px; }
.store-filters [aria-pressed=true] { background: var(--orange-light); border-color: var(--orange); color: var(--orange-ink); }
.store-filters [aria-pressed=true] span { color: inherit; }
.reference-note { margin: 10px 0; max-width: 90ch; }
.store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.store-card { min-width: 0; border: var(--border); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 16px; }
.store-card.selected { outline: 2px solid var(--orange-ink); outline-offset: 3px; }
.work-select { background: none; border: 0; padding: 0; min-width: 0; text-align: left; }
.work-art { display: block; position: relative; aspect-ratio: 657 / 224; overflow: hidden; background: #fff1e3; }
.card-portrait { display: block; width: 100%; height: 100%; padding: 12px; object-fit: contain; }
.work-name { display: block; font-size: 18px; font-weight: 500; padding: 16px 4px 0; overflow-wrap: anywhere; }
.store-card > .btn { margin-top: auto; width: 100%; min-width: 0; box-shadow: none; }
.store-card > .owned-label, .store-card > span { margin-top: auto; padding: 8px 4px; font-size: 13px; }
.owned-label { color: #285b3c; }
.reference-price { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.missing-art { display: flex; height: 100%; align-items: center; justify-content: center; padding: 20px; color: var(--muted); }
.selected-work { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; border: var(--border); background: var(--orange-light); padding: 18px 24px; margin-top: 28px; }
.selected-order { flex-basis: 100%; border-top: 1px solid var(--soft-line); padding-top: 12px; }
.selected-order p { margin: 0; overflow-wrap: anywhere; }
.selected-order .actions { margin-top: 12px; }
.selected-work strong { flex: 1; min-width: 160px; font-weight: 500; overflow-wrap: anywhere; }
.store-layout .page-body > p { max-width: 90ch; color: var(--muted); font-size: 13px; margin: 24px 0; }
.store-layout .page-body > .panel { margin-top: 40px; }
.work-preview > .lede { margin-top: 0; }
.work-details { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; gap: 32px; margin: 28px 0; }
.work-details > div > p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.work-details .panel { margin: 0; }
.work-details .panel .btn { width: 100%; margin-top: 16px; }
.scene-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; }
.scene-previews figure { min-width: 0; }
.scene-previews img { width: 100%; aspect-ratio: 1; object-fit: contain; border: var(--border); background: var(--surface); }
.scene-previews figcaption { font-size: 12px; color: var(--muted); padding-top: 8px; overflow-wrap: anywhere; }

.footer { border-top: var(--border); max-width: 1180px; margin: 0 auto; padding: 24px 0 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: var(--muted); font-size: 12px; }
#footer { padding: 0 var(--gutter); }
.footer button { min-height: 44px; padding: 8px 0; background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: relative; width: auto; height: auto; clip-path: none; padding: 12px var(--gutter); display: block; background: var(--ink); color: var(--surface); }

@media (max-width: 1000px) {
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .account-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 800px) {
  #content.auth-layout { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); }
  .auth-aside, .auth-body { padding: 28px; }
  .auth-aside h2 { font-size: 24px; }
  .work-details { grid-template-columns: minmax(0, 1fr); }
  .work-details .panel { max-width: none; }
}
@media (max-width: 820px) {
  .header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding-block: 10px; }
  .brand { grid-area: 1 / 1; }
  .header nav { grid-area: 2 / 1 / 3 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .header-tools { grid-area: 1 / 2; border: 0; padding: 0; }
  .header select { max-width: 126px; }
  .nav-link { font-size: 13px; padding: 10px 4px; }
  .nav-link[aria-current=page]::after { left: 4px; right: 4px; }
}
@media (max-width: 680px) {
  .brand .wordmark { height: 24px; }
  #content { margin-top: 28px; margin-bottom: 48px; }
  #content.auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { position: relative; min-height: 184px; padding: 24px; border-right: 0; border-bottom: var(--border); flex-direction: row; align-items: center; gap: 16px; }
  .auth-aside > div { position: relative; flex: 1; min-width: 0; }
  .auth-aside h2 { font-size: 22px; }
  .auth-aside .eyebrow { font-size: 10px; letter-spacing: 1px; }
  .welcome-cast { flex: 0 0 42%; gap: 10px; }
  .welcome-cast img { max-height: 170px; }
  .welcome-cast figcaption { font-size: 11px; padding-top: 8px; }
  .auth-body { padding: 28px 24px; }
  .account-shell { grid-template-columns: minmax(0, 1fr); gap: 28px; min-height: 0; }
  .account-sidebar { position: static; }
  .account-sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .account-category { font-size: 12px; padding: 10px 6px; gap: 6px; flex-direction: column; justify-content: flex-start; text-align: center; }
  .account-sidebar-session { margin-top: 16px; padding-top: 16px; }
  .account-sidebar-session .btn { width: auto; }
  .account-content { gap: 16px; }
  .device-summary > .btn { flex-basis: 100%; }
  .store-tools { align-items: flex-start; gap: 16px; }
  .store-tools > h1 { width: 100%; }
  .store-search { width: 100%; min-width: 0; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .store-tools > .btn { width: 100%; }
  .store-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .selected-work { padding: 18px; }
  .selected-work strong { flex-basis: 100%; }
  .selected-work .btn { flex: 1 1 140px; }
  .actions > .btn { flex: 1 1 160px; }
  .task-layout .page-body > .btn { display: flex; width: 100%; margin-right: 0; }
  .task-layout .page-body > .actions { display: flex; width: 100%; }
}
@media (max-width: 360px) {
  .auth-aside { padding: 20px; gap: 10px; }
  .auth-aside h2 { font-size: 20px; }
  .auth-body { padding: 24px 20px; }
  .header .wordmark { height: 22px; }
  .scene-previews { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
