/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio. */
@layer od-layout {
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }
  .od-stack { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill { flex: 1 1 0; min-width: 0; }
  .od-fixed { flex: none; }
  .od-grid { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }
  .od-stat,.od-field,.od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2,.od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap { white-space: nowrap; }
  .od-keep { word-break: keep-all; overflow-wrap: anywhere; }
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }
  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch { min-width: 44px; min-height: 44px; }
}
/* /OD-LAYOUT-PRIMITIVES v1 */

/* Apple-inspired Personal Catalog styling. Device hardware remains in the seed. */
body { background: var(--stage-bg); color: var(--fg); font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-body); letter-spacing: -.015em; }
.device { width: 417px; height: 876px; border-radius: 60px; }
.screen { border-radius: 48px; }
.island { width: 126px; height: 37px; }
.caption { color: var(--muted); }
.caption strong { color: var(--fg); }
.screen, .content { background: var(--bg); }
.content { padding: 0 0 24px; scroll-behavior: smooth; }
.statusbar { color: var(--fg); }
.statusbar svg { fill: var(--fg); }
.home-indicator::after { background: var(--fg); }
.home-indicator { z-index: 10; }
.tabbar { --tabs: 5; padding: 8px 7px 4px; background: var(--bg); border-top: 1px solid var(--border-soft); box-shadow: none; backdrop-filter: saturate(180%) blur(20px); }
.tabbar[hidden] { display: none; }
.tab { border: 0; background: transparent; font-family: var(--font-body); font-size: 11px; font-weight: 500; min-height: 56px; cursor: pointer; color: var(--muted); }
.tab.active { color: var(--accent); }
.tab.active svg { color: var(--accent); }
.tab svg { width: 21px; height: 21px; }
.tab:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.app-view { padding-bottom: 20px; }
.app-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 24px 22px 16px; }
.app-header.compact { align-items: center; padding-top: 12px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font: 600 11px/1.4 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.display { margin: 0; color: var(--fg); font: 600 34px/1.1 var(--font-display); letter-spacing: var(--tracking-display); }
.page-title { margin: 0; color: var(--fg); font: 600 29px/1.15 var(--font-display); letter-spacing: var(--tracking-display); }
.section-title { margin: 0; color: var(--fg); font: 600 23px/1.18 var(--font-display); letter-spacing: var(--tracking-display); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 22px; margin-bottom: 12px; }
.section-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--fg-2); font-size: 14px; text-decoration: none; white-space: nowrap; }
.icon-action { display: grid; place-items: center; flex: none; width: 44px; height: 44px; background: var(--surface); color: var(--fg); border: 1px solid var(--border-soft); border-radius: 50%; box-shadow: none; }
.icon-action svg,.mini-icon { display: block; width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back-action { background: transparent; border-color: transparent; box-shadow: none; margin-left: -8px; }
.hero-intro { margin: 0 22px 28px; padding: 18px 20px; background: var(--surface-warm); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); box-shadow: none; }
.hero-intro strong { display: block; font: 600 19px/1.35 var(--font-display); letter-spacing: -.02em; }
.hero-intro p { margin: 6px 0 0; color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.home-section { margin-bottom: 32px; }
.od-rail { --od-gap: 12px; --od-rail-pad: 22px; }
.product-card { display: block; width: 168px; padding: 0; border: 0; background: transparent; color: var(--fg); text-align: left; font: inherit; text-decoration: none; cursor: pointer; }
.product-card .image-shell { display: block; overflow: hidden; background: var(--image-bg); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); box-shadow: none; transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard); }
.product-card img { display: block; width: 100%; height: auto; }
.image-fallback { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 16px; background: var(--image-bg); color: var(--muted); font: 500 12px/1.4 var(--font-mono); text-align: center; }
.product-card .card-meta { display: block; padding: 10px 2px 0; }
.product-card .brand { display: block; margin-top: 5px; color: var(--muted); font: 500 12px/1.35 var(--font-body); text-transform: uppercase; letter-spacing: .02em; }
.product-card .product-name { display: block; color: var(--fg); font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.product-card .status-text { display: block; margin-top: 5px; color: var(--fg-2); font-size: 12px; }
.product-grid { --od-cols: 2; --od-gap: 18px 12px; padding: 0 22px 22px; }
.product-grid .product-card { width: 100%; }
.product-grid .card-meta { padding-top: 9px; }
.chip-rail { --od-gap: 8px; --od-rail-pad: 22px; margin: 2px 0 22px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 15px; border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); border-radius: var(--radius-pill); box-shadow: none; font-size: 13px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.home-category-rail { margin-top: 0; }
.home-category-rail .chip { font-size: 14px; }
.home-category-rail .chip span { display: block; }
.home-category-rail .chip span:last-child { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 6px 22px; border: 0; background: transparent; color: var(--fg); width: 100%; text-align: left; box-shadow: 0 1px 0 var(--border-soft); }
.collection-row span { display: block; }
.collection-row .count { color: var(--muted); font: 13px var(--font-mono); }
.section-gap { margin-top: 28px; }
.empty-state { margin: 20px 22px; padding: 30px 22px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); box-shadow: none; }
.empty-state h2 { margin: 0 0 7px; font: 600 22px/1.25 var(--font-display); }
.empty-state p { margin: 0 0 18px; color: var(--fg-2); font-size: 15px; line-height: 1.5; }
.primary-button,.secondary-button,.text-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 11px 16px; border-radius: var(--radius-pill); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard); }
.primary-button { border: 0; background: var(--accent); color: var(--accent-on); }
.secondary-button { border: 1px solid var(--border); background: var(--bg); color: var(--fg); box-shadow: none; }
.text-button { border: 0; background: transparent; color: var(--fg); }
.full { width: 100%; }
.button-row { display: flex; gap: 10px; }
.button-row > * { flex: 1; min-width: 0; }
.content-block { padding: 0 22px; }
.detail-hero { display: block; width: calc(100% - 44px); margin: 0 22px 22px; border-radius: var(--radius-lg); background: var(--image-bg); overflow: hidden; box-shadow: 0 0 0 1px var(--border-soft); }
.detail-hero img { display: block; width: 100%; height: auto; }
.detail-head { padding: 0 22px; }
.detail-brand { display: block; color: var(--muted); font: 500 12px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .03em; }
.detail-name { margin: 5px 0 14px; font: 600 30px/1.15 var(--font-display); letter-spacing: var(--tracking-display); overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-pill); color: var(--fg-2); font-size: 12px; box-shadow: none; }
.detail-actions { display: flex; gap: 10px; padding: 18px 22px 0; }
.detail-actions > * { flex: 1; }
.detail-section { padding: 0 22px; margin-top: 30px; }
.detail-section .section-head { padding: 0; }
.note-card { padding: 14px 0; box-shadow: 0 -1px 0 var(--border); }
.note-card:first-of-type { box-shadow: none; }
.note-date { display: block; color: var(--muted); font: 500 12px/1.4 var(--font-mono); }
.note-period { display: block; margin-top: 2px; color: var(--fg); font-size: 14px; font-weight: 600; }
.note-card p { margin: 8px 0 0; color: var(--fg-2); font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card img { display: block; max-width: 100%; height: auto; margin-top: 12px; border-radius: var(--radius-md); }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; box-shadow: 0 -1px 0 var(--border); }
.info-row dt { flex: none; color: var(--muted); font-size: 14px; }
.info-row dd { margin: 0; color: var(--fg); font-size: 15px; text-align: right; overflow-wrap: anywhere; }
.original-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-active); font-size: 15px; text-underline-offset: 3px; }
.form-stack { display: grid; gap: 18px; padding: 4px 22px 30px; }
.field { display: grid; gap: 7px; }
.field label { display: block; color: var(--fg); font-size: 14px; font-weight: 600; }
.field small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.field input,.field textarea,.field select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--fg); box-shadow: none; font-size: 16px; }
.field textarea { min-height: 108px; resize: vertical; }
.field input::placeholder,.field textarea::placeholder { color: var(--muted); }
.field input[type="file"] { padding: 12px; font-size: 13px; }
.field input[type="date"] { color-scheme: light; }
.form-error { margin: 0; color: var(--error); font-size: 14px; line-height: 1.5; }
.form-tip { margin: 0; color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.form-divider { margin: 6px 0 0; padding-top: 18px; box-shadow: 0 -1px 0 var(--border); }
.preview-image { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }
.search-box { padding: 0 22px 14px; }
.search-box input { width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); color: var(--fg); box-shadow: none; font-size: 16px; }
.search-box input::placeholder { color: var(--muted); }
.message-line { padding: 0 22px 18px; color: var(--muted); font-size: 13px; }
.sheet-scrim { position: absolute; inset: 0; z-index: 6; background: var(--scrim); opacity: 1; transition: opacity var(--motion-fast) var(--ease-standard); }
.sheet { position: absolute; z-index: 7; bottom: 28px; left: 0; right: 0; padding: 20px 22px 25px; background: var(--bg); color: var(--fg); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px var(--shadow); }
.sheet h2 { margin: 0 0 14px; font: 600 23px/1.25 var(--font-display); }
.sheet .sheet-actions { display: grid; gap: 10px; }
.sheet .sheet-close { position: absolute; top: 12px; right: 16px; }
.toast { position: absolute; z-index: 9; left: 22px; right: 22px; bottom: 108px; padding: 13px 15px; background: var(--fg); color: var(--bg); border-radius: var(--radius-md); font-size: 14px; box-shadow: 0 10px 25px var(--shadow); }
.setting-row { display: flex; justify-content: space-between; gap: 12px; padding: 17px 22px; box-shadow: 0 -1px 0 var(--border); }
.setting-row strong,.setting-row span { display: block; }
.setting-row span { color: var(--muted); font-size: 14px; }
.sample-tag { display: inline-block; padding: 3px 8px; margin-left: 4px; border-radius: var(--radius-pill); background: var(--surface); color: var(--muted); font: 11px var(--font-body); }
@media (hover:hover) {
  .product-card:hover .image-shell { transform: translateY(-3px); box-shadow: var(--elev-raised); }
  .icon-action:hover,.secondary-button:hover,.chip:not([aria-pressed="true"]):hover { background: var(--surface-hover); }
  .primary-button:hover { background: var(--accent-hover); }
  .section-link:hover,.text-button:hover { color: var(--accent-active); }
}
.primary-button:active,.secondary-button:active { transform: scale(.98); }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition-duration: 0ms !important; animation-duration: 0ms !important; } }
@media (max-height:950px) and (min-width:481px) { .stage { zoom: .88; } }
@media (max-height:790px) and (min-width:481px) { .stage { zoom: .75; } }
@media (max-width:480px) {
  body { display: block; padding: 0; }
  .stage { display: block; }
  .caption { display: none; }
  .device { width: 100%; height: 100dvh; padding: 0; border-radius: 0; box-shadow: none; background: var(--bg); }
  .device::before,.device::after,.btn-rail { display: none; }
  .screen { border-radius: 0; }
  .island { top: 10px; }
}
