/* Shared frontend elements and page patterns. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; font-size: 16px; }
body { margin: 0; color: var(--text); background: var(--canvas); font: 400 var(--text-base)/1.75 var(--font-body); }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { line-height: 1.45; font-weight: 650; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 2.5rem); } h2 { font-size: clamp(1.5rem, 3vw, 2rem); } h3 { font-size: var(--text-lg); }
a { color: inherit; text-decoration: none; } a:hover { color: var(--brand); }
button,input,select,textarea { font: inherit; } button,a,input,select,textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; } img { display: block; max-width: 100%; }
button:disabled { cursor: not-allowed; opacity: .55; }
:where(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
[v-cloak],[hidden] { display: none !important; }
.container { width: min(var(--content-width), calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 99; background: var(--surface); padding: 12px 20px; border: 2px solid var(--brand); }
.skip-link:focus { top: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; min-height: 48px; padding: 11px 24px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-size: var(--text-base); font-weight: 600; line-height: 1.5; text-align: center; transition: background .15s, border-color .15s; }
.button:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.button-outline { background: transparent; color: var(--brand); }
.button-quiet { background: transparent; color: var(--text); border-color: var(--input-border); }
.button-quiet:hover { color: var(--brand); background: var(--brand-soft); border-color: var(--brand); }
.button[aria-busy="true"] { cursor: wait; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 18px; min-height: var(--touch-size); color: var(--brand); font-size: var(--text-sm); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-pending { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.panel { min-width: 0; padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.field { display: grid; gap: 8px; min-width: 0; }
.field>label,.field-label { font-size: var(--text-sm); font-weight: 650; }
.field input,.field select,.field textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: var(--text-base); line-height: 1.5; }
.field textarea { min-height: 128px; resize: vertical; }
.field :disabled { color: var(--text-muted); background: #f3efef; cursor: not-allowed; opacity: 1; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-help,.field-error { font-size: var(--text-sm); }
.field-help { color: var(--text-muted); } .field-error { color: var(--danger); }
.check-field { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--text-sm); }
.check-field input { accent-color: var(--brand); width: 20px; height: 20px; flex-shrink: 0; }
.alert { display: grid; gap: 3px; padding: 16px 20px; border: 1px solid currentColor; border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--info); background: var(--info-soft); }
.alert-success { color: var(--success); background: var(--success-soft); }
.alert-warning { color: var(--warning); background: var(--warning-soft); }
.alert-danger { color: var(--danger); background: var(--danger-soft); }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 28px; border: 1px dashed var(--input-border); border-radius: var(--radius-md); color: var(--text-muted); background: var(--surface-soft); text-align: center; font-size: var(--text-sm); }
.empty-state>span { font-size: 38px; color: var(--brand); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--text-muted); font-size: var(--text-sm); margin-bottom: 32px; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.breadcrumbs>span { display: inline-flex; align-items: center; min-height: 44px; }
.page-shell { padding-block: 28px 72px; min-height: 60vh; }
.page-heading { max-width: var(--reading-width); margin-bottom: 40px; }
.page-heading .eyebrow { margin-bottom: 12px; }
.page-description { margin-top: 16px; color: var(--text-muted); font-size: var(--text-base); }
.pending-panel { max-width: var(--reading-width); margin: 0 auto; padding: 52px 32px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-panel); }
.pending-panel h1 { margin-top: 16px; }
.pending-mark { color: var(--brand); font: 64px/1 var(--font-accent); margin-bottom: 24px; }
.pending-note { margin: 24px 0 32px; color: var(--text-muted); }
.related-section { max-width: var(--reading-width); margin: 48px auto 0; }
.related-section h2 { font-size: var(--text-xl); margin-bottom: 20px; }
.quick-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.quick-links a { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.quick-links a:hover { border-color: var(--brand); background: var(--brand-soft); }
.design-section { padding-block: 36px; border-top: 1px solid var(--border); scroll-margin-top: 120px; }
.design-section>h2 { margin-bottom: 8px; }.design-intro { color: var(--text-muted); margin-bottom: 24px; font-size: var(--text-sm); }
.design-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }.design-stack { display: grid; gap: 16px; align-content: start; }
.design-contents { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-block: 24px 40px; }
.design-contents a { display: flex; align-items: center; min-height: 44px; color: var(--brand); border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.swatches { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 16px; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.swatch-color { height: 80px; }.swatch div:last-child { padding: 12px; font-size: var(--text-sm); }.swatch small { display: block; font-size: var(--text-xs); color: var(--text-muted); }
.type-samples { display: grid; gap: 22px; }.type-samples>div { display: grid; grid-template-columns: 120px minmax(0,1fr); align-items: baseline; gap: 24px; }.type-samples small { color: var(--text-muted); font-size: var(--text-xs); }
.type-display { font-size: clamp(2rem,4vw,2.5rem); font-weight: 650; }.type-heading { font-size: var(--text-2xl); font-weight: 650; }.type-card { font-size: var(--text-lg); font-weight: 650; }
.type-meta { font-size: var(--text-sm); color: var(--text-muted); }.type-caption { font-size: var(--text-xs); color: var(--text-muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tabs button { padding: 12px 16px; min-height: 48px; color: var(--text-muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font-size: var(--text-sm); }
.tabs [aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.preview-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.preview-pager button { min-width: 44px; min-height: 44px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.preview-pager [aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.preview-pager button:hover:not(:disabled) { border-color: var(--brand); }
.reading-preview { max-width: var(--reading-width); }.reading-preview h3 { margin-block: 24px 12px; }.reading-preview p+p { margin-top: 16px; }
.chat-preview { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-soft); }
.chat-preview>header { background: var(--surface); padding: 16px 20px; border-bottom: 1px solid var(--border); }.chat-messages { padding: 24px; display: grid; gap: 20px; }
.chat-bubble { justify-self: start; max-width: 85%; padding: 12px 16px; border-radius: 12px 12px 12px 2px; background: var(--surface); border: 1px solid var(--border); font-size: var(--text-sm); }
.chat-bubble.is-self { justify-self: end; background: var(--brand-soft); border-color: #d9b0c0; border-radius: 12px 12px 2px 12px; }.chat-bubble small { display: block; color: var(--text-muted); font-size: var(--text-xs); margin-top: 6px; }
.locked-preview { text-align: center; background: var(--brand-soft); display: grid; place-content: center; gap: 16px; min-height: 260px; }.locked-preview>span { font-size: 32px; color: var(--brand); }.locked-preview p { color: var(--text-muted); font-size: var(--text-sm); }
.frontend-dialog { max-width: min(480px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-panel); }
.frontend-dialog::backdrop { background: rgb(41 36 43 / 45%); }.dialog-content { padding: 32px; }.dialog-content p { margin-block: 16px 24px; color: var(--text-muted); }.dialog-content .button-row { justify-content: flex-end; }.dialog-content h2 { font-size: var(--text-xl); }
.preview-message { min-height: 28px; color: var(--success); font-size: var(--text-sm); margin-top: 16px; }
.numeric { font-variant-numeric: tabular-nums; }.list-preview { list-style: none; padding: 0; margin: 0; }.list-preview li { padding: 16px 0; border-bottom: 1px solid var(--border); }.list-preview li:first-child { padding-top: 0; }.list-preview time { display: block; font-size: var(--text-xs); color: var(--text-muted); }
@media(max-width:1100px) { .container { width: calc(100% - 56px); }.swatches { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:800px) { html { scroll-padding-top: 90px; }.container { width: calc(100% - 40px); }.design-grid { grid-template-columns: 1fr; }.type-samples>div { grid-template-columns: 90px minmax(0,1fr); gap: 16px; }.panel { padding: 24px; }.page-shell { padding-bottom: 48px; } }
@media(max-width:480px) { .container { width: calc(100% - 32px); }.swatches { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.pending-panel { padding: 36px 20px; }.pending-note { font-size: var(--text-sm); }.quick-links { grid-template-columns: 1fr; }.page-heading { margin-bottom: 28px; }.design-section { padding-block: 28px; }.type-samples>div { grid-template-columns: 1fr; gap: 6px; }.dialog-content { padding: 24px; }.dialog-content .button-row .button { flex: 1; }.button { gap: 16px; }.design-contents { gap: 8px 16px; }.tabs button { padding-inline: 12px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } *,*::before,*::after { transition: none !important; animation: none !important; } }
