/* Event data editor (eventeditor.html) */
.dod-ed { --ed-line: #d9dee3; --ed-soft: #f5f7f9; --ed-ink: #1d2a33; --ed-muted: #5c6b77; --ed-accent: #133F4C; --ed-err: #b3261e; --ed-warn: #8a5a00; --ed-ok: #1e6b3a;
  max-width: 1500px; margin: 0 auto 3rem; color: var(--ed-ink); font-size: 0.95rem; }
.dod-ed code { color: inherit; }
.dod-ed-mono { font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.82rem; }
.dod-ed-label { display: block; font-weight: 600; font-size: 0.8rem; margin-bottom: 0.2rem; color: var(--ed-ink); }
.dod-ed-key { font-weight: 400; font-size: 0.72rem; color: var(--ed-muted); margin-left: 0.4rem; }
.dod-ed-req { color: var(--ed-err); font-weight: 400; font-size: 0.75rem; }
.dod-ed-h { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 0.6rem; }

/* Picker bar */
.dod-ed-bar { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(220px, 1.4fr) auto; gap: 1rem; align-items: end; padding: 1rem; background: var(--ed-soft); border: 1px solid var(--ed-line); border-radius: 8px; }
.dod-ed-bar__pick { display: grid; gap: 0.3rem; min-width: 0; }
.dod-ed-bar__src { display: flex; gap: 0.5rem; min-width: 0; }
.dod-ed-bar__src > div { flex: 1 1 0; min-width: 0; }
.dod-ed-bar__src > div:first-child { flex-grow: 1.4; }
.dod-ed-bar select, .dod-ed-bar input[type="text"], .dod-ed-bar input[type="search"] { width: 100%; min-width: 0; }
.dod-ed .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.dod-ed .badge { display: inline-block; padding: 0.25em 0.5em; font-size: 75%; font-weight: 700; border-radius: 0.25rem; line-height: 1; }
.dod-ed .badge-danger { background: var(--ed-err); color: #fff; }
.dod-ed .badge-success { background: var(--ed-ok); color: #fff; }
.dod-ed .badge-warning { background: #f2c94c; color: #3a2a00; }
.dod-ed .badge-light { background: #eef1f4; color: var(--ed-ink); }
.dod-ed-bar__go { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dod-ed-status { margin: 0.6rem 0; font-size: 0.85rem; color: var(--ed-muted); min-height: 1.2em; }
.dod-ed-empty { border: 1px dashed var(--ed-line); border-radius: 8px; padding: 1.25rem 1.5rem; margin-top: 1rem; }
.dod-ed-empty h2 { font-size: 1.2rem; margin-top: 0; }

/* Tabs */
.dod-ed-tabsbar { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--ed-line); margin-top: 0.5rem; flex-wrap: wrap; gap: 0.5rem; }
.dod-ed-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.dod-ed-tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 0.5rem 0.9rem; font-weight: 600; color: var(--ed-muted); border-radius: 6px 6px 0 0; margin-bottom: -2px; }
.dod-ed-tab:hover { color: var(--ed-ink); background: var(--ed-soft); }
.dod-ed-tab.active { color: var(--ed-accent); background: #fff; border-color: var(--ed-line); border-bottom: 2px solid #fff; }
.dod-ed-tabsbar__state { padding-bottom: 0.4rem; }

.dod-ed-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; margin-top: 1rem; }
.dod-ed-side { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow: auto; border: 1px solid var(--ed-line); border-radius: 8px; padding: 0 1rem 1rem; background: #fff; }
.dod-ed-side .dod-ed-h { margin-top: 0.9rem; }
@media (max-width: 991px) { .dod-ed-main { grid-template-columns: 1fr; } .dod-ed-side { position: static; max-height: none; order: -1; } .dod-ed-bar { grid-template-columns: 1fr; } .dod-ed-formtop { position: static; } }
@media (max-width: 575px) { .dod-ed-bar__src { flex-direction: column; } .dod-ed-diff__ln { grid-template-columns: 2.2rem 2.2rem 1rem 1fr; } }

/* Form */
.dod-ed-formtop { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; position: sticky; top: 3.6rem; z-index: 2; background: #fff; padding: 0.4rem 0; border-bottom: 1px solid var(--ed-line); }
.dod-ed-formnav { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-size: 0.82rem; }
.dod-ed-sec { padding-top: 1rem; scroll-margin-top: 7rem; }
.dod-ed-sec > h3 { font-size: 1.05rem; font-weight: 700; color: var(--ed-accent); border-bottom: 1px solid var(--ed-line); padding-bottom: 0.3rem; }
.dod-ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 1.1rem; }
.dod-ed-field { margin-bottom: 0.85rem; }
.dod-ed-field--wide, .dod-ed-map, .dod-ed-list { grid-column: 1 / -1; }
.dod-ed-field textarea { resize: vertical; }
.dod-ed-input { display: flex; gap: 0.35rem; align-items: center; }
.dod-ed-input > input, .dod-ed-input > select, .dod-ed-input > textarea { flex: 1 1 auto; min-width: 0; }
.dod-ed-input--date { flex-wrap: wrap; }
.dod-ed-input--date > input[type="text"] { flex: 1 1 100%; }
.dod-ed-input--date > input[type="date"], .dod-ed-input--date > input[type="time"] { flex: 1 1 8rem; }
.dod-ed-swatch { flex: 0 0 2.2rem; height: calc(1.5em + 0.5rem + 2px); padding: 0.1rem; border: 1px solid #ced4da; border-radius: 0.2rem; background: #fff; }
.dod-ed-thumb { flex: 0 0 auto; max-height: 2.2rem; max-width: 6rem; object-fit: contain; border: 1px solid var(--ed-line); border-radius: 4px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.dod-ed-thumb.is-broken { outline: 2px solid var(--ed-err); min-width: 2.2rem; min-height: 2.2rem; }
.dod-ed-open { font-size: 0.75rem; white-space: nowrap; }
.dod-ed-msg { font-size: 0.78rem; margin-top: 0.2rem; }
.dod-ed-msg:empty { display: none; }
.dod-ed-msg.is-error { color: var(--ed-err); }
.dod-ed-msg.is-warn { color: var(--ed-warn); }
.has-error .form-control, .has-error .custom-select { border-color: var(--ed-err); }
.has-warn .form-control, .has-warn .custom-select { border-color: #d39e00; }
.dod-ed-map, .dod-ed-list { border: 1px solid var(--ed-line); border-radius: 8px; padding: 0.4rem 0.9rem 0.6rem; margin-bottom: 1rem; }
.dod-ed-map > legend, .dod-ed-list > legend { width: auto; font-size: 0.9rem; font-weight: 700; padding: 0 0.4rem; margin-bottom: 0; }
.dod-ed-item { border: 1px solid var(--ed-line); border-left: 4px solid var(--ed-accent); border-radius: 6px; padding: 0.5rem 0.75rem 0.25rem; margin: 0.6rem 0; background: var(--ed-soft); }
.dod-ed-item__head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.dod-ed-item__head strong { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dod-ed-item__tools .btn { padding: 0 0.35rem; font-size: 0.78rem; }

/* Visual HTML editor */
.dod-ed-html { border: 1px solid #ced4da; border-radius: 0.25rem; background: #fff; }
.dod-ed-html .dod-ed-input > textarea { border: 0; border-radius: 0 0 0.25rem 0.25rem; }
.dod-ed-htmlbar { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.3rem 0.4rem; background: var(--ed-soft); border-bottom: 1px solid var(--ed-line); border-radius: 0.25rem 0.25rem 0 0; }
.dod-ed-toolbar { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.dod-ed-toolbar[hidden] { display: none; }
.dod-ed-tb { border: 1px solid transparent; background: none; font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; color: var(--ed-ink); line-height: 1.4; }
.dod-ed-tb:hover, .dod-ed-tb:focus { background: #fff; border-color: var(--ed-line); }
.dod-ed-tbsep { width: 1px; align-self: stretch; background: var(--ed-line); margin: 0 0.2rem; }
.dod-ed-modes { display: inline-flex; border: 1px solid var(--ed-line); border-radius: 4px; overflow: hidden; margin-left: auto; }
.dod-ed-mode { border: 0; background: #fff; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.6rem; color: var(--ed-muted); }
.dod-ed-mode.active { background: var(--ed-accent); color: #fff; }
.dod-ed-visual { padding: 0.5rem 0.75rem; max-height: 32rem; overflow: auto; resize: vertical; font-size: 0.92rem; line-height: 1.5; outline: none; }
.dod-ed-visual:focus { box-shadow: inset 0 0 0 2px rgba(19, 63, 76, 0.25); }
.dod-ed-visual[hidden] { display: none; }
.dod-ed-visual p { margin: 0 0 0.6rem; }
.dod-ed-visual h2 { font-size: 1.2rem; margin: 0.8rem 0 0.4rem; }
.dod-ed-visual h3 { font-size: 1.05rem; margin: 0.7rem 0 0.35rem; }
.dod-ed-visual img { max-width: 100%; max-height: 10rem; width: auto; height: auto; }
.dod-ed-visual table { border-collapse: collapse; margin: 0.4rem 0 0.8rem; }
.dod-ed-visual td, .dod-ed-visual th { border: 1px solid var(--ed-line); padding: 0.25rem 0.45rem; vertical-align: top; }
.dod-ed-visual a { color: #1F6FAE; text-decoration: underline; }
.dod-ed-htmlnote { font-size: 0.78rem; color: var(--ed-warn); padding: 0.3rem 0.6rem; }
.dod-ed-html > .dod-ed-input[hidden] { display: none; }

/* YAML */
.dod-ed-raw { min-height: 60vh; white-space: pre; tab-size: 4; }

/* Preview */
.dod-ed-previewbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.dod-ed-simdate { width: 10rem; }
.dod-ed-tplsrc summary { font-size: 0.82rem; cursor: pointer; }
.dod-ed-tplsrc[open] { flex-basis: 100%; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 0.4rem; align-items: center; }
.dod-ed-tplsrc[open] summary { grid-column: 1 / -1; }
.dod-ed-previewmsg { font-size: 0.8rem; color: var(--ed-muted); margin: 0.6rem 0; }
.dod-ed-framewrap { margin: 0 auto; border: 1px solid var(--ed-line); border-radius: 8px; overflow: hidden; transition: max-width 0.2s; max-width: 100%; }
.dod-ed-frame { display: block; width: 100%; height: 80vh; border: 0; background: #fff; }

/* Review */
.dod-ed-diff { border: 1px solid var(--ed-line); border-radius: 8px; max-height: 50vh; overflow: auto; background: #fff; }
.dod-ed-diff__ln { display: grid; grid-template-columns: 3rem 3rem 1.2rem 1fr; white-space: pre-wrap; word-break: break-all; line-height: 1.45; }
.dod-ed-diff__no { color: #98a3ad; text-align: right; padding-right: 0.5rem; user-select: none; }
.dod-ed-diff__mk { user-select: none; font-weight: 700; }
.dod-ed-diff__ln.is-add { background: #e6f4ea; }
.dod-ed-diff__ln.is-add .dod-ed-diff__mk { color: var(--ed-ok); }
.dod-ed-diff__ln.is-del { background: #fce8e6; }
.dod-ed-diff__ln.is-del .dod-ed-diff__mk { color: var(--ed-err); }
.dod-ed-diff__gap { color: #98a3ad; padding-left: 6.5rem; background: var(--ed-soft); }
.dod-ed-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.dod-ed-savemsg { font-size: 0.85rem; margin: 0.5rem 0; min-height: 1.2em; }
.dod-ed-gh { border: 1px solid var(--ed-line); border-radius: 8px; padding: 0.9rem 1rem; }
.dod-ed-inline { display: flex; gap: 0.5rem; max-width: 34rem; }
.dod-ed-ghform { max-width: 40rem; border-top: 1px solid var(--ed-line); padding-top: 0.8rem; margin-top: 0.4rem; }

/* Checks */
.dod-ed-checks { list-style: none; padding: 0; margin: 0 0 0.75rem; font-size: 0.82rem; }
.dod-ed-check { overflow-wrap: anywhere; padding: 0.35rem 0.5rem; border-left: 3px solid var(--ed-line); margin-bottom: 0.3rem; background: var(--ed-soft); border-radius: 0 4px 4px 0; cursor: pointer; }
.dod-ed-check code { font-size: 0.7rem; color: var(--ed-muted); }
.dod-ed-check__lvl { font-weight: 700; }
.dod-ed-check.is-error { border-left-color: var(--ed-err); }
.dod-ed-check.is-error .dod-ed-check__lvl { color: var(--ed-err); }
.dod-ed-check.is-warn { border-left-color: #d39e00; }
.dod-ed-check.is-warn .dod-ed-check__lvl { color: var(--ed-warn); }
.dod-ed-check.is-info .dod-ed-check__lvl { color: var(--ed-muted); }
.dod-ed-check.is-ok { border-left-color: var(--ed-ok); color: var(--ed-ok); cursor: default; }
