/* Editor akordov */

/* Editor akordov */
#editor {
  margin: 0; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  background: var(--bg);
}
#editor[open] { display: flex; flex-direction: column; }
.e-head {
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.e-head .icon-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; }
.e-title { flex: 1; min-width: 0; }
.e-title h2 { margin: 0; overflow: hidden; font-size: 1.1rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.e-title small { display: block; color: var(--muted); font-size: .8rem; }
.e-head .btn { min-height: 42px; padding: 0 14px; font-size: .88rem; }
.e-tools {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.e-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.e-row.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.e-row.scroll::-webkit-scrollbar { display: none; }
.e-row.scroll > * { flex: none; }
.e-tools .lbl { color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.palette { display: flex; gap: 6px; }
@media (min-width: 900px) { .e-tools { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; } .e-row.scroll { flex-wrap: wrap; overflow: visible; } }
.palette button {
  min-width: 46px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  color: var(--chord); font: 700 .95rem/1 var(--sans); cursor: pointer;
}
.palette button:hover { background: var(--accent-soft); background: color-mix(in srgb, var(--chord) 12%, var(--bg)); border-color: var(--chord); }
.palette.secs button { min-width: 0; color: var(--accent); font-size: .85rem; }
.palette.secs button:hover { background: var(--accent-soft); border-color: var(--accent); }
.e-meta { display: none; padding: 12px max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--surface); }
.e-meta.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.e-meta .field.wide { grid-column: 1 / -1; }
.e-meta .field span { margin-bottom: 4px; }
.e-meta .field input, .e-meta .field select { height: 40px; }
@media (min-width: 900px) { .e-meta.open { grid-template-columns: 1.4fr .8fr .8fr; } .e-meta .field.wide { grid-column: span 3; } }
.field select { width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
.e-custom { display: inline-flex; gap: 6px; }
.e-custom input { width: 7.5rem; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.e-tabs { display: none; }
.e-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.e-main textarea {
  width: 100%; height: 100%; resize: none;
  padding: 16px max(16px, env(safe-area-inset-left));
  border: 0; border-right: 1px solid var(--line); border-radius: 0;
  background: var(--surface); color: var(--ink);
  font: 500 1rem/1.7 var(--mono); tab-size: 4;
}
.e-main textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.e-preview { overflow-y: auto; margin: 0; padding: 18px max(20px, env(safe-area-inset-right)) 40px 20px; background: var(--bg); animation: none; }
.e-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 8px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  border-top: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: .82rem;
}
.e-foot .warn { color: var(--danger); font-weight: 600; }
.e-foot .warn:empty { display: none; }
.e-acts { display: inline-flex; gap: 8px; }
.e-acts .pill { height: 34px; font-size: .8rem; }
@media (max-width: 640px) { .e-hint { display: none; } .e-foot { justify-content: flex-start; } }
@media (max-width: 899px) {
  .e-tabs { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .e-tabs button { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 650; cursor: pointer; }
  .e-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
  .e-main { grid-template-columns: 1fr; }
  .e-main[data-tab="text"] .e-preview, .e-main[data-tab="preview"] textarea { display: none; }
  .e-main textarea { border-right: 0; }
}
