/* Extends the portfolio’s Charter typography, ivory paper, muted blue, and sage. */
.shelf-page, .studio-page { --sans: var(--font-body); }
[hidden] { display: none !important; }
.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; }
.shelf-page { background: var(--paper); }
.shelf-page header, .shelf-page footer { width: min(100% - 64px, 880px); }
.shelf-page .nav-links a[aria-current] { color: var(--accent); font-weight: 650; box-shadow: inset 0 -2px var(--accent); }
.shelf-main { width: min(100% - 64px, 880px); }
.eyebrow { font: 500 12px/1.5 var(--sans); letter-spacing: 1.8px; }
.shelf-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 38px 0 20px; }
.shelf-intro h1 { font-size: 38px; font-weight: 600; letter-spacing: 0; line-height: 1.2; margin: 0 0 13px; }
.shelf-intro h1 > span { color: var(--foliage); }
.shelf-description { font-size: 16px; line-height: 1.65; color: var(--muted); }
.shelf-intro-aside { padding-bottom: 5px; font: 400 13px/1.6 var(--sans); color: var(--foliage); }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8da67a; margin: 0 7px 1px 0; box-shadow: 0 0 0 4px #8da67a10; }
.aside-hint { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.collection-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; border-top: 1px solid #e5e3db; }
.collection-tabs { display: flex; align-items: center; gap: 7px; }
.collection-tab { border: none; background: transparent; color: var(--muted); border-radius: 6px; padding: 8px 13px; font: 500 13px/1.5 var(--sans); cursor: pointer; transition: background .2s, color .2s; }
.collection-tab:hover { color: #334535; }
.collection-tab.active { background: #e8ebe2; color: var(--foliage); }
.collection-tab > span { font-size: 11px; margin-left: 6px; opacity: .55; }
.collection-search { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 400 21px/1 var(--sans); }
.collection-search input { width: 147px; border: 0; background: transparent; padding: 8px 0; color: var(--muted); font: 400 13px/1.4 var(--sans); }
.collection-search input::placeholder { color: var(--muted); }
.collection-cabinet { position: relative; border-radius: 8px; border: 1px solid var(--line); background: linear-gradient(135deg,#f1f3ecb3,#ffffff90 50%,#eef2f3b3); backdrop-filter: blur(16px); box-shadow: 0 15px 40px -24px #496b8033,inset 0 1px #fff; padding: 27px 0 0; color: var(--ink); overflow: hidden; }
.media-section { padding: 0 0 25px; }
.media-section + .media-section { padding-top: 24px; border-top: 1px solid var(--line); }
.row-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 35px; }
.row-eyebrow { color: var(--foliage); font: 400 10px/1.5 var(--sans); letter-spacing: 2px; margin-bottom: 8px; }
.row-heading h2 { color: var(--ink); font: 400 26px/1.2 var(--font-body); letter-spacing: -.4px; margin-bottom: 7px; }
.row-count { display: inline-flex; vertical-align: middle; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 50%; background: #ffffff0a; color: var(--foliage); margin-left: 10px; font: 400 11px/1 var(--sans); }
.row-description { color: var(--muted); font: 400 12px/1.5 var(--sans); }
.row-controls { display: flex; gap: 7px; }
.row-controls button { display: grid; place-items: center; width: 29px; height: 29px; background: #ffffff80; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer; font: 400 15px/1 var(--sans); transition: background .2s; }
.row-controls button:hover { background: #e9eeeb; }
.row-controls button:disabled { opacity: .25; cursor: default; }
.media-row { display: flex; gap: 20px; padding: 24px 35px 20px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #b4bcae transparent; scroll-padding-inline: 35px; }
.media-row::-webkit-scrollbar { height: 3px; }
.media-row::-webkit-scrollbar-thumb { border-radius: 4px; background: #b4bcae; }
.media-item { min-width: 0; flex: 0 0 260px; scroll-snap-align: start; }
.book-row { gap: 27px; }
.book-row .media-item { flex-basis: 146px; }
.card-tilt { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%; position: relative; perspective: 1100px; aspect-ratio: 1.6; transition: transform .25s; }
.book-row .card-tilt { aspect-ratio: 2 / 3; }
.card-tilt:hover { z-index: 2; }
.media-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .35s cubic-bezier(.2,.65,.3,1); }
.media-card.is-flipped { transform: rotateX(var(--rx)) rotateY(calc(180deg + var(--ry))); }
.card-face { position: absolute; inset: 0; border-radius: 9px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #30392f; box-shadow: 0 8px 18px #2c29241c, inset 0 0 0 1px #ffffff25; isolation: isolate; }
.card-front::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 #ffffff45, inset 0 0 0 1px #ffffff17; background: linear-gradient(145deg,#ffffff17,transparent 45%,#00000018); }
.card-front::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at var(--mx) var(--my),#ffffff75 0%,#ffffff18 24%,transparent 65%); mix-blend-mode: screen; transition: opacity .3s; }
.card-tilt:hover .card-front::before, .card-tilt:focus-within .card-front::before { opacity: .75; }
.cover-image { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; transition: transform .5s ease; }
.card-tilt:hover .cover-image { transform: scale(1.045); }
.book-row .cover-image { object-position: center; }
.book-row .card-front { border-radius: 3px 7px 7px 3px; }
.book-row .card-front::after { background: linear-gradient(90deg,#00000045, #ffffff25 2%, #00000020 4%,transparent 8%,transparent 94%,#ffffff15); }
.card-flip-button { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; background: transparent; color: #fff; border: 0; border-radius: inherit; cursor: pointer; }
.card-flip-button:focus-visible { outline: 2px solid #e0eccf; outline-offset: -4px; }
.card-back { transform: rotateY(180deg); padding: 16px; display: flex; flex-direction: column; background: radial-gradient(ellipse at 100% 0%,#dde5d49c,transparent 90%),#f5f6f0; border: 1px solid #b7c3ae; }
.card-back { cursor: pointer; }
.card-back:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.card-note { cursor: text; }
.shelf-main { padding-bottom: 42px; }
.back-eyebrow { font: 500 9px/1.5 var(--sans); letter-spacing: 1.5px; color: var(--foliage); text-transform: uppercase; margin-bottom: 8px; padding-right: 18px; }
.card-note { min-height: 0; overflow-y: auto; overscroll-behavior: contain; color: var(--ink); font: 400 13px/1.5 var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; }
.card-note.is-empty { color: var(--foliage); font-style: italic; }
.card-back-footer { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-link { color: var(--foliage); font: 400 10px/1.5 var(--sans); text-decoration: none; }
.source-link:hover { color: var(--accent); text-decoration: underline; }
.card-caption { padding-top: 12px; }
.card-caption h3 { font: 500 14px/1.5 var(--sans); color: var(--ink); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.card-caption p { font: 400 11px/1.5 var(--sans); color: var(--muted); margin-top: 3px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.cover-fallback { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center; background: radial-gradient(circle at 15% 10%,#b2c1a940,transparent 70%), linear-gradient(135deg,#48513e,#222d32); }
.cover-fallback > span { font: 400 15px/1.3 var(--font-body); color: #e1e3d7; }
.cover-fallback > small { margin-top: 9px; color: #bcc6b4; font: 400 10px/1.6 var(--sans); letter-spacing: 1px; }
.row-empty { padding-block: 22px; color: var(--muted); font: 400 14px/1.7 var(--sans); }
.page-feedback { font: 400 14px/1.7 var(--sans); margin: 0 0 20px; color: #7f654d; }
.page-feedback button { margin-left: 8px; border: 0; background: transparent; text-decoration: underline; color: inherit; cursor: pointer; font: inherit; }
.skeleton-card { flex: 0 0 260px; aspect-ratio: 1.6; border-radius: 9px; background: linear-gradient(110deg,#dedbd330 30%,#dedbd370 50%,#dedbd330 70%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.book-row .skeleton-card { flex-basis: 146px; aspect-ratio: 2 / 3; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Private studio */
.studio-page { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 14px; min-height: 100dvh; }
.studio-page header, .studio-main, .studio-page footer { width: min(100% - 64px, 880px); }
.studio-header nav { min-height: 80px; }
.studio-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 400 26px/1 var(--font-body); letter-spacing: -1px; }
.studio-brand > span:not(.private-badge):last-of-type { color: var(--muted); }
.brand-divider { color: var(--muted); font-weight: 300; }
.private-badge { margin-left: 6px; padding: 5px 7px; border: 1px solid #b8cba22a; border-radius: 4px; color: var(--foliage); font: 500 9px/1 var(--sans); letter-spacing: 1px; }
.studio-nav { display: flex; align-items: center; gap: 24px; font-size: 12px; }
.studio-nav a { color: var(--foliage); text-decoration: none; }
.text-button { background: none; border: 0; color: var(--foliage); cursor: pointer; padding: 7px 0; font: 400 13px/1.5 var(--sans); }
.text-button:hover { color: var(--ink); }
.login-section { max-width: 540px; padding: 70px 0 80px; margin: auto; text-align: center; }
.login-ornament { display: flex; position: relative; justify-content: center; align-items: center; height: 145px; margin-bottom: 25px; perspective: 800px; }
.login-ornament > div { position: absolute; width: 77px; height: 112px; border-radius: 7px; background: linear-gradient(140deg,#dce5dca0,#ffffff60 80%); border: 1px solid #a8baa18a; box-shadow: 0 12px 25px #47625215,inset 0 1px #ffffff30; backdrop-filter: blur(8px); }
.login-ornament > div:nth-child(1) { transform: translateX(-50px) rotate(-19deg); opacity: .45; }
.login-ornament > div:nth-child(2) { transform: translateX(48px) rotate(19deg); opacity: .7; }
.login-ornament > div:nth-child(3) { transform: translateY(-9px) rotate(-4deg); }
.login-ornament > span { position: relative; z-index: 1; color: var(--ink); font-size: 35px; transform: translateY(-9px); }
.login-section > .eyebrow { color: var(--foliage); font-size: 11px; }
.login-section h1 { font: 400 clamp(40px,5vw,56px)/1.1 var(--font-body); letter-spacing: -1.8px; margin: 18px 0 20px; }
.login-section > p:not(.eyebrow):not(.form-message) { color: var(--muted); font-size: 14px; line-height: 1.8; }
.login-form { text-align: left; max-width: 410px; margin: 33px auto 0; }
.login-form label { font-size: 12px; color: var(--foliage); }
.password-field { display: flex; gap: 7px; padding: 6px; margin-top: 8px; border: 1px solid var(--line); background: #ffffff80; border-radius: 9px; }
.password-field input { min-width: 0; width: 100%; background: none; border: 0; font: 400 14px/1.5 var(--sans); color: var(--ink); padding: 8px; }
.password-field:focus-within { border-color: #abbf8b; }
.password-field input:focus { outline: none; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 20px; flex-shrink: 0; border: 1px solid #496b8040; border-radius: 6px; background: linear-gradient(130deg,#5b7b8f,#496b80); box-shadow: inset 0 1px 0 #ffffff20,0 3px 8px #496b8015; color: #fff; padding: 11px 15px; cursor: pointer; font: 500 13px/1.5 var(--sans); transition: filter .2s; }
.primary-button:hover { filter: brightness(1.08); }
.primary-button:disabled { opacity: .5; cursor: wait; }
.form-message { font: 400 13px/1.6 var(--sans); color: var(--foliage); min-height: 18px; margin-top: 12px; overflow-wrap: anywhere; }
.form-message.error, .search-status.error { color: #91563c; }
.login-back { display: inline-block; margin-top: 24px; color: var(--foliage); text-decoration: none; font-size: 12px; }
.setup-guide { text-align: left; margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #ffffff80; font-size: 13px; color: var(--foliage); }
.setup-guide strong { color: var(--ink); font-weight: 500; }
.setup-guide p { font-size: 12px; margin-top: 10px; }
.setup-guide code { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.studio-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 43px 0 30px; }
.studio-intro .eyebrow { color: var(--foliage); font-size: 10px; }
.studio-intro h1 { font: 400 43px/1.2 var(--font-body); letter-spacing: -1.3px; margin: 13px 0 9px; }
.studio-intro > div > p:last-child { font-size: 13px; color: var(--muted); }
.studio-total { font-size: 12px; color: var(--muted); padding-bottom: 5px; }
.storage-notice { border: 1px solid #a5b99330; background: #a5b99309; color: var(--muted); border-radius: 6px; padding: 12px 15px; margin: 0 0 20px; font-size: 13px; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.studio-panel { border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg,#ffffffa0,#edf0e730); box-shadow: inset 0 1px 0 #ffffff06; padding: 27px; }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 25px; }
.step-number { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #c4d5ac24; border-radius: 50%; color: var(--foliage); font-size: 11px; flex-shrink: 0; }
.panel-heading h2 { color: var(--ink); font: 400 20px/1.2 var(--font-body); letter-spacing: -.3px; margin-bottom: 5px; }
.panel-heading p { color: var(--muted); font: 400 12px/1.5 var(--sans); }
.type-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: #e9ece380; border-radius: 7px; margin-bottom: 16px; }
.type-switch button { flex: 1; border: 0; border-radius: 5px; padding: 8px 10px; background: transparent; color: var(--muted); cursor: pointer; font: 400 13px/1.5 var(--sans); }
.type-switch button.active { background: #ffffffc0; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.studio-search { display: flex; border: 1px solid var(--line); border-radius: 7px; background: #ffffffa0; }
.studio-search:focus-within { border-color: #a5b99380; }
.studio-search input { flex: 1; min-width: 0; background: transparent; color: var(--ink); border: 0; font: 400 13px/1.5 var(--sans); padding: 13px; }
.studio-search input:focus { outline: none; }
.studio-page input::placeholder, .studio-page textarea::placeholder { color: #7f8b76; }
.studio-search button { width: 44px; background: transparent; border: 0; color: var(--foliage); cursor: pointer; font-size: 19px; }
.search-status { margin: 11px 0; color: var(--muted); font-size: 12px; }
.search-results { display: grid; gap: 6px; max-height: 450px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.search-result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #ffffff80; border: 1px solid transparent; border-radius: 7px; padding: 9px; color: var(--ink); cursor: pointer; }
.search-result:hover, .search-result.selected { background: #e9eee680; border-color: var(--line); }
.result-artwork { width: 36px; height: 50px; flex-shrink: 0; border-radius: 3px; overflow: hidden; background: #30392b; }
.result-artwork img { width: 100%; height: 100%; object-fit: cover; }
.result-artwork .cover-fallback { padding: 4px; }
.result-artwork .cover-fallback span { font-size: 9px; }
.result-artwork .cover-fallback small { display: none; }
.result-copy { min-width: 0; }
.result-title { display: block; font: 500 13px/1.5 var(--sans); }
.result-meta { display: block; color: var(--muted); font: 400 11px/1.6 var(--sans); margin-top: 3px; }
.result-add { margin-left: auto; color: var(--foliage); font-size: 18px; padding-left: 7px; }
.manual-button { margin-top: 17px; font-size: 12px; }
.provider-credit { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.provider-credit a { color: var(--muted); }
.editor-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 320px; text-align: center; }
.editor-placeholder > span { color: var(--foliage); font-size: 35px; opacity: .7; margin-bottom: 20px; }
.editor-placeholder h3 { color: var(--ink); font: 400 23px/1.5 var(--font-body); margin-bottom: 8px; }
.editor-placeholder p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.editor-preview { display: flex; justify-content: center; padding: 12px 0 22px; }
.editor-preview .media-item { width: 210px; flex-basis: auto; }
.editor-preview.is-book .media-item { width: 115px; }
.editor-preview.is-book .card-tilt { aspect-ratio: 2 / 3; }
.editor-preview .card-caption { text-align: center; }
.editor-preview .card-note { font-size: 13px; }
.cover-picker { margin-bottom: 12px; }
.cover-picker-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cover-picker-actions .text-button { font-size: 12px; }
.cover-picker-actions button:disabled { opacity: .5; cursor: wait; }
.cover-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; max-height: 370px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.cover-option { min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 5px; background: #ffffff80; color: var(--muted); text-align: left; cursor: pointer; }
.cover-option:hover, .cover-option.selected { border-color: var(--foliage); background: #e9eee680; }
.cover-option-image { height: 110px; overflow: hidden; border-radius: 3px; background: #dedbd330; }
.cover-option-image img { width: 100%; height: 100%; object-fit: contain; }
.cover-option-provider { display: block; margin-top: 6px; color: var(--foliage); font-size: 11px; }
.cover-option-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; margin-top: 2px; }
.entry-fields label { display: block; font-size: 11px; color: var(--foliage); margin: 12px 0 6px; }
.entry-fields label > span { float: right; font-size: 9px; color: var(--muted); letter-spacing: 1px; }
.entry-fields input, .entry-fields textarea, .entry-fields select, .library-filter input { width: 100%; min-width: 0; background: #ffffffa0; border: 1px solid var(--line); color: var(--ink); padding: 9px 11px; border-radius: 5px; font: 400 13px/1.6 var(--sans); }
.entry-fields textarea { resize: vertical; min-height: 90px; }
.field-pair { display: grid; grid-template-columns: 1fr 85px; gap: 12px; }
.note-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; margin-top: 5px; }
.note-meta > span:last-child { flex-shrink: 0; }
.artwork-details { margin-top: 18px; color: var(--foliage); font-size: 11px; }
.artwork-details summary { cursor: pointer; padding: 6px 0; }
.entry-fields select { color-scheme: light; }
.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 15px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.studio-library { padding: 42px 0 60px; }
.library-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.library-heading .eyebrow { color: var(--foliage); font-size: 10px; }
.library-heading h2 { color: var(--ink); font: 400 28px/1.2 var(--font-body); margin: 9px 0 0; }
.library-heading h2 > span { font: 400 12px/1 var(--sans); color: var(--foliage); margin-left: 11px; }
.library-filter input { width: 210px; font-size: 12px; }
.library-list { display: grid; gap: 8px; }
.library-empty { text-align: center; border: 1px dashed var(--line); border-radius: 9px; padding: 35px; color: var(--foliage); font-size: 13px; }
.library-item { display: flex; gap: 14px; align-items: center; padding: 12px 16px; background: #ffffff80; border: 1px solid var(--line); border-radius: 7px; }
.library-item-copy { min-width: 0; flex: 1; }
.library-item h3 { color: var(--ink); font: 500 13px/1.5 var(--sans); }
.library-item-copy > p { margin-top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.library-item-actions { display: flex; gap: 17px; align-items: center; }
.library-item-actions .text-button { font-size: 11px; }
.library-item-actions .remove-button { color: #8c5f48; }
.studio-page footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-color: var(--line); color: var(--muted); font: 400 11px/1.6 var(--sans); padding-top: 21px; }
.studio-footer > span:last-child { font-size: 9px; letter-spacing: 1px; }
.studio-footer > span:last-child > span { font-size: 17px; vertical-align: middle; margin-left: 14px; }
.shelf-toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); z-index: 100; max-width: calc(100% - 40px); border: 1px solid var(--line); border-radius: 8px; background: #f5f6f0f5; box-shadow: 0 12px 35px #0005; backdrop-filter: blur(20px); padding: 13px 22px; color: var(--ink); font-size: 14px; }
.delete-dialog { margin: auto; width: min(100% - 40px,430px); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 28px; color: var(--ink); box-shadow: 0 25px 70px #0005; }
.delete-dialog::backdrop { background: #2c292455; backdrop-filter: blur(7px); }
.delete-dialog .eyebrow { font-size: 10px; color: var(--foliage); }
.delete-dialog h2 { font: 400 29px/1.3 var(--font-body); margin-top: 14px; }
.delete-dialog p { margin-top: 10px; font-size: 13px; color: var(--muted); }
.delete-dialog form > div { display: flex; justify-content: flex-end; align-items: center; gap: 24px; margin-top: 23px; }
.danger-button { border: 1px solid #cb997d50; border-radius: 5px; background: #f4eae4; color: #8c5f48; padding: 9px 13px; font-size: 13px; cursor: pointer; }
.danger-button:disabled { opacity: .5; cursor: wait; }
@media (max-width: 760px) {
    .shelf-page header, .shelf-page footer, .shelf-main, .studio-page header, .studio-main, .studio-page footer { width: calc(100% - 40px); }
    .shelf-intro { flex-wrap: wrap; }
    .shelf-intro-aside { display: block; }
    .aside-hint { display: none; }
    .shelf-description { font-size: 15px; }
    .collection-cabinet { border-radius: 13px; padding-top: 27px; }
    .row-heading { padding-inline: 23px; }
    .row-description { font-size: 11px; max-width: 245px; }
    .media-row { padding-inline: 23px; scroll-padding-inline: 23px; gap: 16px; }
    .media-item { flex-basis: 237px; }
    .book-row { gap: 21px; }
    .book-row .media-item { flex-basis: 134px; }
    .collection-tab { padding-inline: 10px; font-size: 12px; }
    .collection-search input { width: 110px; font-size: 12px; }
    .collection-toolbar { gap: 8px; }
    .studio-grid { grid-template-columns: 1fr; }
    .studio-panel { padding: 23px; }
    .studio-intro h1 { font-size: 36px; }
    .studio-total { font-size: 11px; }
    .studio-brand { font-size: 24px; gap: 10px; }
    .studio-nav { gap: 14px; font-size: 11px; }
    .login-section { padding-top: 45px; }
    .editor-placeholder { min-height: 220px; }
    .library-heading h2 { font-size: 25px; }
    .library-filter input { width: 170px; }
}
@media (max-width: 430px) {
    .collection-search input { width: 85px; }
    .collection-tab { padding-inline: 8px; font-size: 11px; }
    .collection-tab > span { margin-left: 3px; }
    .row-description { max-width: 215px; font-size: 10px; }
    .row-heading { gap: 8px; }
    .row-controls { gap: 5px; }
    .row-controls button { width: 25px; height: 25px; }
    .studio-header nav { flex-wrap: wrap; gap: 12px; padding-block: 20px; }
    .studio-intro { display: block; }
    .studio-total { display: block; margin-top: 13px; }
    .studio-intro h1 { font-size: 32px; }
    .password-field { flex-wrap: wrap; }
    .password-field .primary-button { width: 100%; }
    .library-heading { align-items: flex-start; flex-direction: column; }
    .library-filter, .library-filter input { width: 100%; }
    .library-item { padding-inline: 10px; gap: 10px; }
    .library-item-actions { flex-direction: column; gap: 1px; }
    .note-meta { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .shelf-page *, .studio-page * { animation: none !important; transition: none !important; }
    .media-card { transform: none !important; }
    .media-card.is-flipped { transform: rotateY(180deg) !important; }
    .card-tilt:hover .cover-image { transform: none; }
}

@media (max-width: 700px) {
    .shelf-intro h1 { font-size: 30px; }
    .shelf-intro { padding-top: 38px; padding-bottom: 20px; }
}
@media (max-width: 380px) {
    .shelf-intro h1 { font-size: 26px; }
}
