/* ============================================================================
   PDC Marketplace — application styles
   Built on the PDC design tokens (tokens.css). Faithful to the design system:
   navy anchor + sage accent, Bricolage/Manrope/JetBrains Mono, 4px grid,
   border+xs-shadow cards, no gradients as brand language, no emoji.
   ============================================================================ */

*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink-1); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--accent-200); color: var(--navy-900); }
:focus-visible { outline: none; box-shadow: var(--ring-blue); border-radius: var(--radius-sm); }

/* ---- App fade ---- */
#root { animation: app-in .4s var(--ease-out) both; }
@keyframes app-in { from { opacity: 0; } to { opacity: 1; } }
.route-fade { animation: route-in .26s var(--ease-out) both; }
@keyframes route-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ====== TOP NAV ====== */
.topbar { background: #fff; border-bottom: 1px solid var(--divider); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display:flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink:0; }
.brand img { height: 30px; width: auto; }
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink-1); letter-spacing: -0.01em; }
.brand .name span { color: var(--ink-3); font-weight: 500; }
.nav-links { display:flex; align-items:center; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; cursor: pointer; transition: background var(--dur-1) var(--ease-out); }
.nav-links a:hover { background: var(--navy-100); color: var(--ink-1); text-decoration:none; }
.nav-links a.active { color: var(--ink-1); font-weight: 600; }
.topbar-search { flex: 1; max-width: 380px; position: relative; }
.topbar-search input { width: 100%; border: 1px solid var(--border); background: var(--navy-50); border-radius: 999px; padding: 9px 14px 9px 36px; font-size: 13px; font-family: var(--font-sans); color: var(--ink-1); outline: none; transition: all var(--dur-1) var(--ease-out); }
.topbar-search input:focus { background:#fff; border-color: var(--border-strong); box-shadow: var(--ring-blue); }
.topbar-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); display:flex; }
.topbar-actions { display:flex; gap: 8px; align-items: center; margin-left: auto; }
.topbar-actions .btn { padding: 8px 16px; font-size: 14px; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; position: relative; transition: background var(--dur-1) var(--ease-out); }
.icon-btn:hover { background: var(--navy-100); color: var(--ink-1); }
.icon-btn .badge-count { position:absolute; top:2px; right:2px; min-width:16px; height:16px; padding:0 4px; background:var(--accent-500); color:var(--navy-900); border-radius:999px; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; font-family:var(--font-mono); border:2px solid #fff; }
.hamburger { display:none; }

/* ====== CATEGORY STRIP ====== */
.cat-strip { background: var(--navy-50); border-bottom: 1px solid var(--divider); }
.cat-strip-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display:flex; align-items: center; gap: 18px; overflow-x: auto; scrollbar-width: thin; }
.cat-strip a { display: inline-flex; align-items: center; gap: 6px; padding: 12px 0; font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; cursor:pointer; transition: color var(--dur-1) var(--ease-out); }
.cat-strip a:hover { color: var(--ink-1); text-decoration:none; }
.cat-strip a.active { color: var(--ink-1); border-bottom-color: var(--accent-500); }

/* ====== BUTTONS ====== */
.btn { display: inline-flex; align-items: center; justify-content:center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-family: var(--font-sans); font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: all var(--dur-1) var(--ease-out); white-space: nowrap; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn-primary { background: var(--navy-700); color:#fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-600); }
.btn-primary:active { background: var(--navy-800); transform: translateY(1px); }
.btn-accent { background: var(--accent-500); color: var(--ink-on-accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-600); }
.btn-accent:active { background: var(--accent-700); transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--ink-1); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--navy-50); border-color: var(--navy-400); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--navy-100); }

/* ====== HERO ====== */
.hero { background: radial-gradient(1100px 480px at 88% 18%, var(--accent-50) 0%, transparent 60%), radial-gradient(900px 420px at 6% 90%, var(--blue-50) 0%, transparent 60%), var(--navy-50); color: var(--ink-1); position: relative; overflow: hidden; border-bottom: 1px solid var(--divider); }
.hero-pattern { position: absolute; inset: 0; background-image: url("assets/pdc-monogram-navy.png"); background-repeat: repeat; background-size: 110px auto; opacity: 0.035; pointer-events: none; }
.hero-inner { max-width: 1280px; margin: 0 auto; padding: 72px 24px 88px; position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: 56px; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink-1); margin: 0 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent-700); }
.hero p { font-size: 17px; line-height: 1.6; color: var(--ink-3); margin: 0 0 28px; max-width: 540px; }
.hero-search { background: #fff; border-radius: 14px; padding: 6px; display: flex; gap: 6px; box-shadow: var(--shadow-md); max-width: 560px; border: 1px solid var(--border); }
.hero-search input { flex: 1; border: 0; background: transparent; padding: 12px 16px; font-size: 15px; font-family: var(--font-sans); outline: none; color: var(--ink-1); }
.hero-stats { display: flex; gap: 36px; margin-top: 28px; }
.hero-stats div .num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--ink-1); letter-spacing: -0.02em; }
.hero-stats div .lbl { font-size: 12px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }

.doc-stack { position: relative; height: 360px; perspective: 1000px; }
.doc { position: absolute; width: 280px; aspect-ratio: 8.5 / 11; background: #fff; border-radius: 8px; box-shadow: 0 18px 48px rgba(27,35,48,0.18), 0 4px 12px rgba(27,35,48,0.08); padding: 22px 20px; border: 1px solid var(--border); transition: transform var(--dur-3) var(--ease-out); }
.doc::before { content:""; display:block; height: 14px; width: 60%; background: var(--navy-700); border-radius: 2px; margin-bottom: 8px; }
.doc .lines { display:flex; flex-direction:column; gap: 5px; margin-top: 10px; }
.doc .lines div { height: 4px; background: var(--navy-200); border-radius: 2px; }
.doc .lines div:nth-child(odd) { width: 90%; }
.doc .lines div:nth-child(3n) { width: 70%; }
.doc.d1 { right: 50px; top: 0; transform: rotate(-6deg); }
.doc.d2 { right: 130px; top: 30px; transform: rotate(2deg); }
.doc.d3 { right: 0px; top: 60px; transform: rotate(8deg); background: var(--accent-50); }
.doc.d3::before { background: var(--accent-700); }
.doc-stack:hover .doc.d1 { transform: rotate(-8deg) translateY(-6px); }
.doc-stack:hover .doc.d3 { transform: rotate(10deg) translateY(-6px); }

/* ====== SECTION ====== */
.section { padding: 72px 0; }
.section-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-head { display:flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; gap: 24px; }
.section-head .eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin-bottom: 8px; }
.section-head h2 { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--ink-1); }
.section-head .sub { color: var(--ink-3); margin-top: 8px; font-size: 15px; max-width: 540px; }
.section.alt { background: var(--navy-50); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px; display: flex; align-items: flex-start; gap: 14px; text-decoration: none; color: var(--ink-1); transition: all var(--dur-2) var(--ease-out); cursor: pointer; }
.cat-card:hover { border-color: var(--navy-300); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration:none; }
.cat-card .icon-tile { width: 44px; height: 44px; border-radius: 10px; background: var(--navy-50); display:flex; align-items:center; justify-content:center; color: var(--navy-700); flex-shrink: 0; }
.cat-card .name { font-weight: 700; font-size: 15px; color: var(--ink-1); line-height: 1.3; margin-bottom: 4px; }
.cat-card .count { font-size: 12px; color: var(--ink-4); font-family: var(--font-mono); }

/* ====== PROJECT CARD ====== */
.proj-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.proj-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.proj-card { background:#fff; border:1px solid var(--border); border-radius: 14px; overflow: hidden; transition: all var(--dur-2) var(--ease-out); cursor: pointer; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.proj-card:hover { border-color: var(--navy-300); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration:none; }
.proj-thumb { aspect-ratio: 16/10; position: relative; overflow: hidden; background: var(--navy-700); }
.proj-thumb-doc { position:absolute; inset: 18px 18px 0 18px; bottom: -14px; background:#fff; border-radius: 6px 6px 0 0; transform: rotate(-3deg); box-shadow: 0 10px 28px rgba(0,0,0,0.3); padding: 16px; transition: transform var(--dur-2) var(--ease-out); }
.proj-card:hover .proj-thumb-doc { transform: rotate(-2deg) translateY(-3px); }
.proj-thumb-doc::before { content:""; display:block; height: 8px; width: 60%; background: var(--navy-700); border-radius: 2px; margin-bottom: 8px; }
.proj-thumb-doc div { height: 3px; background: var(--navy-200); border-radius: 2px; margin-bottom: 4px; }
.proj-thumb-doc div:nth-child(odd) { width: 90%; }
.proj-thumb-doc div:nth-child(3n) { width: 70%; }
.proj-badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; flex-wrap:wrap; justify-content:flex-end; max-width:75%; }
.badge-pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.6; }
.bp-bank { background: rgba(255,255,255,0.94); color: var(--navy-700); }
.bp-new  { background: var(--accent-500); color: var(--ink-on-accent); }
.bp-free { background: var(--success-50); color: var(--success-600); }
.bp-en   { background: var(--blue-50); color: var(--blue-700); }
.bp-owned{ background: var(--navy-900); color:#fff; }
.proj-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.proj-meta { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin-bottom: 8px; }
.proj-title { font-weight: 700; font-size: 15px; color: var(--ink-1); line-height: 1.3; margin-bottom: 8px; min-height: 38px; }
.proj-specs { display:flex; gap: 12px; font-size: 12px; color: var(--ink-3); margin-top: auto; }
.proj-specs span { display:inline-flex; align-items: center; gap: 4px; }
.proj-footer { display:flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.proj-price { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--ink-1); }
.proj-price .c { color: var(--ink-3); font-size: 0.75em; margin-left: 1px; }
.proj-price.free { color: var(--success-600); font-family: var(--font-sans); font-size: 14px; }

/* ====== BROWSE ====== */
.detail-shell { max-width: 1280px; margin: 0 auto; padding: 36px 24px 64px; }
.breadcrumb { display:flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-4); margin-bottom: 20px; flex-wrap:wrap; }
.breadcrumb a { color: var(--ink-3); text-decoration: none; cursor:pointer; }
.breadcrumb a:hover { color: var(--ink-1); }
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: flex-start; }
.filter-aside { position: sticky; top: 92px; }
.filter-group { margin-bottom: 24px; }
.filter-col { display: flex; flex-direction: column; gap: 2px; }
.side-item { display:flex; justify-content:space-between; align-items:center; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-3); background: transparent; border:0; width:100%; text-align:left; cursor:pointer; font-weight:500; transition: background var(--dur-1) var(--ease-out); }
.side-item:hover { background: var(--navy-50); color: var(--ink-1); }
.side-item.active { color: var(--ink-1); background: var(--navy-100); font-weight: 600; }
.side-item .ct { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }
.check { display:flex; gap:8px; align-items:center; font-size:13px; color:var(--ink-2); cursor:pointer; padding:6px 0; }
.check input { accent-color: var(--navy-700); width:15px; height:15px; }
.browse-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 20px; gap:16px; flex-wrap:wrap; }
.browse-head h1 { font-family: var(--font-display); font-size: 28px; margin:0; font-weight:700; letter-spacing:-0.02em; }
.browse-head .cnt { font-size:13px; color:var(--ink-4); margin:4px 0 0; }
.select { appearance:none; padding: 8px 32px 8px 12px; border:1px solid var(--border-strong); border-radius:10px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2356657B' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; font-family:var(--font-sans); font-size:13px; color:var(--ink-1); cursor:pointer; }
.select:focus { outline:none; border-color: var(--blue-600); box-shadow: var(--ring-blue); }
.empty-state { padding: 64px; text-align:center; background:var(--navy-50); border-radius: 14px; color: var(--ink-3); }
.active-filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:5px 8px 5px 12px; border-radius:999px; background:var(--navy-100); color:var(--navy-700); font-size:12px; font-weight:600; }
.chip button { background:transparent; border:0; cursor:pointer; color:var(--navy-500); display:flex; padding:0; }
.chip button:hover { color:var(--danger-600); }

/* ====== DETAIL ====== */
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: flex-start; }
.detail-preview { position: sticky; top: 92px; }
.detail-doc-stage { background: var(--navy-50); border-radius: 16px; padding: 36px; aspect-ratio: 4/5; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.doc-mock { width: 80%; aspect-ratio: 8.5/11; background:#fff; border-radius: 4px; box-shadow: var(--shadow-lg); padding: 36px 30px; transform: rotate(-2deg); position: relative; transition: transform var(--dur-3) var(--ease-out); }
.doc-mock:hover { transform: rotate(0deg) scale(1.02); }
.doc-mock h4 { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.2; margin: 0 0 18px; color: var(--ink-1); }
.doc-mock .meta { font-size: 9px; letter-spacing: 0.14em; color: var(--ink-4); text-transform: uppercase; margin-bottom: 12px; font-weight: 700; }
.doc-mock .lines { display:flex; flex-direction:column; gap: 5px; }
.doc-mock .lines div { height: 4px; background: var(--navy-200); border-radius: 2px; }
.doc-mock .lines div:nth-child(odd) { width: 95%; }
.doc-mock .lines div:nth-child(3n) { width: 70%; }
.doc-mock .lines div:nth-child(5) { width: 40%; margin-bottom: 10px; }
.doc-thumbs { display:flex; gap:10px; margin-top:16px; justify-content:center; }
.doc-thumbs button { width:44px; height:56px; border-radius:4px; border:1px solid var(--border); background:#fff; cursor:pointer; padding:6px; display:flex; flex-direction:column; gap:3px; transition: all var(--dur-1) var(--ease-out); }
.doc-thumbs button div { height:3px; background:var(--navy-200); border-radius:1px; }
.doc-thumbs button.active { border-color: var(--accent-500); box-shadow: var(--ring); }
.detail-info h1 { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 16px; }
.detail-tags { display:flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tag { padding: 5px 12px; border-radius: 999px; background: var(--navy-100); color: var(--navy-700); font-size: 12px; font-weight: 600; }
.tag.accent { background: var(--accent-50); color: var(--accent-700); }
.tag.blue { background: var(--blue-50); color: var(--blue-700); }
.detail-info .desc { font-size: 16px; line-height: 1.7; color: var(--ink-3); margin-bottom: 28px; }
.spec-table { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; padding: 20px 24px; background: var(--navy-50); border-radius: 12px; margin-bottom: 28px; }
.spec-table dt { font-size: 13px; color: var(--ink-4); font-weight: 500; }
.spec-table dd { font-size: 13px; color: var(--ink-1); font-weight: 600; margin: 0; }
.spec-table dd.mono { font-family: var(--font-mono); font-weight: 500; }
.buy-card { background:#fff; border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-sm); }
.buy-card .row { display:flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.buy-card .price-big { font-family: var(--font-mono); font-size: 36px; font-weight: 600; color: var(--ink-1); letter-spacing: -0.02em; }
.buy-card .price-big.free { color: var(--success-600); font-family: var(--font-sans); font-size: 28px; }
.buy-card .price-big .c { color: var(--ink-3); font-size: 0.6em; margin-left: 4px; }
.buy-card .price-meta { font-size: 12px; color: var(--ink-4); margin-top: 4px; }
.buy-card .btn { width: 100%; padding: 14px; }
.buy-sub { display:flex; gap:10px; margin-top:10px; }
.buy-sub .btn { flex:1; }
.buy-note { display:flex; gap:10px; align-items:flex-start; margin-top:18px; font-size:12px; color:var(--ink-4); }
.owned-banner { display:flex; align-items:center; gap:10px; padding:12px 14px; background:var(--success-50); border-radius:10px; color:var(--success-600); font-size:13px; font-weight:600; margin-bottom:14px; }
.toc-block { margin-top: 36px; }
.toc-block h3 { font-size: 18px; font-weight: 700; margin: 0 0 12px; color: var(--ink-1); }
.toc-list { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; padding: 12px 0; border-bottom: 1px solid var(--divider); display:flex; gap: 14px; font-size: 14px; color: var(--ink-2); }
.toc-list li::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); color: var(--ink-4); font-size: 12px; }
.related { margin-top: 64px; }
.related h2 { font-family:var(--font-display); font-size:24px; font-weight:700; letter-spacing:-0.02em; margin:0 0 20px; }

/* ====== CART / ACCOUNT ====== */
.page-h1 { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 28px; }
.cart-layout { display:grid; grid-template-columns: 1fr 360px; gap: 36px; align-items: flex-start; }
.cart-list { display:flex; flex-direction:column; gap: 12px; }
.cart-row { display:grid; grid-template-columns: 90px 1fr auto; gap: 18px; align-items:center; background:#fff; border:1px solid var(--border); border-radius: 14px; padding: 16px; }
.cart-thumb { width: 90px; aspect-ratio: 8.5/11; background: var(--navy-700); border-radius: 6px; position: relative; overflow:hidden; }
.cart-thumb div { position:absolute; inset:8px 8px 0; bottom:-4px; background:#fff; border-radius:3px 3px 0 0; transform:rotate(-3deg); }
.cart-meta-lbl { font-size: 11px; letter-spacing: 0.1em; text-transform:uppercase; color: var(--ink-4); font-weight: 700; margin-bottom: 4px; }
.summary-card { background:#fff; border:1px solid var(--border); border-radius: 14px; padding: 24px; position: sticky; top: 92px; }
.summary-card h3 { margin: 0 0 16px; font-size: 17px; font-weight: 700; }
.summary-row { display:flex; justify-content:space-between; padding: 8px 0; font-size: 14px; color: var(--ink-3); }
.summary-row.tot { padding: 14px 0 20px; font-weight: 700; }
.summary-row.tot .v { font-family: var(--font-mono); font-size: 22px; color: var(--ink-1); }
.summary-mono { font-family: var(--font-mono); font-weight: 500; color: var(--ink-1); }
.account-grid { display:grid; grid-template-columns: 240px 1fr; gap:36px; align-items:flex-start; }
.account-side { background:#fff; border:1px solid var(--border); border-radius:14px; padding:8px; position:sticky; top:92px; }
.account-side .who { padding:16px; border-bottom:1px solid var(--divider); margin-bottom:8px; }
.account-side .who .av { width:44px; height:44px; border-radius:50%; background:var(--navy-700); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-family:var(--font-display); margin-bottom:10px; }
.account-side .who .nm { font-weight:700; font-size:15px; color:var(--ink-1); }
.account-side .who .em { font-size:12px; color:var(--ink-4); margin-top:2px; word-break:break-all; }
.account-side button { display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:10px 12px; border:0; background:transparent; border-radius:8px; font-size:13px; font-weight:600; color:var(--ink-3); cursor:pointer; }
.account-side button:hover { background:var(--navy-50); color:var(--ink-1); }
.account-side button.active { background:var(--navy-100); color:var(--ink-1); }
.dl-row { display:grid; grid-template-columns:auto 1fr auto; gap:16px; align-items:center; background:#fff; border:1px solid var(--border); border-radius:12px; padding:16px 18px; }
.dl-row .ic { width:40px; height:40px; border-radius:10px; background:var(--navy-50); display:flex; align-items:center; justify-content:center; color:var(--navy-700); }

/* ====== GUIDE ====== */
.guide-shell { max-width: 920px; margin: 0 auto; padding: 56px 24px 80px; }
.guide-shell h1 { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.guide-shell .lead { font-size: 17px; line-height: 1.6; color: var(--ink-3); margin-bottom: 40px; max-width: 660px; }
.step-list { display: flex; flex-direction: column; gap: 16px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 20px; align-items: flex-start; background:#fff; border:1px solid var(--border); border-radius: 14px; padding: 24px 28px; }
.step-num { width: 44px; height: 44px; border-radius: 12px; background: var(--navy-700); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.step h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--ink-1); }
.step p { font-size: 14px; line-height: 1.6; color: var(--ink-3); margin: 0; }
.step.qpay { background: var(--accent-50); border-color: var(--accent-200); }
.step.qpay .step-num { background: var(--accent-500); color: var(--ink-on-accent); }
.faq { margin-top: 56px; }
.faq h2 { font-size: 28px; font-family: var(--font-display); font-weight: 700; margin: 0 0 20px; letter-spacing: -0.02em; }
.faq-item { background:#fff; border:1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin-bottom: 10px; }
.faq-item summary { font-weight: 600; cursor: pointer; font-size: 15px; color: var(--ink-1); list-style: none; display:flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 18px; color: var(--ink-4); }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 12px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-3); }

/* ====== AUTH ====== */
.auth-shell { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: radial-gradient(700px 420px at 80% 15%, var(--accent-50) 0%, transparent 65%), radial-gradient(600px 360px at 10% 95%, var(--blue-50) 0%, transparent 65%), var(--navy-50); color: var(--ink-1); padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::before { content:""; position:absolute; inset:0; background-image: url("assets/pdc-monogram-navy.png"); background-size: 200px; background-repeat: no-repeat; background-position: -40px 120%; opacity: 0.06; }
.auth-aside h2 { font-family: var(--font-display); font-size: 36px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; color: var(--ink-1); margin: 0 0 16px; position: relative; z-index: 1; }
.auth-aside p { color: var(--ink-3); font-size: 15px; line-height: 1.6; max-width: 360px; position: relative; z-index: 1; }
.auth-aside .quote { font-size: 14px; color: var(--ink-2); border-left: 2px solid var(--accent-500); padding-left: 16px; position: relative; z-index: 1; }
.auth-form { padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; max-width: 480px; width:100%; }
.auth-form h1 { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.auth-form .lead { color: var(--ink-3); margin-bottom: 28px; font-size: 14px; }
.divider-or { text-align:center; position:relative; margin: 12px 0 16px; font-size:12px; color:var(--ink-4); }
.divider-or span { background:#fff; padding:0 12px; position:relative; z-index:1; }
.divider-or::before { content:""; position:absolute; top:50%; left:0; right:0; height:1px; background:var(--divider); }

/* ====== FORMS ====== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.input, .textarea { appearance: none; width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background:#fff; font-family: var(--font-sans); font-size: 14px; color: var(--ink-1); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.input:focus, .textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: var(--ring-blue); }
.input.err { border-color: var(--danger-600); }
.field-err { font-size:12px; color:var(--danger-600); }

/* ====== FOOTER ====== */
.footer { background: var(--navy-50); color: var(--ink-3); padding: 56px 0 28px; margin-top: 80px; border-top: 1px solid var(--divider); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.footer-top { display:grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid var(--divider); }
.footer .brand { color: var(--ink-1); margin-bottom: 14px; }
.footer .brand .name { color: var(--ink-1); }
.footer p { color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.footer h5 { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-1); margin: 0 0 14px; font-weight: 700; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 8px; }
.footer ul a { color: var(--ink-3); text-decoration: none; font-size: 13px; cursor:pointer; }
.footer ul a:hover { color: var(--ink-1); }
.footer-bot { padding-top: 20px; display:flex; justify-content: space-between; font-size: 12px; color: var(--ink-4); gap:16px; flex-wrap:wrap; }
.footer-bot .qpay { display:inline-flex; align-items:center; gap:8px; background: #fff; border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.footer-bot .qpay .dot { width: 7px; height: 7px; background: var(--success-600); border-radius: 50%; }

/* ====== MODAL / QPAY ====== */
.modal-scrim { position: fixed; inset: 0; background: rgba(27,35,48,0.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; animation: scrim .2s var(--ease-out) both; }
@keyframes scrim { from { opacity:0; } to { opacity:1; } }
.modal { background:#fff; border-radius: 18px; width: 460px; max-width: 100%; padding: 32px; box-shadow: var(--shadow-lg); position: relative; animation: modal-in .26s var(--ease-out) both; max-height: 92vh; overflow:auto; }
@keyframes modal-in { from { opacity:0; transform: translateY(10px) scale(.98); } to { opacity:1; transform:none; } }
.modal .close-x { position:absolute; top:14px; right:14px; }
.qr { width: 220px; height: 220px; margin: 0 auto; background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px; display:grid; grid-template-columns:repeat(25,1fr); gap:0; }
.qr div { aspect-ratio:1; }
.qpay-amount { margin-top:20px; padding:14px 20px; background:var(--navy-50); border-radius:12px; display:flex; justify-content:space-between; align-items:center; }
.qpay-status { display:flex; align-items:center; gap:10px; margin-top:14px; padding:10px 14px; border-radius:10px; font-size:12px; font-weight:600; }
.qpay-status.wait { background: var(--warning-50); color: var(--warning-600); }
.qpay-status.ok { background: var(--success-50); color: var(--success-600); }
.pulse { width:8px; height:8px; border-radius:999px; background:currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.3; } }
.spinner { width:48px; height:48px; border-radius:50%; border:3px solid var(--navy-100); border-top-color: var(--accent-500); animation: spin 1s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-check { width:64px; height:64px; border-radius:50%; background:var(--success-50); color:var(--success-600); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; animation: pop .4s var(--ease-out) both; }
@keyframes pop { 0%{ transform:scale(.4); opacity:0; } 60%{ transform:scale(1.1); } 100%{ transform:scale(1); opacity:1; } }

/* ====== TOASTS ====== */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display:flex; flex-direction:column; gap:10px; }
.toast { background:#fff; border:1px solid var(--border); border-left:3px solid var(--accent-500); border-radius:10px; box-shadow: var(--shadow-md); padding:14px 18px; display:flex; align-items:center; gap:12px; font-size:14px; color:var(--ink-1); min-width:260px; max-width:360px; animation: toast-in .3s var(--ease-out) both; }
.toast.ok { border-left-color: var(--success-600); }
.toast.info { border-left-color: var(--blue-600); }
.toast .tx { flex:1; }
@keyframes toast-in { from { opacity:0; transform: translateX(24px); } to { opacity:1; transform:none; } }

/* ====== PAGINATION ====== */
.pager { display:flex; gap:6px; justify-content:center; margin-top:36px; }
.pager button { min-width:36px; height:36px; border:1px solid var(--border); background:#fff; border-radius:8px; font-size:13px; font-weight:600; color:var(--ink-2); cursor:pointer; font-family:var(--font-mono); }
.pager button:hover:not(:disabled) { border-color:var(--navy-300); }
.pager button.active { background:var(--navy-700); color:#fff; border-color:var(--navy-700); }
.pager button:disabled { opacity:.4; cursor:not-allowed; }

/* ====== SKELETON ====== */
.skel { background: linear-gradient(90deg, var(--navy-100) 25%, var(--navy-50) 37%, var(--navy-100) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius:8px; }
@keyframes shimmer { 0%{ background-position: 100% 0; } 100%{ background-position: -100% 0; } }

/* ====== MOBILE ====== */
.mobile-menu { display:none; }
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 56px; }
  .hero h1 { font-size: 38px; }
  .doc-stack { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid, .proj-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .detail-preview { position: static; }
  .detail-doc-stage { aspect-ratio: auto; padding: 28px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-form { padding: 40px 24px; max-width:none; }
  .topbar-search { display: none; }
  .nav-links { display:none; }
  .hamburger { display:inline-flex; }
  .browse-layout { grid-template-columns: 1fr; }
  .filter-aside { position: static; background:#fff; border:1px solid var(--border); border-radius:14px; padding:20px; margin-bottom:20px; }
  .cart-layout { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-side { position: static; }
  .summary-card { position: static; }
  .section { padding: 48px 0; }
  .section-head h2 { font-size: 28px; }
  .page-h1 { font-size: 28px; }
  .toast-wrap { left:16px; right:16px; bottom:16px; }
  .toast { min-width:0; max-width:none; }
  .mobile-menu.open { display:block; position:fixed; inset:64px 0 0; background:#fff; z-index:49; padding:20px; overflow:auto; animation: route-in .2s var(--ease-out) both; }
  .mobile-menu a { display:block; padding:14px 12px; font-size:16px; font-weight:600; color:var(--ink-1); border-bottom:1px solid var(--divider); text-decoration:none; cursor:pointer; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr; }
  .proj-grid, .proj-grid.cols-3 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 64px 1fr; }
  .cart-row .cart-price-col { grid-column: 2; text-align:left; margin-top:8px; }
  .hero h1 { font-size: 32px; }
}
