:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #dce3ed;
  --canvas: #f4f7fb;
  --surface: #ffffff;
  --blue: #1d4ed8;
  --blue-dark: #173b87;
  --blue-soft: #eaf1ff;
  --cyan: #0891b2;
  --green: #15803d;
  --green-soft: #eaf8ef;
  --red: #c2414b;
  --red-soft: #fff0f1;
  --amber: #9a6700;
  --amber-soft: #fff7dd;
  --shadow: 0 12px 32px rgba(21, 42, 83, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select, label[for] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, label[for]:focus-visible { outline: 3px solid rgba(29, 78, 216, .24); outline-offset: 2px; }
.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; }

.app-header { min-height: 60px; background: #0f2554; color: #fff; }
.header-inner { width: min(1140px, calc(100% - 68px)); min-height: 60px; margin: 0 auto; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand strong { display: block; font-size: 1.08rem; letter-spacing: -.02em; }
.brand span:not(.brand-mark) { display: block; margin-top: 2px; color: #b9c7e8; font-size: .82rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px; background: #2f66e2; }
.brand-mark i { width: 5px; display: block; background: #fff; border-radius: 2px 2px 0 0; }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 13px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.privacy-note { color: #b9c7e8; font-size: .8rem; }
.upload-button { padding: 9px 15px; border-radius: 8px; background: #fff; color: #173b87; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.header-add-button { border: 0; font-family: inherit; cursor: pointer; }

.view-tabs { min-height: 44px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs-inner { width: min(1140px, calc(100% - 68px)); min-height: 44px; margin: 0 auto; display: flex; align-items: flex-end; gap: 26px; }
.tab { position: relative; padding: 11px 2px 10px; border: 0; background: transparent; color: var(--muted); font-weight: 650; }
.tab.active { color: var(--blue-dark); }
.tab.active::after { content: ""; position: absolute; height: 3px; left: 0; right: 0; bottom: 0; background: var(--blue); border-radius: 3px 3px 0 0; }

main { width: min(1140px, calc(100% - 68px)); margin: 0 auto; padding: 8px 0 48px; }
.upload-toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(520px, calc(100% - 44px)); min-height: 42px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #cbd9f3; border-radius: 9px; background: #f7faff; color: #34517e; font-size: .85rem; box-shadow: 0 12px 36px rgba(21,42,83,.18); }
.upload-toast[hidden] { display: none; }
.upload-toast.error { border-color: #f0c2c6; background: var(--red-soft); color: #8c2832; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(21, 128, 61, .1); }
.upload-toast.error .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(194, 65, 75, .1); }
.view { display: none; }
.view.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 5px 0 9px; }
.page-heading h1 { margin: 0 0 2px; font-size: clamp(1.45rem, 2.5vw, 1.85rem); line-height: 1.15; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue) !important; font-size: .74rem; font-weight: 800; letter-spacing: .12em; }
.select-field, .compact-select { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: .78rem; font-weight: 650; }
select, input[type="search"] { min-height: 42px; padding: 8px 34px 8px 12px; color: var(--ink); border: 1px solid #cbd5e1; border-radius: 8px; background: var(--surface); }
.select-field select { min-width: 260px; font-weight: 650; }
.compact-select select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 126px; padding: 19px 20px; border: 1px solid var(--line); border-top: 3px solid var(--accent, var(--blue)); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 16px rgba(21,42,83,.035); }
.metric-card span { display: block; color: var(--muted); font-size: .82rem; font-weight: 650; }
.metric-card strong { display: block; margin-top: 7px; font-size: 1.72rem; line-height: 1.1; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 8px; color: #52637c; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.review-card { position: relative; width: min(100%, 1010px); margin: 11px auto 0; padding: 13px 16px 13px 18px; display: grid; grid-template-columns: 130px minmax(0, 820px); justify-content: start; gap: 18px; align-items: start; border: 1px solid #d7e0ec; border-left: 4px solid var(--blue); border-radius: 10px; background: #fff; box-shadow: 0 4px 14px rgba(21,42,83,.05); }
.review-label { color: #172f68; font-size: .9rem; font-weight: 800; }
.review-card p { margin: 4px 0 0; color: #7a8799; font-size: .72rem; line-height: 1.4; }
.review-input-wrap textarea { width: 100%; min-height: 54px; resize: vertical; padding: 8px 10px; border: 1px solid #bdcbe1; border-radius: 8px; background: rgba(255,255,255,.92); color: var(--ink); line-height: 1.4; }
.review-input-wrap textarea:focus { outline: 3px solid rgba(29,78,216,.14); border-color: var(--blue); }
.review-input-wrap { width: 100%; max-width: 820px; }
.review-display { min-height: 32px; padding: 2px 0; border: 0; background: transparent; color: #25364f; font-size: .9rem; line-height: 1.55; white-space: pre-wrap; }
.review-display.empty { color: #8592a5; }
.review-actions { margin-top: 5px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.review-actions #reviewStatus { margin-right: auto; color: var(--green); font-size: .78rem; }
.weekly-lower-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.weekly-lower-grid .review-card { width: 100%; margin: 10px 0 0; padding: 11px 14px 11px 16px; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; }
.weekly-lower-grid .review-label { padding-top: 2px; }
.weekly-lower-grid .review-input-wrap { max-width: none; }
.weekly-toolbar { margin: 0; display: flex; align-items: flex-end; justify-content: flex-end; }
.weekly-toolbar .week-inline { justify-self: end; }
.primary-button, .secondary-button { padding: 5px 10px; border-radius: 7px; font-size: .76rem; font-weight: 750; }
.primary-button { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.secondary-button { border: 1px solid #c4cede; background: #fff; color: #53657d; }
.secondary-metrics { margin-top: 14px; }

.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.right-stack { min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { min-height: 50px; padding: 8px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 1.03rem; letter-spacing: -.02em; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.week-inline { flex: 0 0 auto; margin-left: auto; align-self: flex-start; }
.week-inline select { min-width: 245px; min-height: 34px; padding-top: 5px; padding-bottom: 5px; }
.count-badge { padding: 4px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: .76rem; font-weight: 750; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-grid .table-wrap { max-height: none; overflow-x: auto; }
.data-grid table { table-layout: fixed; }
.data-grid > .panel th:nth-child(1) { width: 9%; }
.data-grid > .panel th:nth-child(2) { width: 59%; }
.data-grid > .panel th:nth-child(3) { width: 14%; }
.data-grid > .panel th:nth-child(4) { width: 18%; }
.cube-panel th:nth-child(1) { width: 12%; }
.cube-panel th:nth-child(2) { width: 61%; }
.cube-panel th:nth-child(3) { width: 14%; }
.cube-panel th:nth-child(4) { width: 13%; }
.data-grid thead { position: sticky; top: 0; z-index: 1; }
table { width: 100%; border-collapse: collapse; }
th { padding: 5px 10px; color: #5f7088; background: #f7f9fc; border-bottom: 1px solid var(--line); font-size: .7rem; text-align: left; white-space: nowrap; line-height: 1.2; }
.top15-panel th, .cube-panel th { text-align: center; }
.top15-panel th:nth-child(2), .top15-panel th:nth-child(3), .cube-panel th:nth-child(2), .cube-panel th:nth-child(3) { text-align: left; }
.top15-panel td, .cube-panel td { text-align: center; }
.top15-panel td.book-name, .top15-panel td.publisher, .cube-panel td.book-name, .cube-panel td.publisher { text-align: left !important; }
td { padding: 4px 10px; border-bottom: 1px solid #edf1f5; font-size: .76rem; line-height: 1.25; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }
.rank { width: 44px; font-size: .8rem; font-weight: 800; color: #111827; text-align: center; }
.book-name { min-width: 0; max-width: 300px; overflow-wrap: anywhere; font-weight: 400; }
.book-name.math-book { font-weight: 700; }
.book-name.series-didimdol { color: #4472c4; }
.book-name.series-ssen { color: #d218c8; }
.book-name.series-top { color: #e3302f; }
.book-name.series-concept { color: #4e8f31; }
.book-name.series-cube-concept { color: #9a6700; }
.book-name.series-cube-calc { color: #397248; }
.book-name.series-cube-type { color: #3f6198; }
.book-name.series-backpoint { color: #74508f; }
.book-name.series-ssen-calc { color: #a16800; }
.cube-panel .rank, .cube-panel .book-name, .cube-panel .change, .top15-panel .rank, .top15-panel .change { font-weight: 400; }
.cube-panel .tracked-row > td { background: transparent; }
.cube-panel .tracked-row:hover > td { background: #f8fbff; }
.cube-panel .tracked-row.series-cube-concept .book-name { background: #fff2cc; color: #5f4b08; }
.cube-panel .tracked-row.series-cube-calc .book-name { background: #e2efda; color: #315f3c; }
.cube-panel .tracked-row.series-cube-type .book-name { background: #dae3f3; color: #344f7d; }
.cube-panel .tracked-row.series-backpoint .book-name { background: #eee3f7; color: #64467e; }
.publisher { color: var(--muted); white-space: nowrap; }
.change { display: inline-block; min-width: 39px; padding: 2px 6px; border-radius: 6px; font-size: .68rem; font-weight: 750; text-align: center; }
.change.up { color: var(--red); background: var(--red-soft); }
.change.new { color: #111827; background: #eef2f6; }
.change.down { color: var(--blue); background: var(--blue-soft); }
.change.same { color: #58687d; background: #eef2f6; }
.change.reentry { color: var(--amber); background: var(--amber-soft); }
.cube-panel .change, .top15-panel .change { padding: 0; border-radius: 0; background: transparent; }
.cube-panel .change.reentry, .top15-panel .change.reentry { color: #111827; background: transparent; }
.empty-state { padding: 36px 20px; color: var(--muted); text-align: center; font-size: .9rem; }
.empty-state.large { min-height: 220px; padding-top: 78px; }

.release-controls { display: flex; gap: 8px; }
.release-controls select { min-width: 136px; }
.yes24-add-button { min-height: 42px; padding: 8px 13px; border: 1px solid #173b87; border-radius: 8px; background: #173b87; color: #fff; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.search-field input { width: min(340px, 40vw); padding-left: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 13px center; }
.filter-row { margin: 12px 0 16px; display: flex; align-items: center; gap: 8px; }
.filter-chip { padding: 7px 14px; border: 1px solid #cad5e3; border-radius: 999px; background: #fff; color: #52637c; font-size: .84rem; font-weight: 700; }
.filter-chip.active { border-color: var(--blue); background: var(--blue); color: #fff; }
#releaseCount { margin-left: auto; color: var(--muted); font-size: .82rem; }
.release-list { display: block; }
.release-single-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.release-list.split-levels { display: block; }
.release-split-head, .release-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.release-split-head { margin-bottom: 12px; }
.release-split-head h2, .release-single-head h2 { width: auto; margin: 0; padding: 0 1px 5px; justify-self: start; border: 0; border-bottom: 2px solid #718096; border-radius: 0; background: transparent; color: #111827; font-size: .9rem; text-align: left; }
.release-split-head h2 + h2 { border-bottom-color: #9a8270; background: transparent; color: #111827; }
.release-single-head { margin-bottom: 12px; display: flex; justify-content: flex-start; }
.release-single-head.middle h2 { border-bottom-color: #9a8270; background: transparent; color: #111827; }
.release-pairs { display: grid; gap: 12px; }
.release-pair { align-items: stretch; }
.release-pair .release-item { height: 100%; }
.release-spacer { min-height: 1px; padding: 24px; color: var(--muted); text-align: center; }
.release-item { position: relative; padding: 16px; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 5px 18px rgba(21,42,83,.04); cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.release-item:hover { border-color: #9fb5db; box-shadow: 0 7px 22px rgba(21,42,83,.09); }
.release-item:focus-visible { outline: 3px solid rgba(29,78,216,.18); outline-offset: 2px; }
.release-item button { cursor: pointer; }
.release-main { min-width: 0; padding-right: 34px; }
.release-cover-area { display: grid; justify-items: center; gap: 8px; }
.cover-slot { position: relative; width: 112px; height: 150px; border: 1px solid #ccd6e4; border-radius: 8px; overflow: hidden; background: linear-gradient(145deg, #e8eef8, #f8faff); }
.cover-slot img { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; padding: 8px; color: #7b8ba0; font-size: .68rem; font-weight: 750; text-align: center; }
.release-tags { display: flex; align-items: center; gap: 7px; }
.cover-text-button { padding: 4px 8px; border: 1px solid #c9d5e6; border-radius: 6px; background: #fff; color: var(--blue-dark); font-size: .7rem; font-weight: 750; }
.level-badge { min-width: 0; padding: 0 1px 2px; border: 0; border-bottom: 2px solid #718096; border-radius: 0; background: transparent; color: #111827; font-size: .73rem; font-weight: 800; text-align: left; }
.level-badge.middle { border-bottom-color: #9a8270; background: transparent; color: #111827; }
.release-main h3 { margin: 0 0 7px; font-size: .98rem; line-height: 1.45; }
.release-main h3 { display: -webkit-box; max-width: 34ch; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.release-meta { margin: 0; color: var(--muted); font-size: .8rem; white-space: pre-line; }
.release-price { margin: 8px 0 0; color: #172f68; font-size: .92rem; font-weight: 850; }
.release-description { grid-column: 1 / -1; margin: 0; display: -webkit-box; overflow: hidden; color: #45566f; font-size: .79rem; line-height: 1.5; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 7; }
.release-specs, .release-detail-specs { margin: 7px 0 0; color: #52637c; font-size: .79rem; font-weight: 650; }
.description-link { color: #1d4ed8; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.description-link:hover { color: #173b87; }
.release-menu { position: absolute; top: 10px; right: 10px; z-index: 3; }
.release-menu-trigger { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #5b687a; font-size: 1.25rem; font-weight: 800; line-height: 1; }
.release-menu-trigger:hover, .release-menu-trigger[aria-expanded="true"] { background: #eef2f7; color: #1f2937; }
.release-menu-popover { position: absolute; top: 34px; right: 0; min-width: 88px; padding: 5px; display: grid; gap: 3px; border: 1px solid #d4dce8; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(21,42,83,.16); }
.release-menu-popover button { width: 100%; min-height: 30px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; white-space: nowrap; font-family: inherit; font-size: .78rem; font-weight: 700; line-height: 1.35; }
.release-menu-popover button:hover { background: #f3f6fa; }
.danger-button { padding: 5px 10px; border: 1px solid #efc2c7; border-radius: 7px; background: #fff7f8; color: #a3323c; font-size: .76rem; font-weight: 750; }
.release-menu-popover .danger-button { padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; font-size: .78rem; font-weight: 700; }
.release-detail-page { width: min(100%, 820px); margin: 12px auto 0; }
.release-detail-card { position: relative; padding: 24px; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.detail-close-button { position: absolute; top: -17px; right: -17px; z-index: 2; width: 34px; height: 34px; padding: 0; border: 1px solid #c5d1e2; border-radius: 50%; background: #fff; color: #344f7d; font-size: 1.35rem; line-height: 1; box-shadow: 0 4px 12px rgba(21,42,83,.12); }
.detail-close-button:hover { background: #f2f6fc; color: #17233c; }
.release-detail-cover { width: 180px; min-height: 0; aspect-ratio: 3 / 4; align-self: start; display: grid; place-items: center; overflow: hidden; border: 1px solid #d3dce8; border-radius: 9px; background: #f4f7fb; }
.release-detail-cover img { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
.release-detail-content { min-width: 0; padding-right: 40px; }
.release-detail-menu { top: 10px; right: 12px; }
.release-detail-content h2 { margin: 0 0 10px; color: #1c2f51; font-size: 1.45rem; line-height: 1.4; }
.release-detail-meta { margin: 0; padding: 11px 13px; border-radius: 8px; background: #f3f6fa; color: #53657d; white-space: pre-line; }
.release-detail-price { margin: 12px 0 0; color: #173b87; font-size: 1.05rem; font-weight: 850; }
.release-detail-description { grid-column: 1 / -1; width: min(100%, 72ch); margin: 0; color: #34445e; font-size: .9rem; line-height: 1.75; white-space: pre-line; }

.stats-cards { margin: 12px 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stat-card { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 4px 16px rgba(21,42,83,.035); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: .73rem; }
.stat-card strong { display: block; margin: 4px 0 3px; color: var(--blue-dark); font-size: 1.25rem; }
.stats-detail-grid { margin-bottom: 12px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.stats-breakdown { min-width: 0; }
.bar-list { padding: 13px 16px 15px; display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 76px 1fr 38px; gap: 10px; align-items: center; color: #53657d; font-size: .76rem; }
.bar-row strong { color: #263b5f; font-size: .76rem; text-align: right; }
.bar-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf1f6; }
.bar-track i { height: 100%; display: block; border-radius: inherit; background: #4d74c9; }
.movement-grid { padding: 13px 14px 15px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.movement-card { padding: 11px 8px; border: 1px solid #e1e7ef; border-radius: 8px; background: #fafbfd; text-align: center; }
.movement-card span, .movement-card strong { display: block; }
.movement-card span { color: #6c7b8f; font-size: .7rem; }
.movement-card strong { margin-top: 4px; color: #263b5f; font-size: 1rem; }
.movement-card.up strong, .movement-card.new strong { color: var(--red); }
.movement-card.down strong { color: var(--blue); }
.share-cell { width: 70px; height: 6px; display: inline-block; margin-right: 6px; overflow: hidden; border-radius: 99px; background: #edf1f6; vertical-align: middle; }
.share-cell span { height: 100%; display: block; border-radius: inherit; background: #4d74c9; }
.history-panel td small { color: #6c7b8f; }

.chart-panel { margin-bottom: 14px; }
.trend-chart { min-height: 280px; padding: 22px 24px 14px; overflow-x: auto; }
.trend-chart svg { min-width: 860px; width: 100%; height: 250px; display: block; }
.chart-grid { stroke: #dfe6ef; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGradient); }
.chart-dot { fill: #fff; stroke: var(--blue); stroke-width: 2.5; }
.chart-label { fill: #65758b; font-size: 11px; }
.chart-value { fill: #27436f; font-size: 11px; font-weight: 700; }
.history-panel td:last-child { max-width: 520px; color: #52637c; font-size: .8rem; }

dialog { width: min(720px, calc(100% - 32px)); max-height: min(80vh, 760px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 80px rgba(15,37,84,.28); color: var(--ink); }
dialog::backdrop { background: rgba(11, 27, 58, .58); backdrop-filter: blur(2px); }
.dialog-close { position: sticky; top: 12px; float: right; z-index: 2; width: 34px; height: 34px; margin: 12px 12px 0 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #4a5b73; font-size: 1.35rem; line-height: 1; }
#dialogContent { padding: 34px 34px 38px; }
.dialog-kicker { margin: 0 0 7px; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
#dialogContent h2 { margin: 0 48px 12px 0; font-size: 1.45rem; line-height: 1.35; }
.dialog-meta { padding: 12px 14px; border-radius: 8px; background: #f3f6fa; color: #4f6077; font-size: .85rem; white-space: pre-line; }
.dialog-description { margin-top: 22px; color: #34445e; white-space: pre-line; }
.dialog-price { display: inline-block; margin-top: 10px; color: #173b87; font-size: 1.05rem; font-weight: 850; }
.dialog-layout { display: grid; grid-template-columns: 130px 1fr; gap: 24px; align-items: start; }
.dialog-cover { width: 130px; min-height: 174px; border-radius: 9px; object-fit: contain; background: #fff; }

.yes24-dialog { width: min(920px, calc(100% - 24px)); max-height: calc(100vh - 20px); overflow: hidden; }
.yes24-form { max-height: calc(100vh - 20px); padding: 20px 28px 18px; overflow-y: auto; }
.yes24-form h2 { margin: 0; font-size: 1.45rem; }
.add-mode-tabs { display: inline-flex; gap: 3px; margin: 12px 0 10px; padding: 3px; border: 1px solid #d3deee; border-radius: 9px; background: #f3f6fa; }
.add-mode-tab { min-height: 34px; padding: 6px 13px; border: 0; border-radius: 6px; background: transparent; color: #66758b; font-size: .8rem; font-weight: 750; }
.add-mode-tab.active { background: #fff; color: #173b87; box-shadow: 0 1px 4px rgba(20,45,90,.13); }
.form-help { margin: 5px 45px 8px 0; color: var(--muted); font-size: .84rem; }
.yes24-form label { display: flex; flex-direction: column; gap: 5px; color: #4f6077; font-size: .8rem; font-weight: 750; }
.yes24-form input, .yes24-form select, .yes24-form textarea { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #c7d2e2; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 500; }
.yes24-form textarea { resize: vertical; line-height: 1.5; }
.paste-import textarea { min-height: 126px; }
#yes24Description { min-height: 126px; }
.import-top { margin-top: 10px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.import-copy-column { min-width: 0; }
.paste-import { min-height: 176px; box-sizing: border-box; margin: 0; padding: 9px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid #d3deee; border-radius: 10px; background: #f6f9fe; }
.paste-import .secondary-button { min-height: 42px; margin-top: 18px; align-self: center; white-space: nowrap; }
.import-status { min-height: 22px; margin: 8px 0 6px; color: #53657d; font-size: .8rem; }
.import-status.error { color: var(--red); }
.yes24-editor { display: block; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.yes24-editor[hidden], .form-actions[hidden] { display: none; }
.bulk-editor { display: grid; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.bulk-editor[hidden] { display: none; }
.bulk-common-row { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: end; }
.bulk-common-row p { margin: 0 0 7px; color: #708096; font-size: .78rem; }
.bulk-preview { display: grid; gap: 7px; max-height: 220px; overflow: auto; }
.bulk-preview:empty { display: none; }
#yes24BulkDescription { min-height: 210px; }
.bulk-preview-item { display: grid; grid-template-columns: minmax(0, 1.7fr) 118px 105px minmax(0, 1.2fr) 30px; gap: 7px; align-items: end; padding: 9px; border: 1px solid #d8e1ee; border-radius: 9px; background: #f8fafd; }
.bulk-preview-item label { font-size: .7rem; }
.bulk-preview-item input { min-height: 34px; padding: 5px 7px; font-size: .77rem; }
.bulk-remove { width: 30px; height: 34px; padding: 0; border: 0; background: transparent; color: #a33737; font-size: 1.1rem; }
.variant-summary { margin-top: 10px; color: #355b9a; font-size: .82rem; font-weight: 750; }
.variant-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.variant-card-row { min-width: 0; display: grid; grid-template-columns: 30px minmax(58px, auto) minmax(0, 1fr); gap: 5px; align-items: center; padding: 5px 7px; border-radius: 6px; background: #f4f7fb; color: #52637a; font-size: .7rem; line-height: 1.3; }
.variant-card-grade { color: #173b87; font-weight: 800; }
.variant-card-price { white-space: nowrap; font-weight: 700; }
.variant-card-specs { min-width: 0; white-space: nowrap; }
.variant-section { grid-column: 1 / -1; margin-top: 4px; }
.variant-section h3 { margin: 0 0 9px; font-size: .92rem; }
.variant-table-wrap { overflow-x: auto; border: 1px solid #dbe3ef; border-radius: 9px; }
.variant-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.variant-table th, .variant-table td { padding: 9px 10px; border-bottom: 1px solid #e5ebf3; text-align: left; vertical-align: top; }
.variant-table th { background: #f5f7fb; color: #53647b; font-weight: 750; white-space: nowrap; }
.variant-table tr:last-child td { border-bottom: 0; }
.variant-table .variant-price { white-space: nowrap; color: #173b87; font-weight: 750; }
.yes24-form.bulk-mode .import-top { grid-template-columns: 120px minmax(0, 1fr); }
.import-cover-frame { width: 120px; height: 176px; overflow: hidden; display: grid; place-items: center; border: 1px solid #c9d4e3; border-radius: 9px; background: #f3f6fa; color: #7b8ba0; font-size: .75rem; font-weight: 750; }
.import-cover-frame img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: #fff; }
.cover-file-button { margin-top: 10px; min-height: 38px; display: grid !important; place-items: center; padding: 8px 10px; border: 1px solid #b8c7dc; border-radius: 8px; background: #fff; color: var(--blue-dark) !important; cursor: pointer; }
.import-copy-column .import-status { margin: 6px 2px 0; }
.import-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
.import-fields > label:last-child { grid-column: 1 / -1; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row.price-specs { display: grid; grid-template-columns: minmax(150px, .36fr) minmax(0, .64fr); gap: 10px; }
.form-actions { position: sticky; bottom: -18px; z-index: 4; display: flex; justify-content: flex-end; gap: 8px; margin: 9px -28px -18px; padding: 11px 28px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -5px 14px rgba(26,49,88,.06); }

.drop-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(15,37,84,.76); backdrop-filter: blur(4px); }
.drop-overlay[hidden] { display: none; }
.drop-overlay div { width: min(520px, calc(100% - 40px)); padding: 48px 24px; border: 2px dashed #a9c4ff; border-radius: 18px; background: #fff; color: var(--blue-dark); text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.drop-overlay strong, .drop-overlay span { display: block; }
.drop-overlay strong { font-size: 1.2rem; }
.drop-overlay span { margin-top: 8px; color: var(--muted); font-size: .86rem; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .data-grid { grid-template-columns: 1fr; }
  .weekly-lower-grid { grid-template-columns: 1fr; }
  .weekly-toolbar .week-inline { width: min(100%, 360px); }
  .release-single-grid { grid-template-columns: 1fr; }
  .stats-cards { grid-template-columns: repeat(4, 1fr); }
  .stats-detail-grid { grid-template-columns: 1fr; }
  .releases-heading { align-items: stretch; flex-direction: column; }
  .releases-heading > div:first-child { min-width: 0; }
}

@media (max-width: 720px) {
  .header-inner { width: calc(100% - 24px); align-items: flex-start; }
  .privacy-note { display: none; }
  .brand span:not(.brand-mark) { display: none; }
  .view-tabs { overflow-x: auto; }
  .tabs-inner { width: calc(100% - 24px); gap: 18px; }
  main { width: min(100% - 24px, 1480px); padding-top: 12px; }
  .upload-toast { right: 12px; bottom: 12px; max-width: calc(100% - 24px); }
  .page-heading { align-items: stretch; flex-direction: column; }
  .select-field select { width: 100%; min-width: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 1.45rem; }
  .review-card { grid-template-columns: 1fr; gap: 6px; }
  .panel-head { align-items: flex-start; }
  th, td { padding-left: 11px; padding-right: 11px; }
  .publisher { white-space: normal; }
  .releases-heading { margin-bottom: 14px; }
  .release-controls { flex-direction: column; }
  .search-field input, .release-controls select, .yes24-add-button { width: 100%; }
  .release-item { grid-template-columns: 90px 1fr; }
  .release-main { padding-right: 0; }
  .cover-slot { width: 90px; height: 122px; }
  .release-split-head { display: none; }
  .release-pair { grid-template-columns: 1fr; }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .movement-grid { grid-template-columns: repeat(3, 1fr); }
  .dialog-layout { grid-template-columns: 90px 1fr; gap: 15px; }
  .dialog-cover { width: 90px; min-height: 122px; }
  .release-detail-card { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; padding: 18px; }
  .detail-close-button { top: 8px; right: 8px; }
  .release-detail-cover { width: 120px; min-height: 160px; }
  #dialogContent { padding: 28px 22px 30px; }
  .yes24-form { padding: 28px 20px 22px; }
  .import-top, .import-fields, .form-row.two, .form-row.price-specs { grid-template-columns: 1fr; }
  .yes24-form.bulk-mode .import-top { grid-template-columns: 1fr; }
  .import-fields > label:last-child { grid-column: auto; }
  .paste-import { grid-template-columns: 1fr; }
  .bulk-common-row, .bulk-preview-item { grid-template-columns: 1fr; }
  .bulk-remove { justify-self: end; }
  .import-cover-column { display: flex; align-items: center; gap: 12px; }
  .import-cover-frame { width: 105px; height: 140px; flex: 0 0 auto; }
  .paste-import { min-height: 0; }
  .variant-card-list { grid-template-columns: 1fr; }
  .import-cover-column p { text-align: left; }
  .form-actions { bottom: -22px; margin-right: -20px; margin-bottom: -22px; margin-left: -20px; padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 460px) {
  .app-header { padding-left: 14px; padding-right: 14px; }
  .brand-mark { display: none; }
  .brand strong { font-size: .98rem; }
  .upload-button { padding: 8px 10px; font-size: .82rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .review-card { padding: 16px; }
  .tab { font-size: .88rem; }
}
