* { box-sizing: border-box; }
body { margin: 0; background: #000033; color: #e5e7eb; font: 16px/1.75 Verdana,sans-serif; }
main { max-width: 850px; margin: 20px auto; padding: 24px; background: #10102e; border: 2px solid #4d94ff; }
header { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 28px; }
h1 { color: #ffd700; font-size: clamp(21px,4vw,30px); line-height: 1.4; overflow-wrap: anywhere; }
h2 { color: #ffd700; font-size: 20px; }
a { color: #00ffff; overflow-wrap: anywhere; }
article { margin: 20px 0; padding-bottom: 16px; border-bottom: 1px dashed #4d94ff; }
time { color: #93c5fd; }
.cover { width: 100%; max-height: 360px; object-fit: contain; background: #000; margin: 14px 0; }
label { display: block; margin: 16px 0; }
input, textarea, select { display: block; width: 100%; padding: 12px; border: 1px solid #818cf8; background: #070b25; color: #fff; font: inherit; margin-top: 6px; min-height: 44px; }
button, .button { display: inline-block; min-height: 44px; padding: 10px 14px; background: #25215d; color: #fff; font: inherit; border: 1px solid #818cf8; cursor: pointer; }
:focus-visible { outline: 3px solid #ffd700; outline-offset: 3px; }
.notice { padding: 14px; border: 1px solid #6ee7b7; }
footer { margin-top: 30px; color: #9ca3af; font-size: 14px; }
@media(max-width:600px) { main { margin: 8px; padding: 16px; } textarea { height: 220px; } }

.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 20px 0; }
input[type=file] { max-width: 100%; padding: 8px; }
input[type=file]::file-selector-button { white-space: normal; margin-right: 8px; padding: 8px; font: inherit; }

.episode-editor { min-width: 0; margin: 18px 0; padding: 16px; border: 1px solid #4d94ff; }
.episode-editor legend { color: #ffd700; padding: 0 8px; }
.filename { overflow-wrap: anywhere; font-size: 14px; }
.episode-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.episode-fields label { min-width: 0; }
.elinks-input { min-height: 180px; font: 14px/1.6 monospace; overflow-wrap: anywhere; }
.download-preview { padding: 12px 0; border-bottom: 1px dashed #4d94ff; }
.project-preview details { margin: 16px 0; }
.project-preview summary { min-height: 44px; color: #93c5fd; cursor: pointer; }
@media(max-width:600px) { .episode-fields { grid-template-columns: 1fr; gap: 0; } }

main { overflow-wrap: anywhere; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.dashboard-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid #4d94ff; background: #070b25; }
.dashboard-card h2 { margin: 0; }
.dashboard-card .button { margin-top: auto; text-align: center; }
.muted { color: #93c5fd; }
.maintenance-summary { display: flex; flex-wrap: wrap; gap: 12px; }
.maintenance-status { border-left: 4px solid; padding: 8px 12px; background: #070b25; }
.maintenance-status.ok { color: #6ee7b7; }
.maintenance-status.warning { color: #fde68a; }
.maintenance-status.error { color: #fda4af; }
.maintenance-status.pending { color: #93c5fd; }
.maintenance-check { margin: 18px 0; padding: 16px; border: 1px solid #4d94ff; }
.maintenance-check h2, .maintenance-check h3 { margin: 0; }
button:disabled { opacity: .65; cursor: wait; }
.sidebar-list { padding: 0; list-style: none; }
.sidebar-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed #4d94ff; }
.sidebar-list a { padding: 4px 8px; min-height: 44px; }
.sidebar-preview { max-width: 320px; padding: 20px; border: 1px solid #4d94ff; background: #070b25; margin: 20px 0; }
.sidebar-preview h2 { font-size: 15px; text-align: center; background: #25215d; }
.sidebar-block { margin-bottom: 24px; }
.sidebar-item { text-align: center; margin: 12px 0; }
.sidebar-image { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.sidebar-status { text-align: center; color: #6ee7b7; font-weight: bold; }
summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: #93c5fd; }
@media(max-width:700px) { .dashboard-grid { grid-template-columns: 1fr; } }

.banner-tool { min-width: 0; margin: 24px 0; padding: 18px; border: 1px solid #ffd700; background: #070b25; }
.banner-tool legend { padding: 0 8px; color: #ffd700; font-weight: bold; }
.banner-tool button { width: 100%; }
.banner-live-preview { margin: 18px 0; }
.banner-live-preview canvas { display: block; width: 100%; height: auto; border: 1px solid #4d94ff; }
.banner-live-preview figcaption, .banner-status { font-size: 14px; color: #93c5fd; }

.visit-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.visit-summary h2 { font-size: 16px; }
.visit-number { margin: 12px 0 0; font-size: 26px; color: #00ffff; font-variant-numeric: tabular-nums; }
.visit-unique { margin: 16px 0 0; font-size: 26px; color: #6ee7b7; font-variant-numeric: tabular-nums; }
.visit-label { margin: 4px 0 0; font-size: 13px; }
.visit-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.visit-filters label { min-width: 0; margin: 0; }
.visit-filters .editor-actions { grid-column: 1 / -1; margin: 0; }
.visit-table-wrap { overflow-x: auto; }
.visit-table { width: 100%; border-collapse: collapse; margin: 16px 0 28px; }
.visit-table caption { text-align: left; color: #93c5fd; margin-bottom: 8px; }
.visit-table th, .visit-table td { padding: 10px; border-bottom: 1px solid #4d94ff; text-align: left; font-weight: normal; }
.visit-table thead th { color: #ffd700; font-weight: bold; }
.visit-table td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media(max-width:700px) { .visit-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } .visit-filters { grid-template-columns: 1fr; } .visit-table th, .visit-table td { padding: 8px 4px; } }

.image-library { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.image-card { min-width: 0; padding: 16px; border: 1px solid #4d94ff; }
.image-card > img { display: block; width: 100%; height: 140px; object-fit: contain; background: #000; }
.image-card h2 { font-size: 17px; }
.library-filters, .news-search { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.library-filters label, .news-search label { flex: 1 1 200px; min-width: 0; }
.check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: 20px; margin: 0; }
.history-text { white-space: normal; padding: 16px; border: 1px solid #4d94ff; }
.unsaved-notice { border-color: #ffd700; color: #ffd700; }
.autosave-status { color: #93c5fd; font-size: 14px; }
.panel-summary { border: 1px solid #ffd700; padding: 18px; margin: 24px 0; }
.project-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.project-gallery figure { margin: 0; min-width: 0; }
.project-gallery img { width: 100%; max-height: 260px; object-fit: contain; background: #000; }
.project-gallery figcaption { padding: 10px 0; }
@media(max-width:600px) { .project-gallery { grid-template-columns: 1fr; } }
@media(max-width:600px) { .image-library { grid-template-columns: 1fr; } }

/* Estadísticas: gráficas locales con tablas equivalentes accesibles. */
.visit-charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.visit-chart { margin: 0; padding: 14px; min-width: 0; border: 1px solid #4d94ff; background: #070b25; }
.visit-chart figcaption { color: #ffd700; font-weight: bold; margin-bottom: 12px; }
.visit-chart svg { display: block; width: 100%; height: auto; }
.chart-grid { stroke: #29446b; stroke-width: 1; }
.chart-label { fill: #c3d6ef; font: 20px sans-serif; }
.chart-pages { fill: #00ffff; stroke: #00ffff; }
.chart-unique { fill: #6ee7b7; stroke: #6ee7b7; }
.chart-line { fill: none; stroke-width: 2; }
.comment { margin: 18px 0; padding: 16px; border: 1px solid #496b9c; background: #080d29; min-width: 0; }
.comment h3 { margin-top: 0; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.comment-form { position: relative; }
.comment-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.comment-action { display: inline-block; margin: 0 8px 8px 0; padding: 0; }
.comment-action button { min-height: 44px; }
.comment input[type="checkbox"] { width: auto; min-height: 0; margin-right: 8px; }
#comentarios { margin-top: 40px; scroll-margin-top: 20px; }
#comentarios textarea { width: 100%; box-sizing: border-box; }
.visit-comparison { margin: 28px 0; }
@media(max-width:900px) { .visit-charts { grid-template-columns: 1fr; } }
