@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --bg: #f3f7ff;
  --panel: #ffffff;
  --line: #dce5f3;
  --muted: #5c6e88;
  --accent: #1768e5;
  --accent-deep: #104cae;
  --soft: #eaf2ff;
  --text: #172b49;
  --lime: var(--accent);
  --white: var(--text);
  --ink: #ffffff;
  --shadow: 0 5px 18px #234b8410, 0 1px 2px #234b8408;
  font-family: Cairo, Arial, sans-serif;
  font-synthesis: none;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #71a8ff; outline-offset: 3px;
}
button:disabled { opacity: .55; cursor: default; }
button, input, select, textarea, .card, .body-option { transition: border-color .18s, background-color .18s, box-shadow .18s, transform .2s; }
header { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 3vw; border-bottom: 1px solid var(--line); background: #ffffffeb; }
.app-header { height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 24px; font-weight: 900; letter-spacing: -.7px; color: var(--text); }
.brand small { display: block; font-size: 10px; letter-spacing: 2.5px; line-height: 1.2; color: var(--muted); }
.mark { display: grid; place-items: center; width: 34px; height: 34px; background: linear-gradient(145deg, #4797ff, #1768e5 65%); color: white; border-radius: 12px 12px 7px 12px; font-size: 26px; box-shadow: 0 3px 0 #104cae, 0 7px 12px #1768e52b, inset 0 1px 1px #ffffff80; transform: perspective(400px) rotateY(-12deg) rotateZ(-8deg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 17px; background: linear-gradient(155deg, #2473e3, var(--accent)); color: #fff; font-size: 14px; font-weight: 800; border-radius: 9px; box-shadow: 0 3px 0 var(--accent-deep), 0 5px 12px #1768e51c; }
.btn.secondary { background: #fff; color: var(--accent-deep); border: 1px solid #bfd3f1; box-shadow: 0 2px 0 #e0e9f7; }
.btn.quiet { background: var(--soft); color: var(--accent-deep); box-shadow: 0 2px 0 #cfddf3; }
.btn.small { padding: 7px 12px; font-size: 13px; min-height: 38px; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
.btn.secondary:active, .btn.quiet:active { box-shadow: none; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; font-weight: 700; }
.eyebrow:before { content: ''; height: 3px; width: 19px; border-radius: 2px; background: var(--accent); }
.screen { max-width: 1000px; margin: 28px auto; padding: 0 20px; }
.narrow { max-width: 590px; }
.screen h1 { font-size: 25px; margin: 0 0 5px; }
.form-card { padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 17px 0; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #cbd8eb; border-radius: 8px; color: var(--text); background: #fff; font-size: 16px; }
input:not([type=range]):not([type=checkbox]):not([type=radio]), select { min-height: 43px; }
input::placeholder, textarea::placeholder { color: #7889a0; font-size: 14px; }
input:hover, select:hover, textarea:hover { border-color: #9bb9e4; }
textarea { resize: vertical; min-height: 68px; }
select { appearance: none; padding-left: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%235c6e88' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 10px center; }
input[type=checkbox] { width: 19px; height: 19px; flex-shrink: 0; accent-color: var(--accent); margin-top: 4px; }
input[type=range] { accent-color: var(--accent); padding: 0; }
label.check { display: flex; gap: 9px; align-items: start; font-size: 14px; line-height: 1.8; margin: 12px 0; }
.notice { padding: 11px 13px; color: #25486f; background: #edf4ff; border: 1px solid #d7e6fc; border-radius: 9px; font-size: 14px; line-height: 1.85; }
.error { color: #b42332; margin-top: 10px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 19px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.read-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.dash { display: grid; grid-template-columns: 195px minmax(0, 1fr); min-height: calc(100svh - 60px); }
aside { display: flex; flex-direction: column; gap: 5px; padding: 22px 12px; border-left: 1px solid var(--line); background: #fff; }
aside button { min-height: 42px; padding: 9px 11px; border-radius: 9px; text-align: right; color: var(--muted); background: transparent; font-size: 14px; }
aside button.active { color: var(--accent-deep); background: var(--soft); font-weight: 800; box-shadow: inset -3px 0 var(--accent); }
.workspace { min-width: 0; padding: 24px 2.5vw; max-width: 1500px; width: 100%; margin-inline: auto; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.title-row h1 { font-size: 24px; margin: 0; line-height: 1.6; }
.title-row p { margin: 5px 0 0; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 18px 0; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px 17px; background: var(--panel); box-shadow: var(--shadow); }
.stat strong { display: block; color: var(--accent); font-size: 26px; font-weight: 800; line-height: 1.4; }
.stat span { color: var(--muted); font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { min-width: 0; text-align: right; padding: 19px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: linear-gradient(145deg, #fff, #fafdff); box-shadow: var(--shadow); transform-style: preserve-3d; }
.card .icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); background: linear-gradient(140deg, #f3f8ff, #e4efff); border: 1px solid #d0e1fa; border-radius: 10px; font-size: 22px; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #d4e4fb; }
.card h3 { font-size: 18px; margin: 14px 0 6px; line-height: 1.65; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.card .tag { display: block; color: var(--accent-deep); font-size: 12px; margin-top: 15px; font-weight: 700; }
.module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0 22px; }
.module-card { width: 100%; }
.module-grid > [data-nav=library] { grid-column: 1 / -1; display: grid; grid-template-columns: 39px 1fr; column-gap: 13px; background: linear-gradient(120deg, #fff, #edf5ff); }
.module-grid > [data-nav=library] .icon { grid-row: 1 / 4; }
.module-grid > [data-nav=library] h3 { margin: 0 0 3px; }
.module-grid > [data-nav=library] .tag { margin-top: 8px; }
.players-heading { font-size: 19px; margin: 22px 0 12px; }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin: 9px 0; box-shadow: var(--shadow); }
.player-row[hidden] { display: none; }
.player-row .muted { font-size: 13px; }
.player-selector { max-width: 470px; margin: 13px 0 16px; }
.player-context { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.player-context summary { cursor: pointer; color: var(--accent-deep); min-height: 24px; font-weight: 600; }
.player-context p { line-height: 1.8; margin: 10px 0; }
.empty { text-align: center; border: 1px dashed #bdcfe9; border-radius: 13px; padding: 33px 18px; background: #ffffffb0; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 18px; margin: 10px 0; }
.empty p { font-size: 14px; margin: 7px 0 15px; }
.tabs { display: flex; gap: 6px; margin-bottom: 15px; padding-bottom: 5px; overflow: auto; scrollbar-width: thin; }
.tabs button { background: #eaf0fa; color: #4c6381; min-height: 40px; padding: 7px 13px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.tabs button.active { background: var(--accent); color: #fff; box-shadow: 0 3px 8px #1768e524; }
.editor-tabs { margin-top: 15px; }
.entry { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 15px; margin: 10px 0; box-shadow: var(--shadow); }
.entry .fields { margin: 9px 0; }
.entry h3 { font-size: 18px; }
.entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.entry-heading h3 { font-size: 17px; margin: 0 0 6px; }
.entry-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.entry-tools button { min-height: 38px; background: var(--soft); color: var(--accent-deep); padding: 6px 10px; border-radius: 7px; font-size: 13px; }
.entry-tools button.danger { color: #b42332; background: #fff0f1; }
.merge-badge { font-size: 12px; padding: 3px 9px; background: var(--soft); border: 1px solid #c6dcfc; border-radius: 20px; color: var(--accent-deep); white-space: nowrap; }
.merged-entry { border-right: 3px solid var(--accent); }
.merge-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.merge-controls > .field { flex: 1; min-width: 170px; }
.savebar { display: flex; gap: 9px; margin: 17px 0; flex-wrap: wrap; }
.editor-savebar { position: sticky; bottom: 8px; z-index: 4; padding: 11px; border: 1px solid #ceddf2; border-radius: 12px; align-items: center; background: #fffffff2; backdrop-filter: blur(12px); box-shadow: 0 3px 22px #274a851a; }
.save-status { font-size: 12px; color: var(--muted); }
.save-status.unsaved { color: var(--accent-deep); font-weight: 700; }
.search { max-width: 350px; margin-bottom: 15px; }
.profile-img { width: 68px; height: 68px; object-fit: cover; border-radius: 50%; border: 2px solid #b6d4ff; box-shadow: var(--shadow); }
.chart { display: flex; align-items: end; gap: 8px; min-height: 125px; border-bottom: 1px solid var(--line); padding: 12px 0; overflow: auto; direction: ltr; }
.bar { min-width: 52px; background: linear-gradient(0deg, #1768e5, #62a4ff); border-radius: 6px 6px 0 0; color: #fff; text-align: center; padding-top: 4px; font-size: 13px; }
.bar small { display: block; font-size: 11px; }
.progress-item { border-bottom: 1px solid var(--line); padding: 11px 0; }
#toast { position: fixed; bottom: 18px; left: 18px; right: auto; max-width: min(430px, calc(100vw - 36px)); padding: 11px 17px; border: 1px solid #bad4fa; background: #fff; color: var(--accent-deep); border-radius: 10px; display: none; z-index: 30; box-shadow: 0 8px 32px #204b8526; font-size: 14px; }
dialog { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 16px; max-width: 480px; width: 92%; padding: 21px; box-shadow: 0 24px 100px #18345d33; }
dialog::backdrop { background: #18355c55; backdrop-filter: blur(3px); }
dialog[open] { animation: dialog-in .22s ease both; }
.auth-screen { position: relative; isolation: isolate; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at 50% 0, #cfe3ff80, transparent 65%), var(--bg); }
.auth-panel { width: min(100%, 390px); padding: 28px 25px; background: linear-gradient(145deg, #fff, #fbfdff); border: 1px solid #d1e1f8; border-radius: 21px; box-shadow: 0 16px 45px #1c4b8612, 0 3px 0 #deebfc, inset 0 1px 0 #fff; }
.auth-panel > .brand { justify-content: center; margin: 0 0 27px; gap: 11px; }
.auth-panel .mark { width: 39px; height: 39px; animation: mark-float 6s ease-in-out infinite; }
.auth-heading { text-align: center; }
.auth-heading h1 { font-size: 25px; margin: 0 0 3px; }
.auth-heading p { margin: 0; font-size: 14px; }
.auth-panel .fields { grid-template-columns: 1fr; gap: 14px; margin: 21px 0 18px; }
.auth-panel .btn { width: 100%; min-height: 44px; }
.auth-panel input[name=username], .auth-panel input[name=password] { direction: rtl; text-align: right; }
.auth-panel .error:empty { display: none; }
.auth-panel > form > p.muted { font-size: 13px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.auth-divider:before, .auth-divider:after { content: ''; flex: 1; height: 1px; background: var(--line); }
.body-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.body-picker legend { font-size: 14px; font-weight: 700; margin: 0; padding: 0; }
.body-hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.body-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center; padding: 3px 1px 8px; }
.body-option { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: end; min-width: 0; padding: 8px 3px 9px; border: 1px solid var(--line); background: linear-gradient(180deg, #f8fbff, #eef4fd); border-radius: 10px; cursor: pointer; isolation: isolate; }
.body-option.active { border-color: var(--accent); background: linear-gradient(180deg, #e1edff, #f4f8ff); color: var(--accent-deep); box-shadow: 0 3px 10px #1768e51c, inset 0 0 0 1px #1768e526; }
.body-option:focus-within { outline: 2px solid #71a8ff; outline-offset: 2px; }
.body-option input { position: absolute; width: 1px; height: 1px; opacity: 0; min-height: 0; padding: 0; bottom: 5px; left: 50%; }
.body-figure { width: 100%; display: grid; place-items: center; min-height: 126px; }
.body-figure img { width: 100%; height: 126px; max-width: 70px; object-fit: contain; display: block; filter: drop-shadow(0 3px 3px #365d8830); transition: transform .22s; }
.body-option.active .body-figure img { transform: perspective(500px) translateY(-2px) rotateY(-4deg); }
.body-label { font-size: 12px; font-weight: 700; line-height: 1.5; min-height: 18px; }
.body-check { position: absolute; top: 5px; left: 5px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; opacity: 0; }
.body-option.active .body-check { opacity: 1; }
.body-slider { width: 100%; margin: 4px 0; min-height: 28px; cursor: pointer; direction: rtl; }
.body-selection { text-align: center; font-size: 12px; color: var(--muted); }
.body-selection strong { color: var(--accent-deep); }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.video-card { min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.video-cover { width: 100%; aspect-ratio: 16/8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; background: radial-gradient(ellipse at 50% 20%, #fff, #dfeeff); color: #355e91; font-size: 12px; border-bottom: 1px solid var(--line); }
.video-play { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: linear-gradient(145deg, #428dfa, #1768e5); color: #fff; padding-right: 2px; font-size: 17px; box-shadow: 0 3px 0 #1454bb, 0 7px 14px #1768e526; transform: perspective(400px) rotateY(-8deg); }
.video-card-content { padding: 14px; }
.video-card h3 { font-size: 16px; line-height: 1.65; margin: 6px 0; overflow-wrap: anywhere; }
.video-category { color: var(--accent-deep); font-size: 12px; }
.video-note { color: var(--muted); font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; min-height: 42px; margin: 8px 0 12px; }
.video-remove { background: #fff0f1; color: #b42332; border-radius: 7px; padding: 6px 8px; min-height: 36px; font-size: 13px; }
.library-filters { display: flex; flex-wrap: wrap; gap: 11px; align-items: end; margin: 20px 0 17px; }
.library-filters > .field { min-width: 140px; flex: 1; }
.library-filters > .library-search { flex: 2; min-width: 210px; }
.library-filters > span { padding: 8px 0; font-size: 12px; }
.library-limit { font-size: 12px; line-height: 1.8; }
.library-categories { margin: 15px 0; }
.category-tree { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 17px; }
.category-tree > div { min-width: 180px; flex: 1; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #f7faff; }
.category-tree strong { color: var(--accent-deep); font-size: 14px; }
.category-tree p { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.upload-panel { margin: 18px 0 25px; }
.upload-panel h2 { font-size: 20px; margin: 0; }
.upload-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 10px 0; box-shadow: var(--shadow); }
.upload-item .entry-heading h3 { font-size: 14px; overflow-wrap: anywhere; }
.upload-item .entry-heading > span { white-space: nowrap; font-size: 12px; }
.upload-item .fields { margin: 10px 0; }
.upload-item input:disabled, .upload-item textarea:disabled, .upload-item select:disabled { opacity: .65; background: #f5f8fd; }
.upload-item:has([data-q-status].error) { border-color: #e8aeb5; }
.upload-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--accent-deep); }
.upload-progress progress { width: 100%; height: 8px; accent-color: var(--accent); }
.bulk-category { align-items: end; padding: 12px; border: 1px dashed #afc8ec; border-radius: 10px; background: #f1f6ff; grid-template-columns: 1fr 1fr auto; }
.library-modal { max-width: 760px; max-height: 90svh; overflow: auto; padding: 20px; }
.modal-top { display: flex; justify-content: end; margin-bottom: 7px; }
.library-modal h2 { font-size: 22px; margin: 8px 0; overflow-wrap: anywhere; }
.library-player { width: 100%; max-height: 55svh; background: #0c1830; border-radius: 10px; margin: 13px 0; }
.library-modal .fields { margin: 15px 0; }
.library-modal p { line-height: 1.8; }
.fade { animation: panel-in .28s ease both; }
@keyframes panel-in { from { opacity: 0; transform: perspective(1200px) translate3d(0, 7px, 0) rotateX(.4deg); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: perspective(800px) translateY(7px) rotateX(2deg) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes mark-float { 0%, 100% { transform: perspective(400px) rotateY(-12deg) rotateZ(-8deg) translateY(0); } 50% { transform: perspective(400px) rotateY(10deg) rotateZ(-5deg) translateY(-3px); } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: perspective(600px) translateY(-1px) rotateX(2deg); filter: brightness(1.03); }
  .card:hover { transform: perspective(900px) rotateX(1.3deg) rotateY(-1deg) translateY(-3px); border-color: #a9c8f6; box-shadow: 0 12px 25px #26548c18, 0 3px 0 #e0ebfc; }
  .video-cover:hover .video-play { transform: perspective(400px) rotateY(8deg) translateY(-2px); }
  aside button:hover, .tabs button:hover { background: #edf4ff; color: var(--accent-deep); }
  .tabs button.active:hover { background: var(--accent); color: #fff; }
}
@media (max-width: 1100px) {
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-category { grid-template-columns: 1fr 1fr; }
  .bulk-category > .btn { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 180px minmax(0, 1fr); }
  .workspace { padding: 19px; }
  .card { padding: 16px; }
  header { padding: 0 20px; }
}
@media (max-width: 650px) {
  body { font-size: 14px; }
  header, .app-header { height: 56px; padding: 0 14px; gap: 10px; }
  .brand { font-size: 23px; gap: 8px; }
  .brand small { font-size: 9px; letter-spacing: 2px; }
  .mark { width: 31px; height: 31px; font-size: 24px; }
  .dash { display: block; min-height: calc(100svh - 56px); }
  aside { flex-direction: row; gap: 5px; overflow: auto; padding: 7px 10px; border-left: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fffffff2; backdrop-filter: blur(12px); z-index: 5; scrollbar-width: none; }
  aside::-webkit-scrollbar { display: none; }
  aside button { flex-shrink: 0; white-space: nowrap; font-size: 13px; padding: 8px 11px; min-height: 40px; }
  aside button.active { box-shadow: inset 0 -2px var(--accent); }
  .workspace { padding: 16px 12px; }
  .title-row { gap: 10px; margin-bottom: 15px; align-items: start; }
  .title-row h1 { font-size: 21px; }
  .title-row p { font-size: 14px; }
  .title-row > .btn { flex-shrink: 0; }
  .stats { gap: 7px; margin: 13px 0; }
  .stat { padding: 11px 9px; border-radius: 10px; }
  .stat strong { font-size: 23px; }
  .stat span { font-size: 12px; line-height: 1.6; display: block; }
  .cards, .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .module-grid { margin: 14px 0 19px; }
  .card { padding: 13px; border-radius: 12px; }
  .card h3 { font-size: 16px; margin: 12px 0 5px; }
  .card p { font-size: 14px; line-height: 1.7; }
  .card .icon { width: 31px; height: 31px; font-size: 21px; }
  .card .tag { margin-top: 11px; font-size: 12px; }
  .player-row { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .player-row > .row { width: 100%; gap: 8px; }
  .player-row .btn { flex: 1; }
  .screen { margin: 17px auto; padding: 0 12px; }
  .screen h1 { font-size: 23px; }
  .form-card { padding: 16px; border-radius: 14px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 9px; margin: 14px 0; }
  .field { font-size: 14px; gap: 4px; }
  .field.wide { grid-column: 1 / -1; }
  input, select, textarea { padding: 9px; font-size: 16px; }
  select { padding-left: 26px; background-position: 7px center; }
  .notice { padding: 10px 11px; font-size: 14px; }
  .empty { padding: 25px 14px; }
  .empty h3 { font-size: 17px; }
  .auth-screen { padding: 18px 14px; }
  .auth-panel { padding: 25px 22px; border-radius: 19px; width: min(100%, 365px); }
  .auth-panel > .brand { margin-bottom: 24px; }
  .auth-heading h1 { font-size: 24px; }
  .auth-panel .fields { grid-template-columns: 1fr; gap: 13px; margin: 20px 0 17px; }
  .auth-panel .btn { min-height: 44px; }
  .body-options { gap: 4px; }
  .body-option { padding: 7px 2px 8px; }
  .body-figure { min-height: 116px; }
  .body-figure img { height: 116px; max-width: 60px; }
  .body-label { font-size: 11px; min-height: 30px; display: flex; align-items: center; justify-content: center; }
  .body-check { width: 14px; height: 14px; font-size: 10px; top: 4px; left: 4px; }
  .entry { padding: 12px; }
  .entry-heading h3 { font-size: 16px; }
  .tabs button { min-height: 40px; padding: 7px 11px; font-size: 13px; }
  .editor-savebar { padding: 9px; gap: 8px; bottom: 7px; }
  .editor-savebar .btn { flex: 1; min-width: 130px; font-size: 13px; padding: 9px; min-height: 42px; }
  .save-status { width: 100%; text-align: center; }
  .merge-controls > .field { min-width: 100%; }
  .merge-controls > .btn { flex: 1; }
  .player-selector { max-width: none; }
  .library-grid { gap: 9px; }
  .video-card-content { padding: 11px; }
  .video-card h3 { font-size: 15px; }
  .video-cover { aspect-ratio: 16/9; gap: 5px; }
  .video-cover > span:last-child { font-size: 11px; }
  .video-play { width: 33px; height: 33px; font-size: 15px; border-radius: 11px; }
  .video-card-content .row { gap: 7px; }
  .video-card-content .btn { padding: 5px 9px; font-size: 12px; min-height: 36px; flex: 1; }
  .video-category { font-size: 11px; line-height: 1.6; }
  .video-note { font-size: 13px; min-height: 40px; margin: 6px 0 9px; }
  .video-remove { min-height: 36px; font-size: 12px; }
  .library-filters { gap: 10px; margin: 15px 0; }
  .library-filters > .library-search { min-width: 100%; }
  .library-filters > .field { min-width: 110px; }
  .library-filters > span { padding: 0; }
  .title-row:has([data-lib-action]) { flex-direction: column; }
  .title-row .row { gap: 8px; }
  .library-modal { padding: 16px; width: 95%; max-height: 94svh; }
  .library-modal h2 { font-size: 20px; }
  .upload-item { padding: 13px; }
  .bulk-category { grid-template-columns: 1fr 1fr; padding: 11px; }
  .bulk-category > .btn { grid-column: 1 / -1; }
  .category-tree > div { min-width: 130px; }
}
@media (max-width: 359px) {
  .library-grid { grid-template-columns: 1fr; }
  .fields { gap: 9px 7px; }
  .body-figure, .body-figure img { min-height: 104px; height: 104px; }
  .btn.small { padding-inline: 10px; }
  .auth-panel { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card, .btn, .mark, .body-option.active .body-figure img { transform: none !important; }
}
