:root {
  --navy: #0f2f6b;
  --blue: #2563eb;
  --bg: #f1f5f9;
  --panel: #ffffff;
  --border: #d8dee9;
  --text: #1e293b;
  --muted: #64748b;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: 10px 20px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: #38bdf8; }
.brand .tb-logo { height: 30px; width: auto; background: #fff; border-radius: 4px; padding: 2px 4px; }
.brand strong { display: block; font-size: 14px; }
.brand small { display: block; opacity: .8; font-size: 11px; }
.today { font-size: 12px; opacity: .92; }
.today b { background: rgba(255,255,255,.15); padding: 1px 6px; border-radius: 4px; }

.layout {
  display: grid; grid-template-columns: minmax(420px, 520px) 1fr;
  gap: 16px; padding: 16px; align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.form { padding: 16px; }
.field { margin-bottom: 12px; display: flex; flex-direction: column; }
.field label { font-size: 12px; font-weight: 600; margin-bottom: 4px; color: #334155; }
.field .muted, .muted { color: var(--muted); font-weight: 400; }
.hint { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.row { display: flex; gap: 12px; }
.row .field { flex: 0 0 auto; }
.row .field.grow { flex: 1; }
input, select, textarea {
  font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 7px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
textarea { resize: vertical; line-height: 1.4; }

.actions { display: flex; gap: 10px; margin-top: 8px; position: sticky; bottom: 0; }
.btn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 9px 16px;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #0b2452; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn.secondary:hover { background: #eef2f9; }

.preview { position: sticky; top: 16px; display: flex; flex-direction: column;
  height: calc(100vh - 100px); overflow: hidden; }
.preview-head {
  padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
#preview-frame { border: 0; width: 100%; flex: 1; background: #e9edf3; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .preview { position: static; height: 70vh; }
}
