:root {
  --primary: #2f8f4e;
  --primary-text: #fff;
  --accent: #0b7fa4;
  --banner: #0a7748;
  --banner-text: #fff;
  --primary-dark: color-mix(in srgb, var(--primary) 76%, #151515);
  --primary-soft: color-mix(in srgb, var(--primary) 10%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
  --banner-dark: color-mix(in srgb, var(--banner) 82%, #101010);
  --banner-soft: color-mix(in srgb, var(--banner) 9%, #fff);
  --ink: #202522;
  --muted: #707772;
  --line: color-mix(in srgb, var(--primary) 11%, #ecefec);
  --canvas: #f6f9f7;
  --card: #fff;
  --danger: #c63d3d;
  --warning: #ad6a08;
  --shadow: 0 18px 55px color-mix(in srgb, var(--primary) 11%, transparent);
  --shadow-sm: 0 8px 26px color-mix(in srgb, var(--primary) 9%, transparent);
  --radius: 22px;
  --radius-sm: 14px;
  --sidebar: 244px;
  --control-height: 46px;
  --font-caption: 11px;
  --font-small: 12px;
  --font-body: 14px;
  --font-heading: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.12; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.preloader { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--canvas); transition: opacity .5s var(--ease), visibility .5s; }
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader p { color: var(--muted); font-size: 13px; letter-spacing: .03em; }
.preloader-mark { display: flex; gap: 4px; width: 58px; height: 50px; }
.preloader-mark span { flex: 1; border-radius: 6px 18px 8px 8px; background: var(--primary); transform-origin: bottom center; animation: leaf 1.1s infinite alternate var(--ease); }
.preloader-mark span:last-child { background: var(--accent); animation-delay: -.55s; }
@keyframes leaf { from { transform: rotate(0) scaleY(.78); } to { transform: rotate(5deg) scaleY(1); } }

.button { min-height: 46px; padding: 0 20px; border: 1px solid var(--primary); border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: var(--primary-text); background: var(--primary); font-weight: 760; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 22%, transparent); transition: transform .2s var(--ease), box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 28%, transparent); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); box-shadow: none; }
.button.ghost { color: var(--primary-dark); background: transparent; border-color: transparent; box-shadow: none; }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button.small { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 13px; }
.button.large { min-height: 54px; }
.button.full { width: 100%; }
.button-row { display: flex; justify-content: flex-end; gap: 10px; }
.button-row.left { justify-content: flex-start; margin-top: 26px; }
.text-link { color: var(--primary-dark); font-weight: 750; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 26px; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; }
.text-danger { color: var(--danger) !important; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.badge, .status { display: inline-flex; align-items: center; white-space: nowrap; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge.success, .status.active, .status.available, .status.ready, .status.returned { color: #1c713a; background: #e7f6eb; }
.badge.neutral, .status.neutral, .status.pending { color: #657168; background: #eef2ef; }
.status.borrowed { color: #176985; background: #e5f4f8; }
.status.overdue, .status.inactive, .status.rejected, .status.lost { color: #a42d2d; background: #fdeaea; }
.status.repair, .status.damaged { color: #976007; background: #fff3d9; }

.brand { display: flex; align-items: center; height: 62px; }
.brand img { display: block; width: 190px; max-height: 56px; object-fit: contain; object-position: left center; }
.theme-logo { transition: filter .35s var(--ease); }
.theme-logo.is-adaptive { filter: var(--logo-filter, none); }

/* Public */
.public-shell { background: var(--canvas); }
.public-header { position: sticky; top: 0; z-index: 100; height: 82px; padding: 0 clamp(22px, 6vw, 92px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent); background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(18px); }
.public-header nav { display: flex; gap: 32px; color: #526157; font-weight: 680; }
.public-header nav a:hover { color: var(--primary); }
.header-actions { justify-self: end; display: flex; gap: 8px; }
.hero { min-height: calc(100vh - 82px); padding: 80px clamp(24px, 8vw, 130px); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 7vw; overflow: hidden; background: radial-gradient(circle at 72% 42%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 33%), linear-gradient(135deg, var(--canvas) 58%, var(--primary-soft)); }
.hero h1 { margin-bottom: 22px; max-width: 760px; font-size: clamp(48px, 6.2vw, 88px); font-weight: 810; }
.hero h1 em { color: var(--primary); font-family: Georgia, serif; font-weight: 500; }
.hero-copy > p { max-width: 620px; margin-bottom: 30px; color: var(--muted); font-size: 18px; }
.hero-search { max-width: 680px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; padding: 7px 7px 7px 18px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.hero-search > span, .catalog-search > span { color: var(--primary); font-size: 24px; }
.hero-search input, .catalog-search input { width: 100%; min-width: 0; padding: 11px 8px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.hero-search button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 11px; color: var(--primary-text); background: var(--primary); font-weight: 750; }
.hero-actions { margin-top: 24px; display: flex; align-items: center; gap: 24px; }
.hero-visual { position: relative; min-height: 590px; display: grid; place-items: center; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 430px; height: 430px; background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 20%, white), color-mix(in srgb, var(--accent) 14%, white)); box-shadow: inset 0 0 80px rgba(255,255,255,.65); }
.orb-two { width: 230px; height: 230px; left: 8%; bottom: 3%; background: color-mix(in srgb, var(--primary) 8%, white); }
.book-stack { position: relative; width: 330px; height: 400px; z-index: 2; perspective: 800px; }
.book { position: absolute; width: 235px; height: 330px; top: 35px; left: 46px; border-radius: 8px 18px 18px 8px; display: grid; place-items: center; color: rgba(255,255,255,.9); font-size: 13px; font-weight: 850; letter-spacing: .2em; box-shadow: -14px 22px 40px color-mix(in srgb, var(--primary) 24%, transparent); transform-origin: left center; }
.book:before { content: ''; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.28); }
.book-a { background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 84%, white), var(--primary-dark)); transform: rotate(-8deg) translateX(-40px); }
.book-b { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 86%, white), color-mix(in srgb, var(--accent) 76%, #171717)); transform: rotate(2deg); }
.book-c { background: linear-gradient(160deg, color-mix(in srgb, var(--banner) 88%, white), var(--banner-dark)); transform: rotate(11deg) translateX(40px); }
.floating-card { position: absolute; z-index: 4; min-width: 200px; padding: 15px 18px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(255,255,255,.8); border-radius: 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(14px); box-shadow: var(--shadow); animation: float 4.5s ease-in-out infinite; }
.floating-card > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 18px; font-weight: 900; }
.floating-card strong, .floating-card small { display: block; }
.floating-card small { color: var(--muted); }
.card-available { right: -3%; top: 17%; }
.card-scan { left: -4%; bottom: 16%; animation-delay: -2.2s; }
@keyframes float { 50% { transform: translateY(-12px); } }
.trust-strip { max-width: 1200px; margin: -35px auto 0; padding: 24px 30px; position: relative; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.trust-strip div { padding: 5px 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.trust-strip div:last-child { border: 0; }
.trust-strip strong { font-size: 27px; }
.trust-strip span { color: var(--muted); font-size: 13px; }
.section { max-width: 1260px; margin: 0 auto; padding: 110px 30px; }
.section.compact { padding-top: 62px; padding-bottom: 82px; }
.section-heading { margin-bottom: 34px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(30px, 4vw, 46px); }
.section-heading.centered { text-align: center; justify-content: center; }
.section-heading.centered p { max-width: 560px; margin: 14px auto 0; color: var(--muted); }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.book-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 6px 24px color-mix(in srgb, var(--primary) 6%, transparent); transition: transform .25s var(--ease), box-shadow .25s; }
.book-card:hover { transform: translateY(-7px); box-shadow: var(--shadow); }
.book-cover { aspect-ratio: 3/4; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 84%, #161616), color-mix(in srgb, var(--accent) 76%, #161616)); }
.book-cover:after { content: ''; position: absolute; width: 70%; height: 130%; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; transform: rotate(35deg); }
.book-cover.has-image:after { display: none; }
.book-cover > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.book-cover > span { color: var(--primary-text); font-family: Georgia, serif; font-size: 74px; position: relative; z-index: 1; }
.book-cover b { position: absolute; z-index: 2; right: 13px; top: 13px; padding: 5px 8px; border-radius: 7px; color: var(--banner-text); background: color-mix(in srgb, var(--banner) 82%, transparent); font-size: 9px; letter-spacing: .1em; }
.book-meta { padding: 20px; }
.book-meta > small { color: var(--primary); font-weight: 800; }
.book-meta h3 { min-height: 44px; margin: 8px 0 5px; font-size: 18px; }
.book-meta > p { min-height: 23px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-meta > div { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.book-meta strong { font-size: 12px; }
.availability { padding: 4px 8px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--primary) 5%, #f3f4f3); font-size: 10px; font-weight: 800; }
.availability.ready { color: var(--primary-dark); background: var(--primary-soft); }
.service-section { max-width: none; background: linear-gradient(180deg, var(--primary-soft), var(--canvas)); }
.service-grid { max-width: 1200px; margin: 50px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.service-card { padding: 30px; border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent); border-radius: 20px; background: rgba(255,255,255,.76); }
.service-card > span { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 22px; }
.service-card h3 { margin-bottom: 10px; font-size: 20px; }
.service-card p { margin: 0; color: var(--muted); }
.public-footer { padding: 50px clamp(25px, 8vw, 130px); display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 30px; color: var(--banner-text); background: linear-gradient(135deg, var(--banner-dark), var(--banner)); }
.public-footer img { width: 190px; max-height: 64px; padding: 8px 10px; object-fit: contain; object-position: left; border-radius: 12px; background: color-mix(in srgb, var(--banner-text) 92%, transparent); }
.public-footer p { margin: 8px 0 0; color: color-mix(in srgb, var(--banner-text) 72%, transparent); }
.public-footer small { color: color-mix(in srgb, var(--banner-text) 62%, transparent); }
.catalog-hero { padding: 80px 25px 66px; text-align: center; color: var(--banner-text); background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 48%, transparent), transparent 32%), linear-gradient(135deg, var(--banner-dark), var(--banner)); }
.catalog-hero h1 { margin-bottom: 10px; font-size: clamp(38px, 6vw, 62px); }
.catalog-hero p { color: color-mix(in srgb, var(--banner-text) 76%, transparent); }
.catalog-hero .eyebrow { color: color-mix(in srgb, var(--accent) 58%, var(--banner-text)); }
.catalog-search { max-width: 700px; margin: 28px auto -92px; padding: 8px 8px 8px 18px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; border-radius: 17px; background: white; box-shadow: 0 20px 50px color-mix(in srgb, var(--banner) 25%, transparent); }
.result-heading { margin-bottom: 28px; display: flex; justify-content: space-between; color: var(--muted); }
.result-heading a { color: var(--primary); font-weight: 700; }
.empty-state { padding: 80px 25px; text-align: center; border: 1px dashed color-mix(in srgb, var(--primary) 22%, #d8dcd9); border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 3%, var(--canvas)); }
.empty-state > div { margin-bottom: 12px; color: var(--primary); font-size: 42px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { margin: 0; color: var(--muted); }
.detail-grid { margin-bottom: 50px; display: grid; grid-template-columns: 370px 1fr; gap: 70px; align-items: center; }
.detail-cover { aspect-ratio: 3/4; display: grid; place-items: center; position: relative; border-radius: 16px 36px 36px 16px; color: var(--primary-text); background: linear-gradient(145deg, var(--primary), var(--accent)); box-shadow: -14px 20px 45px color-mix(in srgb, var(--primary) 22%, transparent); }
.detail-cover.has-image { overflow: hidden; background: white; }
.detail-cover > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail-cover > span { font-family: Georgia, serif; font-size: 130px; }
.detail-cover b { position: absolute; top: 22px; right: 22px; font-size: 11px; letter-spacing: .13em; }
.detail-copy h1 { margin-bottom: 8px; font-size: clamp(36px, 5vw, 62px); }
.detail-author { color: var(--primary); font-weight: 750; }
.detail-copy > p:not(.detail-author) { max-width: 720px; color: var(--muted); font-size: 16px; }
.metadata { margin-top: 25px; padding: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.metadata div { padding-right: 20px; }
.metadata small, .metadata strong { display: block; }
.metadata small { color: var(--muted); }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 5px 22px rgba(22,60,34,.035); }
.panel.spaced { margin-top: 24px; }
.panel-heading { min-height: 48px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 0; font-size: 21px; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.panel-heading > a { color: var(--primary); font-weight: 750; font-size: 13px; }
.empty-inline { padding: 34px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.scan-page { min-height: calc(100vh - 82px); padding: 70px 22px; display: grid; place-items: center; background: linear-gradient(145deg, var(--canvas), var(--primary-soft)); }
.scan-card { width: min(100%, 540px); padding: 44px; text-align: center; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.scan-success, .scan-error { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-text); background: var(--primary); font-size: 28px; font-weight: 900; }
.scan-error { background: var(--danger); }
.scan-card h1 { margin-bottom: 7px; font-size: 32px; }
.scan-card > p { color: var(--muted); }
.scan-code { display: inline-block; margin: 12px 0 22px; padding: 7px 12px; border-radius: 8px; color: var(--primary-dark); background: var(--primary-soft); font-weight: 850; letter-spacing: .08em; }
.scan-location { padding: 20px; border-radius: 16px; background: var(--canvas); }
.scan-location small, .scan-location strong, .scan-location span { display: block; }
.scan-location small { color: var(--muted); }
.scan-location strong { margin: 5px 0; font-size: 19px; }
.scan-status { margin: 20px 0; display: flex; justify-content: space-between; align-items: center; }
.due-note { color: var(--danger) !important; }

/* Auth */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 25%), radial-gradient(circle at 10% 85%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 30%), var(--canvas); }
.auth-main { width: min(100%, 570px); position: relative; }
.auth-login .auth-main { width: min(100%, 460px); }
.auth-card { padding: 42px 50px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.auth-login .auth-card { padding: 36px 38px; border-radius: 24px; }
.auth-brand { justify-content: center; margin-bottom: 28px; }
.auth-brand img { width: 230px; max-height: 75px; object-position: center; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 700; }
.auth-heading { margin-bottom: 28px; text-align: center; }
.auth-heading h1 { margin: 12px 0 7px; font-size: 32px; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-icon { width: 46px; height: 46px; margin: auto; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 24px; }
.auth-icon i { line-height: 1; }
.auth-divider { margin: 24px 0 15px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth-divider:before, .auth-divider:after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 750; }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.inline-alert { margin-bottom: 20px; padding: 12px 14px; border-radius: 12px; color: #9d2e2e; background: #feeeee; font-size: 13px; }
.inline-alert.success { color: #1d6c38; background: #e9f7ed; }

/* Forms */
.form-stack { display: grid; gap: 17px; }
.form-field { display: grid; gap: 7px; }
.field-label { color: #34453a; font-size: var(--font-small); font-weight: 750; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
label { display: grid; gap: 7px; color: #34453a; font-size: var(--font-small); font-weight: 750; }
label small { color: var(--muted); font-size: var(--font-caption); font-weight: 500; }
input, select, textarea { width: 100%; min-height: var(--control-height); padding: 10px 13px; border: 1px solid #dbe4de; border-radius: 11px; outline: none; color: var(--ink); background: #fff; font-size: var(--font-body); font-weight: 600; line-height: 1.4; transition: border-color .2s, box-shadow .2s, background .2s; }
select { height: var(--control-height); padding-block: 0; cursor: pointer; }
.select-control { position: relative; display: block; width: 100%; min-width: 0; }
.select-control select { -webkit-appearance: none; -moz-appearance: none; appearance: none; display: block; height: var(--control-height); padding: 0 42px 0 13px; line-height: normal; }
.select-control-icon { position: absolute; top: 50%; right: 14px; z-index: 1; transform: translateY(-50%); color: #6f7c73; font-size: 12px; line-height: 1; pointer-events: none; transition: color .2s, transform .2s; }
.select-control:focus-within .select-control-icon { color: var(--primary); transform: translateY(-50%) rotate(180deg); }
.select-control select:disabled + .select-control-icon { color: #aeb6b0; }
select option { color: var(--ink); background: #fff; font-weight: 500; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #929c95; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 28%, #dbe4de); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 75%, white); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { color: #87928b; background: #f5f7f6; cursor: not-allowed; }
input[type="file"] { padding: 6px; }
input[type="file"]::file-selector-button { height: 32px; margin-right: 10px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--primary-dark); background: var(--primary-soft); font: inherit; font-size: var(--font-small); font-weight: 750; cursor: pointer; }
.media-drop { min-height: 156px; padding: 15px; position: relative; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 17px; overflow: hidden; border: 1.5px dashed color-mix(in srgb, var(--primary) 32%, #cfd9d2); border-radius: 16px; background: color-mix(in srgb, var(--primary) 3%, #fff); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.media-drop:hover, .media-drop.is-dragging { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.media-drop input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.media-preview-frame { width: 92px; aspect-ratio: 3/4; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; color: var(--primary); background: white; box-shadow: var(--shadow-sm); }
.media-preview-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-preview-frame > span { font-size: 29px; }
.media-drop-copy { min-width: 0; display: grid; gap: 4px; }
.media-drop-copy strong { color: var(--ink); font-size: 13px; }
.media-drop-copy small { color: var(--muted); font-size: 11px; font-weight: 550; line-height: 1.45; }
.media-drop-copy em { margin-top: 4px; overflow: hidden; color: var(--primary-dark); font-size: 10px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
input[type="color"] { padding: 5px; height: var(--control-height); }
select[multiple] { height: auto; min-height: 170px; padding: 9px 11px; }
.password-field, .scan-input { position: relative; display: flex; gap: 9px; }
.password-field button { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; border: 0; color: var(--muted); background: transparent; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { min-height: 46px; padding: 11px 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; }
.check input { width: 18px; height: 18px; min-height: 18px; accent-color: var(--primary); }
.check span > small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.form-separator { display: flex; align-items: center; gap: 12px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.form-separator:after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-actions { display: flex; justify-content: flex-end; }
.inline-form { display: flex; align-items: end; gap: 12px; }
.inline-form label { flex: 1; }
.info-box { padding: 13px; border-radius: 12px; color: var(--primary-dark); background: var(--primary-soft); font-size: 12px; }

/* App shell */
.app-shell { min-height: 100vh; background: var(--canvas); font-size: 14px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 300; width: var(--sidebar); padding: 18px 16px; display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid #e9eeeb; background: #fff; }
.sidebar .brand { height: 54px; margin: 0 10px 24px; }
.sidebar .brand img { width: 168px; max-height: 50px; }
.sidebar-groups { display: grid; gap: 14px; }
.sidebar-group { display: grid; gap: 3px; }
.sidebar-label { margin: 0 11px 9px; color: #a1aba4; font-size: 9px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 3px; }
.sidebar-nav a { min-height: 41px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border-radius: 10px; color: #69756d; font-size: 12px; font-weight: 700; transition: color .2s, background .2s, transform .2s; }
.sidebar-nav a > i { width: 22px; color: #8a958e; text-align: center; font-size: 15px; }
.sidebar-nav a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.sidebar-nav a:hover { transform: translateX(2px); }
.sidebar-nav a.active { color: var(--primary-text); background: var(--primary); box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 21%, transparent); }
.sidebar-nav a.active > i { color: var(--primary-text); }
.sidebar-user { margin-top: auto; padding: 11px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; border: 1px solid #e8edea; border-radius: 13px; background: #fbfcfb; }
.sidebar-user strong, .sidebar-user small { max-width: 106px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user small { color: var(--muted); font-size: 9px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; }
.icon-button i { font-size: 15px; }
.avatar { display: grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%; color: var(--primary-text); background: linear-gradient(145deg, var(--primary), var(--accent)); font-weight: 850; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-xl { width: 105px; height: 105px; font-size: 36px; }
.app-main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 68px; padding: 0 clamp(20px, 2.6vw, 38px); position: sticky; top: 0; z-index: 200; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(226,233,228,.92); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); }
.topbar-search { width: min(410px, 42vw); height: 39px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #e4eae6; border-radius: 10px; color: #8a958e; background: #f8faf9; }
.topbar-search input { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 12px; }
.topbar-search input:focus { box-shadow: none; }
.topbar-search i { font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.topbar-alert { width: 36px; height: 36px; position: relative; display: grid; place-items: center; border: 1px solid #e4eae6; border-radius: 10px; color: #69756d; background: #fff; }
.topbar-alert > span { min-width: 17px; height: 17px; padding: 0 4px; position: absolute; top: -6px; right: -6px; display: grid; place-items: center; border: 2px solid white; border-radius: 10px; color: white; background: var(--danger); font-size: 8px; font-weight: 850; }
.topbar-profile { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.topbar-profile > span { min-width: 105px; display: grid; }
.topbar-profile strong, .topbar-profile small { display: block; max-width: 145px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-profile strong { font-size: 11px; }
.topbar-profile small { color: var(--muted); font-size: 9px; }
.topbar-profile > i { color: #97a199; font-size: 10px; }
.menu-toggle { display: none; }
.app-content { width: min(100%, 1580px); margin: auto; padding: 25px clamp(22px, 2.5vw, 40px) 64px; }
.page-heading { margin-bottom: 30px; display: flex; align-items: end; justify-content: space-between; gap: 25px; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(30px, 3.2vw, 44px); }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; gap: 10px; }
.stat-grid { margin-bottom: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { min-height: 145px; padding: 22px; display: flex; gap: 16px; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: 0 6px 24px rgba(22,60,34,.03); }
.stat-card > span { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.stat-card small, .stat-card strong, .stat-card p { display: block; }
.stat-card small { color: var(--muted); }
.stat-card strong { margin: 5px 0 0; font-size: 32px; line-height: 1.15; }
.stat-card strong.word { font-size: 24px; }
.stat-card p { margin: 2px 0 0; color: #8b978f; font-size: 11px; }
.stat-card.primary { color: var(--primary-text); border-color: transparent; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); }
.stat-card.primary > span { color: var(--primary-text); background: color-mix(in srgb, var(--primary-text) 16%, transparent); }
.stat-card.primary small, .stat-card.primary p { color: color-mix(in srgb, var(--primary-text) 72%, transparent); }
.stat-card.danger > span { color: var(--danger); background: #fdeaea; }
.dashboard-grid { margin-bottom: 24px; display: grid; grid-template-columns: 1.65fr .75fr; gap: 20px; }
.loan-list { display: grid; }
.loan-list article { padding: 14px 0; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.loan-list article:last-child { border: 0; }
.list-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.list-grow { min-width: 0; flex: 1; }
.list-grow strong, .list-grow p { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-grow strong { font-size: 13px; }
.list-grow p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.list-end { display: grid; justify-items: end; gap: 4px; }
.list-end small { color: var(--muted); font-size: 10px; }
.quick-links { display: grid; gap: 8px; }
.quick-links a { padding: 12px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; transition: .2s; }
.quick-links a:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); transform: translateX(3px); }
.quick-links a > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.quick-links strong, .quick-links small { display: block; }
.quick-links strong { font-size: 12px; }
.quick-links small { color: var(--muted); font-size: 10px; }
.activity-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.activity-list > div { display: flex; gap: 10px; }
.activity-list > div > span { width: 8px; height: 8px; margin-top: 8px; flex: none; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.activity-list p { margin: 0; color: var(--muted); font-size: 12px; }
.activity-list strong, .activity-list small { display: block; color: var(--ink); }
.activity-list small { margin-top: 3px; color: #929e96; font-size: 10px; }

/* Dashboard · Option 1 */
.app-shell .panel { border-color: #e6ece8; border-radius: 16px; box-shadow: 0 8px 24px rgba(25, 59, 36, .035); }
.dashboard-heading { margin-bottom: 17px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.dashboard-heading .eyebrow { margin-bottom: 3px; font-size: 9px; }
.dashboard-heading h1 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.dashboard-date { display: inline-flex; align-items: center; gap: 8px; color: #7d8981; font-size: 11px; font-weight: 650; }
.dashboard-date i { color: var(--primary); }
.dashboard-hero-grid { margin-bottom: 17px; display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(285px, .68fr); gap: 17px; }
.welcome-card { min-height: 252px; padding: 31px 34px; position: relative; overflow: hidden; border-radius: 17px; color: var(--banner-text); background: radial-gradient(circle at 75% 10%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 34%), linear-gradient(135deg, color-mix(in srgb, var(--banner) 88%, white) 0%, var(--banner) 56%, color-mix(in srgb, var(--banner) 82%, black) 100%); box-shadow: 0 15px 36px color-mix(in srgb, var(--banner) 18%, transparent); }
.welcome-card:before { content: ''; width: 290px; height: 290px; position: absolute; right: 20%; bottom: -74%; border: 1px solid color-mix(in srgb, var(--banner-text) 10%, transparent); border-radius: 50%; }
.welcome-copy { width: 58%; position: relative; z-index: 2; }
.welcome-role { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 17px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--banner-text) 18%, transparent); border-radius: 999px; color: color-mix(in srgb, var(--banner-text) 84%, transparent); background: color-mix(in srgb, var(--banner-text) 9%, transparent); font-size: 9px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.welcome-copy h2 { margin: 0 0 9px; font-size: clamp(25px, 2.25vw, 33px); font-weight: 790; line-height: 1.09; letter-spacing: -.035em; }
.welcome-copy p { max-width: 450px; margin-bottom: 20px; color: color-mix(in srgb, var(--banner-text) 76%, transparent); font-size: 11px; line-height: 1.55; }
.welcome-action { min-height: 35px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border-radius: 9px; color: var(--banner); background: var(--banner-text); font-size: 10px; font-weight: 820; box-shadow: 0 8px 22px rgba(0,0,0,.1); transition: transform .2s var(--ease), box-shadow .2s; }
.welcome-action:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.welcome-illustration { width: min(49%, 510px); height: 96%; position: absolute; right: -1%; bottom: -6%; z-index: 1; object-fit: contain; object-position: right bottom; filter: saturate(.55) drop-shadow(0 18px 20px rgba(0,0,0,.09)); mix-blend-mode: luminosity; }
.daily-summary { min-width: 0; padding: 20px; }
.daily-summary-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.daily-summary-heading .eyebrow { margin-bottom: 3px; font-size: 8px; }
.daily-summary-heading h2 { margin: 0; font-size: 16px; }
.live-indicator { display: inline-flex; align-items: center; gap: 5px; color: #6f7d74; font-size: 9px; font-weight: 750; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #30af5a; box-shadow: 0 0 0 4px #e5f7ea; }
.summary-list { display: grid; }
.summary-row { min-height: 44px; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; border-bottom: 1px solid #edf1ee; color: #657168; font-size: 10px; }
.summary-row:last-child { border: 0; }
.summary-row strong { color: var(--ink); font-size: 13px; }
.summary-icon, .dashboard-stat-icon { display: grid; place-items: center; border-radius: 9px; }
.summary-icon { width: 29px; height: 29px; font-size: 12px; }
.summary-icon.green, .dashboard-stat-icon.green { color: var(--primary-dark); background: var(--primary-soft); }
.summary-icon.blue, .dashboard-stat-icon.blue { color: color-mix(in srgb, var(--accent) 88%, #123); background: color-mix(in srgb, var(--accent) 11%, white); }
.summary-icon.red, .dashboard-stat-icon.red { color: #c54242; background: #fdecec; }
.summary-icon.purple, .dashboard-stat-icon.purple { color: color-mix(in srgb, var(--primary) 45%, var(--accent)); background: color-mix(in srgb, var(--primary) 8%, white); }
.summary-icon.orange, .dashboard-stat-icon.orange { color: color-mix(in srgb, var(--accent) 68%, #b45f13); background: color-mix(in srgb, var(--accent) 9%, #fff7e9); }
.dashboard-stat-grid { margin-bottom: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.dashboard-stat-card { min-width: 0; min-height: 106px; padding: 17px; display: flex; align-items: flex-start; gap: 13px; border: 1px solid #e6ece8; border-radius: 15px; background: #fff; box-shadow: 0 6px 20px rgba(25, 59, 36, .025); }
.dashboard-stat-icon { width: 37px; height: 37px; flex: none; font-size: 16px; }
.dashboard-stat-card > div { min-width: 0; }
.dashboard-stat-card small, .dashboard-stat-card strong, .dashboard-stat-card p { display: block; }
.dashboard-stat-card small { margin-bottom: 2px; color: #79857d; font-size: 9px; font-weight: 720; }
.dashboard-stat-card strong { color: #14271b; font-size: 26px; line-height: 1.05; letter-spacing: -.03em; }
.dashboard-stat-card strong.word { margin-top: 5px; font-size: 19px; }
.dashboard-stat-card p { margin: 5px 0 0; white-space: nowrap; overflow: hidden; color: #98a199; font-size: 9px; text-overflow: ellipsis; }
.dashboard-lower-grid { margin-bottom: 17px; display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(285px, .68fr); gap: 17px; align-items: start; }
.circulation-panel, .quick-panel { padding: 21px; }
.compact-heading { min-height: 37px; margin-bottom: 14px; }
.compact-heading .eyebrow { margin-bottom: 3px; font-size: 8px; }
.compact-heading h2 { font-size: 16px; }
.compact-heading > a { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; }
.circulation-table { min-width: 0; }
.circulation-head, .circulation-row { display: grid; grid-template-columns: 75px minmax(220px, 1fr) minmax(130px, .55fr) 94px; gap: 12px; align-items: center; }
.circulation-head { min-height: 30px; padding: 0 9px; border-radius: 8px; color: #909a93; background: #f8faf9; font-size: 8px; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.circulation-row { min-height: 61px; padding: 8px 9px; border-bottom: 1px solid #edf1ee; }
.circulation-row:last-child { border: 0; }
.circulation-date strong, .circulation-date span, .circulation-member strong, .circulation-member small { display: block; }
.circulation-date strong { font-size: 15px; line-height: 1; }
.circulation-date span, .circulation-member small { margin-top: 4px; color: #929d95; font-size: 8px; }
.circulation-book { min-width: 0; display: flex; align-items: center; gap: 10px; }
.circulation-book > div { min-width: 0; }
.circulation-book .list-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.circulation-book strong, .circulation-book small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circulation-book strong, .circulation-member strong { font-size: 10px; }
.circulation-book small { margin-top: 3px; color: #919c94; font-size: 8px; }
.circulation-row .status { padding: 4px 8px; font-size: 8px; }
.quick-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-action-grid a { min-height: 81px; padding: 11px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; border: 1px solid #e8edea; border-radius: 11px; background: #fbfcfb; transition: transform .2s var(--ease), border-color .2s, background .2s; }
.quick-action-grid a:hover { border-color: color-mix(in srgb, var(--primary) 40%, #e8edea); background: var(--primary-soft); transform: translateY(-2px); }
.quick-action-grid span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 13px; }
.quick-action-grid strong { font-size: 9px; line-height: 1.25; }
.circulation-panel .empty-inline { min-height: 210px; display: grid; place-content: center; justify-items: center; gap: 4px; }
.circulation-panel .empty-inline i { margin-bottom: 5px; color: var(--primary); font-size: 25px; }
.circulation-panel .empty-inline strong, .circulation-panel .empty-inline span { display: block; }
.circulation-panel .empty-inline span { font-size: 10px; }
.audit-panel { margin-top: 0; padding: 21px; }
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
.profile-summary { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-summary h2 { margin: 18px 0 4px; }
.profile-summary > p { color: var(--muted); }
.member-code { width: 100%; margin-top: 30px; padding: 16px; border-radius: 14px; background: var(--canvas); }
.member-code small, .member-code strong { display: block; }
.member-code small { color: var(--muted); }
.member-code strong { margin-top: 3px; letter-spacing: .08em; }
.table-search { width: min(260px, 100%); display: flex; align-items: center; padding-left: 12px; border: 1px solid var(--line); border-radius: 11px; }
.table-search input { min-height: 39px; border: 0; box-shadow: none; background: transparent; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; color: #8a968e; background: #f8faf9; font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.table-action { padding: 0; border: 0; color: var(--primary-dark); background: transparent; font-size: 12px; font-weight: 800; }
.danger-link { color: var(--danger); }
.person-cell { display: flex; align-items: center; gap: 10px; }
.collection-cell { min-width: 230px; display: flex; align-items: center; gap: 11px; }
.collection-cell > img, .collection-cell > span { width: 38px; height: 50px; display: grid; place-items: center; flex: none; border-radius: 7px; object-fit: cover; color: var(--primary-text); background: linear-gradient(145deg, var(--primary), var(--accent)); font-weight: 850; }
.action-group { display: flex; align-items: center; gap: 12px; }
.copy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.copy-card { padding: 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 14px; }
.copy-card small, .copy-card strong { display: block; }
.copy-card em { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-style: normal; }
.copy-card small { color: var(--primary); font-weight: 800; }
.copy-card strong { font-size: 12px; }
.copy-code-actions { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.code-button { min-height: 35px; padding: 7px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; color: var(--primary-dark); background: var(--primary-soft); font-size: 11px; font-weight: 750; }
.code-button:last-child { color: color-mix(in srgb, var(--accent) 78%, #151515); background: var(--accent-soft); }
.generated-input { min-height: var(--control-height); padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px dashed color-mix(in srgb, var(--primary) 30%, #dbe4de); border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); }
.generated-input i { font-size: 15px; }
.generated-input strong { font-size: 12px; }
.subsection { margin-top: 26px; padding-top: 23px; border-top: 1px solid var(--line); }
.subsection h3 { margin-bottom: 15px; }
.attention-panel, .info-banner { margin-bottom: 20px; padding: 16px 19px; display: flex; justify-content: space-between; border: 1px solid #f0dfbb; border-radius: 16px; color: #704600; background: #fff9e8; }
.attention-panel > div, .info-banner { display: flex; gap: 13px; align-items: center; }
.attention-panel > div > span, .info-banner > span { width: 35px; height: 35px; display: grid; place-items: center; flex: none; border-radius: 11px; background: rgba(215,151,26,.13); font-weight: 900; }
.attention-panel strong, .attention-panel p, .info-banner strong, .info-banner p { margin: 0; }
.attention-panel p, .info-banner p { font-size: 12px; opacity: .78; }
.attention-panel.danger { color: #842a2a; border-color: #f0caca; background: #fff1f1; }
.info-banner { color: var(--primary-dark); border-color: color-mix(in srgb, var(--primary) 22%, #e8e8e8); background: var(--primary-soft); }
.inventory-grid { margin-bottom: 20px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.scanner-panel { background: linear-gradient(160deg, #fff, #f6fbf7); }
.scanner-pulse { width: 13px; height: 13px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 7px var(--primary-soft); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 13px transparent; } }
.camera-box { min-height: 270px; padding: 14px; position: relative; overflow: hidden; text-align: center; border-radius: 16px; color: white; background: #07120b; }
.camera-box video { width: 100%; max-height: 350px; border-radius: 10px; }
.camera-box p { margin: 8px 0; }
.location-list { display: grid; gap: 10px; max-height: 490px; overflow: auto; }
.location-list article { padding: 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 13px; }
.location-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.location-list strong, .location-list p, .location-list small { display: block; margin: 0; }
.location-list p { font-size: 11px; }
.location-list small { color: var(--muted); font-size: 10px; }
.settings-heading { margin-bottom: 22px; }
.settings-form { display: grid; gap: 18px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-detail-grid { align-items: start; }
.theme-builder-panel { padding: 24px; }
.settings-heading h1 { font-size: clamp(25px, 2.4vw, 34px); }
.theme-panel-heading { align-items: flex-start; }
.theme-panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.theme-state { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.theme-builder-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 28px; align-items: start; }
.settings-subheading { margin-bottom: 12px; }
.settings-subheading strong, .settings-subheading small { display: block; }
.settings-subheading strong { font-size: 12px; }
.settings-subheading small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.theme-preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.theme-preset { min-height: 68px; padding: 10px 11px; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 10px; text-align: left; border: 1px solid #e5ebe7; border-radius: 12px; color: var(--ink); background: #fff; transition: border-color .2s, background .2s, transform .2s; }
.theme-preset:hover { border-color: color-mix(in srgb, var(--primary) 38%, #e5ebe7); transform: translateY(-1px); }
.theme-preset.active { border-color: color-mix(in srgb, var(--primary) 55%, #dfe7e2); background: var(--primary-soft); box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 8%, transparent); }
.theme-preset > span:nth-child(2) { min-width: 0; }
.theme-preset strong, .theme-preset small { display: block; }
.theme-preset strong { font-size: 10px; }
.theme-preset small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.theme-check { color: var(--primary); opacity: 0; font-size: 13px; }
.theme-preset.active .theme-check { opacity: 1; }
.theme-swatches { width: 56px; display: flex; align-items: center; }
.theme-swatches i { width: 21px; height: 31px; margin-right: -8px; display: block; border: 2px solid white; border-radius: 8px; background: var(--swatch); box-shadow: 0 2px 7px rgba(20,39,27,.1); }
.palette-heading { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.palette-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.color-setting { min-height: 67px; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e5ebe7; border-radius: 12px; background: #fbfcfb; }
.color-setting > span:first-child { min-width: 0; font-size: 10px; }
.color-setting > span:first-child small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; }
.color-control { display: flex; align-items: center; gap: 7px; }
.color-control input[type="color"] { width: 35px; height: 35px; min-height: 35px; padding: 3px; border-radius: 9px; }
.color-control output { min-width: 54px; color: #66736a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 700; }
.theme-preview-wrap { min-width: 0; }
.theme-live-preview { min-height: 277px; padding: 10px; display: grid; grid-template-columns: 54px 1fr; gap: 9px; overflow: hidden; border: 1px solid #e2e8e4; border-radius: 15px; background: var(--canvas); box-shadow: 0 15px 34px rgba(22,53,33,.08); }
.theme-preview-nav { padding: 11px 7px; display: grid; align-content: start; gap: 10px; border-radius: 10px; background: white; }
.theme-preview-nav span { height: 8px; border-radius: 5px; background: #e8edea; }
.theme-preview-nav span:first-child { width: 70%; margin-bottom: 12px; background: color-mix(in srgb, var(--primary) 22%, white); }
.theme-preview-nav span.active { height: 25px; background: var(--primary); }
.theme-preview-content { min-width: 0; padding: 2px; display: grid; align-content: start; gap: 9px; }
.theme-preview-top { height: 23px; display: flex; align-items: center; justify-content: space-between; }
.theme-preview-top span { width: 44%; height: 8px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 14%, white); }
.theme-preview-top i { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); }
.theme-preview-banner { min-height: 129px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; overflow: hidden; border-radius: 12px; color: var(--banner-text); background: linear-gradient(135deg, color-mix(in srgb, var(--banner) 88%, white), var(--banner), color-mix(in srgb, var(--banner) 82%, black)); }
.theme-preview-banner > div { min-width: 0; }
.theme-preview-banner small, .theme-preview-banner strong, .theme-preview-banner span { display: block; }
.theme-preview-banner small { margin-bottom: 6px; color: color-mix(in srgb, var(--banner-text) 72%, transparent); font-size: 6px; letter-spacing: .08em; text-transform: uppercase; }
.theme-preview-banner strong { max-width: 140px; font-size: 13px; line-height: 1.2; }
.theme-preview-banner span { width: 55px; height: 16px; margin-top: 12px; border-radius: 5px; background: var(--banner-text); }
.theme-preview-banner > i { color: color-mix(in srgb, var(--banner-text) 70%, transparent); font-size: 48px; }
.theme-preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-preview-stats span { height: 49px; border: 1px solid #e7ece8; border-radius: 9px; background: white; box-shadow: inset 0 3px 0 var(--primary-soft); }
.contrast-note { margin-top: 10px; padding: 9px 10px; display: flex; align-items: center; gap: 8px; border-radius: 10px; color: #607067; background: #f7f9f8; font-size: 8px; }
.contrast-note i { color: var(--primary); font-size: 13px; }
.identity-preview { margin-bottom: 24px; padding: 22px; display: flex; align-items: center; gap: 18px; border-radius: 16px; background: linear-gradient(140deg, color-mix(in srgb, var(--primary) 8%, white), color-mix(in srgb, var(--accent) 8%, white)); }
.identity-preview img { width: 150px; height: 62px; object-fit: contain; object-position: left; }
.identity-preview strong, .identity-preview small { display: block; }
.identity-preview small { color: var(--muted); }
.rule-heading { margin-top: 30px; padding-top: 25px; border-top: 1px solid var(--line); }
.sticky-save { margin-top: 0; padding: 16px 20px; position: sticky; bottom: 18px; z-index: 20; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.92); backdrop-filter: blur(15px); box-shadow: var(--shadow); }
.sticky-save strong, .sticky-save small { display: block; }
.sticky-save small { color: var(--muted); }

/* Overlays */
.drawer { position: fixed; inset: 0; z-index: 600; display: grid; grid-template-columns: 1fr min(520px, 94vw); }
.drawer-backdrop { background: rgba(7,23,13,.42); backdrop-filter: blur(3px); }
.drawer-panel { height: 100%; padding: 28px; overflow-y: auto; background: white; animation: drawerIn .3s var(--ease); }
@keyframes drawerIn { from { transform: translateX(30px); opacity: .5; } }
.drawer-heading { margin-bottom: 25px; display: flex; justify-content: space-between; align-items: start; }
.drawer-heading h2 { margin: 0; font-size: 27px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 900; padding: 20px; display: grid; place-items: center; background: rgba(7,23,13,.48); backdrop-filter: blur(5px); }
.confirm-card { width: min(100%, 430px); padding: 32px; position: relative; text-align: center; border-radius: 22px; background: white; box-shadow: 0 25px 70px rgba(0,0,0,.2); animation: modalIn .25s var(--ease); }
@keyframes modalIn { from { transform: translateY(10px) scale(.97); opacity: 0; } }
.confirm-icon { width: 56px; height: 56px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 24px; font-weight: 900; }
.confirm-card h2 { margin-bottom: 8px; }
.confirm-card p { color: var(--muted); }
.confirm-card .button-row { margin-top: 24px; justify-content: center; }
.modal-close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--canvas); }
.qr-card { width: min(100%, 390px); }
#qrCanvas { width: 230px; height: 230px; margin: 20px auto; padding: 15px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; }
#qrCanvas img, #qrCanvas canvas { max-width: 100%; height: auto !important; }
.barcode-card { width: min(100%, 520px); }
#barcodeCanvas { width: 100%; min-height: 154px; margin: 20px auto; padding: 18px 12px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
#barcodeCanvas svg { width: 100%; max-width: 430px; height: auto; }
.toast { max-width: 650px; margin: 0 0 22px auto; padding: 13px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid color-mix(in srgb, var(--primary) 22%, #e8e8e8); border-radius: 13px; color: var(--primary-dark); background: var(--primary-soft); box-shadow: var(--shadow-sm); transition: opacity .3s, transform .3s; }
.toast.error { color: #8c2c2c; border-color: #f0cece; background: #fff0f0; }
.toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-text); background: var(--primary); font-size: 12px; font-weight: 900; }
.toast.error > span { background: var(--danger); }
.toast button { margin-left: auto; border: 0; color: inherit; background: transparent; font-size: 20px; }
.toast-public { position: fixed; z-index: 500; top: 98px; right: 22px; }
.toast.hide { opacity: 0; transform: translateY(-8px); }
.mobile-nav { display: none; }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s var(--ease), transform .65s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* Reader */
.reader-page { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: 68px 1fr; background: color-mix(in srgb, var(--banner) 36%, #202020); }
.reader-header { padding: 0 20px; display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 16px; color: var(--banner-text); background: var(--banner-dark); }
.reader-header > a { display: inline-flex; align-items: center; gap: 7px; color: color-mix(in srgb, var(--banner-text) 78%, transparent); }
.reader-header > div:nth-child(2) { text-align: center; }
.reader-header strong, .reader-header small { display: block; }
.reader-header small { color: color-mix(in srgb, var(--banner-text) 62%, transparent); }
.reader-header > div:last-child { display: flex; justify-content: flex-end; gap: 8px; }
.reader-frame { width: 100%; height: 100%; border: 0; background: #333; }
.reader-empty { color: var(--ink); background: white; }

@media (max-width: 1180px) {
  .hero { padding-inline: 55px; gap: 3vw; }
  .hero-visual { transform: scale(.88); }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-builder-grid { grid-template-columns: 1fr; }
  .theme-preview-wrap { max-width: 620px; }
  .activity-list { grid-template-columns: repeat(2, 1fr); }
  .copy-grid { grid-template-columns: repeat(2, 1fr); }
  .inline-form.responsive { display: grid; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar: 252px; }
  .public-header { grid-template-columns: 1fr auto; padding-inline: 22px; }
  .public-header nav { display: none; }
  .hero { min-height: auto; padding: 70px 28px 30px; grid-template-columns: 1fr; text-align: center; }
  .hero-copy > p { margin-inline: auto; }
  .hero-search { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { min-height: 480px; }
  .trust-strip { margin: 0 22px; grid-template-columns: repeat(2, 1fr); }
  .trust-strip div:nth-child(2) { border-right: 0; }
  .trust-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .public-footer { grid-template-columns: 1fr 1fr; }
  .public-footer small { grid-column: 1/-1; }
  .detail-grid { grid-template-columns: 270px 1fr; gap: 35px; }
  .sidebar { transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .mobile-nav { height: calc(68px + env(safe-area-inset-bottom)); padding: 8px 9px env(safe-area-inset-bottom); position: fixed; inset: auto 0 0; z-index: 250; display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(17px); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; color: #7b887f; }
  .mobile-nav a > i { font-size: 18px; line-height: 1; }
  .mobile-nav a small { margin-top: 4px; font-size: 9px; font-weight: 750; }
  .mobile-nav a.active { color: var(--primary); }
  .app-content { padding-bottom: 100px; }
  .topbar-search { width: min(430px, 58vw); }
  .dashboard-grid, .profile-grid, .settings-grid, .inventory-grid { grid-template-columns: 1fr; }
  .profile-summary { display: grid; grid-template-columns: auto 1fr auto; text-align: left; column-gap: 15px; }
  .profile-summary h2, .profile-summary > p { margin: 0; }
  .profile-summary > p { grid-column: 2; }
  .profile-summary .badge { grid-column: 3; grid-row: 1/3; }
  .profile-summary .member-code { grid-column: 1/-1; }
}

@media (max-width: 780px) {
  .dashboard-hero-grid, .dashboard-lower-grid { grid-template-columns: 1fr; }
  .welcome-card { min-height: 236px; }
  .daily-summary { padding-inline: 22px; }
  .summary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .summary-row:nth-last-child(2) { border-bottom: 0; }
  .quick-action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .public-header { height: 70px; }
  .public-header .brand img { width: 150px; }
  .header-actions .ghost { display: none; }
  .hero { min-height: calc(100vh - 70px); padding-top: 55px; }
  .hero h1 { font-size: 45px; }
  .hero-copy > p { font-size: 15px; }
  .hero-search { grid-template-columns: 28px 1fr; }
  .hero-search button { grid-column: 1/-1; width: 100%; }
  .hero-actions { flex-direction: column; gap: 15px; }
  .hero-visual { min-height: 370px; transform: scale(.76); margin: -40px -45px; }
  .trust-strip { padding: 17px; }
  .trust-strip div { padding: 10px 14px; }
  .section { padding: 75px 18px; }
  .section.compact { padding-top: 48px; }
  .section-heading { align-items: start; }
  .section-heading > a { display: none; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .book-card { border-radius: 15px; }
  .book-cover > span { font-size: 52px; }
  .book-meta { padding: 13px; }
  .book-meta h3 { min-height: 37px; font-size: 14px; }
  .book-meta > p, .book-meta strong { font-size: 10px; }
  .service-grid { grid-template-columns: 1fr; }
  .public-footer { grid-template-columns: 1fr; }
  .public-footer small { grid-column: auto; }
  .catalog-hero { padding-top: 55px; }
  .catalog-search { margin-bottom: -85px; grid-template-columns: 28px 1fr; }
  .catalog-search .button { grid-column: 1/-1; }
  .detail-grid { grid-template-columns: 1fr; gap: 35px; }
  .detail-cover { width: min(260px, 82vw); margin: auto; }
  .metadata { grid-template-columns: 1fr; gap: 14px; }
  .button-row.left { flex-direction: column; }
  .button-row.left .button { width: 100%; }
  .scan-card { padding: 32px 22px; }
  .auth-shell { padding: 20px 12px; align-items: start; }
  .auth-card { padding: 30px 20px; border-radius: 22px; }
  .auth-login .auth-card { padding: 28px 20px; border-radius: 22px; }
  .form-grid, .form-grid.three, .check-grid { grid-template-columns: 1fr; }
  .media-drop { min-height: 136px; padding: 12px; grid-template-columns: 76px minmax(0, 1fr); gap: 13px; }
  .media-preview-frame { width: 76px; }
  .media-drop-copy strong { font-size: 12px; }
  .media-drop-copy small { font-size: 10px; }
  .theme-builder-panel { padding: 18px; }
  .theme-panel-heading { gap: 10px; }
  .settings-heading h1 { font-size: 27px; }
  .theme-state { align-self: flex-start; padding: 6px 8px; font-size: 8px; }
  .theme-state i { font-size: 13px; }
  .theme-preset-grid, .palette-grid { grid-template-columns: 1fr; }
  .theme-live-preview { min-height: 247px; grid-template-columns: 46px 1fr; }
  .theme-preview-banner { min-height: 112px; padding: 14px; }
  .theme-preview-banner > i { font-size: 40px; }
  .topbar { height: 66px; padding: 0 15px; }
  .topbar { gap: 9px; }
  .topbar-search { min-width: 0; width: auto; flex: 1; }
  .topbar-search input { font-size: 11px; }
  .topbar-profile { display: none; }
  .topbar-actions { gap: 7px; }
  .topbar-alert, .topbar-profile .avatar { width: 34px; height: 34px; }
  .app-content { padding: 25px 14px 100px; }
  .dashboard-heading { margin-bottom: 14px; align-items: center; }
  .dashboard-heading h1 { font-size: 21px; }
  .dashboard-date { font-size: 0; }
  .dashboard-date i { font-size: 14px; }
  .dashboard-hero-grid { margin-bottom: 13px; gap: 13px; }
  .welcome-card { min-height: 230px; padding: 25px 23px; border-radius: 16px; }
  .welcome-copy { width: 100%; }
  .welcome-copy h2 { max-width: 88%; font-size: 25px; }
  .welcome-copy p { max-width: 82%; font-size: 10px; }
  .welcome-illustration { width: 47%; height: 70%; right: -9%; opacity: .4; }
  .daily-summary { padding: 18px; }
  .summary-list { grid-template-columns: 1fr; }
  .summary-row:nth-last-child(2) { border-bottom: 1px solid #edf1ee; }
  .dashboard-stat-grid { margin-bottom: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dashboard-stat-card { min-height: 119px; padding: 14px; display: block; }
  .dashboard-stat-icon { width: 33px; height: 33px; margin-bottom: 10px; font-size: 14px; }
  .dashboard-stat-card strong { font-size: 23px; }
  .dashboard-stat-card strong.word { font-size: 17px; }
  .dashboard-stat-card p { white-space: normal; font-size: 8px; line-height: 1.35; }
  .dashboard-lower-grid { margin-bottom: 13px; gap: 13px; }
  .circulation-panel, .quick-panel { padding: 17px; }
  .circulation-head { display: none; }
  .circulation-row { min-height: 78px; padding: 11px 0; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; }
  .circulation-date { display: none; }
  .circulation-book { grid-column: 1; grid-row: 1; }
  .circulation-member { grid-column: 1; grid-row: 2; padding-left: 42px; }
  .circulation-row > div:last-child { grid-column: 2; grid-row: 1 / 3; }
  .circulation-member strong { font-size: 9px; }
  .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-action-grid a { min-height: 76px; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading h1 { font-size: 32px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 130px; padding: 16px; display: block; }
  .stat-card > span { width: 35px; height: 35px; margin-bottom: 13px; }
  .stat-card strong { font-size: 27px; }
  .panel { padding: 18px; border-radius: 18px; }
  .panel-heading { align-items: start; flex-direction: column; }
  .table-search { width: 100%; }
  td, th { padding: 12px 10px; }
  .copy-grid { grid-template-columns: 1fr; }
  .inline-form.responsive { grid-template-columns: 1fr; }
  .profile-summary { grid-template-columns: auto 1fr; }
  .profile-summary .badge { grid-column: 2; grid-row: auto; justify-self: start; }
  .avatar-xl { width: 76px; height: 76px; grid-row: 1/4; }
  .activity-list { grid-template-columns: 1fr; }
  .drawer { grid-template-columns: 1fr; }
  .drawer-backdrop { display: none; }
  .drawer-panel { padding: 22px 17px 90px; }
  .sticky-save { bottom: 76px; }
  .sticky-save > div { display: none; }
  .sticky-save .button { width: 100%; }
  .reader-header { padding: 0 10px; grid-template-columns: auto 1fr auto; }
  .reader-header > div:nth-child(2) { min-width: 0; text-align: left; }
  .reader-header strong, .reader-header small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reader-header .secondary { display: none; }
}

/* Interface consistency, activity log, and scanner */
.app-shell .page-heading h1 { font-size: clamp(26px, 2.4vw, 34px); }
.app-shell .page-heading p { font-size: 13px; }
.app-shell .panel-heading h2 { font-size: 18px; }
.app-shell .topbar-profile strong { font-size: 12px; }
.app-shell .topbar-profile small { font-size: 10px; }
.app-shell .stat-card strong { font-size: 27px; }
.app-shell .stat-card strong.word { font-size: 21px; }
.dashboard-heading .eyebrow,
.daily-summary-heading .eyebrow,
.compact-heading .eyebrow { font-size: 10px; }
.welcome-role,
.live-indicator,
.dashboard-stat-card small,
.dashboard-stat-card p,
.circulation-head,
.circulation-date span,
.circulation-member small,
.circulation-book small,
.circulation-row .status,
.quick-action-grid strong { font-size: 10px; }
.welcome-copy p { font-size: 12px; }
.welcome-action { min-height: 38px; font-size: 11px; }
.summary-row,
.circulation-book strong,
.circulation-member strong { font-size: 11px; }
th { color: #77847b; font-size: 11px; }
td { font-size: 13px; }
td small { font-size: 11px; }
.settings-subheading small,
.theme-preset small,
.color-setting > span:first-child small,
.color-control output,
.contrast-note { font-size: 10px; }
.theme-preset strong,
.color-setting > span:first-child { font-size: 11px; }
.table-wrap { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 30%, #dfe5e1) transparent; overscroll-behavior-inline: contain; }
.action-group { flex-wrap: wrap; }

.scanner-alternatives { margin-top: -5px; padding: 11px 12px; display: flex; align-items: center; gap: 12px; border: 1px dashed color-mix(in srgb, var(--primary) 26%, #dbe4de); border-radius: 11px; background: color-mix(in srgb, var(--primary) 3%, #fff); }
.scanner-alternatives > span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.scanner-file-button { min-height: 38px; padding: 0 13px; display: inline-flex; grid-auto-flow: column; align-items: center; justify-content: center; gap: 8px; flex: none; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 12px; cursor: pointer; }
.scanner-file-button input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.camera-box { display: grid; gap: 11px; }
.camera-viewport { position: relative; overflow: hidden; border-radius: 12px; background: #020604; aspect-ratio: 4 / 3; }
.camera-box video { width: 100%; height: 100%; max-height: none; display: block; object-fit: cover; }
.camera-frame { position: absolute; inset: 15%; border: 2px solid color-mix(in srgb, var(--primary) 72%, white); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.22); pointer-events: none; }
.camera-box p { min-height: 20px; margin: 0; color: rgba(255,255,255,.82); font-size: 12px; }
.camera-box p[data-tone="success"] { color: #8cf2aa; }
.camera-box p[data-tone="error"] { color: #ffb5b5; }
.camera-actions { display: flex; justify-content: center; gap: 9px; }
.camera-actions .button.secondary { color: white; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.1); }

.activity-total { min-width: 172px; padding: 12px 15px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.activity-total > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 17px; }
.activity-total strong, .activity-total small { display: block; }
.activity-total strong { font-size: 17px; }
.activity-total small { color: var(--muted); font-size: 10px; }
.activity-filter-panel { margin-bottom: 18px; padding-block: 17px; }
.activity-filters { display: grid; grid-template-columns: minmax(180px, 1.25fr) repeat(2, minmax(150px, .8fr)) repeat(2, minmax(135px, .62fr)) auto; align-items: end; gap: 11px; }
.activity-filters label { font-size: 11px; }
.activity-filter-actions { display: flex; gap: 8px; }
.activity-filter-actions .button { min-height: var(--control-height); padding-inline: 14px; font-size: 12px; }
.activity-log-panel { padding-top: 22px; }
.activity-log-list { display: grid; }
.activity-log-item { min-height: 82px; padding: 14px 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.activity-log-item:last-child { border-bottom: 0; }
.activity-log-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.activity-log-main { min-width: 0; }
.activity-log-main > div { display: flex; align-items: center; gap: 8px; }
.activity-log-main strong { font-size: 13px; }
.activity-log-main p { margin: 3px 0 0; color: #657168; font-size: 11px; }
.activity-log-main small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-log-item time { min-width: 95px; text-align: right; }
.activity-log-item time strong, .activity-log-item time span { display: block; }
.activity-log-item time strong { font-size: 13px; }
.activity-log-item time span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.pagination { margin-top: 16px; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.pagination > span { color: var(--muted); font-size: 11px; }
.pagination .disabled { opacity: .45; pointer-events: none; }
.empty-state.compact { min-height: 230px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state.compact i { margin-bottom: 10px; color: var(--primary); font-size: 24px; }
.empty-state.compact p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .activity-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .activity-filter-actions { align-self: end; }
}

@media (max-width: 900px) {
  .app-content { padding-inline: clamp(16px, 3vw, 28px); }
  .activity-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-search { grid-column: 1 / -1; }
  .activity-filter-actions { grid-column: 1 / -1; }
  .activity-filter-actions .button { flex: 1; }
  .table-wrap table { min-width: 720px; }
  .drawer-panel { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .app-shell .page-heading { margin-bottom: 22px; }
  .app-shell .page-heading h1 { font-size: 26px; }
  .app-shell .page-heading p { font-size: 12px; }
  .app-shell .panel-heading h2 { font-size: 17px; }
  .welcome-copy h2 { font-size: 23px; }
  .welcome-copy p { max-width: 92%; font-size: 11px; }
  .dashboard-stat-card p { font-size: 10px; }
  .mobile-nav a { min-width: 54px; }
  .mobile-nav a small { font-size: 10px; }
  .scan-input { flex-direction: column; }
  .scan-input .button { width: 100%; }
  .scanner-alternatives { align-items: stretch; flex-direction: column; }
  .scanner-file-button { width: 100%; }
  .camera-box { min-height: 0; padding: 11px; }
  .camera-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camera-actions .button:only-child { grid-column: 1 / -1; }
  .activity-heading .activity-total { width: 100%; }
  .activity-filters { grid-template-columns: 1fr; }
  .activity-search,
  .activity-filter-actions { grid-column: auto; }
  .activity-log-item { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .activity-log-main > div { align-items: flex-start; flex-direction: column; gap: 5px; }
  .activity-log-main small { white-space: normal; }
  .activity-log-item time { grid-column: 2; min-width: 0; display: flex; gap: 6px; text-align: left; }
  .activity-log-item time strong, .activity-log-item time span { display: inline; margin: 0; font-size: 10px; }
  .pagination { align-items: stretch; flex-wrap: wrap; }
  .pagination > span { width: 100%; order: -1; text-align: center; }
  .pagination .button { flex: 1; }
}

/* Buku Tamu Desa Ungasan */
.guestbook-heading { margin-bottom: 18px; }
.guestbook-heading-actions { display: flex; gap: 9px; }
.guestbook-heading-actions form { display: flex; }
.guestbook-connection { margin-bottom: 18px; padding: 14px 17px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--primary) 5%, #fff); }
.guestbook-connection-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 18px; }
.guestbook-connection strong { display: block; font-size: 12px; }
.guestbook-connection p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.guestbook-connection > small { color: var(--muted); font-size: 10px; text-align: right; }
.guestbook-connection.stale { border-color: #ecd69e; background: #fff9e9; }
.guestbook-connection.stale .guestbook-connection-icon { color: #9a6914; background: #fff0c8; }
.guestbook-connection.offline { border-color: #efc4c4; background: #fff3f3; }
.guestbook-connection.offline .guestbook-connection-icon { color: #a63b3b; background: #ffe0e0; }
.guestbook-stat-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.guestbook-stat-card { min-height: 126px; padding: 19px; display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 5px 22px rgba(22,60,34,.035); }
.guestbook-stat-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; font-size: 18px; }
.guestbook-stat-icon.green { color: var(--primary); background: var(--primary-soft); }
.guestbook-stat-icon.blue { color: #2676a8; background: #eaf5fb; }
.guestbook-stat-icon.purple { color: #7354a5; background: #f2edfb; }
.guestbook-stat-icon.orange { color: #a96621; background: #fff1df; }
.guestbook-stat-card small, .guestbook-stat-card strong, .guestbook-stat-card p { display: block; }
.guestbook-stat-card small { color: var(--muted); font-size: 10px; font-weight: 750; }
.guestbook-stat-card strong { margin-top: 5px; font-size: 26px; line-height: 1; }
.guestbook-stat-card p { margin: 8px 0 0; color: var(--muted); font-size: 9px; }
.guestbook-insight-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 14px; }
.guestbook-insight-grid .panel { min-height: 218px; }
.guestbook-insight-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 17px; }
.guestbook-top-purpose { display: block; margin: 25px 0 9px; font-size: clamp(21px, 2.2vw, 29px); line-height: 1.2; }
.guestbook-purpose-panel > p { margin: 0; color: var(--muted); font-size: 11px; }
.guestbook-empty-insight { min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.guestbook-rating-list { display: grid; gap: 13px; }
.guestbook-rating-row > div { margin-bottom: 6px; display: flex; justify-content: space-between; gap: 12px; font-size: 10px; }
.guestbook-rating-row strong { font-size: 11px; }
.guestbook-rating-track { height: 7px; display: block; overflow: hidden; border-radius: 999px; background: #edf1ee; }
.guestbook-rating-track i { height: 100%; display: block; border-radius: inherit; background: var(--primary); transition: width .35s var(--ease); }
.guestbook-rating-track i.neutral { background: #d19835; }
.guestbook-rating-track i.bad { background: #d65a5a; }
.guestbook-filter-panel { margin-bottom: 18px; padding-block: 17px; }
.guestbook-filters { display: grid; grid-template-columns: minmax(145px, .7fr) minmax(145px, .7fr) minmax(230px, 1.2fr) auto; align-items: end; gap: 11px; }
.guestbook-filters label { font-size: 11px; }
.guestbook-filter-actions { display: flex; gap: 8px; }
.guestbook-filter-actions .button { min-height: var(--control-height); padding-inline: 14px; font-size: 12px; }
.guestbook-list-panel { padding-top: 22px; }
.guestbook-privacy-badge { min-height: 31px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 10px; font-weight: 750; }
.guestbook-desktop-table table { min-width: 860px; }
.guestbook-person { min-width: 140px; display: flex; align-items: center; gap: 9px; }
.guestbook-person > span { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 850; }
.guestbook-person strong, .guestbook-person small { display: block; }
.guestbook-person strong { font-size: 12px; }
.guestbook-person small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.guestbook-purpose-badge { display: inline-block; max-width: 230px; padding: 6px 9px; border-radius: 8px; color: var(--primary-dark); background: var(--primary-soft); font-size: 10px; font-weight: 750; white-space: normal; }
.guestbook-rating-badge { display: inline-flex; min-height: 27px; padding: 0 9px; align-items: center; border-radius: 999px; color: #1d6b39; background: #e8f7ed; font-size: 9px; font-weight: 800; white-space: nowrap; }
.guestbook-rating-badge.neutral { color: #8a5d14; background: #fff1cd; }
.guestbook-rating-badge.bad { color: #9d3434; background: #ffe7e7; }
.guestbook-rating-badge.unrated { color: #647068; background: #edf1ee; }
.guestbook-mobile-list { display: none; }
.guestbook-privacy-note { margin-top: 18px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 9px; border-radius: 12px; color: var(--muted); background: var(--canvas); }
.guestbook-privacy-note i { margin-top: 1px; color: var(--primary); }
.guestbook-privacy-note p { margin: 0; font-size: 10px; line-height: 1.6; }

@media (max-width: 1100px) {
  .guestbook-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guestbook-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guestbook-purpose-filter { grid-column: 1 / -1; }
  .guestbook-filter-actions { grid-column: 1 / -1; }
  .guestbook-filter-actions .button { flex: 1; }
}

@media (max-width: 760px) {
  .guestbook-heading-actions { width: 100%; }
  .guestbook-heading-actions form { flex: 1; }
  .guestbook-heading-actions .button { width: 100%; }
  .guestbook-connection { grid-template-columns: auto minmax(0, 1fr); }
  .guestbook-connection > small { grid-column: 2; text-align: left; }
  .guestbook-insight-grid { grid-template-columns: 1fr; }
  .guestbook-insight-grid .panel { min-height: 0; }
  .guestbook-desktop-table { display: none; }
  .guestbook-mobile-list { display: grid; gap: 10px; }
  .guestbook-mobile-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .guestbook-mobile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .guestbook-mobile-head time { color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
  .guestbook-mobile-card > p { margin: 12px 0; padding: 10px 11px; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); font-size: 11px; font-weight: 750; }
  .guestbook-mobile-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .guestbook-mobile-meta > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
}

@media (max-width: 540px) {
  .guestbook-heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guestbook-heading-actions .button { padding-inline: 10px; font-size: 11px; }
  .guestbook-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .guestbook-stat-card { min-height: 135px; padding: 14px; display: block; }
  .guestbook-stat-icon { width: 35px; height: 35px; margin-bottom: 12px; font-size: 15px; }
  .guestbook-stat-card strong { font-size: 23px; }
  .guestbook-filters { grid-template-columns: 1fr; }
  .guestbook-purpose-filter, .guestbook-filter-actions { grid-column: auto; }
  .guestbook-privacy-badge { width: 100%; justify-content: center; }
}

/* Public guest book */
.public-header nav a { position: relative; }
.public-header nav a.active { color: var(--primary-dark); }
.public-header nav a.active:after { content: ''; height: 2px; position: absolute; inset: auto 0 -10px; border-radius: 999px; background: var(--primary); }
.public-mobile-nav { display: none; }
.public-guestbook-hero { min-height: 275px; position: relative; display: grid; align-items: center; overflow: hidden; color: var(--banner-text); background: linear-gradient(90deg, color-mix(in srgb, var(--banner) 94%, #111) 0%, color-mix(in srgb, var(--banner) 74%, transparent) 60%, color-mix(in srgb, var(--accent) 36%, var(--banner)) 100%); }
.public-guestbook-hero:before, .public-guestbook-hero:after { content: ''; position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--banner-text) 18%, transparent); }
.public-guestbook-hero:before { width: 440px; height: 440px; right: 4%; top: -280px; }
.public-guestbook-hero:after { width: 260px; height: 260px; right: 22%; bottom: -205px; }
.public-guestbook-hero-inner { width: min(1160px, calc(100% - 48px)); margin: 0 auto; position: relative; z-index: 1; }
.public-guestbook-hero-inner > span { display: block; margin-bottom: 14px; font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; opacity: .78; }
.public-guestbook-hero h1 { margin-bottom: 20px; font-size: clamp(34px, 4.4vw, 54px); }
.public-guestbook-hero nav { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.public-guestbook-hero nav a { opacity: .76; }
.public-guestbook-hero nav a:hover { opacity: 1; }
.public-guestbook-hero nav i { font-size: 9px; opacity: .62; }
.public-guestbook-content { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 76px 0 110px; }
.public-guestbook-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); align-items: center; gap: clamp(38px, 7vw, 100px); }
.public-guestbook-copy h2 { max-width: 720px; margin-bottom: 18px; font-size: clamp(31px, 4vw, 47px); }
.public-guestbook-copy p { max-width: 760px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.public-guestbook-action { display: grid; gap: 10px; }
.public-guestbook-security { min-height: 88px; padding: 17px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow-sm); }
.public-guestbook-security > span { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.public-guestbook-security strong, .public-guestbook-security small { display: block; }
.public-guestbook-security strong { margin-bottom: 3px; font-size: 13px; }
.public-guestbook-security small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.public-guestbook-official { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 9px; }
.public-guestbook-stats { margin-top: 44px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.public-guestbook-stats article { min-height: 134px; padding: 21px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 25px color-mix(in srgb, var(--primary) 5%, transparent); }
.public-guestbook-stats article > span { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.public-guestbook-stats small, .public-guestbook-stats strong, .public-guestbook-stats p { display: block; }
.public-guestbook-stats small { color: var(--muted); font-size: 9px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.public-guestbook-stats strong { margin-top: 4px; font-size: 27px; line-height: 1.05; }
.public-guestbook-stats strong.is-text { max-width: 150px; font-size: 13px; line-height: 1.3; }
.public-guestbook-stats p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.public-guestbook-source { margin: 18px 0 42px; padding: 12px 15px; display: flex; align-items: center; gap: 11px; border: 1px solid color-mix(in srgb, var(--primary) 20%, white); border-radius: 13px; color: var(--primary-dark); background: var(--primary-soft); }
.public-guestbook-source.stale { color: #81550f; border-color: #f2d9a7; background: #fff8e9; }
.public-guestbook-source.offline { color: #983636; border-color: #f4c7c7; background: #fff0f0; }
.public-guestbook-source > span { font-size: 18px; }
.public-guestbook-source p { margin: 0; }
.public-guestbook-source strong, .public-guestbook-source small { display: block; }
.public-guestbook-source strong { font-size: 11px; }
.public-guestbook-source small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.public-guestbook-list { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow-sm); }
.public-guestbook-list > header { margin-bottom: 25px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.public-guestbook-list h2 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 36px); }
.public-guestbook-list header p { margin: 0; color: var(--muted); font-size: 12px; }
.public-guestbook-private { min-height: 33px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; flex: none; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 10px; font-weight: 760; }
.public-guestbook-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.public-guestbook-cards > article { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--canvas) 55%, white); }
.public-guestbook-person { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; }
.public-guestbook-person > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 850; }
.public-guestbook-person strong, .public-guestbook-person small { display: block; }
.public-guestbook-person strong { font-size: 12px; }
.public-guestbook-person small, .public-guestbook-person time { color: var(--muted); font-size: 9px; }
.public-guestbook-person time { white-space: nowrap; font-weight: 700; }
.public-guestbook-purpose { margin: 15px 0; padding: 11px 12px; border-radius: 11px; background: var(--primary-soft); }
.public-guestbook-purpose small, .public-guestbook-purpose strong { display: block; }
.public-guestbook-purpose small { margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.public-guestbook-purpose strong { color: var(--primary-dark); font-size: 11px; }
.public-guestbook-cards footer { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 9px; }
.public-guestbook-cards footer > span { display: inline-flex; align-items: center; gap: 5px; }
.public-guestbook-rating { margin-left: auto; padding: 5px 8px; border-radius: 999px; color: #1d6b39; background: #e8f7ed; font-weight: 780; }
.public-guestbook-rating.neutral { color: #8a5d14; background: #fff1cd; }
.public-guestbook-rating.bad { color: #9d3434; background: #ffe7e7; }
.public-guestbook-rating.unrated { color: #647068; background: #edf1ee; }
.public-guestbook-empty { min-height: 270px; display: grid; place-items: center; align-content: center; text-align: center; }
.public-guestbook-empty > span { width: 66px; height: 66px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 20px; color: var(--primary); background: var(--primary-soft); font-size: 26px; }
.public-guestbook-empty h3 { margin-bottom: 8px; font-size: 19px; }
.public-guestbook-empty p { max-width: 470px; margin: 0; color: var(--muted); font-size: 12px; }
.public-guestbook-action .button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.public-guestbook-modal[hidden] { display: none; }
.public-guestbook-modal { position: fixed; inset: 0; z-index: 840; padding: 24px; display: grid; place-items: center; }
.public-guestbook-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(7, 23, 13, .62); backdrop-filter: blur(5px); }
.public-guestbook-dialog { width: min(940px, 100%); max-height: calc(100vh - 48px); position: relative; z-index: 1; overflow-y: auto; overscroll-behavior: contain; border: 1px solid color-mix(in srgb, var(--primary) 18%, #dfe7e2); border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(5, 24, 12, .28); animation: modalIn .25s var(--ease); }
.public-guestbook-dialog > header { min-height: 112px; padding: 25px 78px 23px 28px; position: sticky; top: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .97); backdrop-filter: blur(14px); }
.public-guestbook-dialog > header h2 { margin: 4px 0 6px; font-size: 23px; }
.public-guestbook-dialog > header p { max-width: 570px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.public-guestbook-dialog-privacy { padding: 7px 10px; display: inline-flex; align-items: center; gap: 7px; flex: none; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 9px; font-weight: 750; white-space: nowrap; }
.public-guestbook-modal-close { width: 38px; height: 38px; position: absolute; top: 20px; right: 22px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--canvas); }
.public-guestbook-form { padding: 26px 28px 30px; }
.public-guestbook-form fieldset { margin: 0 0 23px; padding: 0 0 23px; border: 0; border-bottom: 1px solid var(--line); }
.public-guestbook-form fieldset:last-of-type { margin-bottom: 20px; }
.public-guestbook-form legend { width: 100%; margin-bottom: 16px; color: var(--ink); font-size: 14px; font-weight: 820; }
.public-guestbook-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.public-guestbook-form label, .public-guestbook-label { color: #34453a; font-size: 11px; font-weight: 750; }
.public-guestbook-form label > small, .public-guestbook-label > small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; }
.public-guestbook-form em { color: var(--danger); font-style: normal; }
.public-guestbook-field-full { grid-column: 1 / -1; }
.public-guestbook-choices { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 9px; }
.public-guestbook-choices label { display: block; }
.public-guestbook-choices input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; }
.public-guestbook-choices label > span { min-height: 40px; padding: 8px 13px; display: inline-flex; align-items: center; border: 1px solid #d7e1da; border-radius: 10px; color: #5e6e63; background: #fff; cursor: pointer; }
.public-guestbook-choices input:checked + span { color: var(--primary-dark); border-color: color-mix(in srgb, var(--primary) 48%, #d7e1da); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); }
.public-guestbook-form footer { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.public-guestbook-consent { max-width: 670px; display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px !important; color: var(--muted) !important; font-size: 10px !important; font-weight: 520 !important; line-height: 1.6; }
.public-guestbook-consent input { width: 17px; height: 17px; min-height: 17px; margin-top: 1px; flex: 0 0 17px; accent-color: var(--primary); }
.public-guestbook-form footer .button { min-width: 210px; flex: none; }
.public-guestbook-honeypot { width: 1px; height: 1px; position: absolute; left: -9999px; overflow: hidden; }
.public-guestbook-modal-open { overflow: hidden; }

@media (max-width: 980px) {
  .public-guestbook-intro { grid-template-columns: 1fr; gap: 30px; }
  .public-guestbook-action { max-width: 520px; }
  .public-guestbook-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .public-shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .public-mobile-nav { height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); position: fixed; inset: auto 0 0; z-index: 250; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); background: color-mix(in srgb, white 94%, transparent); backdrop-filter: blur(18px); }
  .public-mobile-nav a { display: grid; place-items: center; align-content: center; color: #7b887f; }
  .public-mobile-nav a i { font-size: 17px; line-height: 1; }
  .public-mobile-nav a small { margin-top: 4px; font-size: 9px; font-weight: 760; }
  .public-mobile-nav a.active { color: var(--primary); }
}

@media (max-width: 700px) {
  .public-guestbook-hero { min-height: 225px; }
  .public-guestbook-hero-inner, .public-guestbook-content { width: min(100% - 34px, 1160px); }
  .public-guestbook-content { padding: 52px 0 82px; }
  .public-guestbook-copy h2 { font-size: 31px; }
  .public-guestbook-copy p { font-size: 13px; }
  .public-guestbook-stats { margin-top: 30px; gap: 9px; }
  .public-guestbook-stats article { min-height: 125px; padding: 15px; display: block; }
  .public-guestbook-stats article > span { width: 37px; height: 37px; margin-bottom: 12px; font-size: 16px; }
  .public-guestbook-stats strong { font-size: 23px; }
  .public-guestbook-stats strong.is-text { font-size: 11px; }
  .public-guestbook-list { padding: 20px 15px; border-radius: 18px; }
  .public-guestbook-list > header { display: block; }
  .public-guestbook-private { margin-top: 14px; }
  .public-guestbook-cards { grid-template-columns: 1fr; }
  .public-guestbook-modal { padding: 0; display: block; }
  .public-guestbook-dialog { width: 100%; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .public-guestbook-dialog > header { min-height: 118px; padding: 20px 62px 20px 20px; display: block; }
  .public-guestbook-dialog > header h2 { font-size: 20px; }
  .public-guestbook-dialog-privacy { margin-top: 10px; white-space: normal; }
  .public-guestbook-modal-close { top: 18px; right: 16px; }
  .public-guestbook-form { padding: 22px 18px calc(32px + env(safe-area-inset-bottom)); }
  .public-guestbook-form-grid { grid-template-columns: 1fr; }
  .public-guestbook-field-full { grid-column: auto; }
  .public-guestbook-form footer { align-items: stretch; flex-direction: column; }
  .public-guestbook-form footer .button { width: 100%; }
}

@media (max-width: 420px) {
  .public-guestbook-hero h1 { font-size: 31px; }
  .public-guestbook-person { grid-template-columns: 38px 1fr; }
  .public-guestbook-person time { grid-column: 2; }
  .public-guestbook-cards footer { flex-wrap: wrap; }
  .public-guestbook-rating { margin-left: 0; }
}

.seo-environment { margin: 0 0 22px; padding: 17px 20px; display: flex; align-items: flex-start; gap: 14px; border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--primary) 7%, white); }
.seo-environment > i { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 17px; }
.seo-environment strong { display: block; margin: 1px 0 4px; font-size: 13px; }
.seo-environment p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.seo-environment.is-production { border-color: #bfe0c8; background: #f3fbf5; }
.seo-settings-grid { align-items: stretch; }
.seo-share-preview { margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(20, 37, 27, .07); }
.seo-share-preview img { width: 100%; aspect-ratio: 1.91 / 1; display: block; object-fit: cover; background: var(--primary-soft); }
.seo-share-preview div { padding: 14px 16px 16px; }
.seo-share-preview small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.seo-share-preview strong { display: block; color: #2449a8; font-size: 14px; line-height: 1.4; }
.seo-share-preview p { margin: 5px 0 0; color: #526159; font-size: 10px; line-height: 1.55; }
.seo-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seo-links a { min-height: 42px; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); font-size: 10px; font-weight: 780; }
.seo-page-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.seo-page-card { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); }
.seo-page-card legend { padding: 0 8px; color: var(--primary-dark); font-size: 12px; font-weight: 820; }
.seo-page-card label { margin-top: 13px; }
.seo-toggle-stack { gap: 11px; }
.seo-toggle-stack .check { padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.drawer-form-section { margin: 5px 0 -2px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-form-section p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

@media (max-width: 1050px) {
  .seo-page-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .seo-environment { padding: 15px; }
  .seo-links { grid-template-columns: 1fr; }
  .seo-page-card { padding: 15px; }
}

@media print {
  body * { visibility: hidden; }
  .label-modal:not([hidden]), .label-modal:not([hidden]) * { visibility: visible; }
  .label-modal:not([hidden]) { position: absolute; inset: 0; padding: 0; background: white; }
  .label-modal:not([hidden]) .confirm-card { width: 100%; box-shadow: none; }
  .label-modal:not([hidden]) button, .label-modal:not([hidden]) p, .label-modal:not([hidden]) .eyebrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
