/* ============================================================
   AI Media Studio — EKF тёмная тема
   ============================================================ */
@font-face {
  font-family: "Golos UI";
  src: url("/golos-ui_vf.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg:        #0a0a0b;
  --bg-side:   #0c0c0e;
  --panel:     #141416;
  --panel-2:   #1a1a1d;
  --border:    #242427;
  --border-2:  #2e2e32;
  --text:      #f4f4f5;
  --text-mut:  #8a8a90;
  --text-dim:  #5c5c63;
  --white:     #fafafa;
  --accent:    #E30613;
  --accent-hover: #ff1a28;
  --accent-dim: rgba(227,6,19,.15);
  --danger:    #e05a5a;
  --radius:    12px;
  --radius-sm: 9px;
  --shadow:    0 8px 30px rgba(0,0,0,.4);
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===================== LUCIDE ICONS ===================== */
.lucide { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.brand-logo .lucide { width: 20px; height: 20px; }
.mode-btn .lucide { width: 16px; height: 16px; }
.btn-primary .lucide { width: 16px; height: 16px; }
.btn-ghost .lucide { width: 14px; height: 14px; }
.icon-btn .lucide { width: 15px; height: 15px; }
.step-btn .lucide, .ref-add .lucide { width: 17px; height: 17px; }
.frame-empty .lucide { width: 13px; height: 13px; }
.ref-item .x .lucide { width: 12px; height: 12px; }
.empty .empty-ico { width: 46px; height: 46px; color: var(--text-dim); }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Golos UI", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255,255,255,.18); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--white); }

/* ===================== LAYOUT ===================== */
.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-scroll {
  overflow-y: auto;
  padding: 6px 18px 28px;
  flex: 1;
}

.main {
  overflow-y: auto;
  padding: 26px 34px 48px;
}

/* ===================== BRAND ===================== */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  color: var(--white);
  overflow: hidden;
}
.brand-logo img {
  width: 100%; height: 100%; object-fit: cover;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--text-dim); letter-spacing: .4px; }

/* ===================== BALANCE ===================== */
.balance {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 18px 0; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
}
.balance[hidden] { display: none; }
.bal-left { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-mut); }
.bal-left .lucide { width: 14px; height: 14px; }
.bal-val { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.bal-val.low { color: #f0a3a3; }

/* ===================== MODE SWITCH ===================== */
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
  margin: 14px 18px 2px; padding: 4px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 11px;
}
.mode-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 8px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-mut);
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--white); color: #0a0a0b; font-weight: 600; }

/* ===================== GROUPS ===================== */
.group { padding: 18px 0 0; }
.group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--text-mut);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px;
}
.group-label.nomargin { margin: 0; }
.group-label .hint {
  font-weight: 500; letter-spacing: .2px; text-transform: none;
  color: var(--text-dim); font-size: 10.5px;
}
.group > .hint {
  font-size: 10.5px; color: var(--text-dim); margin: 6px 0 8px;
}

/* ===================== FRAMES / REFS ===================== */
.frames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frame-slot, .ref-add, .ref-item {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-2);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color .15s, color .15s, background .15s;
}
.frame-slot:hover, .ref-add:hover { border-color: var(--text-mut); color: var(--text-mut); }
.frame-empty { font-size: 11px; display: flex; align-items: center; justify-content: center; gap: 4px; height: 100%; }
.frame-slot.filled, .ref-item { border-style: solid; border-color: var(--border-2); }
.frame-slot img, .ref-item img { width: 100%; height: 100%; object-fit: cover; }
.ref-item img { cursor: zoom-in; }
.frame-view {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 6px; cursor: zoom-in;
  background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .12s;
}
.frame-slot:hover .frame-view { opacity: 1; }
.frame-view .lucide { width: 12px; height: 12px; }
.frame-slot .frame-tag {
  position: absolute; left: 5px; bottom: 5px;
  background: rgba(0,0,0,.7); color: #fff; font-size: 9px;
  padding: 2px 6px; border-radius: 6px; letter-spacing: .3px;
}

.refs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; border-radius: 10px; transition: background .12s, outline-color .12s; }
.refs.dragover { outline: 2px dashed var(--text-mut); outline-offset: 5px; background: rgba(255,255,255,.04); }
.frame-slot.frame-drop { outline: 2px dashed var(--text-mut); outline-offset: 2px; border-color: var(--text-mut); }
.card-media img.shot { cursor: zoom-in; }
.card-media img.shot.dragging { cursor: grabbing; }
.ref-add { display: grid; place-items: center; font-size: 18px; line-height: 1; }
.ref-item { border-style: solid; }
.ref-item .x {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 6px;
  background: rgba(0,0,0,.65); color: #fff;
  display: grid; place-items: center; font-size: 12px; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.ref-item:hover .x { opacity: 1; }

/* ===================== SELECT ===================== */
.select-wrap { position: relative; }
.select {
  width: 100%;
  appearance: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 34px 10px 12px;
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  transition: border-color .15s;
}
.select:hover { border-color: var(--border-2); }
.select:focus { outline: none; border-color: var(--text-mut); }
.select option { background: #1a1a1d; color: var(--text); }
.select-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-mut); pointer-events: none; }
/* ===================== MODEL DROPDOWN ===================== */
.model-dropdown { position: relative; }
.model-dropdown-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  appearance: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  transition: border-color .15s;
  text-align: left;
}
.model-dropdown-btn:hover { border-color: var(--border-2); }
.model-dropdown-btn:focus { outline: none; border-color: var(--text-mut); }
.model-dropdown-btn .select-caret { position: static; transform: none; margin-left: 8px; flex-shrink: 0; }

.model-dropdown-list {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
  z-index: 30;
  max-height: 320px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 4px;
}
.model-dropdown-list[hidden] { display: none; }
.model-dropdown-item {
  width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 12.5px; line-height: 1.35;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  transition: background .1s;
}
.model-dropdown-item:hover { background: var(--panel); }
.model-dropdown-item.active { background: var(--panel); color: var(--white); font-weight: 600; }
.model-dropdown-item { display: flex; align-items: baseline; }
.model-dropdown-item .mdl-cost { font-size: 11px; color: var(--muted); margin-left: auto; padding-left: 8px; flex-shrink: 0; white-space: nowrap; }
.model-tooltip {
  position: fixed; z-index: 35;
  width: 280px;
  background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow);
  font-size: 12px; color: var(--text-mut); line-height: 1.55;
  pointer-events: none;
  opacity: 0; transform: translateX(-4px);
  transition: opacity .18s, transform .18s;
}
.model-tooltip.show { opacity: 1; transform: translateX(0); }
.model-tooltip[hidden] { display: none; }
.model-tooltip-name { font-weight: 600; color: var(--text); margin-bottom: 6px; font-size: 12.5px; }

.model-meta { margin-top: 9px; font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* ===================== SEGMENTED ===================== */
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented.grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px; font-weight: 500;
  background: var(--panel);
  color: var(--text-mut);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
}
.seg:hover { border-color: var(--border-2); color: var(--text); }
.seg.active { background: var(--white); color: #0a0a0b; border-color: var(--white); font-weight: 600; }
.seg-empty { font-size: 11px; color: var(--text-dim); }

/* ===================== CUSTOM RESOLUTION ===================== */
.custom-res {
  display: flex; align-items: center; gap: 8px;
}
.custom-res[hidden] { display: none; }
.custom-res input {
  flex: 1; min-width: 0; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 12px; text-align: center;
}
.custom-res input:focus { border-color: var(--border-2); outline: none; }
.custom-res span { color: var(--text-dim); font-size: 13px; }

/* ===================== DURATION SLIDER ===================== */
.dur-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--panel); border-radius: 3px; outline: none;
  margin: 8px 0 4px;
}
.dur-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--white); border-radius: 50%; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.dur-slider::-moz-range-thumb {
  width: 18px; height: 18px; border: none;
  background: var(--white); border-radius: 50%; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.dur-val {
  font-weight: 400; font-size: 11px; color: var(--text-dim); margin-left: 6px;
}

/* ===================== TOGGLE / NUMBER / STEPPER ===================== */
.row-between { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; }
.row-between + .row-between { border-top: 1px solid var(--border); }

.toggle {
  width: 40px; height: 23px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--border-2);
  position: relative; cursor: pointer; transition: background .16s, border-color .16s;
}
.toggle .knob {
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--text-mut); transition: transform .16s, background .16s;
}
.toggle.on { background: var(--white); border-color: var(--white); }
.toggle.on .knob { transform: translateX(17px); background: #0a0a0b; }

.num-input {
  width: 76px; text-align: center;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 8px; font-family: inherit; font-size: 13px;
}
.num-input:focus { outline: none; border-color: var(--text-mut); }

.stepper {
  display: grid; grid-template-columns: 44px 1fr 44px; gap: 7px; align-items: stretch;
}
.step-btn {
  display: grid; place-items: center;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 17px; cursor: pointer; transition: all .14s;
}
.step-btn:hover { border-color: var(--border-2); background: var(--panel-2); }
.step-val {
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
}

/* ===================== TEXT INPUT ===================== */
.text-input {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px; font-family: inherit;
  transition: border-color .15s;
}
.text-input:hover { border-color: var(--border-2); }
.text-input:focus { outline: none; border-color: var(--text-mut); }
.text-input::placeholder { color: var(--text-dim); }

/* ===================== LOGIN ===================== */
.login-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, #141418, var(--bg));
}
.login-overlay.show { display: flex; }
.login-card {
  width: 340px; display: flex; flex-direction: column; gap: 12px;
  padding: 34px 28px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 .ekf-red { color: var(--white); }
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 14px;
  display: grid; place-items: center; color: var(--white);
  background: var(--accent); border: none;
  overflow: hidden;
}
.login-logo img {
  width: 100%; height: 100%; object-fit: cover;
}
.login-logo .lucide { width: 24px; height: 24px; }
.login-card h1 { font-size: 18px; font-weight: 600; }
.login-sub { font-size: 12.5px; color: var(--text-dim); margin-top: -6px; margin-bottom: 4px; }
.login-card .text-input { text-align: left; }
.btn-primary.full, .btn-ghost.full { width: 100%; justify-content: center; }
.login-pwd { display: flex; flex-direction: column; gap: 12px; }
.login-pwd[hidden], .login-adfs[hidden] { display: none; }
.login-adfs { margin-top: 4px; }
.login-err { font-size: 12.5px; color: #f0a3a3; min-height: 16px; }

/* ===================== USER BAR ===================== */
.user-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}
.user-bar[hidden] { display: none; }
.user-name { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); min-width: 0; }
.user-name #userName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name .lucide { width: 15px; height: 15px; color: var(--text-mut); flex-shrink: 0; }
.user-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===================== KEY BANNER ===================== */
.key-banner {
  display: none; align-items: center; gap: 10px;
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(224,90,90,.08); border: 1px solid rgba(224,90,90,.3);
  color: #f0a3a3; font-size: 13px; line-height: 1.45;
}
.key-banner.show { display: flex; }
.key-banner code {
  background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 5px;
  font-size: 12px; color: #ffd3d3;
}

/* ===================== BUTTONS ===================== */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); color: var(--text-mut);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12.5px; font-family: inherit; cursor: pointer;
  transition: all .14s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); background: var(--panel-2); }
.btn-ghost.full { width: 100%; }
.btn-ghost.danger:hover { color: var(--danger); border-color: rgba(224,90,90,.4); }
.btn-ghost[hidden] { display: none; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: #0a0a0b;
  border: none; border-radius: 10px;
  padding: 11px 20px; font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform .1s, opacity .14s, box-shadow .14s;
  box-shadow: 0 2px 10px rgba(255,255,255,.06);
}
.btn-primary:hover { box-shadow: 0 4px 18px rgba(255,255,255,.12); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ===================== PROMPT ===================== */
.prompt-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 0;
  transition: border-color .15s;
}
.foot-right { display: flex; align-items: center; gap: 8px; }
.hist-pop {
  position: absolute; right: 12px; top: 100%; margin-top: 4px; z-index: 20;
  width: min(440px, 70%); max-height: 280px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
}
.hist-pop[hidden] { display: none; }
.hist-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 12.5px; line-height: 1.4;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-item:hover { background: var(--panel); }
.hist-empty { padding: 12px; font-size: 12.5px; color: var(--text-dim); text-align: center; }
.prompt-card:focus-within { border-color: var(--border-2); }
.prompt {
  width: 100%; resize: none; min-height: 78px; max-height: 360px; overflow-y: auto;
  background: transparent; color: var(--text);
  border: none; outline: none;
  padding: 14px 14px 6px; font-family: inherit; font-size: 15px; line-height: 1.5;
}
.foot-right [hidden] { display: none; }
.prompt::placeholder { color: var(--text-dim); }
.prompt-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 10px;
}
.char-count { font-size: 12px; color: var(--text-dim); }

/* ===================== TOAST ===================== */
.toast {
  margin-top: 14px; padding: 0 14px; max-height: 0; overflow: hidden;
  border-radius: var(--radius-sm); font-size: 13px;
  opacity: 0; transition: all .25s;
  border: 1px solid transparent;
}
.toast.show { max-height: 120px; padding: 11px 14px; opacity: 1; margin-top: 14px; }
.toast.ok  { background: rgba(111,207,151,.08); border-color: rgba(111,207,151,.3); color: #9fe0b8; }
.toast.err { background: rgba(224,90,90,.08); border-color: rgba(224,90,90,.3); color: #f0a3a3; }
.toast.info{ background: var(--panel); border-color: var(--border-2); color: var(--text-mut); }

/* ===================== LABELS ===================== */
.labels-wrap { position: relative; }
.labels-pop {
  position: absolute; right: 0; top: 40px; z-index: 25;
  width: 280px; max-height: 340px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px;
}
.labels-pop[hidden] { display: none; }
.lbl-add { display: flex; gap: 6px; margin-bottom: 8px; }
.lbl-add input {
  flex: 1; min-width: 0; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px;
  font-family: inherit; font-size: 12.5px;
}
.lbl-add input:focus { outline: none; border-color: var(--text-mut); }
.lbl-add button { padding: 7px 10px; }
.lbl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
}
.lbl-row:hover { background: var(--panel); }
.lbl-row.active { background: var(--panel); outline: 1px solid var(--border-2); }
.lbl-grip { color: var(--text-dim); cursor: grab; display: inline-flex; }
.lbl-grip .lucide { width: 13px; height: 13px; }
.lbl-name { flex: 1; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-badge { font-size: 10.5px; color: var(--text-mut); display: inline-flex; gap: 7px; white-space: nowrap; }
.lbl-badge span { display: inline-flex; align-items: center; gap: 3px; }
.lbl-badge .lucide { width: 12px; height: 12px; }
.lbl-badge b { color: var(--text); font-weight: 600; }
.lbl-del { color: var(--text-dim); cursor: pointer; display: inline-flex; padding: 2px; border-radius: 5px; }
.lbl-del:hover { color: var(--danger); }
.lbl-del .lucide { width: 13px; height: 13px; }
.lbl-empty { padding: 8px; font-size: 12px; color: var(--text-dim); text-align: center; }
.lbl-all { font-size: 12.5px; }

/* метки на карточке */
.card-labels { display: flex; flex-wrap: wrap; gap: 5px; }
.card-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--text); cursor: grab;
  background: var(--panel-2); border: 1px solid var(--border-2);
  padding: 2px 6px 2px 7px; border-radius: 999px;
}
.card-label .lx { color: var(--text-dim); cursor: pointer; display: inline-flex; }
.card-label .lx:hover { color: var(--danger); }
.card-label .lx .lucide { width: 11px; height: 11px; }
.card-info { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10.5px; color: var(--text-dim); }
.card-info-item { display: inline-flex; align-items: center; gap: 3px; }
.card-info-item .lucide { width: 12px; height: 12px; }
.card.label-drop { outline: 2px dashed var(--text-mut); outline-offset: 2px; }

/* ===================== GALLERY ===================== */
.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 34px 0 16px;
}
.gallery-head h2 { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.gallery-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-ico { position: absolute; left: 9px; color: var(--text-dim); width: 14px; height: 14px; pointer-events: none; }
.search-box {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px 8px 28px; font-family: inherit; font-size: 12.5px; width: 190px;
}
.search-box:focus { outline: none; border-color: var(--text-mut); }
.sort-sel {
  appearance: none; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.sort-sel:focus { outline: none; border-color: var(--text-mut); }

.bulk-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar span { font-size: 13px; font-weight: 600; }
.bulk-actions { display: flex; gap: 8px; align-items: center; }

/* чекбокс выбора на карточке */
.card-check {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.4);
  display: grid; place-items: center; color: #fff;
  opacity: 0; transition: opacity .12s;
}
.card:hover .card-check, .card-check.on { opacity: 1; }
.card-check.on { background: var(--white); color: #0a0a0b; border-color: var(--white); }
.card-check .lucide { width: 13px; height: 13px; }
.card.selected { outline: 2px solid var(--white); outline-offset: -1px; }
.card-maximize {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  background: rgba(0,0,0,.55); border: none; color: #fff;
  display: grid; place-items: center; opacity: 0; transition: opacity .12s;
}
.card:hover .card-maximize { opacity: 1; }
.card-maximize .lucide { width: 14px; height: 14px; }

.usage-line {
  margin: -6px 0 16px; font-size: 12px; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.usage-line .lucide { width: 13px; height: 13px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--border-2); }
.card-media {
  aspect-ratio: 16 / 10;
  background: #0e0e10;
  display: grid; place-items: center; position: relative;
}
.card-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.card-media img.shot {
  width: 100%; height: 100%; object-fit: cover; cursor: zoom-in;
  background: repeating-conic-gradient(#c0c0c0 0% 25%, #e8e8e8 0% 50%) 0 0 / 16px 16px;
}
.card-status { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-dim); font-size: 12px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border-2); border-top-color: var(--text);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.card-status.error { color: #f0a3a3; }

.card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; }
.card-prompt {
  font-size: 12.5px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  position: relative;
}
.prompt-copy {
  position: absolute; right: 0; bottom: 0;
  background: var(--bg); border: none; color: var(--muted); cursor: pointer;
  padding: 0 0 0 6px; line-height: 1;
  opacity: 0; transition: opacity .15s;
}
.prompt-copy svg { width: 13px; height: 13px; }
.card-prompt:hover .prompt-copy { opacity: 1; }
.prompt-copy:hover { color: var(--white); }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 10.5px; color: var(--text-mut);
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 6px;
}
.chip-strike { text-decoration: line-through; opacity: .5; }
.card-actions { display: flex; gap: 7px; margin-top: 2px; }
.icon-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel-2); color: var(--text-mut);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px; font-size: 12px; cursor: pointer; transition: all .14s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(224,90,90,.4); }

.load-more {
  display: block; margin: 18px auto 0; padding: 10px 22px;
}
.load-more[hidden] { display: none; }

/* ===================== EMPTY ===================== */
.empty {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 70px 20px; margin-top: 4px;
}
.empty.show { display: flex; }
.empty p { font-size: 14px; color: var(--text-mut); }
.empty span { font-size: 12.5px; }

/* ===================== LIGHTBOX ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.85); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 40px;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox-inner { max-width: 100%; max-height: 100%; display: flex; }
.lightbox-inner img, .lightbox-inner video { max-width: 100%; max-height: 90vh; border-radius: 10px; box-shadow: var(--shadow); }
.lightbox-inner img { background: repeating-conic-gradient(#c0c0c0 0% 25%, #e8e8e8 0% 50%) 0 0 / 20px 20px; }
.lightbox-inner video { background: #000; }
.lightbox-inner img { cursor: zoom-out; }
.lightbox-inner video { cursor: default; }

/* мелкие иконочные действия (3 в ряд) */
.card-actions.three .icon-btn { padding: 7px 4px; font-size: 11px; }

/* ===================== ONBOARDING ===================== */
.brand-help {
  margin-left: auto;
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); cursor: pointer;
  transition: all .15s;
}
.brand-help + .brand-help { margin-left: -4px; }
.brand-help:hover { color: var(--text); border-color: var(--border); background: var(--panel); }
.brand-help .lucide { width: 16px; height: 16px; }

.ob-overlay {
  position: fixed; inset: 0; z-index: 55;
  display: none;
}
.ob-overlay.show { display: block; }

.ob-spotlight {
  position: fixed;
  border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .72);
  transition: top .35s ease, left .35s ease, width .35s ease, height .35s ease, border-radius .35s ease;
  pointer-events: none;
  z-index: 55;
}
/* центрированный режим (welcome / done) — spotlight скрыт, затемняем всё */
.ob-overlay.ob-center .ob-spotlight {
  top: 0 !important; left: 0 !important; width: 0 !important; height: 0 !important;
  border-radius: 0;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .78);
}

.ob-tooltip {
  position: fixed; z-index: 56;
  width: 340px; max-width: calc(100vw - 40px);
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: 16px; padding: 22px 22px 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.ob-overlay.show .ob-tooltip { opacity: 1; transform: translateY(0); }

.ob-text {
  font-size: 14px; line-height: 1.55;
  color: var(--text); margin-bottom: 18px;
}
.ob-text strong { font-weight: 600; }

.ob-foot {
  display: flex; align-items: center; justify-content: space-between;
}
.ob-counter {
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.ob-btns { display: flex; align-items: center; gap: 6px; }
.ob-btns .btn-ghost { padding: 7px 12px; }
.ob-btns .btn-primary { padding: 8px 18px; font-size: 13px; }
#obPrev { padding: 7px 8px; }
#obPrev .lucide { width: 14px; height: 14px; }

/* прогресс-бар */
.ob-progress {
  display: flex; gap: 4px; margin-bottom: 16px;
}
.ob-dot {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--border);
  transition: background .25s;
}
.ob-dot.done { background: var(--white); }

/* ===================== PARAMS STRIP (mobile only) ===================== */
.params-strip {
  display: none;
  gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.params-strip .ps-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-mut);
  background: var(--panel); border: 1px solid var(--border);
  padding: 4px 9px; border-radius: 8px;
  white-space: nowrap; cursor: pointer;
}
.params-strip .ps-chip .lucide { width: 12px; height: 12px; }
.params-strip .ps-chip.ps-mode { color: var(--text); font-weight: 600; }

/* ===================== MOBILE HEADER (hidden on desktop) ===================== */
.mobile-header {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-side);
  border-bottom: 1px solid var(--border);
}
.mobile-header .brand-text { display: flex; gap: 5px; align-items: baseline; }
.mobile-header .brand-text strong { font-size: 15px; font-weight: 600; }
.mobile-header .brand-text span { font-size: 11px; color: var(--text-dim); }
.mobile-burger {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); cursor: pointer;
}
.mobile-burger .lucide { width: 20px; height: 20px; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 39;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

/* ===================== MOBILE ===================== */
@media (max-width: 760px) {
  /* layout */
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* mobile header & params strip */
  .mobile-header { display: flex; }
  .params-strip { display: flex; }

  /* sidebar as slide-in drawer */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 300px; max-width: 85vw;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }

  /* main area */
  .main {
    padding: 16px 12px 80px;
  }

  /* prompt card */
  .prompt { font-size: 14px; min-height: 64px; padding: 12px 12px 4px; }
  .prompt-foot { flex-wrap: wrap; gap: 8px; padding: 6px 8px 8px; }
  .foot-right { flex-wrap: wrap; gap: 6px; }
  .foot-right .btn-ghost { padding: 8px 10px; font-size: 12px; }
  .foot-right .btn-primary { padding: 10px 14px; font-size: 13px; }
  .hist-pop { width: min(340px, 90vw); right: 4px; }

  /* gallery header */
  .gallery-head {
    flex-direction: column; align-items: stretch; gap: 10px;
    margin: 20px 0 12px;
  }
  .gallery-head h2 { font-size: 16px; }
  .gallery-head-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .search-wrap { grid-column: 1 / -1; }
  .search-box { width: 100%; }
  .sort-sel { width: 100%; grid-column: 1 / -1; }

  /* gallery grid */
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .card-body { padding: 10px 10px 11px; gap: 6px; }
  .card-prompt { font-size: 11.5px; -webkit-line-clamp: 2; }
  .card-meta { gap: 4px; }
  .chip { font-size: 10px; padding: 2px 5px; }
  .card-actions { gap: 5px; flex-wrap: wrap; }
  .card-actions .icon-btn { padding: 8px 6px; font-size: 11px; }
  .card-check { opacity: 1; }

  /* bulk bar */
  .bulk-bar {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px 10px;
  }
  .bulk-actions { flex-wrap: wrap; gap: 6px; }
  .bulk-actions .sort-sel { flex: 1; min-width: 120px; }

  /* labels popup */
  .labels-pop { width: calc(100vw - 24px); right: -60px; }

  /* empty state */
  .empty { padding: 40px 16px; }

  /* lightbox */
  .lightbox { padding: 12px; }
  .lightbox-inner img, .lightbox-inner video { max-height: 80vh; border-radius: 8px; }

  /* login card */
  .login-card { width: calc(100vw - 40px); max-width: 340px; padding: 28px 20px; }

  /* onboarding */
  .ob-tooltip { width: calc(100vw - 32px); max-width: 340px; }

  /* user bar in sidebar */
  .user-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .user-actions { width: 100%; }
  .user-actions .btn-ghost { flex: 1; }

  /* key banner */
  .key-banner { font-size: 12px; }
  .key-banner code { font-size: 11px; }

  /* toast */
  .toast.show { font-size: 12.5px; }

  /* usage line */
  .usage-line { font-size: 11px; margin: -2px 0 10px; }

  /* segmented buttons */
  .segmented.grid { grid-template-columns: repeat(3, 1fr); }
  .seg { padding: 9px 4px; font-size: 12px; }

  /* model dropdown */
  .model-tooltip { display: none !important; }

  /* admin panel mobile */
  .admin-panel { width: calc(100vw - 16px); max-height: 90vh; }
  .admin-body { padding: 10px; }
  .admin-add-row { flex-direction: column; }
  .admin-pwd-row { width: 100%; }
  .admin-table-wrap { overflow-x: auto; margin: 0 -10px; padding: 0 10px; }
  .admin-table { font-size: 11px; }
  .admin-table th, .admin-table td { padding: 6px 6px; }
  .admin-settings .admin-field-row { flex-direction: column; }
  .admin-settings .admin-field-row .btn-ghost { width: 100%; justify-content: center; }
}

/* ===================== MODEL LOW-BALANCE NOTICE ===================== */
.model-low-notice {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ===================== ADMIN PANEL ===================== */
.admin-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 50;
  display: none;
  align-items: center; justify-content: center;
}
.admin-overlay.show { display: flex; }

.admin-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 820px; max-width: 95vw;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-header h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.admin-close {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  color: var(--text-mut); cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.admin-close:hover { color: var(--text); border-color: var(--border); background: var(--panel-2); }
.admin-close .lucide { width: 16px; height: 16px; }

/* Admin tabs */
.admin-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-mut); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 10px 20px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--white); font-weight: 600; }

.admin-body {
  overflow-y: auto; padding: 14px 20px;
  flex: 1;
}
.admin-loading {
  text-align: center; padding: 24px; color: var(--text-mut); font-size: 13px;
}

/* Add user form */
.admin-add {
  margin-bottom: 14px;
}
.admin-add-row {
  display: flex; gap: 8px; align-items: center;
}
.admin-add-row .text-input { flex: 1; min-width: 0; font-size: 13px; padding: 7px 10px; }
.admin-add-row .btn-primary { white-space: nowrap; padding: 7px 14px; font-size: 13px; gap: 5px; }
.admin-add-row .btn-primary .lucide { width: 14px; height: 14px; }

/* Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.admin-table tbody tr:hover { background: var(--panel-2); }
.admin-table tbody tr.is-blocked { opacity: .5; }

.admin-user-name {
  font-weight: 600; font-size: 13px; color: var(--text);
  margin-right: 6px;
}
.admin-badge {
  display: inline-block;
  font-size: 9px; padding: 1px 5px;
  border-radius: 3px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  vertical-align: middle;
  margin-left: 2px;
}
.admin-badge.admin { background: var(--accent-dim); color: var(--accent); }
.admin-badge.env { background: rgba(100,149,237,.15); color: #6495ed; }
.admin-badge.adfs { background: rgba(144,238,144,.12); color: #90ee90; }
.admin-badge.blocked { background: rgba(224,90,90,.15); color: var(--danger); }

.admin-td-dim { color: var(--text-mut); font-size: 12px; white-space: nowrap; }
.admin-td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.admin-td-actions {
  white-space: nowrap;
  text-align: right;
}

.admin-td-limit { white-space: nowrap; }

/* Small icon buttons for actions */
.admin-icon-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-mut);
  padding: 4px;
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-icon-btn:hover { background: var(--panel-2); color: var(--text); }
.admin-icon-btn.danger:hover { color: var(--danger); }
.admin-icon-btn .lucide { width: 14px; height: 14px; }

/* Limit toggle (3-state: ∞ / 0 / $N) */
.limit-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.lt-opt {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 11px; font-family: inherit;
  padding: 3px 8px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  display: flex; align-items: center;
  transition: background .15s, color .15s;
}
.lt-opt:last-child { border-right: none; }
.lt-opt:hover { background: var(--panel-2); color: var(--text); }
.lt-opt.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.lt-custom { gap: 1px; }
.lt-input {
  background: none; border: none; color: inherit;
  font-size: 11px; font-family: inherit; font-weight: inherit;
  width: 32px; padding: 0; text-align: center;
  outline: none;
}
.lt-input::placeholder { color: var(--text-dim); }

/* Limit badge (read-only display) */
.limit-badge {
  display: inline-block;
  font-size: 11px; padding: 2px 7px;
  border-radius: 4px; font-weight: 600;
}
.limit-badge.unlimited { background: rgba(100,149,237,.12); color: #6495ed; }
.limit-badge.free-only { background: rgba(224,90,90,.12); color: var(--danger); }
.limit-badge.custom { background: rgba(144,238,144,.1); color: #90ee90; }

/* Settings form */
.admin-settings { display: flex; flex-direction: column; gap: 18px; }
.admin-field { display: flex; flex-direction: column; gap: 6px; }
.admin-field-label {
  font-size: 12px; font-weight: 600; color: var(--text-mut);
  text-transform: uppercase; letter-spacing: .04em;
}
.admin-field-hint { font-size: 11.5px; color: var(--text-dim); margin-top: -2px; }
.admin-field-row { display: flex; gap: 8px; align-items: center; }
.admin-field-row .text-input { flex: 1; min-width: 0; }
.admin-field-row .btn-ghost { flex-shrink: 0; white-space: nowrap; }
.admin-settings .select { font-size: 13px; }
.admin-settings .row-between { padding: 0; border: none; }
.admin-settings .row-between + .row-between { border-top: none; }
.admin-settings .btn-primary { align-self: flex-start; }

/* Searchable model picker */
.model-picker { position: relative; }
.model-picker .text-input { padding-right: 28px; }
.model-picker-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 4px;
  display: grid; place-items: center;
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; padding: 0;
}
.model-picker-clear:hover { color: var(--text); }
.model-picker-clear .lucide { width: 14px; height: 14px; }
.model-picker-list {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
  max-height: 220px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); z-index: 10;
  box-shadow: var(--shadow);
}
.model-picker-list[hidden] { display: none; }
.model-picker-item {
  padding: 7px 10px; font-size: 12px; cursor: pointer;
  color: var(--text-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.model-picker-item:hover { background: var(--panel); color: var(--text); }
.model-picker-item.active { background: var(--accent-dim); color: var(--accent); }
.model-picker-empty {
  padding: 10px; font-size: 12px; color: var(--text-dim); text-align: center;
}

/* Password gen row */
.admin-pwd-row { display: flex; gap: 8px; align-items: center; }
.admin-pwd-row .text-input { flex: 1; min-width: 0; font-size: 13px; padding: 7px 10px; }
.admin-pwd-row .admin-icon-btn { flex-shrink: 0; }
