:root { --fg:#111; --muted:#666; --bg:#fff; --soft:#f6f7f9; }
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin:0; color:var(--fg); background:var(--bg); }
.container { max-width: 900px; margin: 24px auto 64px; padding: 0 16px; }
.lead-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.lead { color: var(--muted); margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 36px; height: 20px; border-radius: 999px; background: #e2e6ea; position: relative; transition: background 0.2s ease; }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); transition: transform 0.2s ease; }
.toggle input:checked + .toggle-track { background: #0b5d4a; }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-label { font-weight: 600; }
.emb-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.emb-status-item { display: inline-flex; align-items: center; gap: 4px; }
.emb-status-index { font-weight: 600; }
.led { width: 10px; height: 10px; border-radius: 50%; background: #cfd5db; border: 1px solid #bcc3ca; display: inline-block; }
.led-online { background: #2da44e; border-color: #258a41; }
.led-offline { background: #d73a49; border-color: #c22f3e; }
.led-active { background: #f2c200; border-color: #d1a700; }
.ghost { background: transparent; border: 1px solid rgba(14, 32, 55, 0.25); color: var(--fg); padding: 10px 14px; border-radius: 999px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.ghost:hover { border-color: rgba(14, 32, 55, 0.45); background: rgba(255, 255, 255, 0.6); }
.ghost.small { padding: 6px 10px; font-size: 12px; }
.ghost.subtle { border: 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.ghost.subtle:hover { color: var(--fg); background: transparent; text-decoration: underline; }
.row { display: flex; gap: 8px; margin: 16px 0 24px; }
input { flex: 1; padding: 12px; font-size: 16px; border:1px solid #ddd; border-radius: 10px; }
button { padding: 12px 16px; font-size: 16px; border:1px solid #ddd; background:#fafafa; border-radius: 10px; cursor: pointer; }
button:hover { background:#f0f0f0; }
pre { background: var(--soft); padding: 14px; white-space: pre-wrap; border-radius: 12px; }
.status { display: none; flex-direction: row; flex-wrap: wrap; gap: 10px 14px; color: var(--muted); font-size: 14px; margin: 6px 0 16px; }
.status.is-active { display: flex; }
.status-line { display: flex; align-items: center; gap: 8px; }
.status-spinner { width: 14px; height: 14px; border: 2px solid #d9dde2; border-top-color: #0b5d4a; border-radius: 50%; animation: status-spin 0.9s linear infinite; }
.status-check { width: 16px; height: 16px; border-radius: 50%; background: #e6f4f0; color: #0b5d4a; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
@keyframes status-spin { to { transform: rotate(360deg); } }
.site-header { display:flex; align-items:center; justify-content: space-between; gap:16px; padding: 12px 16px; border-bottom:1px solid #eee; }
.site-header img { height: 40px; }
.author-tag { font-size: 14px; color: var(--muted); }
.site-footer { display:flex; flex-direction: column; gap:6px; padding: 16px; border-top:1px solid #eee; color: var(--muted); }
.site-footer .mini { height: 20px; vertical-align: middle; margin-right: 8px; }
.tiny { font-size: 12px; color: var(--muted); }
#media { margin-top: 24px; }
.media-section { margin-top: 16px; }
.media-section h4 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.media-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.media-image-button { border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.media-image-button img { width: 100%; height: auto; border-radius: 10px; border: 1px solid #eee; background: var(--soft); display: block; }
.media-meta { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.media-caption { font-size: 14px; line-height: 1.4; }
.media-ref { font-size: 12px; color: var(--muted); }
.media-placeholder { background: var(--soft); color: var(--muted); border-radius: 10px; padding: 18px; text-align: center; font-size: 12px; }
.media-links a { font-size: 12px; color: #0b5d4a; text-decoration: none; }
.media-links a:hover { text-decoration: underline; }

.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(12, 20, 29, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 20; }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-card { background: #fff; border-radius: 20px; padding: 22px 24px; max-width: 520px; width: min(90vw, 520px); box-shadow: 0 24px 70px rgba(9, 21, 35, 0.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-body p { margin: 0 0 12px; color: var(--fg); line-height: 1.6; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body a { color: #0b5d4a; text-decoration: none; }
.modal-body a:hover { text-decoration: underline; }

.popover { max-width: 520px; background: #fff; border: 1px solid #e2e6ea; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--fg); box-shadow: 0 16px 30px rgba(12, 20, 29, 0.12); display: none; }
.popover.is-open { display: block; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.72); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 999; }
.lightbox.is-open { display: flex; }
.lightbox-inner { max-width: min(90vw, 1100px); max-height: 90vh; background: #fff; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.lightbox-image { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--soft); }
.lightbox-caption { font-size: 14px; color: var(--muted); }
.lightbox-close { position: absolute; top: 8px; right: 12px; border: 0; background: transparent; font-size: 28px; cursor: pointer; color: var(--muted); }

.overrides-page { margin: 0; background: #f4f6f1; color: var(--fg); min-height: 100vh; }
.overrides-header { max-width: 1100px; margin: 32px auto 16px; padding: 0 16px; }
.overrides-header h1 { margin: 0 0 6px; font-size: 28px; }
.overrides-subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.overrides-main { padding: 0 16px 40px; }
.overrides-table { width: 100%; max-width: 1100px; margin: 0 auto; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(14, 18, 25, 0.08); }
.overrides-table th, .overrides-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #eef0ea; vertical-align: top; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.overrides-table th { background: #f8faf6; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #4b5b47; }
.overrides-table tr:last-child td { border-bottom: none; }
.overrides-table a { color: #0b5d4a; text-decoration: none; }
.overrides-table a:hover { text-decoration: underline; }
.overrides-table .is-hidden { opacity: 0.5; }
.overrides-empty { text-align: center; color: var(--muted); font-style: italic; }
