html { height: 100%; overflow: hidden; font-size: 15px; }
body { position: fixed; inset: 0; height: 100dvh; min-height: 0; overflow: hidden; background: var(--rd-paper); font-family: var(--rd-font-body); overscroll-behavior: none; }
body::before { display: none; }
#app { display: block; height: 100dvh; min-height: 0; overflow: hidden; }
[hidden] { display: none !important; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #85a781; outline-offset: 4px; }
.rd-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.rd-glyph { display: inline-flex; width: 20px; height: 20px; flex-shrink: 0; }
.rd-glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
button.visual-action, .visual-action, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-width: 44px; min-height: 44px; padding: 12px 16px; border: 1px solid var(--rd-rule); border-radius: 14px; background: white; color: var(--rd-ink); font: 500 13px/1.2 var(--rd-font-body); letter-spacing: 0; text-transform: none; clip-path: none; cursor: pointer; text-decoration: none; box-shadow: none; transition: background .18s, transform .18s; }
.visual-action:hover, .button:hover { background: var(--rd-accent-soft); transform: translateY(-1px); }
button.visual-primary, .visual-action.visual-primary, .button.primary { background: var(--rd-accent); color: white; border-color: var(--rd-accent); box-shadow: 0 4px 12px rgb(53 101 69 / .1); }
.visual-danger, .button.danger-outline { color: #a2473b; }
.visual-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.visual-info { position: relative; }
.visual-info > summary { list-style: none; }
.visual-info > summary::-webkit-details-marker { display: none; }
.visual-info[open] > summary { background: var(--rd-accent-soft); }
.visual-info-body { margin-top: 12px; padding: 20px; border: 1px solid var(--rd-rule); border-radius: 18px; background: white; width: min(400px,100%); }
.visual-info-body dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px 20px; font-size: 12px; }
.visual-info-body dt { color: var(--rd-ink-4); }
.visual-info-body dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.visual-info-body strong { display: block; margin-bottom: 16px; font-size: 14px; }
.visual-field, label { display: grid; gap: 8px; font: 500 12px/1.4 var(--rd-font-body); color: var(--rd-ink-2); }
.visual-field { position: relative; }
.visual-field > .rd-glyph { position: absolute; left: 14px; bottom: 15px; pointer-events: none; color: var(--rd-ink-4); }
input, select, textarea, .home-form input { width: 100%; min-width: 0; min-height: 50px; padding: 14px; border: 1px solid var(--rd-rule); border-radius: 12px; background: #fafbf8; color: var(--rd-ink); font: 400 16px/1.4 var(--rd-font-body); }
.visual-field input, .visual-field select { padding-left: 44px; }
input::placeholder { color: #a1aaa1; }
input:focus, select:focus, textarea:focus { border-color: #85a781; background: white; }
input[readonly] { font-family: var(--rd-font-mono); }
input[type=checkbox] { width: auto; }
.visual-switch { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; min-height: 48px; }
.visual-switch > .rd-glyph { display: none; }
.visual-switch input { appearance: none; width: 46px; height: 28px; min-height: 28px; padding: 3px; border: 0; border-radius: 20px; background: #dbe3d8; cursor: pointer; }
.visual-switch input::before { content: ''; display: block; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(0 0 0 / .1); transition: transform .18s; }
.visual-switch input:checked { background: var(--rd-accent); }
.visual-switch input:checked::before { transform: translateX(18px); }
.visual-art { display: grid; place-items: center; color: var(--rd-accent); }
.visual-art > .rd-glyph { width: 100%; height: 100%; }
.visual-empty { min-height: 55dvh; display: grid; place-content: center; justify-items: center; gap: 24px; }
.visual-empty > .visual-art { width: 120px; height: 120px; padding: 32px; background: white; border: 1px solid var(--rd-rule); border-radius: 32px; transform: rotate(-8deg); box-shadow: 14px 14px 0 var(--rd-accent-soft), -12px -10px 0 #e3e8dd; }
.visual-empty > p { color: var(--rd-ink-3); font-size: 15px; margin-top: 16px; }
.media-tools { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin: 0 0 24px; flex-wrap: wrap; }
.media-search { position: relative; width: min(320px,100%); }
.media-search input { min-height: 44px; font-size: 13px; border: 0; background: #ebefe8; padding-left: 42px; }
.media-search > .rd-glyph { position: absolute; left: 14px; top: 12px; color: var(--rd-ink-4); }
.media-filters { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--rd-rule); border-radius: 14px; background: white; }
.media-filters button { min-height: 44px; border: 0; border-radius: 10px; padding: 8px 14px; background: transparent; color: var(--rd-ink-3); font: 500 12px var(--rd-font-body); letter-spacing: 0; text-transform: none; cursor: pointer; }
.media-filters button[aria-pressed=true] { color: var(--rd-accent); background: var(--rd-accent-soft); }
.media-grid { columns: 3 240px; column-gap: 18px; }
.media-card { min-width: 0; break-inside: avoid; margin-bottom: 18px; }
.media-card > summary { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 4/3; border-radius: 22px; background: #e7ede4; cursor: pointer; list-style: none; }
.media-card:nth-child(3n+1) > summary { aspect-ratio: 4/5; }
.media-card > summary::-webkit-details-marker { display: none; }
.media-card > summary > .rd-glyph { width: 44px; height: 44px; color: #a3b3a2; }
.media-card > summary > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.media-card > summary:hover > img { transform: scale(1.035); }
.media-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px 18px 16px; color: white; font-size: 11px; font-weight: 500; background: linear-gradient(transparent,rgb(0 0 0 / .35)); opacity: 0; transition: opacity .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card > summary:hover .media-caption, .media-card > summary:focus-visible .media-caption { opacity: 1; }
.media-video .rd-glyph { width: 44px; height: 44px; }
.media-card[open] { column-span: all; }
.media-card[open] > summary { aspect-ratio: auto; height: 160px; }
.media-sheet { display: grid; gap: 20px; padding: 24px 0; }
.media-sheet h2 { margin: 0; font: 500 13px var(--rd-font-body); color: var(--rd-ink-3); overflow-wrap: anywhere; }
.media-preview { display: grid; place-items: center; min-height: 120px; border-radius: 18px; overflow: hidden; background: #f1f4ee; touch-action: pan-y; }
.media-preview img, .media-preview video { max-width: 100%; max-height: 62dvh; object-fit: contain; }
.media-viewer { width: min(1120px,calc(100vw - 32px)); max-width: 100%; max-height: calc(100dvh - 32px); margin: auto; padding: 24px; border: 1px solid rgb(255 255 255 / .4); border-radius: 28px; background: white; color: var(--rd-ink); box-shadow: 0 30px 100px rgb(0 0 0 / .2); }
.media-viewer::backdrop { background: rgb(16 27 19 / .65); backdrop-filter: blur(14px); }
.media-viewer > .visual-action { display: flex; margin-left: auto; border-radius: 24px; }
.media-viewer .media-sheet { padding-bottom: 0; }
.media-viewer .visual-actions { align-items: start; }
.media-no-results { display: grid; place-items: center; gap: 18px; padding: 80px 20px; color: var(--rd-ink-3); }
.token-state { width: 8px; height: 8px; border-radius: 50%; background: var(--rd-accent); }
.token-state.is-off { background: #b8c1b5; }
@media (max-width:599px) {
  .media-grid { columns: 2; column-gap: 10px; }
  .media-card { margin-bottom: 10px; }
  .media-card > summary { border-radius: 16px; }
  .media-tools { gap: 10px; flex-wrap: nowrap; }
  .media-search { flex: 1; width: auto; min-width: 0; }
  .media-filters { gap: 2px; }
  .media-filters button { min-width: 44px; padding-inline: 8px; font-size: 11px; }
  .media-caption { opacity: 1; font-size: 10px; padding: 26px 12px 12px; }
  .media-viewer { padding: 16px; border-radius: 24px; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .media-viewer .visual-action { font-size: 12px; padding: 11px 12px; }
}
@media (max-width:359px) { .media-tools { flex-wrap: wrap; } .media-search { flex-basis: 100%; } }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
