/* Shared responsive layer: keep content in the viewport, not scaled to fit. */
.resource-card { min-width: 0; padding: 20px; border: 1px solid var(--border-subtle); border-radius: 20px; background: var(--bg-surface); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.cards-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.resource-card .card-media-wrap { margin-bottom: 16px; border-radius: 12px; }
.card-top, .card-actions { flex-wrap: wrap; }
.card-link-seller { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.workspace-switch { z-index: 40; }
.modal-backdrop { z-index: 1000; }
body:has(.modal-backdrop[style*="display: flex"]), body:has(dialog[open]) { overflow: hidden; }
.mobile-links summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent-amber); font-weight: 600; font-size: 14px; }
.mobile-links summary::before { content: '▸'; margin-right: 8px; }
.mobile-links[open] summary::before { content: '▾'; }
.mobile-card-preview { display: none; }
@media (max-width: 700px) {
  html { scroll-padding-top: 16px; }
  body { min-width: 0; }
  input, select, textarea { font-size: 16px !important; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { touch-action: manipulation; }
  .site-header, .workspace-switch, .topbar { position: static; }
  .header-container { padding: 0 14px; flex-wrap: wrap; gap: 12px; }
  .brand-title { font-size: 20px; }
  .brand-subtitle { font-size: 10px; }
  .auth-bar { flex-wrap: wrap; gap: 8px; }
  .auth-bar button { min-height: 44px; padding: 8px 12px; }
  .workspace-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; gap: 8px; }
  .workspace-tab { min-width: 0; min-height: 46px; text-align: center; text-decoration: none; padding: 10px 6px; }
  .hero-section { padding: 24px 16px 16px; }
  .hero-heading { font-size: 30px; line-height: 1.15; }
  .hero-description { font-size: 14px; }
  .filter-wrapper { padding: 12px; }
  .categories-bar { flex-wrap: wrap; overflow: visible; gap: 6px; }
  .cat-tab { min-height: 42px; padding: 8px 12px; font-size: 13px; }
  .main-container { padding: 0 12px; margin-top: 20px; }
  .feed-header { flex-direction: column; gap: 14px; align-items: stretch; }
  .feed-header > div { flex-wrap: wrap; gap: 8px !important; }
  .quick-filter-btn, .view-toggle button { min-height: 44px; }
  .cards-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .resource-card { padding: 16px; border-radius: 18px; }
  .resource-card .card-media-wrap { height: 120px; }
  .resource-card:has(.mobile-card-preview) .card-desc { display: none; }
  .mobile-card-preview { display: block; font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 16px; }
  .card-top { gap: 8px; margin-bottom: 12px; }
  .cat-badge { white-space: normal; font-size: 11px; }
  .card-date { font-size: 11px; }
  .card-title { font-size: 21px; line-height: 1.25; }
  .card-desc { font-size: 15px; line-height: 1.6; }
  .description-point-copy { gap: 5px; }
  .card-meta-row { flex-wrap: wrap; }
  .card-link-item { min-height: 46px; flex-wrap: wrap; }
  .card-link-info { display: block; white-space: normal; overflow: visible; }
  .card-link-variant { display: block; white-space: normal; }
  .card-link-price { white-space: normal; }
  .tags-list { margin-bottom: 12px; }
  .card-actions { gap: 8px; }
  .btn-details, .btn-share, .btn-reel, .btn-delete-item { min-height: 44px; min-width: 44px; }
  .btn-details { padding: 10px 16px; font-size: 14px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal-card { max-width: none; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior-y: contain; }
  .modal-close { position: sticky; top: 0; margin: 0 0 12px auto; width: 48px; height: 48px; z-index: 2; background: #263244; color: white; box-shadow: 0 2px 10px #0006; }
  #modal-content { overflow-wrap: anywhere; }
  #modal-content > div { min-width: 0; flex-wrap: wrap; gap: 12px; }
  .modal-description { padding: 14px; font-size: 16px; }
  .modal-hero-wrap { max-height: 180px; }
  .modal-hero-img { max-height: 180px; object-fit: contain; }
  .modal-link-card { flex-wrap: wrap; gap: 12px; }
  .modal-link-card-left { min-width: 0; }
  .modal-link-btn { min-height: 44px; }
  .sales-hero { flex-direction: column; align-items: stretch; }
  .sales-grid { grid-template-columns: minmax(0,1fr); }
  .sale-card, .sale-card-body, .sales-search { min-width: 0; overflow-wrap: anywhere; }
  .sale-gallery { max-width: 100%; }
  .dashboard { width: calc(100% - 24px); }
  .dashboard .panel, .dashboard .kpi { min-width: 0; overflow-wrap: anywhere; }
  .dashboard .panel-heading { flex-wrap: wrap; gap: 12px; }
  .year-buttons { flex-wrap: wrap; overflow: visible; }
  .year-buttons button, .dashboard button, #detail-dialog button { min-height: 44px; }
  .dashboard .filter-panel { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .dashboard .kpi strong { font-size: clamp(19px,5.5vw,24px); }
  .monthly-chart { overflow: visible; min-height: 0; }
  .grouped-months { min-width: 0; height: auto; display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; padding: 8px 0; }
  .month-group { flex-direction: column-reverse; text-align: left; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid #ffffff15; }
  .group-bars { height: auto; display: grid; grid-template-columns: minmax(0,1fr); justify-content: stretch; gap: 8px; border: 0; }
  .group-bar { display: grid; grid-template-columns: 44px minmax(0,1fr) 76px; gap: 8px; max-width: none; min-width: 0; align-items: center; }
  .bar-year { grid-column: 1; grid-row: 1; font-size: 12px; }
  .bar-space { grid-column: 2; grid-row: 1; height: 18px; display: block; background: #ffffff09; border-radius: 4px; }
  .bar-pillar { height: 18px !important; width: var(--mobile-bar,0%); max-width: none; border-radius: 4px; }
  .bar-amount { grid-column: 3; grid-row: 1; height: auto; text-align: right; font-size: 12px; }
  .mobile-table { min-width: 0; width: 100%; }
  .mobile-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-table tbody { display: grid; gap: 12px; }
  .mobile-table tr { display: block; padding: 12px; border: 1px solid #ffffff18; border-radius: 12px; background: #ffffff03; }
  .mobile-table td { display: grid; grid-template-columns: minmax(90px,0.8fr) minmax(0,1.4fr); gap: 8px; padding: 7px 0; text-align: left; font-size: 14px; overflow-wrap: anywhere; }
  .mobile-table td::before { content: attr(data-label); color: #9eafb4; font-size: 12px; }
  .mobile-table td > * { min-width: 0; grid-column: 2; }
  .mobile-table td[colspan] { display: block; }
  .mobile-table .text-button { text-align: left; white-space: normal; }
  .table-scroll:has(.mobile-table) { overflow: visible; margin: 0; }
  .ingestion-row { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .pagination { flex-wrap: wrap; gap: 8px; }
  #detail-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; overflow-y: auto; }
  #detail-dialog > .panel-heading { position: sticky; top: -16px; z-index: 2; background: #10211b; padding: 12px 0; align-items: start; gap: 8px; }
  #detail-title { font-size: 20px; overflow-wrap: anywhere; min-width: 0; }
  #close-detail { flex-shrink: 0; }
  .price-history { flex-wrap: wrap; overflow: visible; }
  .preferences-form { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
