:root { --bg:#0A0E13; --panel:#0F151C; --line:#1E2933; --line-2:#2E3B48; --text:#F3F6F9; --muted:#9AA7B4; --blue:#4AACF0; --blue-hi:#7CC6F6; --blue-wash:#10253A; --err:#F07A6E; --ok:#5CCB8A; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: radial-gradient(1200px 600px at 10% -10%, var(--blue-wash), transparent 60%) var(--bg) fixed; color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; }
h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
button { background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 10px 20px; box-shadow: 0 0 22px rgba(74,172,240,.28); font: inherit; font-weight: 600; cursor: pointer; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .4; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
button.ghost:hover:not(:disabled) { border-color: var(--muted); filter: none; }
button.small, .small { font-size: 13px; }
button.small { padding: 5px 10px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
input::placeholder { color: #6B7885; }
input[type=file] { padding: 8px; color: var(--muted); }
input[type=file]::file-selector-button { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; margin-right: 10px; font: inherit; cursor: pointer; }
.muted { color: var(--muted); } .err { color: var(--err); }
.empty { margin: 0; padding: 8px 0; }
p.err:empty { display: none; }
body.auth { display: grid; place-items: center; padding: 16px; min-height: 100%; height: auto; }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.card h1 { color: var(--text); }
.card .logo { display: block; width: 56px; height: auto; margin-bottom: 18px; }
.card form { display: grid; gap: 14px; margin: 18px 0; } .card label { display: grid; gap: 6px; font-weight: 500; }
.card p { margin: 0; }
.top { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 57px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); letter-spacing: .01em; margin-right: 4px; }
.brand img { width: 30px; height: auto; display: block; }
.brand span { color: var(--blue); }
.top select { width: auto; max-width: 220px; padding: 7px 10px; } .spacer { flex: 1; }
.layout { display: grid; grid-template-columns: 380px 1fr; height: calc(100% - 57px); }
.panel { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; box-shadow: none; color: var(--muted); border-radius: 0; border-bottom: 2px solid transparent; padding: 12px 16px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--blue); }
#edit { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#fields { overflow: auto; padding: 16px; display: grid; gap: 18px; flex: 1; align-content: start; }
.field { display: grid; gap: 6px; } .field label { font-weight: 600; }
.thumb { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; background: var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
#history { overflow: auto; padding: 16px; flex: 1; }
#hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
#hist li { display: grid; gap: 4px; justify-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow-wrap: anywhere; }
#hist li.muted, #hist li.err { border: 0; background: none; padding: 0; }
#hist .meta { color: var(--muted); font-size: 13px; }
#hist button { margin-top: 4px; }
.preview { background: #fff; min-height: 0; } .preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--blue); padding: 10px 16px; border-radius: 10px; margin: 0; z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
@media (max-width: 860px) {
  html, body { height: auto; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 70vh; height: auto; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  #fields, #history { overflow: visible; }
  .bar { position: sticky; bottom: 0; z-index: 5; }
  .top { flex-wrap: wrap; } .top select { max-width: none; flex: 1 1 140px; }
  .top .brand { flex: 1 1 100%; } .top .spacer { display: none; }
  .top #who { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  input, textarea, select { font-size: 16px; }
  button { min-height: 44px; } button.small { min-height: 36px; }
}
@media (prefers-reduced-motion: no-preference) { button, input, textarea, select { transition: border-color .15s, filter .15s; } }
