* { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #101418; color: #edf2f7; }
a { color: inherit; text-decoration: none; }
code { background: #1c242d; padding: 0.15rem 0.35rem; border-radius: 6px; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.site-header { border-bottom: 1px solid #24313d; background: rgba(16, 20, 24, 0.92); position: sticky; top: 0; backdrop-filter: blur(8px); }
.nav-row { display: flex; justify-content: space-between; align-items: center; min-height: 72px; gap: 1rem; }
.brand { font-size: 1.6rem; font-weight: 800; }
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.page { padding: 2rem 0 4rem; }
.hero, .panel, .auth-card { background: #17212b; border: 1px solid #24313d; border-radius: 18px; padding: 1.5rem; }
.hero { padding: 3rem; margin-bottom: 1.5rem; }
.hero h1, .page-head h1, .auth-card h1 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.05; }
.eyebrow, .muted, small, .status { color: #98a7b5; }
.actions, .between, .filter-row, .inline-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.page-head, .between { justify-content: space-between; }
.page-head { display: flex; gap: 1rem; margin-bottom: 1.5rem; align-items: end; }
.grid { display: grid; gap: 1rem; }
.grid > *, .stack > *, label, fieldset, .panel { min-width: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.5rem; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: grid; gap: 1rem; }
.button, button, input, textarea, select { font: inherit; }
.button, button.button, .link-button { border: 1px solid #3a4a59; background: #17212b; color: #edf2f7; border-radius: 10px; padding: 0.75rem 1rem; cursor: pointer; }
.button.primary { background: #d0ff45; color: #0b0f12; border-color: #d0ff45; }
.button.danger { border-color: #eb5757; color: #eb5757; }
.link-button { background: transparent; border: 0; padding: 0; }
.favorite-button { border: 1px solid #3a4a59; background: transparent; color: #c9d5e0; border-radius: 999px; padding: 0.45rem 0.8rem; cursor: pointer; }
.favorite-button.is-active { background: #d0ff45; border-color: #d0ff45; color: #0b0f12; }
label span, legend, .slot-title { display: block; margin-bottom: 0.35rem; color: #c9d5e0; font-size: 0.95rem; }
input, textarea, select { display: block; width: 100%; max-width: 100%; min-width: 0; padding: 0.75rem 0.85rem; border: 1px solid #31404f; border-radius: 10px; background: #0f161d; color: #edf2f7; }
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; }
.flash { margin-bottom: 1rem; border-radius: 12px; padding: 1rem; }
.flash.success { background: rgba(87, 242, 135, 0.12); border: 1px solid rgba(87, 242, 135, 0.4); }
.flash.error { background: rgba(235, 87, 87, 0.12); border: 1px solid rgba(235, 87, 87, 0.4); }
.auth-card { width: min(520px, 100%); margin: 3rem auto 0; }
body[data-fullscreen="true"] { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
body[data-fullscreen="true"] .site-header { flex-shrink: 0; }
body[data-fullscreen="true"] main.page--fullscreen { width: 100%; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
body[data-fullscreen="true"] .page-head { flex-shrink: 0; padding: 1.5rem; margin-bottom: 0; border-bottom: 1px solid #24313d; }
body[data-fullscreen="true"] .panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 0; background: transparent; }
body[data-fullscreen="true"] .miniapp-shell { flex: 1; width: 100%; height: 100%; min-height: 0; }
body[data-fullscreen="true"] .miniapp-frame { flex: 1; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; }
body[data-fullscreen="true"] .miniapp-loading { border-radius: 0; }
.miniapp-shell { position: relative; min-height: 72vh; }
.miniapp-frame { display: block; width: 100%; min-height: 72vh; border: 0; border-radius: 12px; background: #0f1115; opacity: 0; transition: opacity 0.18s ease; }
.miniapp-frame.is-ready { opacity: 1; }
.miniapp-loading { position: absolute; inset: 0; display: grid; place-items: center; gap: 0.75rem; padding: 2rem; border-radius: 12px; background: linear-gradient(180deg, rgba(15, 22, 29, 0.92), rgba(23, 33, 43, 0.96)); color: #c9d5e0; text-align: center; transition: opacity 0.18s ease, visibility 0.18s ease; }
.miniapp-loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.miniapp-loading p { margin: 0; }
.miniapp-loading__spinner { width: 40px; height: 40px; border-radius: 999px; border: 3px solid rgba(208, 255, 69, 0.18); border-top-color: #d0ff45; animation: miniapp-spin 0.8s linear infinite; }
@keyframes miniapp-spin { to { transform: rotate(360deg); } }
.card-link { display: block; }
.card-tile { display: grid; gap: 1rem; align-content: start; }
.emoji { font-size: 2rem; margin-bottom: 0.75rem; }
.list-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid #24313d; }
.list-row:last-child { border-bottom: 0; }
.quote { padding: 1rem 0; border-top: 1px solid #24313d; }
.quote:first-of-type { border-top: 0; padding-top: 0; }
.slot-box { width: 100%; max-width: 100%; min-inline-size: 0; border: 1px solid #31404f; border-radius: 12px; padding: 1rem; }
.slot-title { margin-top: 0; }
.status, .chip { display: inline-flex; align-items: center; padding: 0.3rem 0.65rem; border: 1px solid #31404f; border-radius: 999px; }
.chip.active { background: #d0ff45; color: #0b0f12; border-color: #d0ff45; }
.checkbox-row { display: flex; gap: 0.75rem; align-items: center; }
.checkbox-row input { width: auto; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.75rem; border-bottom: 1px solid #24313d; vertical-align: top; }
.editor-section, .danger-zone { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #24313d; }
.code-area { min-height: 220px; font-family: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; line-height: 1.5; }
.danger-zone { border-top-color: rgba(235, 87, 87, 0.35); }
@media (max-width: 720px) {
    .hero { padding: 1.5rem; }
    .container { width: min(100% - 1rem, 1120px); }
    .panel { padding: 1rem; }
    .page-head, .between, .list-row { flex-direction: column; align-items: start; }
    .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
    .slot-box { padding: 0.75rem; }
    .nav-row { align-items: start; padding: 1rem 0; }
}
