/* 늘봄사진자료실 — 페이지 레이아웃과 화면 전용 클래스.
   방향: nb-light-table (plan Variation A). 색·반경·그림자는 전부 var(--aq-*) 시맨틱 토큰만 쓴다.
   literal 색 없음. 프리셋 값은 assets/aquila/run-preset.css 가 [data-preset="nb-light-table"] 로 준다. */

:root {
  /* glide: 트랙 안 인디케이터용, 오버슈트 없는 감쇠 곡선(Aquila motion 'glide' ζ≈1 대응) */
  --nb-glide: var(--aq-ease-emphasized);
  --nb-glide-dur: 280ms;
  --nb-gutter: 16px;
  --nb-matte: 6px;
  --nb-bar-h: 0px;
}
@media (min-width: 768px) {
  :root { --nb-gutter: 24px; --nb-matte: 8px; }
}
@media (min-width: 1200px) {
  :root { --nb-gutter: 32px; }
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--aq-page);
  color: var(--aq-fg);
  font-family: var(--aq-font-sans);
  font-size: var(--aq-text-base);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; color: var(--aq-fg-strong); word-break: keep-all; text-wrap: balance; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.text-secondary { color: var(--aq-fg-secondary); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 키보드 포커스: 링이 필요한 곳(링크·버튼·사진 열기)에만. 입력칸은 .aq-input 글로우를 쓴다. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible,
.check-input:focus-visible + .check-box {
  outline: 2px solid var(--aq-ring-strong);
  outline-offset: 2px;
}

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--nb-gutter); box-sizing: border-box; }

/* ── 상단 바 ── */
.site-header { background: var(--aq-surface); border-bottom: 1px solid var(--aq-border); }
.site-header .container { display: flex; align-items: center; gap: 12px 24px; min-height: 64px; flex-wrap: wrap; }
.wordmark { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; color: var(--aq-fg-strong); white-space: nowrap; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  border-radius: var(--aq-radius-el); text-decoration: none; font-size: 15px;
  color: var(--aq-fg-secondary); white-space: nowrap;
}
.site-nav a:hover { background: var(--aq-surface-sunken); color: var(--aq-fg); }
.site-nav a[aria-current="page"] { color: var(--aq-fg-strong); font-weight: 600; box-shadow: inset 0 -2px 0 var(--aq-accent); border-radius: 0; }
@media (max-width: 639px) {
  .site-header .container { padding-top: 10px; padding-bottom: 4px; gap: 4px; }
  .site-nav { margin-left: -12px; width: calc(100% + 12px); }
  .site-nav a { font-size: 14px; padding: 0 10px; min-height: 44px; }
}

/* ── 푸터 ── */
.site-footer { margin-top: 64px; border-top: 1px solid var(--aq-border); background: var(--aq-surface); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 20px; padding-bottom: calc(20px + var(--nb-bar-h)); font-size: 13px; color: var(--aq-fg-secondary); }

/* ── 버튼 (Aquila Button cva 를 정적 클래스로 옮김) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--aq-radius-el);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 160ms var(--aq-ease-out), border-color 160ms var(--aq-ease-out), color 160ms var(--aq-ease-out);
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--aq-solid); color: var(--aq-solid-fg); }
.btn-primary:hover:not([disabled]) { background: var(--aq-solid-hover); }
.btn-accent { background: var(--aq-accent); color: var(--aq-accent-fg); }
.btn-accent:hover:not([disabled]) { background: var(--aq-accent-strong); }
.btn-outline { background: var(--aq-surface); color: var(--aq-fg-strong); border-color: var(--aq-border-strong); }
.btn-outline:hover:not([disabled]) { background: var(--aq-surface-subtle); }
.btn-ghost { background: transparent; color: var(--aq-fg-secondary); }
.btn-ghost:hover:not([disabled]) { background: var(--aq-surface-sunken); color: var(--aq-fg); }
.icon-btn { width: 44px; height: 44px; padding: 0; }
@media (max-width: 639px) { .btn { height: 44px; } .btn-sm { height: 40px; } }

/* ── 입력 (Aquila Input: .aq-input 이 테두리·포커스 글로우 담당) ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 600; color: var(--aq-fg-strong); }
.field-label .req { color: var(--aq-accent-strong); margin-left: 2px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--aq-fg-secondary); }
.field-error { font-size: 13px; color: color-mix(in srgb, var(--aq-error) 70%, var(--aq-fg-strong)); font-weight: 600; }
.control {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--aq-fg); background: var(--aq-surface);
  border-radius: var(--aq-radius-el); outline: none;
  transition: border-color 200ms var(--aq-ease-out), box-shadow 200ms var(--aq-ease-out);
}
.control::placeholder { color: var(--aq-fg-placeholder); }
textarea.control { height: auto; min-height: 132px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
select.control { appearance: none; padding-right: 40px; background-image: none; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--aq-fg-secondary); border-bottom: 1.5px solid var(--aq-fg-secondary);
  transform: rotate(45deg); pointer-events: none;
}
input[type="file"].control { height: auto; padding: 10px 12px; font-size: 14px; }

/* 체크박스: 44px 히트 영역 + 20px 상자 (Aquila Checkbox 크기) */
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; position: relative; }
.check-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  width: 20px; height: 20px; flex: none; box-sizing: border-box; border-radius: var(--aq-radius-xs);
  border: 1.5px solid var(--aq-border-strong); background: var(--aq-surface);
  display: grid; place-items: center; color: var(--aq-accent-fg);
  transition: background-color 140ms var(--aq-ease-out), border-color 140ms var(--aq-ease-out);
}
.check-box svg { width: 14px; height: 14px; opacity: 0; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.check-input:checked + .check-box { background: var(--aq-accent); border-color: var(--aq-accent); }
.check-input:checked + .check-box svg { opacity: 1; }

/* ── 카테고리 표식: 작은 점에만 카테고리 색, 라벨은 항상 함께 ── */
.cat-dot { width: 8px; height: 8px; border-radius: var(--aq-radius-full); flex: none; display: inline-block; background: var(--aq-fg-subtle); }
.cat-dot[data-tone="cat-1"] { background: var(--aq-cat-1); }
.cat-dot[data-tone="cat-2"] { background: var(--aq-cat-2); }
.cat-dot[data-tone="cat-3"] { background: var(--aq-cat-3); }
.cat-dot[data-tone="cat-4"] { background: var(--aq-cat-4); }
.cat-dot[data-tone="cat-5"] { background: var(--aq-cat-5); }
.cat-dot[data-tone="neutral"] { background: var(--aq-surface); box-shadow: inset 0 0 0 2px var(--aq-fg-subtle); }

/* ── 매트 사진: 이번 방향의 핵심. 회색 바닥 위 흰 매트 + 헤어라인 ── */
.matte {
  background: var(--aq-surface); padding: var(--nb-matte);
  border: 1px solid var(--aq-border); border-radius: var(--aq-radius-card);
  transition: border-color 160ms var(--aq-ease-out), box-shadow 160ms var(--aq-ease-out);
}
.photo-media { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--aq-radius-xs); background: var(--aq-surface-sunken); }
.photo-media img { width: 100%; height: 100%; object-fit: cover; }

.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.link-more { font-size: 14px; color: var(--aq-fg-secondary); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; white-space: nowrap; }
.link-more:hover { color: var(--aq-fg); text-decoration: underline; }

/* ── 사진 타일 (아카이브·홈 공용) ── */
.photo-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px) { .photo-grid.wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .photo-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .photo-grid { gap: 12px; } }
.tile { position: relative; margin: 0; min-width: 0; }
.tile-open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in; color: inherit; font: inherit; text-decoration: none; border-radius: var(--aq-radius-card); }
.tile-open:hover .matte { border-color: var(--aq-border-strong); }
.tile[data-selected="true"] .matte { border-color: var(--aq-accent); box-shadow: inset 0 0 0 1px var(--aq-accent); }
.tile-caption { padding: 8px 2px 0; min-width: 0; }
.tile-title { font-size: 14px; font-weight: 600; color: var(--aq-fg-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--aq-fg-secondary); margin-top: 2px; }
.tile-meta .num { margin-left: 4px; }
.tile-check { position: absolute; top: 0; left: 0; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; margin: 0; }
.tile-check .check-box { box-shadow: 0 0 0 2px var(--aq-surface); }

/* ── 패널·셀 그룹 (Aquila Panel / CellGroup) ── */
.panel { background: var(--aq-surface); border: 1px solid var(--aq-border); border-radius: var(--aq-radius-card); padding: 20px; }
.panel-title { font-size: 16px; font-weight: 700; color: var(--aq-fg-strong); }
.cell-group { background: var(--aq-surface); border: 1px solid var(--aq-border); border-radius: var(--aq-radius-card); overflow: hidden; }
.cell-group-title { padding: 16px 20px 8px; font-size: 13px; font-weight: 600; color: var(--aq-fg-secondary); }
.cell { display: flex; align-items: center; gap: 12px; padding: 14px 20px; min-height: 44px; text-decoration: none; color: inherit; border-top: 1px solid var(--aq-border-subtle); background: none; width: 100%; box-sizing: border-box; font: inherit; text-align: left; cursor: pointer; }
.cell:first-of-type { border-top: 0; }
.cell:hover { background: var(--aq-surface-subtle); }
.cell-main { flex: 1; min-width: 0; }
.cell-title { font-weight: 600; font-size: 15px; color: var(--aq-fg-strong); }
.cell-sub { font-size: 13px; color: var(--aq-fg-secondary); }
.cell .icon { color: var(--aq-fg-subtle); }

/* ── 배지(태그) ── */
.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--aq-radius-full); background: var(--aq-surface-sunken); color: var(--aq-fg-secondary); font-size: 13px; white-space: nowrap; }
.badge-accent { background: var(--aq-accent-subtle); color: var(--aq-accent-strong); font-weight: 600; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

/* ── 세그먼트 컨트롤: 표시자는 glide (오버슈트 금지) ── */
.segmented { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; background: var(--aq-surface-sunken); border-radius: var(--aq-radius-el); overflow: hidden; }
.segmented-indicator { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: var(--aq-radius-sm); background: var(--aq-surface); box-shadow: 0 0 0 1px var(--aq-border); transition: transform var(--nb-glide-dur) var(--nb-glide), width var(--nb-glide-dur) var(--nb-glide); }
.segmented button { position: relative; z-index: 1; height: 34px; padding: 0 14px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--aq-fg-secondary); cursor: pointer; white-space: nowrap; border-radius: var(--aq-radius-sm); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { color: var(--aq-fg-strong); font-weight: 600; }
@media (max-width: 639px) { .segmented button { height: 40px; } }

/* ── 빈 상태 ── */
.empty { padding: 56px 20px; text-align: center; border: 1px dashed var(--aq-border-strong); border-radius: var(--aq-radius-card); color: var(--aq-fg-secondary); }
.empty h2 { font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ── 선택 바 (하단 고정) ── */
.select-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--aq-solid); color: var(--aq-solid-fg);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.select-bar[hidden] { display: none; }
.select-bar .container { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.select-bar-count { font-weight: 700; font-size: 15px; white-space: nowrap; }
.select-bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.select-bar .btn-ghost { color: var(--aq-solid-fg); }
.select-bar .btn-ghost:hover { background: var(--aq-solid-hover); color: var(--aq-solid-fg); }
.select-bar .btn-light { background: var(--aq-surface); color: var(--aq-fg-strong); }
.select-bar .btn-light:hover:not([disabled]) { background: var(--aq-surface-subtle); }
.select-bar .segmented { background: var(--aq-surface-sunken); }
@media (max-width: 639px) {
  .select-bar .container { gap: 8px; }
  .select-bar-actions { margin-left: 0; width: 100%; }
  .select-bar-actions .btn-light { flex: 1; }
}

/* ── 토스트 ── */
.toast-region { position: fixed; left: 50%; bottom: calc(24px + var(--nb-bar-h)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--aq-solid); color: var(--aq-solid-fg); border-radius: var(--aq-radius-el); font-size: 14px; animation: toast-in 200ms var(--aq-ease-out); }
.toast-action { color: var(--aq-solid-fg); font-weight: 700; white-space: nowrap; min-height: 32px; display: inline-flex; align-items: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── 모달 (native dialog) ── */
.modal { border: 1px solid var(--aq-border); border-radius: var(--aq-radius-card); padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--aq-surface); color: var(--aq-fg); box-sizing: border-box; }
.modal::backdrop { background: color-mix(in srgb, var(--aq-solid) 45%, transparent); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.modal-title { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.modal-wide { width: min(640px, calc(100vw - 32px)); }
@media (max-width: 639px) {
  .modal-wide { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
}

/* ── 상세 서랍 (Aquila Drawer: .aq-drawer / .aq-drawer-backdrop) ── */
.drawer-root { position: fixed; inset: 0; z-index: 50; }
.drawer-root[hidden] { display: none; }
.aq-drawer-backdrop.drawer-dim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: color-mix(in srgb, var(--aq-solid) 45%, transparent); cursor: default; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--aq-surface); border-left: 1px solid var(--aq-border);
  display: flex; flex-direction: column; box-sizing: border-box;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--aq-border-subtle); }
.drawer-head h2 { font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--aq-border-subtle); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 767px) {
  .drawer-panel { width: 100vw; border-left: 0; }
}

/* 상세 메타 (Aquila DescriptionList) */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--aq-fg-secondary); white-space: nowrap; }
.dl dd { margin: 0; color: var(--aq-fg-strong); min-width: 0; font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--aq-fg-secondary); background: var(--aq-surface-subtle); border: 1px solid var(--aq-border-subtle); border-radius: var(--aq-radius-el); padding: 10px 12px; }

/* 크기 선택 (Aquila RadioGroup 카드형) */
.size-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.size-options legend { font-size: 14px; font-weight: 600; color: var(--aq-fg-strong); margin-bottom: 8px; padding: 0; }
.size-option { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--aq-border); border-radius: var(--aq-radius-el); cursor: pointer; min-width: 0; }
.size-option input { position: absolute; opacity: 0; }
.size-option strong { font-size: 14px; color: var(--aq-fg-strong); }
.size-option span { font-size: 12px; color: var(--aq-fg-secondary); font-variant-numeric: tabular-nums; }
.size-option:has(input:checked) { border-color: var(--aq-accent); box-shadow: inset 0 0 0 1px var(--aq-accent); }
.size-option:has(input:focus-visible) { outline: 2px solid var(--aq-ring-strong); outline-offset: 2px; }

/* ── 페이지 머리 ── */
.page-head { padding-top: 40px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.page-lead { margin-top: 8px; color: var(--aq-fg-secondary); font-size: 15px; }
@media (max-width: 639px) { .page-head { padding-top: 28px; } .page-title { font-size: 24px; } }

/* ── 큰 검색창 (Aquila SearchBar: .aq-search-bar 글로우) ── */
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--aq-surface); border: 1px solid var(--aq-border-strong); border-radius: var(--aq-radius-el); padding: 4px 4px 4px 16px; }
.search-bar .icon { color: var(--aq-fg-secondary); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--aq-fg); height: 46px; }
.search-bar input::placeholder { color: var(--aq-fg-placeholder); }
.search-bar .btn { height: 46px; }
.search-bar-lg input { height: 54px; font-size: 17px; }
.search-bar-lg .btn { height: 54px; padding: 0 28px; }
@media (max-width: 639px) {
  .search-bar-lg input, .search-bar input { height: 48px; font-size: 16px; }
  .search-bar-lg .btn, .search-bar .btn { height: 48px; padding: 0 16px; }
}

/* ══ index ══ */
.home-hero { display: grid; gap: 24px; padding-top: 48px; align-items: start; }
@media (min-width: 1024px) { .home-hero { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding-top: 64px; } }
.home-intro h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.3; }
.home-intro p { margin-top: 10px; color: var(--aq-fg-secondary); }
.home-intro .search-bar { margin-top: 24px; }
.search-hint { margin-top: 10px; font-size: 13px; color: var(--aq-fg-secondary); }
@media (max-width: 639px) { .home-intro h1 { font-size: 25px; } .home-hero { padding-top: 28px; } }

.cat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.cat-card { display: block; text-decoration: none; color: inherit; border-radius: var(--aq-radius-card); }
.cat-card:hover .matte { border-color: var(--aq-border-strong); }
.cat-card-label { display: flex; align-items: center; gap: 8px; padding: 10px 2px 0; }
.cat-card-name { font-weight: 700; font-size: 16px; color: var(--aq-fg-strong); }
.cat-card-count { margin-left: auto; font-size: 13px; color: var(--aq-fg-secondary); }
.cat-card-label .icon-sm { color: var(--aq-fg-secondary); }

.request-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 28px; }
.request-cta h2 { font-size: 20px; }
.request-cta p { color: var(--aq-fg-secondary); margin-top: 4px; }

/* ══ archive ══ */
.archive-search { margin-top: 20px; }
.archive-layout { display: grid; gap: 24px; margin-top: 28px; }
@media (min-width: 1024px) { .archive-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 32px; } }
.filter-rail { align-self: start; }
.filter-group + .filter-group { margin-top: 24px; }
.filter-group h2 { font-size: 13px; font-weight: 600; color: var(--aq-fg-secondary); margin-bottom: 4px; }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list .check { width: 100%; }
.filter-list .count { margin-left: auto; font-size: 13px; color: var(--aq-fg-secondary); }
.filter-sheet-head, .filter-sheet-foot { display: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.result-count { font-size: 15px; color: var(--aq-fg-secondary); }
.result-count strong { color: var(--aq-fg-strong); }
.filter-chips { display: none; }
.filter-open { display: none; }

/* 768: 레일 → 상단 칩 줄 */
@media (min-width: 640px) and (max-width: 1023px) {
  .filter-rail { display: none; }
  .filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
}
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--aq-radius-full); border: 1px solid var(--aq-border-strong); background: var(--aq-surface); color: var(--aq-fg-secondary); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--aq-solid); border-color: var(--aq-solid); color: var(--aq-solid-fg); font-weight: 600; }
.chip-select { width: auto; height: 36px; font-size: 14px; border-radius: var(--aq-radius-full); }

/* 390: "필터" 버튼 → 하단 시트 */
@media (max-width: 639px) {
  .filter-open { display: inline-flex; }
  .filter-rail { display: none; }
  .filter-rail[data-open="true"] {
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    max-height: 85dvh; background: var(--aq-surface); border-top: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-card) var(--aq-radius-card) 0 0; animation: sheet-in 260ms var(--aq-ease-emphasized);
  }
  .filter-rail[data-open="true"] .filter-sheet-body { overflow-y: auto; padding: 8px 20px 16px; }
  .filter-rail[data-open="true"] .filter-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 20px; }
  .filter-rail[data-open="true"] .filter-sheet-foot { display: flex; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--aq-border-subtle); }
  .filter-rail[data-open="true"] .filter-sheet-foot .btn { flex: 1; }
  .sheet-dim { position: fixed; inset: 0; z-index: 54; background: color-mix(in srgb, var(--aq-solid) 45%, transparent); border: 0; padding: 0; width: 100%; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }

/* ══ request ══ */
.request-layout { display: grid; gap: 32px; margin-top: 28px; align-items: start; }
@media (min-width: 1024px) { .request-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; } }
.form-card { padding: 24px; }
@media (max-width: 639px) { .form-card { padding: 20px 16px; } }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset + .fieldset { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--aq-border-subtle); }
.fieldset legend { float: left; width: 100%; font-size: 17px; font-weight: 700; color: var(--aq-fg-strong); padding: 0; margin-bottom: 16px; }
.fieldset > :not(legend) { clear: both; }
.form-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill span { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--aq-border-strong); border-radius: var(--aq-radius-el); font-size: 14px; cursor: pointer; background: var(--aq-surface); white-space: nowrap; }
.radio-pill input:checked + span { border-color: var(--aq-accent); box-shadow: inset 0 0 0 1px var(--aq-accent); color: var(--aq-accent-strong); font-weight: 600; }
.radio-pill input:focus-visible + span { outline: 2px solid var(--aq-ring-strong); outline-offset: 2px; }
.error-summary { border: 1px solid var(--aq-error); border-radius: var(--aq-radius-el); padding: 14px 16px; margin-bottom: 20px; background: var(--aq-surface); }
.error-summary[hidden] { display: none; }
.error-summary h2 { font-size: 15px; color: var(--aq-fg-strong); }
.error-summary ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.error-summary a { color: var(--aq-fg-strong); }
.file-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--aq-fg-secondary); }
.file-list li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.file-list li span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
@media (max-width: 639px) { .form-actions .btn { flex: 1; } }

.steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.steps li::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 1px; background: var(--aq-border); }
.steps li:last-child::before { display: none; }
.step-no { width: 24px; height: 24px; border-radius: var(--aq-radius-full); border: 1px solid var(--aq-border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--aq-fg-secondary); background: var(--aq-surface); font-variant-numeric: tabular-nums; }
.steps li.done .step-no { background: var(--aq-accent); border-color: var(--aq-accent); color: var(--aq-accent-fg); }
.steps strong { display: block; font-size: 14px; color: var(--aq-fg-strong); }
.steps span.desc { font-size: 13px; color: var(--aq-fg-secondary); }

.receipt { padding: 32px 24px; }
.receipt-no { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 16px; background: var(--aq-surface-subtle); border: 1px solid var(--aq-border); border-radius: var(--aq-radius-el); }
.receipt-no .label { font-size: 13px; color: var(--aq-fg-secondary); }
.receipt-no .value { font-size: 22px; font-weight: 700; color: var(--aq-fg-strong); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.receipt-no .btn { margin-left: auto; }
.receipt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.receipt .dl { margin-top: 20px; }

/* ══ admin ══ */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-layout { display: grid; gap: 24px; margin-top: 28px; align-items: start; }
@media (min-width: 1100px) { .admin-layout { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.admin-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--aq-border-subtle); }
.admin-filters .segmented { max-width: 100%; }
.date-range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.date-range .field { width: 160px; }
.date-range .control { height: 40px; font-size: 14px; }
.table-card { padding: 0; overflow: hidden; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.status-tabs { overflow: hidden; }
.status-tabs button .n { margin-left: 4px; color: var(--aq-fg-secondary); font-weight: 400; font-variant-numeric: tabular-nums; }

.req-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.req-table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--aq-fg-secondary); padding: 10px 12px; background: var(--aq-surface-subtle); border-bottom: 1px solid var(--aq-border); white-space: nowrap; }
.req-table td { padding: 12px; border-bottom: 1px solid var(--aq-border-subtle); vertical-align: middle; }
.req-table tr[data-selected="true"] td { background: var(--aq-accent-subtle); }
.req-table .col-check { width: 44px; padding-left: 12px; padding-right: 0; }
.req-id { font-weight: 600; color: var(--aq-fg-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.req-who strong { display: block; color: var(--aq-fg-strong); font-weight: 600; }
.req-who span, .req-sub { font-size: 13px; color: var(--aq-fg-secondary); }
.req-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-cell { display: flex; align-items: center; gap: 10px; }
.status-select { height: 36px; font-size: 14px; width: 120px; padding: 0 30px 0 10px; }
.status-cell .select-wrap::after { right: 12px; }
.status-dots { display: inline-flex; gap: 3px; }
.status-dots i { width: 6px; height: 6px; border-radius: var(--aq-radius-full); background: var(--aq-border); }
.status-dots i.on { background: var(--aq-fg-secondary); }
.status-dots[data-done="true"] i.on { background: var(--aq-accent); }
.table-empty { padding: 40px 20px; text-align: center; color: var(--aq-fg-secondary); }

/* 768 미만: 표 → 카드형 목록 (페이지 가로 스크롤 금지) */
@media (max-width: 767px) {
  .req-table thead { display: none; }
  .req-table, .req-table tbody { display: block; }
  .req-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 8px; padding: 14px 16px 14px 8px; border-bottom: 1px solid var(--aq-border-subtle); }
  .req-table tr[data-selected="true"] { background: var(--aq-accent-subtle); }
  .req-table tr[data-selected="true"] td { background: none; }
  .req-table td { display: block; border: 0; padding: 0; grid-column: 2; }
  .req-table td.col-check { grid-column: 1; grid-row: 1 / span 5; padding: 0; width: auto; }
  .req-table td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--aq-fg-secondary); margin-right: 8px; }
  .req-table td.status-td { margin-top: 8px; }
}

.storage-card { display: flex; flex-direction: column; gap: 16px; }
.storage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.storage-usage { font-size: 15px; color: var(--aq-fg-secondary); }
.storage-usage strong { font-size: 20px; color: var(--aq-fg-strong); font-variant-numeric: tabular-nums; }
.waffle { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.waffle i { aspect-ratio: 1; border-radius: var(--aq-radius-xs); background: var(--aq-surface-sunken); box-shadow: inset 0 0 0 1px var(--aq-border-subtle); position: relative; overflow: hidden; }
.waffle i.orig { background: var(--aq-accent); box-shadow: none; }
.waffle i.web { background: var(--aq-heatmap-2); box-shadow: none; }
.waffle i.part::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--fill, 40%); background: var(--aq-heatmap-2); }
.legend { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: var(--aq-radius-xs); flex: none; }
.legend .sw.orig { background: var(--aq-accent); }
.legend .sw.web { background: var(--aq-heatmap-2); }
.legend .sw.free { background: var(--aq-surface-sunken); box-shadow: inset 0 0 0 1px var(--aq-border); }
.legend .v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--aq-fg-strong); }
.storage-notes { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--aq-border-subtle); display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--aq-fg-secondary); }
.storage-notes strong { color: var(--aq-fg-strong); }

.upload-preview { aspect-ratio: 3 / 2; border: 1px dashed var(--aq-border-strong); border-radius: var(--aq-radius-el); display: grid; place-items: center; overflow: hidden; color: var(--aq-fg-secondary); font-size: 14px; background: var(--aq-surface-subtle); }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.tag-input-row { display: flex; gap: 8px; }
.tag-input-row .control { flex: 1; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chips button { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 10px; border-radius: var(--aq-radius-full); border: 0; background: var(--aq-surface-sunken); color: var(--aq-fg-strong); font: inherit; font-size: 13px; cursor: pointer; }
.upload-form { max-height: calc(100dvh - 48px); overflow-y: auto; }
@media (max-width: 639px) { .upload-form { max-height: 100dvh; } }

/* 인쇄용 목록: 화면에서는 숨기고 인쇄 때만 선택 건 표를 보인다 */
.print-sheet { display: none; }
@media print {
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; color: var(--aq-fg-strong); font-size: 11pt; }
  .print-sheet h1 { font-size: 16pt; margin-bottom: 4pt; }
  .print-sheet p { margin-bottom: 10pt; }
  .print-sheet table { width: 100%; border-collapse: collapse; }
  .print-sheet th, .print-sheet td { border: 1px solid currentColor; padding: 4pt 6pt; text-align: left; vertical-align: top; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* admin 상태 필터: 390 에서는 세그먼트 대신 select (가로 넘침 방지) */
.status-mobile { display: none; }
@media (max-width: 639px) {
  .status-tabs { display: none; }
  .status-mobile { display: block; }
  .admin-filters { padding: 16px; }
  .date-range { width: 100%; }
  .date-range .field { width: auto; flex: 1 1 140px; }
}

.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-rail[data-open="true"] .rail-only { display: none; }
@media (min-width: 768px) and (max-width: 1023px) {
  .req-table .status-dots { display: none; }
  .req-table td, .req-table th { padding-left: 8px; padding-right: 8px; }
  .status-select { width: 112px; }
}
