:root {
  color: #e6edf7;
  background: #0b1020;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1120px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 72px 1fr 30px;
  background:
    radial-gradient(circle at top left, rgba(60, 119, 255, 0.18), transparent 36%),
    linear-gradient(135deg, #0b1020 0%, #121a2c 100%);
}

.app-header {
  display: grid;
  grid-template-columns: 280px minmax(320px, 1fr) 280px;
  align-items: center;
  gap: 22px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 11, 22, 0.82);
  backdrop-filter: blur(20px);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  color: #f8fbff;
  background: transparent;
  text-align: left;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ddecff;
  background: linear-gradient(135deg, rgba(59,130,246,0.9), rgba(124,92,255,0.9));
  box-shadow: 0 16px 45px rgba(66, 125, 255, 0.25);
}

.header-logo strong, .user-card strong { display: block; line-height: 1.1; }
.header-logo small, .user-card small { color: #8fa1c3; font-size: 12px; }

.search-box {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.075);
  color: #9fb2d4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #f8fbff;
}
.search-box input::placeholder { color: #7184a8; }

.header-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.055);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,0.14);
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 15px;
  color: #e5eefc;
  background: rgba(255,255,255,0.075);
}
.icon-button:hover, .soft-button:hover { background: rgba(255,255,255,0.13); }

.app-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(520px, 1fr) 310px;
  gap: 18px;
  padding: 18px;
}

.action-rail, .workspace, .info-panel {
  min-height: 0;
}

.action-rail {
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background: rgba(8, 13, 25, 0.72);
  box-shadow: 0 18px 70px rgba(0,0,0,0.24);
}
.action-rail h2 {
  margin: 0 0 16px;
  font-size: 15px;
  color: #f8fbff;
}
.action-rail > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px 13px;
  border: 0;
  border-radius: 15px;
  color: #eaf2ff;
  background: rgba(255,255,255,0.078);
  text-align: left;
}
.action-rail > button:hover:not(:disabled) { background: rgba(59,130,246,0.22); }
.action-rail > button span {
  width: 23px;
  height: 23px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.09);
}
.action-rail > button.danger:hover:not(:disabled) { background: rgba(239,68,68,0.22); }
.rail-divider { height: 1px; margin: 18px 0; background: rgba(255,255,255,0.08); }
.rail-card {
  padding: 14px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 16px;
  color: #dbe8ff;
  background: rgba(15,23,42,0.55);
}
.rail-card p { margin: 8px 0 0; color: #92a5c8; font-size: 12px; line-height: 1.45; }
.switch-line {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 14px;
  color: #c7d7f7;
  font-size: 13px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.workspace-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
h1 { margin: 0 0 8px; font-size: 31px; letter-spacing: -0.045em; }
.workspace-topline p { margin: 0; max-width: 740px; color: #91a5c7; line-height: 1.55; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #7689aa; }
.breadcrumbs button {
  border: 0;
  padding: 0;
  color: #c8d7f6;
  background: transparent;
}
.soft-button {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 14px;
  color: #e8f0ff;
  background: rgba(255,255,255,0.075);
}

.dropzone, .upload, .error, .file-area, .info-card, .setting-card {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  background: rgba(255,255,255,0.055);
  box-shadow: 0 18px 70px rgba(0,0,0,0.22);
}
.dropzone {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-style: dashed;
}
.dropzone strong { font-size: 16px; }
.dropzone span, .upload span, .empty-state span, .info-card p, dt, .setting-card small { color: #91a5c7; font-size: 13px; }

.upload {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr 36px;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.upload strong, .upload span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,0.1); }
.progress div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #54ef9a, #3aa7ff); transition: width 0.2s ease; }
.upload button { border: 0; border-radius: 12px; padding: 7px; color: #eaf2ff; background: rgba(255,255,255,0.09); }
.upload.error .progress div { background: #ff6b6b; }
.error { padding: 13px 15px; color: #ffd3d3; background: rgba(255, 90, 90, 0.12); }

.file-area {
  flex: 1;
  min-height: 380px;
  overflow: auto;
  padding: 18px;
}
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.file-card {
  position: relative;
  min-height: 158px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(8, 13, 25, 0.58);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.file-card:hover { transform: translateY(-1px); border-color: rgba(95,164,255,0.38); }
.file-card.selected { border-color: rgba(85,179,255,0.72); background: rgba(48, 111, 207, 0.18); }
.item-art {
  width: 50px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.75);
  background: linear-gradient(135deg, rgba(59,130,246,0.34), rgba(124,92,255,0.22));
}
.item-art.file { background: linear-gradient(135deg, rgba(148,163,184,0.25), rgba(255,255,255,0.10)); }
.item-main { min-width: 0; }
.item-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-main small { display: block; margin-top: 5px; color: #8fa1c3; }
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.card-actions a { color: #9fccff; text-decoration: none; }
.card-actions button {
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  color: #f4f8ff;
  background: rgba(255,255,255,0.075);
}

.empty-state {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  color: #b9c7df;
}
.empty-state.compact { min-height: 180px; }
.empty-folder-art {
  position: relative;
  width: 150px;
  height: 112px;
  opacity: 0.38;
  filter: grayscale(1);
}
.folder-tab {
  position: absolute;
  left: 20px;
  top: 16px;
  width: 62px;
  height: 28px;
  border: 2px solid rgba(180,194,218,0.85);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: rgba(180,194,218,0.08);
}
.folder-body {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 78px;
  border: 2px solid rgba(180,194,218,0.85);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    repeating-linear-gradient(-45deg, rgba(180,194,218,0.14) 0 8px, transparent 8px 18px);
}

.info-panel { overflow: auto; }
.info-card { padding: 18px; min-height: 100%; }
.info-card h2 { margin: 0 0 18px; font-size: 18px; }
.info-card.muted { color: #91a5c7; }
.info-icon {
  width: 72px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 20px;
  background: rgba(59,130,246,0.18);
  color: #ddecff;
  font-size: 28px;
}
.info-icon.file { background: rgba(148,163,184,0.16); }
.info-name {
  display: block;
  word-break: break-word;
  margin-bottom: 16px;
  font-size: 16px;
}
dl { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 9px 10px; margin: 0; }
dd { margin: 0; text-align: right; color: #f7fbff; overflow-wrap: anywhere; }
.download-link {
  display: block;
  margin-top: 18px;
  padding: 11px 13px;
  border-radius: 14px;
  color: #eaf4ff;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, #3288ff, #7c5cff);
}
.info-file-actions { display: grid; gap: 9px; margin-top: 18px; }
.info-file-actions .download-link { margin-top: 0; }
.verify-link {
  padding: 10px 13px;
  border: 1px solid rgba(111, 163, 228, .32);
  border-radius: 14px;
  color: #cfe4ff;
  background: rgba(46, 99, 170, .13);
}
.verify-link:disabled { cursor: wait; opacity: .62; }
.verification-error { padding: 9px 10px; border-radius: 12px; color: #ffc6c6; background: rgba(180, 45, 60, .14); font-size: 11px; overflow-wrap: anywhere; }
.account-password-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.account-password-form .primary-button { min-height: 46px; }
@media (max-width: 900px) { .account-password-form { grid-template-columns: 1fr; } }

.settings-page { display: flex; flex-direction: column; gap: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; }
.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}
.setting-card span { display: grid; gap: 6px; }
.setting-card input { transform: scale(1.2); }
.setting-card.readonly { align-items: flex-start; }

.status-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: #8fa1c3;
  background: rgba(7,11,22,0.72);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

@media (max-width: 1180px) {
  body { min-width: 980px; }
  .app-header { grid-template-columns: 240px 1fr 230px; }
  .app-body { grid-template-columns: 210px 1fr 280px; gap: 14px; padding: 14px; }
}

.telegram-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  background: rgba(7, 12, 24, 0.68);
  box-shadow: 0 18px 70px rgba(0,0,0,0.24);
}

.settings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.settings-section-heading h2 { margin: 5px 0 8px; font-size: 23px; }
.settings-section-heading p { margin: 0; max-width: 760px; color: #91a5c7; line-height: 1.5; }
.eyebrow { color: #7fb8ff; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.primary-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  color: #fff;
  background: linear-gradient(135deg, #3288ff, #7c5cff);
  box-shadow: 0 12px 30px rgba(72, 116, 255, 0.25);
}
.primary-button:disabled { opacity: 0.55; cursor: default; }
.success-message {
  padding: 13px 15px;
  border: 1px solid rgba(74,222,128,0.24);
  border-radius: 16px;
  color: #c9f7d9;
  background: rgba(34,197,94,0.12);
}

.database-identity-card,
.form-card,
.bot-setting-card {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  background: rgba(255,255,255,0.045);
}
.database-identity-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  align-items: center;
  gap: 20px;
  padding: 18px;
}
.database-identity-card strong,
.database-identity-card small { display: block; }
.database-identity-card strong { margin: 5px 0 7px; }
.database-identity-card small,
.form-card small,
.form-field small { color: #8fa1c3; line-height: 1.4; }
.field-label { color: #9fc8ff; font-size: 12px; font-weight: 750; }
.uuid-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.uuid-line input,
.form-card textarea,
.form-field input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 13px;
  outline: none;
  color: #f7fbff;
  background: rgba(5,9,18,0.66);
}
.uuid-line input,
.form-field input { height: 42px; padding: 0 12px; }
.uuid-line input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.form-card textarea { min-height: 138px; resize: vertical; padding: 12px; line-height: 1.5; }
.uuid-line input:focus,
.form-card textarea:focus,
.form-field input:focus { border-color: rgba(90,166,255,0.7); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }

.start-message-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}
.form-card { display: flex; flex-direction: column; gap: 9px; padding: 17px; }
.form-card code,
.settings-section-heading code { color: #b9d8ff; }
.start-preview-card { min-height: 100%; }
.message-preview {
  flex: 1;
  min-height: 138px;
  padding: 14px;
  border: 1px solid rgba(95,164,255,0.18);
  border-radius: 15px;
  color: #deebff;
  background: rgba(40, 73, 128, 0.15);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.bot-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 14px;
}
.bot-setting-card { display: flex; flex-direction: column; gap: 14px; padding: 17px; transition: border-color .16s ease, background .16s ease; }
.bot-setting-card.active { border-color: rgba(65, 170, 255, 0.36); background: rgba(36, 92, 166, 0.11); }
.bot-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bot-card-heading strong { display: block; margin-top: 4px; }
.bot-slot { color: #7fb8ff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.toggle-control,
.inline-check { display: flex; align-items: center; gap: 8px; color: #c9d8f5; font-size: 13px; }
.toggle-control input,
.inline-check input { accent-color: #4b9cff; }
.form-field { display: flex; flex-direction: column; gap: 7px; color: #cad8f2; font-size: 13px; }
.form-field input:disabled { opacity: .55; }
.danger-check { color: #ffb4b4; }
.bot-status-row { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill {
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: #9badca;
  background: rgba(255,255,255,.04);
  font-size: 11px;
}
.status-pill.ok { border-color: rgba(74,222,128,.22); color: #b8f2cf; background: rgba(34,197,94,.09); }
.settings-loading { grid-column: 1 / -1; padding: 30px; text-align: center; color: #91a5c7; }

@media (max-width: 1260px) {
  .bot-settings-grid,
  .start-message-grid { grid-template-columns: 1fr; }
  .database-identity-card { grid-template-columns: 1fr; }
}

/* v0.0.2 operation status and multi-client transfer UI */
.info-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}
.info-card { min-height: auto; }
.download-link {
  width: 100%;
  border: 0;
  font: inherit;
}

.activity-card {
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  background: rgba(255,255,255,0.055);
  box-shadow: 0 18px 70px rgba(0,0,0,0.22);
}
.activity-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.activity-heading h2 { margin: 4px 0 0; font-size: 19px; }
.activity-card p {
  margin: 12px 0;
  color: #9eb0cf;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.activity-card small { color: #8498bb; line-height: 1.45; }
.activity-dot {
  width: 11px;
  height: 11px;
  margin-top: 6px;
  border-radius: 50%;
  background: #71809b;
  box-shadow: 0 0 0 6px rgba(113,128,155,.1);
}
.activity-card.busy .activity-dot {
  background: #45a3ff;
  box-shadow: 0 0 0 6px rgba(69,163,255,.12), 0 0 22px rgba(69,163,255,.55);
  animation: status-pulse 1.4s ease-in-out infinite;
}
.activity-card.done .activity-dot {
  background: #52dc91;
  box-shadow: 0 0 0 6px rgba(82,220,145,.12);
}
.activity-card.error .activity-dot {
  background: #ff6b78;
  box-shadow: 0 0 0 6px rgba(255,107,120,.12);
}
.activity-progress {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
}
.activity-progress > div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3a9dff, #59e4a2);
  transition: width .18s ease;
}
.activity-metrics {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 9px 0 4px;
}
.activity-metrics strong { font-size: 18px; }
.activity-metrics span { color: #bdd2f5; font-size: 12px; }


@keyframes status-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.78); opacity: .7; }
}

/* v0.0.3 download modes, drag targets and upload confirmation */
.file-card.drag-target {
  border-color: rgba(91, 194, 255, 0.95);
  background: rgba(46, 131, 221, 0.25);
  box-shadow: 0 0 0 3px rgba(69, 163, 255, 0.16), 0 20px 50px rgba(21, 104, 196, 0.25);
}

.setting-card-wide { grid-column: 1 / -1; }
.setting-card select,
.required-setting input {
  min-width: 340px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 13px;
  outline: none;
  color: #f7fbff;
  background: rgba(5,9,18,0.66);
  transform: none;
}
.required-setting input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #b9d8ff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 14, 0.74);
  backdrop-filter: blur(8px);
}
.upload-dialog {
  width: min(620px, 92vw);
  max-height: 82vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 24px;
  color: #eaf2ff;
  background: linear-gradient(145deg, rgba(18,28,48,.98), rgba(9,15,29,.98));
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.dialog-heading h2 { margin: 5px 0 0; font-size: 24px; }
.upload-dialog > p { margin: 14px 0; color: #91a5c7; }
.upload-dialog-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}
.upload-dialog-list > div {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}
.upload-dialog-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-dialog-list small { color: #91a5c7; }
.dialog-summary,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dialog-summary { margin-top: 14px; color: #9eb0cf; font-size: 13px; }
.dialog-actions { justify-content: flex-end; margin-top: 20px; }

@media (max-width: 900px) {
  .setting-card-wide { align-items: flex-start; flex-direction: column; }
  .setting-card select,
  .required-setting input { min-width: 100%; width: 100%; }
}

/* v0.0.3 realtime workspace, filters, sequential queue and bulk selection */
.workspace-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  background: rgba(8,13,25,0.56);
}
.workspace-controls label { display: grid; gap: 5px; color: #91a5c7; font-size: 11px; }
.workspace-controls select {
  min-width: 128px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 12px;
  color: #eaf2ff;
  background: rgba(5,9,18,0.75);
}
.control-button, .view-switch button {
  width: 39px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #dce9ff;
  background: rgba(255,255,255,0.065);
}
.view-switch { display: flex; gap: 5px; }
.view-switch button.active { border-color: rgba(83,166,255,.66); background: rgba(55,126,224,.24); }
.realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: #9db1d4;
  background: rgba(255,255,255,.05);
  font-size: 12px;
}
.realtime-badge span { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.realtime-badge.connected span { background: #49dc91; box-shadow: 0 0 0 4px rgba(73,220,145,.1); }
.realtime-badge.disconnected span { background: #ef6b6b; }

.action-rail > button.active-action { background: rgba(59,130,246,.26); box-shadow: inset 0 0 0 1px rgba(95,164,255,.32); }
.file-card { cursor: default; }
.file-card:hover { transform: none; border-color: rgba(95,164,255,0.28); background: rgba(19,30,50,.72); }
.selection-check {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 8px;
  color: white;
  background: rgba(5,9,18,.62);
  font-size: 13px;
}
.selection-check.checked { border-color: rgba(85,179,255,.82); background: rgba(54,133,239,.92); }
.multi-selection-note { margin-bottom: 12px; padding: 9px 10px; border-radius: 12px; color: #cfe3ff; background: rgba(53,124,220,.15); font-size: 12px; }

.file-grid.list-mode { display: grid; grid-template-columns: 1fr; gap: 7px; }
.file-grid.list-mode .file-card {
  min-height: 66px;
  grid-template-columns: 48px minmax(0,1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
}
.file-grid.list-mode .item-art { width: 42px; height: 38px; border-radius: 11px; }
.file-grid.list-mode .card-actions { min-width: 150px; justify-content: flex-end; }
.file-grid.list-mode .selection-check { position: static; grid-column: 1; grid-row: 1; margin-left: 7px; }
.file-grid.list-mode .selection-check + .item-art { display: none; }

.upload-queue-panel {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 14px;
  background: rgba(8,13,25,.66);
  box-shadow: 0 16px 55px rgba(0,0,0,.18);
}
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.queue-heading h2 { margin: 3px 0 0; font-size: 17px; }
.queue-heading > div:last-child { display: flex; align-items: center; gap: 10px; color: #91a5c7; font-size: 12px; }
.queue-list { display: grid; gap: 7px; max-height: 230px; overflow: auto; }
.queue-item {
  display: grid;
  grid-template-columns: 28px minmax(180px,1fr) minmax(210px, .8fr);
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}
.queue-item.uploading { border-color: rgba(80,160,255,.36); background: rgba(48,110,205,.1); }
.queue-item.done { opacity: .72; }
.queue-item.error { border-color: rgba(239,90,90,.34); }
.queue-position { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: #a9bee1; background: rgba(255,255,255,.07); font-size: 11px; }
.queue-file { min-width: 0; }
.queue-file strong, .queue-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-file small, .queue-progress small { margin-top: 3px; color: #8fa1c3; font-size: 11px; }
.queue-progress { min-width: 0; }
.queue-progress .progress { height: 7px; }

@media (max-width: 1250px) {
  .queue-item { grid-template-columns: 28px minmax(0,1fr); }
  .queue-progress { grid-column: 2; }
}

/* External database settings — v0.0.5 */
.database-settings-panel { margin-top: 24px; }
.database-sync-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.database-sync-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 14px;
  background: rgba(247, 249, 252, .76);
}
.database-sync-summary span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .62; }
.database-sync-summary strong { overflow-wrap: anywhere; }
.database-sync-summary small { line-height: 1.45; opacity: .7; overflow-wrap: anywhere; }
.external-database-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.external-database-card {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 17px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 8px 28px rgba(27, 38, 59, .04);
}
.external-database-card.active { border-color: rgba(47, 111, 237, .35); box-shadow: 0 10px 28px rgba(47, 111, 237, .08); }
.database-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .55fr); gap: 10px; }
.database-field-row .port-field { max-width: 150px; }
.database-checks { display: grid; gap: 8px; padding: 4px 0; }
.database-status-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.database-status-line small { opacity: .68; }
.database-error { padding: 10px 12px; border-radius: 10px; color: #9a2530; background: rgba(200, 48, 64, .08); font-size: 12px; overflow-wrap: anywhere; }
.database-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: auto; }
.external-database-card input[readonly] { opacity: .72; }

@media (max-width: 1250px) {
  .external-database-grid { grid-template-columns: 1fr; }
  .database-sync-summary { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .database-field-row, .database-actions { grid-template-columns: 1fr; }
  .database-field-row .port-field { max-width: none; }
}
.settings-heading-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* v0.0.5 layout polish */
.app-shell {
  height: 100vh;
  min-height: 0;
  grid-template-rows: 72px minmax(0, 1fr) 30px;
  overflow: hidden;
}

.app-body {
  overflow: hidden;
}

.app-body.settings-layout {
  grid-template-columns: minmax(680px, 1fr) 310px;
}

.action-rail {
  overflow: auto;
}

.app-body:not(.settings-layout) .workspace {
  overflow: hidden;
}

.settings-layout .workspace {
  overflow: auto;
  padding-right: 3px;
}

.header-context {
  min-width: 0;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  color: #edf4ff;
  background: rgba(5, 9, 18, 0.48);
}
.header-context strong,
.header-context small { display: block; }
.header-context small { margin-top: 2px; color: #8295b8; font-size: 11px; }

.workspace-heading {
  min-width: 0;
  flex: 1;
}

.path-bar {
  width: min(100%, 760px);
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,0.065);
  border-radius: 14px;
  color: #cbdaf5;
  background: rgba(3, 7, 15, 0.67);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}
.path-label {
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,.08);
  color: #6f84a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.path-bar .breadcrumbs {
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.path-bar .breadcrumbs button {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 7px;
  color: #dbe8ff;
}
.path-bar .breadcrumbs button:hover {
  background: rgba(255,255,255,.07);
}
.path-bar .breadcrumbs span { color: #526683; }

.info-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.info-panel .info-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.info-panel .activity-card {
  flex: 0 0 auto;
  margin-top: auto;
}

/* External database forms use the same dark palette as the rest of settings. */
.database-sync-summary > div {
  border-color: rgba(255,255,255,.085);
  color: #e6eefc;
  background: linear-gradient(145deg, rgba(14, 22, 38, .88), rgba(7, 12, 24, .82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.database-sync-summary span { color: #86a0c7; opacity: 1; }
.database-sync-summary strong { color: #f1f6ff; }
.database-sync-summary small { color: #8297ba; opacity: 1; }

.external-database-card {
  border-color: rgba(255,255,255,.09);
  color: #e8f0ff;
  background: linear-gradient(155deg, rgba(15, 24, 42, .96), rgba(7, 12, 24, .93));
  box-shadow: 0 16px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.025);
}
.external-database-card.active {
  border-color: rgba(77, 158, 255, .38);
  background: linear-gradient(155deg, rgba(22, 41, 70, .96), rgba(8, 16, 31, .94));
  box-shadow: 0 18px 52px rgba(18, 76, 157, .14), inset 0 1px 0 rgba(255,255,255,.035);
}
.external-database-card .form-field { color: #c6d6ef; }
.external-database-card .form-field input,
.external-database-card .form-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 13px;
  outline: none;
  color: #f3f7ff;
  background: rgba(3, 7, 15, .72);
  color-scheme: dark;
}
.external-database-card .form-field select option {
  color: #edf4ff;
  background: #0a1221;
}
.external-database-card .form-field input::placeholder { color: #657a9c; }
.external-database-card .form-field input:focus,
.external-database-card .form-field select:focus {
  border-color: rgba(82, 166, 255, .67);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.external-database-card input[readonly] {
  color: #9fb4d5;
  background: rgba(10, 17, 30, .64);
  opacity: 1;
}
.database-checks {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(3, 7, 15, .42);
}
.database-status-line small { color: #8297ba; opacity: 1; }
.database-error {
  border: 1px solid rgba(255, 101, 116, .18);
  color: #ffc4ca;
  background: rgba(142, 31, 48, .18);
}
.database-actions .soft-button {
  background: rgba(255,255,255,.055);
}

@media (max-width: 1180px) {
  .app-body.settings-layout { grid-template-columns: minmax(620px, 1fr) 280px; }
}


/* v0.0.6 authentication, project dialogs and administration */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, .95fr);
  background:
    radial-gradient(circle at 15% 18%, rgba(67, 124, 255, .2), transparent 32%),
    linear-gradient(135deg, #08111f 0%, #0e1727 48%, #09101c 100%);
  color: #eaf1ff;
}
.auth-brand, .auth-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(42px, 8vw, 110px); }
.auth-brand { border-right: 1px solid rgba(139, 168, 219, .14); }
.auth-logo { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-weight: 800; font-size: 24px; background: linear-gradient(145deg, #5d8dff, #3067e6); box-shadow: 0 18px 55px rgba(38, 94, 224, .36); margin-bottom: 28px; }
.auth-brand h1 { max-width: 620px; font-size: clamp(36px, 5vw, 66px); line-height: 1.02; margin: 12px 0 22px; }
.auth-brand > p { max-width: 610px; color: #9cabc3; font-size: 17px; line-height: 1.7; }
.auth-default { margin-top: 30px; width: fit-content; display: grid; gap: 6px; padding: 16px 19px; border: 1px solid rgba(123, 157, 219, .22); background: rgba(8, 17, 31, .58); border-radius: 14px; color: #aebdd5; }
.auth-default strong { color: #eef4ff; }
.auth-default code { color: #86aeff; }
.auth-card { align-items: center; }
.auth-card > form, .auth-tabs { width: min(100%, 470px); }
.auth-card > form { display: grid; gap: 18px; padding: 30px; border-radius: 22px; background: rgba(17, 28, 47, .92); border: 1px solid rgba(128, 159, 215, .18); box-shadow: 0 30px 100px rgba(0, 0, 0, .35); }
.auth-card h2 { margin: 6px 0 0; font-size: 30px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; margin-bottom: 14px; border-radius: 13px; background: rgba(8, 15, 27, .75); }
.auth-tabs button { border: 0; border-radius: 9px; padding: 12px; color: #91a0ba; background: transparent; cursor: pointer; }
.auth-tabs button.active { color: white; background: #253b60; }
.auth-submit { width: 100%; min-height: 46px; }
.loading-auth { grid-template-columns: 1fr; place-items: center; align-content: center; gap: 18px; }
.logout-button { color: #ffb3b3; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(2, 7, 15, .72); backdrop-filter: blur(8px); }
.dialog-card { width: min(100%, 480px); display: grid; grid-template-columns: auto 1fr; gap: 16px 18px; padding: 26px; border-radius: 20px; border: 1px solid rgba(127, 163, 225, .2); background: #111d30; box-shadow: 0 28px 90px rgba(0,0,0,.46); color: #eaf1ff; }
.dialog-card .form-field, .dialog-card .dialog-actions, .dialog-card .error { grid-column: 1 / -1; }
.dialog-card h2 { margin: 4px 0 4px; }
.dialog-card p { margin: 0; color: #91a0b8; }
.dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; font-size: 24px; background: rgba(75, 126, 231, .18); color: #82aaff; }
.compact-error { padding: 10px 12px; margin: 0; }

.admin-settings-panel { border-color: rgba(93, 142, 245, .24); }
.invite-create-row { display: grid; grid-template-columns: minmax(180px, 280px) auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.invite-code-list { display: grid; gap: 8px; margin-bottom: 24px; max-height: 260px; overflow: auto; }
.invite-code-row { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(170px, auto) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 11px; background: #0c1728; border: 1px solid #203451; }
.invite-code-row.used { opacity: .56; }
.invite-code-row code { overflow-wrap: anywhere; color: #a9c2ff; }
.invite-code-row span { color: #8d9bb2; font-size: 12px; }
.compact-button { padding: 7px 10px; min-height: 0; }
.muted-copy { color: #8c9ab0; }
.users-table-wrap { overflow: auto; border: 1px solid #203451; border-radius: 13px; }
.users-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.users-table th, .users-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid #1d304a; }
.users-table th { color: #8192ad; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: #0b1626; }
.users-table td { color: #dbe6f8; }
.users-table td:first-child { display: grid; gap: 4px; }
.users-table td:first-child small { color: #6f819e; font-size: 10px; }
.users-table tr:last-child td { border-bottom: 0; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card { padding: 24px; }
  .invite-create-row, .invite-code-row { grid-template-columns: 1fr; }
}

/* v0.0.7 role-aware settings and Telegram bot pools */
.shared-bot-choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin: 16px 0 18px;
  border: 1px solid rgba(116, 145, 191, .22);
  border-radius: 14px;
  background: rgba(14, 26, 47, .72);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.shared-bot-choice:hover { border-color: rgba(93, 142, 245, .42); background: rgba(19, 34, 60, .82); }
.shared-bot-choice.active { border-color: rgba(69, 163, 255, .58); background: rgba(25, 63, 105, .34); box-shadow: inset 0 0 0 1px rgba(69, 163, 255, .1); }
.shared-bot-choice input { margin-top: 4px; width: 18px; height: 18px; accent-color: #45a3ff; }
.shared-bot-choice span { display: grid; gap: 5px; }
.shared-bot-choice strong { color: #eef6ff; }
.shared-bot-choice small { color: #91a5c7; line-height: 1.45; }
.invite-settings-panel { border-color: rgba(167, 126, 255, .28); }
.permissions-table { min-width: 1040px; }
.permissions-table th { white-space: normal; line-height: 1.25; }
.permissions-table td { vertical-align: middle; }
.permissions-table .toggle-control { justify-content: flex-start; min-width: 72px; }


/* v0.0.8 stable layout and settings recovery */
html, body, #root { width: 100%; height: 100%; min-width: 0; overflow: hidden; }
body { min-width: 0; }

.app-header {
  grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr) minmax(230px, 300px);
  min-width: 0;
}
.app-header > * { min-width: 0; }
.header-user { min-width: 0; }
.user-card { min-width: 0; }
.user-card > span:last-child { min-width: 0; }
.user-card strong, .user-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-body {
  grid-template-areas: "actions workspace info";
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(260px, 310px);
  align-items: stretch;
  min-width: 0;
}
.files-layout .action-rail { grid-area: actions; }
.app-body .workspace { grid-area: workspace; }
.files-layout .info-panel { grid-area: info; }
.action-rail, .workspace, .info-panel {
  position: relative;
  isolation: isolate;
  min-width: 0;
  max-width: 100%;
}
.action-rail, .info-panel { overflow: hidden; }
.action-rail { overflow-y: auto; }
.info-panel { overflow: hidden; }
.workspace-topline, .workspace-controls, .file-area, .file-grid, .file-list { min-width: 0; max-width: 100%; }
.workspace-topline { flex-wrap: wrap; }
.workspace-controls { flex: 0 0 auto; }
.file-area { width: 100%; }

.app-body.settings-layout {
  grid-template-areas: "workspace";
  grid-template-columns: minmax(0, 1fr);
}
.settings-layout .workspace {
  width: 100%;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(8, 13, 25, .66);
  box-shadow: 0 18px 70px rgba(0,0,0,.24);
}
.settings-page { width: 100%; min-width: 0; }
.settings-page > * { min-width: 0; max-width: 100%; }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setting-card, .telegram-settings-panel, .external-database-card, .database-identity-card, .form-card, .bot-setting-card { min-width: 0; }
.setting-card select, .required-setting input { max-width: 100%; }
.bot-settings-grid, .start-message-grid, .external-database-grid, .database-sync-summary { min-width: 0; }
.external-database-card input, .external-database-card select, .form-field input, .form-card textarea { min-width: 0; max-width: 100%; }
.settings-page-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(69,163,255,.2);
  border-radius: 16px;
  color: #dceaff;
  background: rgba(31, 77, 132, .16);
}
.settings-page-loading .activity-dot { flex: 0 0 auto; background: #45a3ff; animation: status-pulse 1.4s ease-in-out infinite; }
.settings-page-loading strong, .settings-page-loading small { display: block; }
.settings-page-loading small { margin-top: 3px; color: #8fa5c8; }
.settings-crash-card {
  width: min(720px, 100%);
  margin: auto;
  padding: 28px;
  border: 1px solid rgba(255,105,120,.28);
  border-radius: 22px;
  background: rgba(86, 24, 38, .24);
  box-shadow: 0 20px 70px rgba(0,0,0,.3);
}
.settings-crash-card h1 { margin-top: 8px; }
.settings-crash-card p { color: #aebbd0; line-height: 1.55; }
.settings-crash-card code { display: block; padding: 12px; border-radius: 12px; color: #ffd1d6; background: rgba(0,0,0,.22); overflow-wrap: anywhere; }

@media (max-width: 1240px) {
  .app-body.files-layout { grid-template-columns: 190px minmax(0, 1fr) 260px; gap: 12px; padding: 12px; }
  .app-header { grid-template-columns: 220px minmax(220px, 1fr) 250px; gap: 12px; padding-inline: 14px; }
}
@media (max-width: 1020px) {
  .app-shell { overflow: auto; }
  html, body, #root { overflow: auto; }
  .app-header { grid-template-columns: 1fr auto; grid-template-areas: "logo user" "context context"; height: auto; }
  .header-logo { grid-area: logo; }
  .search-box, .header-context { grid-area: context; }
  .header-user { grid-area: user; }
  .app-shell { height: auto; min-height: 100vh; grid-template-rows: auto minmax(0, 1fr) 30px; }
  .app-body.files-layout { grid-template-areas: "actions workspace" "info workspace"; grid-template-columns: 210px minmax(0, 1fr); }
  .files-layout .info-panel { min-height: 360px; }
  .settings-grid { grid-template-columns: 1fr; }
  .setting-card-wide { grid-column: auto; }
}


/* Settings navigation v0.0.10 */
.settings-topline { flex: 0 0 auto; }
.settings-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  width: 100%;
  flex: 1 1 auto;
}
.settings-navigation {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px;
  background: rgba(7, 12, 24, .76);
  box-shadow: 0 18px 55px rgba(0,0,0,.2);
}
.settings-navigation-title { display: grid; gap: 4px; padding: 2px 6px 10px; }
.settings-navigation-title strong { color: #f3f7ff; font-size: 15px; }
.settings-navigation-title small { color: #8196b9; line-height: 1.35; }
.settings-navigation-list { display: grid; gap: 7px; }
.settings-navigation-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #aebed8;
  text-align: left;
  background: transparent;
}
.settings-navigation-item:hover { color: #eaf3ff; background: rgba(255,255,255,.045); }
.settings-navigation-item.active {
  border-color: rgba(83,155,255,.28);
  color: #fff;
  background: linear-gradient(135deg, rgba(47,124,235,.24), rgba(114,83,222,.16));
  box-shadow: inset 3px 0 0 #4b9cff;
}
.settings-navigation-item > span:last-child { display: grid; min-width: 0; gap: 3px; }
.settings-navigation-item strong { font-size: 13px; }
.settings-navigation-item small { color: #8196b9; font-size: 11px; line-height: 1.25; }
.settings-navigation-item.active small { color: #a9c7ef; }
.settings-navigation-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255,255,255,.055);
  color: #91c4ff;
  font-size: 16px;
}
.settings-navigation-access {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
.settings-navigation-access span { color: #7186a8; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.settings-navigation-access strong { color: #cfe1fa; font-size: 12px; }
.settings-content { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.settings-content > .telegram-settings-panel,
.settings-content > .settings-grid { width: 100%; }

@media (max-width: 1080px) {
  .settings-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 12px; }
  .settings-navigation { padding: 11px; }
}
@media (max-width: 820px) {
  .settings-shell { grid-template-columns: 1fr; }
  .settings-navigation { position: static; }
  .settings-navigation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v0.0.11 system-aware light/dark color schemes (retained in v0.0.12) */
.theme-toggle {
  position: relative;
  font-size: 18px;
}
.theme-toggle span { display: grid; place-items: center; line-height: 1; }
:root[data-theme="system"] .theme-toggle::after,
:root[data-theme-preference="system"] .theme-toggle::after {
  content: "A";
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 900;
  background: #4b9cff;
  color: #fff;
}

:root[data-theme="light"] {
  color: #182235;
  background: #edf2f8;
  color-scheme: light;
}
:root[data-theme="light"] body { background: #edf2f8; color: #182235; }
:root[data-theme="light"] .app-shell {
  background:
    radial-gradient(circle at top left, rgba(72, 130, 245, .12), transparent 34%),
    linear-gradient(135deg, #f5f8fc 0%, #e9eff7 100%);
}
:root[data-theme="light"] .app-header {
  border-bottom-color: rgba(47, 63, 91, .12);
  background: rgba(250, 252, 255, .9);
  box-shadow: 0 8px 30px rgba(34, 55, 88, .07);
}
:root[data-theme="light"] .header-logo,
:root[data-theme="light"] .header-logo strong,
:root[data-theme="light"] .user-card strong,
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3 { color: #172238; }
:root[data-theme="light"] .header-logo small,
:root[data-theme="light"] .user-card small,
:root[data-theme="light"] .workspace-topline p,
:root[data-theme="light"] .empty-state span,
:root[data-theme="light"] .info-card p,
:root[data-theme="light"] dt,
:root[data-theme="light"] .setting-card small,
:root[data-theme="light"] .queue-file small,
:root[data-theme="light"] .queue-progress small,
:root[data-theme="light"] .activity-card p,
:root[data-theme="light"] .activity-card small { color: #63738e; }
:root[data-theme="light"] .search-box,
:root[data-theme="light"] .header-context,
:root[data-theme="light"] .user-card,
:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .soft-button {
  border-color: rgba(59, 76, 104, .15);
  color: #263651;
  background: rgba(255, 255, 255, .84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
:root[data-theme="light"] .search-box input { color: #172238; }
:root[data-theme="light"] .search-box input::placeholder { color: #8a98ad; }
:root[data-theme="light"] .header-context { color: #172238; }
:root[data-theme="light"] .header-context small { color: #6c7c95; }
:root[data-theme="light"] .avatar { color: #263651; background: #e4ebf5; }
:root[data-theme="light"] .icon-button:hover,
:root[data-theme="light"] .soft-button:hover { background: #f0f5fb; }
:root[data-theme="light"] .logout-button { color: #b73b4b; }

:root[data-theme="light"] .action-rail,
:root[data-theme="light"] .settings-layout .workspace,
:root[data-theme="light"] .file-area,
:root[data-theme="light"] .info-card,
:root[data-theme="light"] .activity-card,
:root[data-theme="light"] .upload-queue-panel,
:root[data-theme="light"] .workspace-controls,
:root[data-theme="light"] .setting-card,
:root[data-theme="light"] .telegram-settings-panel,
:root[data-theme="light"] .database-identity-card,
:root[data-theme="light"] .form-card,
:root[data-theme="light"] .bot-setting-card,
:root[data-theme="light"] .settings-navigation,
:root[data-theme="light"] .settings-crash-card {
  border-color: rgba(59, 76, 104, .14);
  color: #1d2a40;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 16px 45px rgba(44, 62, 92, .08);
}
:root[data-theme="light"] .action-rail h2 { color: #172238; }
:root[data-theme="light"] .action-rail > button {
  color: #263651;
  background: #f2f6fb;
}
:root[data-theme="light"] .action-rail > button:hover:not(:disabled) { background: #e4eefc; }
:root[data-theme="light"] .action-rail > button span { background: #e4ebf5; }
:root[data-theme="light"] .rail-divider { background: rgba(59, 76, 104, .12); }
:root[data-theme="light"] .rail-card {
  border-color: #d9e2ee;
  color: #273753;
  background: #f5f8fc;
}
:root[data-theme="light"] .rail-card p { color: #687993; }

:root[data-theme="light"] .path-bar {
  border-color: #d7e0ec;
  color: #31415d;
  background: #e6edf6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
:root[data-theme="light"] .path-label { border-right-color: #c8d3e1; color: #6b7b94; }
:root[data-theme="light"] .path-bar .breadcrumbs button { color: #24344f; }
:root[data-theme="light"] .path-bar .breadcrumbs button:hover { background: rgba(55, 94, 151, .09); }
:root[data-theme="light"] .path-bar .breadcrumbs span { color: #8a98ad; }

:root[data-theme="light"] .workspace-controls label { color: #65758f; }
:root[data-theme="light"] .workspace-controls select,
:root[data-theme="light"] .control-button,
:root[data-theme="light"] .view-switch button,
:root[data-theme="light"] .setting-card select,
:root[data-theme="light"] .required-setting input {
  border-color: #d1dbe8;
  color: #263651;
  background: #f7f9fc;
}
:root[data-theme="light"] .view-switch button.active {
  border-color: #6ca5ef;
  color: #174b91;
  background: #e4efff;
}
:root[data-theme="light"] .realtime-badge {
  border-color: #d5deea;
  color: #52637e;
  background: #f6f8fb;
}

:root[data-theme="light"] .file-card {
  border-color: #dbe3ed;
  color: #1f2c43;
  background: #f9fbfd;
}
:root[data-theme="light"] .file-card:hover {
  border-color: #adc8eb;
  background: #f1f6fc;
}
:root[data-theme="light"] .file-card.selected {
  border-color: #65a2ef;
  background: #e7f1ff;
}
:root[data-theme="light"] .item-main small { color: #71819a; }
:root[data-theme="light"] .item-art { color: #315b91; background: linear-gradient(135deg, #dfeeff, #eae6ff); }
:root[data-theme="light"] .item-art.file { color: #56677f; background: linear-gradient(135deg, #e3e9f1, #f7f9fc); }
:root[data-theme="light"] .card-actions a { color: #2469ba; }
:root[data-theme="light"] .card-actions button {
  color: #263651;
  background: #e8eef6;
}
:root[data-theme="light"] .selection-check {
  border-color: #b8c5d6;
  color: #fff;
  background: rgba(255,255,255,.88);
}
:root[data-theme="light"] .selection-check.checked { background: #3f86df; }
:root[data-theme="light"] .multi-selection-note { color: #27578f; background: #e5f0fe; }

:root[data-theme="light"] .queue-item {
  border-color: #dce4ee;
  background: #f7f9fc;
}
:root[data-theme="light"] .queue-item.uploading { border-color: #9fc1ec; background: #edf5ff; }
:root[data-theme="light"] .queue-position { color: #536681; background: #e7edf5; }
:root[data-theme="light"] .progress,
:root[data-theme="light"] .activity-progress { background: #dce5f0; }
:root[data-theme="light"] .activity-dot { background: #7e8da3; }
:root[data-theme="light"] .status-pill { border-color: #d9e1eb; color: #63738c; background: #f3f6fa; }
:root[data-theme="light"] .status-pill.ok { color: #277247; background: #e9f8ef; }

:root[data-theme="light"] .settings-navigation-title strong { color: #172238; }
:root[data-theme="light"] .settings-navigation-title small,
:root[data-theme="light"] .settings-navigation-item small { color: #71819a; }
:root[data-theme="light"] .settings-navigation-item { color: #465974; }
:root[data-theme="light"] .settings-navigation-item:hover { color: #18365f; background: #f1f5fa; }
:root[data-theme="light"] .settings-navigation-item.active {
  border-color: #bbd2f1;
  color: #174d91;
  background: linear-gradient(135deg, #e3efff, #eeeaff);
  box-shadow: inset 3px 0 0 #3f86df;
}
:root[data-theme="light"] .settings-navigation-item.active small { color: #537399; }
:root[data-theme="light"] .settings-navigation-icon { color: #306cae; background: #e8f0fb; }
:root[data-theme="light"] .settings-navigation-access { background: #f2f6fa; }
:root[data-theme="light"] .settings-navigation-access span { color: #7988a0; }
:root[data-theme="light"] .settings-navigation-access strong { color: #2b3e5d; }
:root[data-theme="light"] .settings-page-loading {
  border-color: #b9d3f4;
  color: #23466f;
  background: #edf5ff;
}
:root[data-theme="light"] .settings-page-loading small { color: #687c98; }
:root[data-theme="light"] .settings-crash-card { border-color: #e5b8bf; background: #fff5f6; }
:root[data-theme="light"] .settings-crash-card p { color: #68758a; }
:root[data-theme="light"] .settings-crash-card code { color: #9b3040; background: #f9e7e9; }

:root[data-theme="light"] .database-identity-card,
:root[data-theme="light"] .form-card,
:root[data-theme="light"] .bot-setting-card {
  border-color: #dbe3ed;
  background: #f8fafc;
}
:root[data-theme="light"] .bot-setting-card.active { border-color: #a9c8ee; background: #edf5ff; }
:root[data-theme="light"] .form-field,
:root[data-theme="light"] .toggle-control,
:root[data-theme="light"] .inline-check { color: #3a4b66; }
:root[data-theme="light"] .uuid-line input,
:root[data-theme="light"] .form-card textarea,
:root[data-theme="light"] .form-field input,
:root[data-theme="light"] .form-field select {
  border-color: #cfd9e6;
  color: #172238;
  background: #fff;
  color-scheme: light;
}
:root[data-theme="light"] .form-field input::placeholder,
:root[data-theme="light"] .form-card textarea::placeholder { color: #95a1b3; }
:root[data-theme="light"] .message-preview {
  border-color: #c8dcf4;
  color: #29415f;
  background: #edf5ff;
}
:root[data-theme="light"] .shared-bot-choice {
  border-color: #d2dce8;
  background: #f7f9fc;
}
:root[data-theme="light"] .shared-bot-choice:hover { border-color: #adc8eb; background: #f0f5fb; }
:root[data-theme="light"] .shared-bot-choice.active { border-color: #79acec; background: #eaf3ff; }
:root[data-theme="light"] .shared-bot-choice strong { color: #1c2c44; }
:root[data-theme="light"] .shared-bot-choice small { color: #6a7a92; }

:root[data-theme="light"] .database-sync-summary > div,
:root[data-theme="light"] .external-database-card,
:root[data-theme="light"] .external-database-card.active {
  border-color: #d7e0eb;
  color: #1f2c43;
  background: #f9fbfd;
  box-shadow: 0 10px 30px rgba(44, 62, 92, .06);
}
:root[data-theme="light"] .external-database-card.active { border-color: #9fc2ef; background: #eef6ff; }
:root[data-theme="light"] .database-sync-summary span,
:root[data-theme="light"] .database-status-line small { color: #6d7d95; }
:root[data-theme="light"] .database-sync-summary strong { color: #1c2b42; }
:root[data-theme="light"] .database-sync-summary small { color: #71819a; }
:root[data-theme="light"] .external-database-card .form-field { color: #3c4e69; }
:root[data-theme="light"] .external-database-card .form-field input,
:root[data-theme="light"] .external-database-card .form-field select {
  border-color: #cfd9e6;
  color: #172238;
  background: #fff;
  color-scheme: light;
}
:root[data-theme="light"] .external-database-card .form-field select option { color: #172238; background: #fff; }
:root[data-theme="light"] .external-database-card .form-field input::placeholder { color: #95a1b3; }
:root[data-theme="light"] .external-database-card input[readonly] { color: #5c6f8a; background: #eef2f7; }
:root[data-theme="light"] .database-checks { border-color: #dce4ee; background: #f2f6fa; }
:root[data-theme="light"] .database-error { border-color: #efc1c7; color: #9d2d3c; background: #fff0f2; }
:root[data-theme="light"] .database-actions .soft-button { background: #edf2f8; }

:root[data-theme="light"] .users-table-wrap { border-color: #d7e0eb; }
:root[data-theme="light"] .users-table th,
:root[data-theme="light"] .users-table td { border-bottom-color: #e2e8f0; }
:root[data-theme="light"] .users-table th { color: #687892; background: #f0f4f8; }
:root[data-theme="light"] .users-table td { color: #253650; background: #fff; }
:root[data-theme="light"] .users-table td:first-child small { color: #7a899f; }
:root[data-theme="light"] .invite-code-row { border-color: #d7e0eb; background: #f5f8fc; }
:root[data-theme="light"] .invite-code-row code { color: #315f9e; }
:root[data-theme="light"] .invite-code-row span { color: #71819a; }

:root[data-theme="light"] .auth-shell {
  color: #182235;
  background:
    radial-gradient(circle at 15% 18%, rgba(67, 124, 255, .12), transparent 32%),
    linear-gradient(135deg, #f4f7fb 0%, #e8eef6 48%, #f4f7fb 100%);
}
:root[data-theme="light"] .auth-brand { border-right-color: #d8e1ec; }
:root[data-theme="light"] .auth-brand h1,
:root[data-theme="light"] .auth-default strong { color: #172238; }
:root[data-theme="light"] .auth-brand > p { color: #63738b; }
:root[data-theme="light"] .auth-default {
  border-color: #d1deef;
  color: #5b6e8a;
  background: rgba(255,255,255,.72);
}
:root[data-theme="light"] .auth-default code { color: #265fae; }
:root[data-theme="light"] .auth-card > form {
  border-color: #d8e1ec;
  background: rgba(255,255,255,.92);
  box-shadow: 0 28px 75px rgba(44, 62, 92, .12);
}
:root[data-theme="light"] .auth-tabs { background: #e6edf5; }
:root[data-theme="light"] .auth-tabs button { color: #66768e; }
:root[data-theme="light"] .auth-tabs button.active { color: #1c3f70; background: #fff; box-shadow: 0 4px 14px rgba(44,62,92,.09); }

:root[data-theme="light"] .dialog-backdrop,
:root[data-theme="light"] .modal-backdrop { background: rgba(48, 61, 82, .36); }
:root[data-theme="light"] .dialog-card,
:root[data-theme="light"] .upload-dialog {
  border-color: #d5dfeb;
  color: #1e2c43;
  background: #fff;
  box-shadow: 0 28px 80px rgba(38, 53, 77, .2);
}
:root[data-theme="light"] .dialog-card p,
:root[data-theme="light"] .upload-dialog > p { color: #687890; }
:root[data-theme="light"] .upload-dialog-list > div { border-color: #dce4ee; background: #f7f9fc; }
:root[data-theme="light"] .upload-dialog-list small,
:root[data-theme="light"] .dialog-summary { color: #687890; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .file-card,
  .settings-navigation-item { transition: none; }
}


/* v0.0.12 compact invitation action and polished checkbox controls */
.invite-create-button {
  justify-self: start;
  align-self: end;
  width: auto;
  min-width: 138px;
  max-width: 190px;
  white-space: nowrap;
}

/* Square checkbox used for explicit confirmations and choices. */
.inline-check input[type="checkbox"],
.shared-bot-choice input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin: 0;
  border: 1px solid rgba(145, 169, 207, .46);
  border-radius: 7px;
  background: rgba(8, 16, 30, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 4px 12px rgba(0, 0, 0, .12);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
  cursor: pointer;
}
.inline-check input[type="checkbox"]:hover,
.shared-bot-choice input[type="checkbox"]:hover {
  border-color: rgba(105, 166, 255, .76);
}
.inline-check input[type="checkbox"]:checked,
.shared-bot-choice input[type="checkbox"]:checked {
  border-color: #5b9cff;
  background-color: #4388ef;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m5 10.5 3.1 3.1L15.5 6.5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  box-shadow: 0 0 0 4px rgba(67, 136, 239, .13), 0 5px 14px rgba(36, 100, 211, .24);
}
.inline-check input[type="checkbox"]:focus-visible,
.shared-bot-choice input[type="checkbox"]:focus-visible,
.toggle-control input[type="checkbox"]:focus-visible,
.setting-card > input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .34);
  outline-offset: 3px;
}
.inline-check input[type="checkbox"]:disabled,
.shared-bot-choice input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.danger-check input[type="checkbox"]:checked {
  border-color: #ef6b75;
  background-color: #d94f5d;
  box-shadow: 0 0 0 4px rgba(239, 107, 117, .12);
}

/* Switch control for on/off settings and permissions. */
.toggle-control input[type="checkbox"],
.setting-card > input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 1px solid rgba(145, 169, 207, .38);
  border-radius: 999px;
  background-color: rgba(8, 16, 30, .86);
  background-image: radial-gradient(circle, #9eabc0 0 56%, transparent 59%);
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: 2px center;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .32), 0 4px 12px rgba(0, 0, 0, .1);
  transition: background-color .18s ease, background-position .18s ease, border-color .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.toggle-control input[type="checkbox"]:checked,
.setting-card > input[type="checkbox"]:checked {
  border-color: #4f96f7;
  background-color: #3e84e8;
  background-image: radial-gradient(circle, #fff 0 56%, transparent 59%);
  background-position: calc(100% - 2px) center;
  box-shadow: 0 0 0 4px rgba(67, 136, 239, .11), inset 0 1px 3px rgba(0, 0, 0, .16);
}
.toggle-control input[type="checkbox"]:disabled,
.setting-card > input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: saturate(.45);
}
.toggle-control { gap: 10px; }
.permissions-table .toggle-control { min-width: 86px; }
.shared-bot-choice input[type="checkbox"] { margin-top: 2px; }

:root[data-theme="light"] .inline-check input[type="checkbox"],
:root[data-theme="light"] .shared-bot-choice input[type="checkbox"] {
  border-color: #b7c5d8;
  background-color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 3px 9px rgba(48, 65, 91, .08);
}
:root[data-theme="light"] .inline-check input[type="checkbox"]:checked,
:root[data-theme="light"] .shared-bot-choice input[type="checkbox"]:checked {
  border-color: #397fdc;
  background-color: #4388ef;
}
:root[data-theme="light"] .toggle-control input[type="checkbox"],
:root[data-theme="light"] .setting-card > input[type="checkbox"] {
  border-color: #b6c4d6;
  background-color: #dfe6ef;
  background-image: radial-gradient(circle, #fff 0 56%, transparent 59%);
  box-shadow: inset 0 1px 3px rgba(46, 64, 91, .14);
}
:root[data-theme="light"] .toggle-control input[type="checkbox"]:checked,
:root[data-theme="light"] .setting-card > input[type="checkbox"]:checked {
  border-color: #397fdc;
  background-color: #4388ef;
}

@media (max-width: 820px) {
  .invite-create-button { justify-self: start; width: auto; }
}

/* Diagnostics capture and archive controls. */
.diagnostics-capture-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(115, 145, 190, .22);
  border-radius: 18px;
  background: rgba(10, 20, 36, .58);
}
.diagnostics-toggle-card { margin: 0; }
.diagnostics-log-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.diagnostics-log-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(115, 145, 190, .18);
  border-radius: 14px;
  background: rgba(8, 16, 29, .58);
}
.diagnostics-log-summary span { color: #8fa4c6; font-size: .78rem; }
.diagnostics-log-summary strong { color: #edf5ff; overflow-wrap: anywhere; }
.diagnostics-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.diagnostics-actions .primary-button { width: auto; min-width: 220px; }
.diagnostics-actions .backup-button { width: auto; min-width: 260px; }
.diagnostics-actions small { flex: 1 1 320px; color: #8fa4c6; line-height: 1.45; }

:root[data-theme="light"] .diagnostics-capture-panel {
  border-color: #d4dfed;
  background: #f4f7fb;
}
:root[data-theme="light"] .diagnostics-log-summary > div {
  border-color: #d8e2ef;
  background: #fff;
}
:root[data-theme="light"] .diagnostics-log-summary span,
:root[data-theme="light"] .diagnostics-actions small { color: #65758d; }
:root[data-theme="light"] .diagnostics-log-summary strong { color: #1b2b43; }

@media (max-width: 900px) {
  .diagnostics-log-summary { grid-template-columns: 1fr; }
}

/* v0.0.16 per-bot HTTP/SOCKS5 proxy settings. */
.settings-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 13px;
  outline: none;
  color: #f7fbff;
  background-color: rgba(5,9,18,0.66);
  color-scheme: dark;
}
.form-field select:focus {
  border-color: rgba(90,166,255,0.7);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-field select:disabled { opacity: .55; cursor: not-allowed; }

.bot-proxy-panel {
  overflow: hidden;
  border: 1px solid rgba(130, 153, 190, .18);
  border-radius: 16px;
  background: rgba(7, 13, 25, .42);
}
.bot-proxy-panel.enabled { border-color: rgba(74, 144, 245, .32); }
.bot-proxy-panel > summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.bot-proxy-panel > summary::-webkit-details-marker { display: none; }
.bot-proxy-panel > summary::before {
  content: '›';
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #8fbfff;
  background: rgba(74, 144, 245, .12);
  transition: transform .16s ease;
}
.bot-proxy-panel[open] > summary::before { transform: rotate(90deg); }
.bot-proxy-panel > summary > span:first-of-type { flex: 1; min-width: 0; }
.bot-proxy-panel > summary strong,
.bot-proxy-panel > summary small { display: block; }
.bot-proxy-panel > summary strong { color: #e8f1ff; font-size: 13px; }
.bot-proxy-panel > summary small { margin-top: 3px; color: #8498ba; font-size: 11px; line-height: 1.35; }
.bot-proxy-body {
  display: grid;
  gap: 13px;
  padding: 0 14px 14px;
  border-top: 1px solid rgba(130, 153, 190, .13);
}
.proxy-enable-row { padding-top: 14px; }
.proxy-fields-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}
.proxy-host-field { grid-column: 1 / -1; }
.proxy-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.proxy-actions-row small { color: #8498ba; }
.proxy-error-message {
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, .28);
  border-radius: 12px;
  color: #ffc4c4;
  background: rgba(127, 29, 29, .17);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.status-pill.warn { border-color: rgba(250, 204, 21, .24); color: #f7e39b; background: rgba(202, 138, 4, .1); }
.status-pill.error { border-color: rgba(248, 113, 113, .27); color: #ffc0c0; background: rgba(185, 28, 28, .11); }
.status-pill.busy { border-color: rgba(96, 165, 250, .28); color: #bfdbfe; background: rgba(37, 99, 235, .12); }

:root[data-theme="light"] .form-field select {
  border-color: #cbd6e4;
  color: #1b2a42;
  background-color: #fff;
  color-scheme: light;
}
:root[data-theme="light"] .bot-proxy-panel {
  border-color: #d8e1ed;
  background: #f7f9fc;
}
:root[data-theme="light"] .bot-proxy-panel.enabled { border-color: #aac9ef; background: #f2f7fd; }
:root[data-theme="light"] .bot-proxy-panel > summary strong { color: #24344e; }
:root[data-theme="light"] .bot-proxy-panel > summary small,
:root[data-theme="light"] .proxy-actions-row small { color: #687890; }
:root[data-theme="light"] .bot-proxy-body { border-top-color: #dce4ee; }
:root[data-theme="light"] .proxy-error-message { border-color: #efc4c8; color: #9d2e38; background: #fff1f2; }
:root[data-theme="light"] .status-pill.warn { border-color: #ead79b; color: #82640d; background: #fff9e5; }
:root[data-theme="light"] .status-pill.error { border-color: #edbdc1; color: #9d3039; background: #fff0f1; }
:root[data-theme="light"] .status-pill.busy { border-color: #b8d2f3; color: #295f9e; background: #edf6ff; }

@media (max-width: 760px) {
  .settings-heading-actions { justify-content: flex-start; }
  .proxy-fields-grid { grid-template-columns: 1fr; }
  .proxy-host-field { grid-column: auto; }
  .bot-proxy-panel > summary { align-items: flex-start; flex-wrap: wrap; }
}

/* v0.0.17 cancellation controls and realtime Telegram runtime markers. */
.queue-cancel-button {
  min-width: 86px;
  justify-self: end;
  align-self: center;
  white-space: nowrap;
}

.activity-cancel-button {
  width: 100%;
  margin-top: 12px;
  border-color: rgba(255, 179, 71, 0.38);
}

.queue-item.cancelled {
  opacity: 0.72;
  border-style: dashed;
}

.queue-item.cancelled .progress > div {
  background: #8b98ad;
}

:root[data-theme="light"] .activity-cancel-button {
  border-color: #d9a252;
  background: #fff8ec;
  color: #7a4c0c;
}

.network-interface-hint {
  display: block;
  margin: -2px 0 10px;
  color: var(--muted, #8fa1c3);
  line-height: 1.45;
}

/* v0.0.24 interface polish and realtime-only workspace refresh. */
.header-user { overflow: hidden; }
.header-user .icon-button { flex: 0 0 auto; }
.user-card {
  flex: 1 1 0;
  max-width: 148px;
  overflow: hidden;
}
.user-card > span:last-child {
  display: block;
  overflow: hidden;
}

.item-art.folder,
.info-icon.folder,
.dialog-icon.folder {
  color: #c5ddff;
  background: linear-gradient(135deg, rgba(49, 114, 211, .32), rgba(88, 92, 188, .22));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.workspace-controls select,
.setting-card select,
.form-field select,
.external-database-card select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='%239eb3d4' d='M5.4 7.5 10 12.1l4.6-4.6 1.4 1.4-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 14px 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.workspace-controls select:hover,
.setting-card select:hover,
.form-field select:hover,
.external-database-card select:hover {
  border-color: rgba(91, 166, 255, .46);
}
.workspace-controls select:focus-visible,
.setting-card select:focus-visible,
.form-field select:focus-visible,
.external-database-card select:focus-visible {
  outline: none;
  border-color: rgba(91, 166, 255, .78);
  box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}

.setting-select-card {
  align-items: center;
  min-height: 104px;
}
.setting-card-copy {
  min-width: 0;
  max-width: 720px;
}
.select-shell.setting-select-shell {
  flex: 0 1 440px;
  width: min(100%, 440px);
  min-width: 260px;
}
.select-shell.setting-select-shell select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-radius: 14px;
  background-color: rgba(5, 9, 18, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.success-message {
  color: #d5ffe2;
  background: rgba(22, 163, 74, .18);
  border-color: rgba(74, 222, 128, .42);
  box-shadow: 0 10px 28px rgba(4, 120, 87, .12);
}

:root[data-theme="light"] .item-art.folder,
:root[data-theme="light"] .info-icon.folder,
:root[data-theme="light"] .dialog-icon.folder {
  color: #285b9d;
  background: linear-gradient(135deg, #dcecff, #e8e7fa);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}
:root[data-theme="light"] .workspace-controls select,
:root[data-theme="light"] .setting-card select,
:root[data-theme="light"] .form-field select,
:root[data-theme="light"] .external-database-card select {
  color: #22324c;
  border-color: #cbd7e5;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='%23546680' d='M5.4 7.5 10 12.1l4.6-4.6 1.4 1.4-6 6-6-6z'/%3E%3C/svg%3E");
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
}
:root[data-theme="light"] .workspace-controls select:hover,
:root[data-theme="light"] .setting-card select:hover,
:root[data-theme="light"] .form-field select:hover,
:root[data-theme="light"] .external-database-card select:hover {
  border-color: #91b4df;
  background-color: #fff;
}
:root[data-theme="light"] .success-message {
  color: #14532d;
  border-color: #86d9a3;
  background: #e8f8ee;
  box-shadow: 0 10px 28px rgba(22, 101, 52, .08);
}

@media (max-width: 1180px) {
  .user-card { max-width: 126px; }
  .setting-select-card { align-items: flex-start; flex-direction: column; }
  .select-shell.setting-select-shell { width: 100%; min-width: 0; }
}
.settings-navigation-access { min-width: 0; overflow: hidden; }
.settings-navigation-access strong { min-width: 0; overflow-wrap: anywhere; }

/* v0.0.26 custom combo boxes, warm folder palette and cancellable folder stats. */
.combo-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #91a5c7;
  font-size: 11px;
}
.combo-label { display: block; }
.combo-box { position: relative; min-width: 0; }
.combo-trigger {
  width: 100%;
  min-width: 128px;
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  color: #edf5ff;
  background: linear-gradient(180deg, rgba(24,35,55,.96), rgba(8,14,27,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 8px 24px rgba(0,0,0,.13);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
.combo-trigger:hover:not(:disabled) {
  border-color: rgba(100,174,255,.5);
  background: linear-gradient(180deg, rgba(30,45,70,.98), rgba(10,18,34,.98));
}
.combo-trigger:focus-visible,
.combo-box.open .combo-trigger {
  outline: none;
  border-color: rgba(94,171,255,.82);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15), inset 0 1px 0 rgba(255,255,255,.07), 0 12px 30px rgba(0,0,0,.17);
}
.combo-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.combo-chevron {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #9db7dc;
  background: rgba(255,255,255,.055);
  font-size: 17px;
  line-height: 1;
  transition: transform .16s ease, background .16s ease;
}
.combo-box.open .combo-chevron { transform: rotate(180deg); background: rgba(80,151,245,.15); }
.combo-trigger:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.combo-menu {
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(130,171,225,.26);
  border-radius: 15px;
  color: #eef6ff;
  background: linear-gradient(160deg, rgba(24,35,55,.995), rgba(7,13,25,.995));
  box-shadow: 0 24px 70px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.06);
  overscroll-behavior: contain;
}
.combo-option {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: #dce9fb;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.combo-option > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.combo-option.active:not(:disabled) { color: #fff; background: rgba(76,145,238,.16); }
.combo-option.selected { color: #ddecff; background: rgba(62,134,231,.2); }
.combo-option:focus-visible { outline: 2px solid rgba(94,171,255,.74); outline-offset: -2px; }
.combo-option:disabled { opacity: .46; cursor: not-allowed; }
.combo-check { color: #73b5ff; text-align: center; font-weight: 800; }
.workspace-controls .combo-field { flex: 0 1 180px; }
.workspace-controls .combo-trigger { min-height: 38px; }
.form-field.combo-field { width: 100%; }
.setting-select-shell .combo-trigger { min-height: 46px; border-radius: 14px; }

.item-art.folder,
.info-icon.folder,
.dialog-icon.folder {
  color: #ffe17a;
  background: linear-gradient(135deg, rgba(245,171,38,.46), rgba(212,128,16,.27));
  box-shadow: inset 0 1px 0 rgba(255,244,190,.18), 0 8px 22px rgba(172,101,8,.12);
}
.file-card.selected .item-art.folder {
  color: #ffeb9e;
  background: linear-gradient(135deg, rgba(255,190,52,.58), rgba(218,132,15,.34));
}
.empty-folder-art { filter: none; opacity: .52; }
.empty-folder-art .folder-tab,
.empty-folder-art .folder-body { border-color: rgba(238,181,67,.9); background-color: rgba(238,181,67,.1); }

.info-card dl { grid-template-columns: 118px minmax(0, 1fr); }
.folder-stats-status {
  margin-top: 16px;
  padding: 10px 11px;
  border: 1px solid rgba(111,163,228,.2);
  border-radius: 12px;
  color: #9eb4d5;
  background: rgba(46,99,170,.1);
  font-size: 11px;
  line-height: 1.45;
}
.folder-stats-status.loading::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #70adf5;
  box-shadow: 0 0 0 4px rgba(74,144,245,.1);
  animation: status-pulse 1.4s ease-in-out infinite;
}
.folder-stats-status.paused { color: #d9c28d; border-color: rgba(214,165,66,.24); background: rgba(142,91,13,.1); }
.folder-stats-status.error { color: #ffc3c3; border-color: rgba(238,103,103,.28); background: rgba(157,43,43,.12); }

:root[data-theme="light"] .combo-field { color: #65758f; }
:root[data-theme="light"] .combo-trigger {
  color: #20314b;
  border-color: #c9d6e5;
  background: linear-gradient(180deg, #fff, #f3f6fa);
  box-shadow: inset 0 1px 0 #fff, 0 7px 18px rgba(53,75,105,.08);
}
:root[data-theme="light"] .combo-trigger:hover:not(:disabled) {
  border-color: #8eb4e2;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
:root[data-theme="light"] .combo-trigger:focus-visible,
:root[data-theme="light"] .combo-box.open .combo-trigger {
  border-color: #5f98d9;
  box-shadow: 0 0 0 3px rgba(63,134,223,.13), inset 0 1px 0 #fff, 0 10px 22px rgba(48,85,130,.1);
}
:root[data-theme="light"] .combo-chevron { color: #506884; background: #e9eef5; }
:root[data-theme="light"] .combo-box.open .combo-chevron { color: #2d6db5; background: #dfecfb; }
:root[data-theme="light"] .combo-menu {
  color: #20314b;
  border-color: #c8d7e7;
  background: #fff;
  box-shadow: 0 22px 58px rgba(44,63,88,.2), inset 0 1px 0 #fff;
}
:root[data-theme="light"] .combo-option { color: #354761; }
:root[data-theme="light"] .combo-option.active:not(:disabled) { color: #1f4f86; background: #edf5ff; }
:root[data-theme="light"] .combo-option.selected { color: #214f83; background: #e3effd; }
:root[data-theme="light"] .combo-check { color: #3278c7; }
:root[data-theme="light"] .item-art.folder,
:root[data-theme="light"] .info-icon.folder,
:root[data-theme="light"] .dialog-icon.folder {
  color: #875600;
  background: linear-gradient(135deg, #ffe89c, #ffc950);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 8px 20px rgba(165,104,5,.14);
}
:root[data-theme="light"] .file-card.selected .item-art.folder {
  color: #704500;
  background: linear-gradient(135deg, #ffeba7, #ffc13c);
}
:root[data-theme="light"] .empty-folder-art .folder-tab,
:root[data-theme="light"] .empty-folder-art .folder-body { border-color: #d8a52f; background-color: #fff4c9; }
:root[data-theme="light"] .folder-stats-status { color: #60738f; border-color: #d4e1ef; background: #f4f8fc; }
:root[data-theme="light"] .folder-stats-status.paused { color: #785a19; border-color: #ead79c; background: #fff9e8; }
:root[data-theme="light"] .folder-stats-status.error { color: #9c3038; border-color: #efc5c9; background: #fff1f2; }

@media (max-width: 700px) {
  .workspace-controls .combo-field { flex: 1 1 140px; }
  .info-card dl { grid-template-columns: 108px minmax(0, 1fr); }
}

/* v0.0.29 interaction consistency and complete folder palette. This final
   layer intentionally wins over historical component overrides above. */
:root {
  --ui-control-height: 44px;
  --ui-control-radius: 14px;
  --ui-border: rgba(154, 181, 222, .18);
  --ui-border-hover: rgba(106, 169, 255, .5);
  --ui-surface: rgba(255, 255, 255, .07);
  --ui-surface-hover: rgba(78, 139, 225, .16);
  --folder-border: rgba(238, 181, 67, .34);
  --folder-border-hover: rgba(255, 202, 84, .64);
  --folder-border-selected: rgba(255, 211, 105, .9);
  --folder-surface: linear-gradient(145deg, rgba(124, 82, 16, .24), rgba(67, 47, 14, .2));
  --folder-surface-hover: linear-gradient(145deg, rgba(157, 104, 18, .34), rgba(82, 55, 13, .27));
  --folder-surface-selected: linear-gradient(145deg, rgba(183, 119, 17, .42), rgba(97, 62, 11, .32));
  --folder-text: #ffe8a2;
  --folder-muted: #d8bf7b;
}

.primary-button,
.soft-button,
.download-link,
.verify-link,
.action-rail > button,
.control-button,
.view-switch button,
.card-actions button,
.icon-button,
.combo-trigger,
.form-field input,
.uuid-line input,
.form-card textarea {
  border-radius: var(--ui-control-radius);
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease, color .14s ease, opacity .14s ease;
}

.primary-button,
.soft-button,
.download-link,
.verify-link,
.action-rail > button {
  min-height: var(--ui-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.soft-button {
  border-color: var(--ui-border);
  background: var(--ui-surface);
}
.soft-button:hover:not(:disabled) {
  border-color: var(--ui-border-hover);
  background: var(--ui-surface-hover);
}
.primary-button:hover:not(:disabled) {
  box-shadow: 0 12px 30px rgba(72, 116, 255, .34), inset 0 1px 0 rgba(255,255,255,.2);
}
.primary-button:active:not(:disabled),
.soft-button:active:not(:disabled),
.action-rail > button:active:not(:disabled),
.file-card:active {
  transform: none;
  filter: brightness(.94);
}
.primary-button:focus-visible,
.soft-button:focus-visible,
.action-rail > button:focus-visible,
.file-card:focus-visible,
.icon-button:focus-visible,
.control-button:focus-visible,
.view-switch button:focus-visible,
.card-actions button:focus-visible {
  outline: 2px solid rgba(109, 177, 255, .84);
  outline-offset: 2px;
}
.primary-button:disabled,
.soft-button:disabled,
.action-rail > button:disabled,
.control-button:disabled,
.view-switch button:disabled {
  opacity: .48;
  cursor: not-allowed;
  filter: saturate(.7);
}

.action-rail > button {
  justify-content: flex-start;
  margin-bottom: 10px;
  border: 1px solid transparent;
  padding: 10px 12px;
  background: var(--ui-surface);
}
.action-rail > button:hover:not(:disabled) {
  border-color: var(--ui-border-hover);
  background: var(--ui-surface-hover);
}
.action-rail > button.folder-action {
  color: var(--folder-text);
  border-color: var(--folder-border);
  background: var(--folder-surface);
}
.action-rail > button.folder-action:hover:not(:disabled),
.action-rail > button.folder-action:focus-visible {
  border-color: var(--folder-border-hover);
  background: var(--folder-surface-hover);
  box-shadow: 0 10px 28px rgba(159, 103, 12, .16);
}
.action-rail > button.folder-action span {
  color: #ffe58a;
  background: rgba(235, 174, 45, .2);
}
.action-rail > button.current-upload-action {
  border-color: rgba(83, 155, 248, .24);
}
.action-rail > button.active-action {
  color: #eaf4ff;
  border-color: rgba(95,164,255,.46);
  background: rgba(59,130,246,.26);
  box-shadow: inset 0 0 0 1px rgba(95,164,255,.16);
}
.action-rail > button.danger:hover:not(:disabled),
.action-rail > button.danger:focus-visible {
  color: #ffd9d9;
  border-color: rgba(239,94,94,.42);
  background: rgba(190,48,58,.2);
}
.soft-button.compact-button {
  min-height: 34px;
  padding: 7px 10px;
}

.file-card {
  transform: none !important;
  border-color: rgba(255,255,255,.09);
  background: rgba(8, 13, 25, .58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, filter .1s ease;
}
.file-card:hover {
  transform: none !important;
  border-color: var(--ui-border-hover);
  background: rgba(19, 30, 50, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 28px rgba(0,0,0,.14);
}
.file-card.selected {
  border-color: rgba(85,179,255,.76);
  background: rgba(48,111,207,.2);
  box-shadow: inset 0 0 0 1px rgba(105,181,255,.18), 0 12px 30px rgba(20,74,153,.15);
}
.file-card.folder {
  color: var(--folder-text);
  border-color: var(--folder-border);
  background: var(--folder-surface);
  box-shadow: inset 0 1px 0 rgba(255,239,181,.06), 0 10px 28px rgba(75,48,7,.1);
}
.file-card.folder:hover {
  color: #ffedb0;
  border-color: var(--folder-border-hover);
  background: var(--folder-surface-hover);
  box-shadow: inset 0 1px 0 rgba(255,241,183,.1), 0 14px 34px rgba(104,66,6,.18);
}
.file-card.folder.selected {
  color: #fff0b8;
  border-color: var(--folder-border-selected);
  background: var(--folder-surface-selected);
  box-shadow: inset 0 0 0 1px rgba(255,226,134,.2), 0 15px 36px rgba(111,67,4,.22);
}
.file-card.folder.drag-target {
  border-color: #ffd56a;
  background: linear-gradient(145deg, rgba(194,132,27,.5), rgba(103,67,10,.4));
  box-shadow: 0 0 0 3px rgba(245,184,54,.17), 0 16px 38px rgba(111,67,4,.24);
}
.file-card.folder .item-main strong { color: inherit; }
.file-card.folder .item-main small { color: var(--folder-muted); }
.file-card.folder .card-actions button {
  color: #ffe9a2;
  border: 1px solid rgba(244,188,65,.2);
  background: rgba(118,76,9,.26);
}
.file-card.folder .card-actions button:hover {
  border-color: rgba(255,210,105,.5);
  background: rgba(158,101,8,.38);
}

.folder-dialog {
  border-color: rgba(245, 190, 70, .48);
  background:
    radial-gradient(circle at top left, rgba(241, 180, 51, .16), transparent 42%),
    linear-gradient(145deg, #211a0d, #151712 58%, #111a22);
  box-shadow: 0 30px 90px rgba(61,38,3,.42), inset 0 1px 0 rgba(255,237,174,.08);
}
.folder-dialog .eyebrow,
.folder-dialog h2 { color: #ffe39a; }
.folder-dialog p,
.folder-dialog .form-field { color: #d8c48f; }
.folder-dialog .form-field input {
  color: #fff4ce;
  border-color: rgba(239,185,66,.34);
  background: rgba(52, 37, 9, .55);
}
.folder-dialog .form-field input::placeholder { color: #9e8855; }
.folder-dialog .form-field input:hover { border-color: rgba(246,196,87,.54); }
.folder-dialog .form-field input:focus {
  border-color: rgba(255,207,101,.86);
  box-shadow: 0 0 0 3px rgba(237,174,43,.15);
}
.folder-dialog .primary-button {
  color: #3a2600;
  background: linear-gradient(135deg, #ffd96a, #eea928);
  box-shadow: 0 12px 30px rgba(180,111,5,.24);
}
.folder-dialog .primary-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffe28a, #f5b432);
  box-shadow: 0 14px 34px rgba(180,111,5,.32);
}
.folder-dialog .soft-button {
  color: #ead9ae;
  border-color: rgba(226,188,103,.24);
  background: rgba(99,72,18,.2);
}

:root[data-theme="light"] {
  --ui-border: #d2dce9;
  --ui-border-hover: #8fb5e3;
  --ui-surface: #f2f6fb;
  --ui-surface-hover: #e7f0fb;
  --folder-border: #e5c05b;
  --folder-border-hover: #cf9416;
  --folder-border-selected: #b87900;
  --folder-surface: linear-gradient(145deg, #fff9e6, #fff0bd);
  --folder-surface-hover: linear-gradient(145deg, #fff4cf, #ffe59a);
  --folder-surface-selected: linear-gradient(145deg, #ffe9a3, #ffd36a);
  --folder-text: #6f4900;
  --folder-muted: #8a6824;
}
:root[data-theme="light"] .file-card.folder,
:root[data-theme="light"] .file-card.folder:hover,
:root[data-theme="light"] .file-card.folder.selected {
  color: var(--folder-text);
}
:root[data-theme="light"] .file-card.folder .card-actions button {
  color: #704900;
  border-color: #e5bd57;
  background: rgba(255,255,255,.52);
}
:root[data-theme="light"] .action-rail > button.folder-action {
  color: #704900;
}
:root[data-theme="light"] .action-rail > button.folder-action span {
  color: #704900;
  background: #ffe8a3;
}
:root[data-theme="light"] .folder-dialog {
  color: #3e300e;
  border-color: #dfb64d;
  background:
    radial-gradient(circle at top left, rgba(244,185,51,.16), transparent 42%),
    linear-gradient(145deg, #fffdf6, #fff7dc);
  box-shadow: 0 30px 80px rgba(105,76,15,.2);
}
:root[data-theme="light"] .folder-dialog .eyebrow,
:root[data-theme="light"] .folder-dialog h2 { color: #744d00; }
:root[data-theme="light"] .folder-dialog p,
:root[data-theme="light"] .folder-dialog .form-field { color: #806c3d; }
:root[data-theme="light"] .folder-dialog .form-field input {
  color: #3b2a08;
  border-color: #dfc77f;
  background: rgba(255,255,255,.78);
}
:root[data-theme="light"] .folder-dialog .soft-button {
  color: #624a16;
  border-color: #dfc77f;
  background: rgba(255,255,255,.58);
}

@media (prefers-reduced-motion: reduce) {
  .primary-button,
  .soft-button,
  .action-rail > button,
  .file-card,
  .combo-trigger { transition: none; }
}

/* v0.0.30 MIME vectors and stable settings geometry. */
.mime-icon {
  display: block;
  width: 36px;
  height: 36px;
  overflow: visible;
  color: #a9bad3;
}
.item-art .mime-icon { width: 36px; height: 36px; }
.info-icon .mime-icon { width: 50px; height: 50px; }
.dialog-icon .mime-icon { width: 40px; height: 40px; }
.upload-file-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.05);
}
.upload-file-icon .mime-icon { width: 26px; height: 26px; }
.upload-dialog-list > div { grid-template-columns: 30px minmax(0, 1fr) auto; }
.mime-icon--folder { color: #ffd66d; }
.mime-icon--image { color: #66d6a4; }
.mime-icon--video { color: #bc92ff; }
.mime-icon--audio { color: #ff9fc6; }
.mime-icon--pdf { color: #ff7979; }
.mime-icon--archive { color: #f0bd64; }
.mime-icon--code { color: #69c7ff; }
.mime-icon--spreadsheet { color: #5ed58a; }
.mime-icon--presentation { color: #ff9b63; }
.mime-icon--document { color: #78aaff; }
.mime-icon--text { color: #b7c6dc; }
.mime-icon--generic { color: #9caec8; }

.settings-layout .workspace {
  padding: 22px;
}
.settings-page {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-topline {
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 0 2px 18px;
  border-bottom: 1px solid rgba(148,178,220,.13);
}
.settings-topline > div:first-child { min-width: 0; }
.settings-topline h1 {
  margin: 3px 0 5px;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.05;
}
.settings-topline p {
  min-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-topline .settings-heading-actions {
  min-width: 290px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.settings-topline .settings-heading-actions > button {
  min-width: 124px;
  min-height: var(--ui-control-height);
  white-space: nowrap;
}

.settings-shell {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}
.settings-navigation {
  position: sticky;
  top: 0;
  width: 236px;
  min-width: 236px;
  align-self: start;
  padding: 14px;
  border: 1px solid rgba(148,178,220,.14);
  border-radius: 20px;
  background: rgba(7,12,24,.78);
  box-shadow: 0 14px 38px rgba(0,0,0,.16);
}
.settings-navigation-title { padding: 3px 5px 11px; }
.settings-navigation-list { display: grid; gap: 7px; }
.settings-navigation-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #aebed8;
  background: transparent;
  box-shadow: inset 3px 0 0 transparent;
  text-align: left;
  transform: none !important;
  transition: color .14s ease, border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.settings-navigation-item:hover:not(:disabled) {
  color: #eef6ff;
  border-color: rgba(139,174,222,.14);
  background: rgba(255,255,255,.05);
}
.settings-navigation-item.active {
  color: #fff;
  border-color: rgba(83,155,255,.32);
  background: linear-gradient(135deg, rgba(47,124,235,.25), rgba(114,83,222,.17));
  box-shadow: inset 3px 0 0 #4b9cff;
}
.settings-navigation-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}
.settings-navigation-access {
  margin-top: 7px;
  min-height: 58px;
  align-content: center;
}

.settings-content {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.settings-content > .settings-grid,
.settings-content > .telegram-settings-panel,
.settings-content > .error,
.settings-content > .success-message {
  width: 100%;
  margin: 0;
}
.settings-content.is-loading > :not(.settings-page-loading) {
  opacity: .34;
  pointer-events: none;
}
.settings-page-loading {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  right: 0;
  min-height: 64px;
  margin: 0;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 36px rgba(0,0,0,.2);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}
.setting-card {
  width: 100%;
  min-width: 0;
  min-height: 108px;
  margin: 0;
  padding: 17px 18px;
  border-radius: 18px;
  box-shadow: none;
}
.setting-card-wide { grid-column: 1 / -1; }
.setting-select-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: center;
  gap: 20px;
}
.select-shell.setting-select-shell {
  width: 100%;
  min-width: 0;
}

.telegram-settings-panel {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 20px;
  border-radius: 20px;
  box-shadow: none;
}
.settings-section-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}
.settings-section-heading > div:first-child { min-width: 0; }
.settings-section-heading h2 { margin: 5px 0 7px; }
.settings-section-heading .settings-heading-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 9px;
}
.settings-heading-actions > button { min-height: var(--ui-control-height); }

.bot-settings-grid,
.external-database-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}
.bot-setting-card,
.external-database-card,
.database-identity-card,
.form-card {
  min-width: 0;
  border-radius: 18px;
  box-shadow: none;
}
.form-field input,
.form-field select,
.form-field .combo-trigger,
.required-setting input,
.setting-select-shell .combo-trigger {
  min-height: var(--ui-control-height);
}
.account-password-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
.account-password-form .primary-button { width: 100%; }

:root[data-theme="light"] .settings-topline {
  border-bottom-color: #dce4ee;
}
:root[data-theme="light"] .settings-navigation {
  border-color: #d5dfeb;
  background: rgba(255,255,255,.9);
  box-shadow: 0 14px 36px rgba(44,62,92,.08);
}
:root[data-theme="light"] .settings-navigation-item:hover:not(:disabled) {
  border-color: #dbe5f0;
  background: #f3f7fb;
}
:root[data-theme="light"] .settings-navigation-item.active {
  border-color: #9fc2ef;
  background: linear-gradient(135deg, #e7f2ff, #f0ebff);
}
:root[data-theme="light"] .settings-page-loading {
  background: rgba(237,246,255,.94);
  box-shadow: 0 16px 36px rgba(44,62,92,.12);
}
:root[data-theme="light"] .upload-file-icon { background: #edf2f7; }

@media (max-width: 1180px) {
  .settings-shell { grid-template-columns: 210px minmax(0, 1fr); gap: 14px; }
  .settings-navigation { width: 210px; min-width: 210px; }
  .bot-settings-grid,
  .external-database-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .settings-layout .workspace { padding: 16px; }
  .settings-topline { grid-template-columns: 1fr; min-height: 0; }
  .settings-topline .settings-heading-actions { min-width: 0; justify-content: flex-start; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-navigation { position: static; width: 100%; min-width: 0; }
  .settings-navigation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-content { min-height: 480px; }
  .settings-grid,
  .account-password-form { grid-template-columns: 1fr; }
  .setting-card-wide { grid-column: auto; }
  .setting-select-card { grid-template-columns: 1fr; }
  .settings-section-heading { grid-template-columns: 1fr; }
  .settings-section-heading .settings-heading-actions { justify-content: flex-start; }
}

/* v0.0.33 Go 1.27.1 runtime/zstd optimizations; v0.0.32 compact SQLite storage; v0.0.31 contextual upload target and project-native dialogs. */
.action-rail > button.current-upload-action .current-upload-label {
  width: auto;
  height: auto;
  min-width: 0;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action-rail > button.current-upload-action .action-icon {
  flex: 0 0 23px;
}

.rename-dialog,
.delete-dialog {
  width: min(100%, 540px);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
}
.dialog-copy {
  min-width: 0;
  align-self: center;
}
.dialog-copy p,
.dialog-copy strong {
  overflow-wrap: anywhere;
}
.rename-dialog.file-dialog {
  border-color: rgba(93, 161, 255, .34);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, .15), transparent 44%),
    linear-gradient(145deg, #111e34, #111827 60%, #0e1726);
}
.rename-dialog.file-dialog .eyebrow,
.rename-dialog.file-dialog h2 { color: #bcd8ff; }
.rename-dialog .dialog-icon {
  overflow: hidden;
}
.rename-dialog .dialog-icon .mime-icon {
  width: 42px;
  height: 42px;
}
.rename-dialog[aria-busy="true"],
.delete-dialog[aria-busy="true"] {
  cursor: progress;
}

.delete-backdrop {
  background: rgba(21, 3, 8, .78);
}
.delete-dialog {
  border-color: rgba(245, 99, 110, .42);
  background:
    radial-gradient(circle at top left, rgba(230, 61, 78, .17), transparent 43%),
    linear-gradient(145deg, #271118, #19141b 58%, #111720);
  box-shadow: 0 30px 95px rgba(49, 3, 12, .56), inset 0 1px 0 rgba(255, 210, 216, .06);
}
.delete-dialog .eyebrow,
.delete-dialog h2 { color: #ffc2c8; }
.delete-dialog p { color: #d7aab0; }
.dialog-icon.danger-icon {
  color: #ff7c88;
  background: rgba(224, 51, 70, .16);
  box-shadow: inset 0 0 0 1px rgba(245, 105, 118, .18);
}
.dialog-icon.danger-icon svg {
  width: 38px;
  height: 38px;
}
.delete-item-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.delete-item-list > div:not(.delete-more-items) {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 121, 133, .13);
  border-radius: 13px;
  background: rgba(110, 25, 36, .16);
}
.delete-item-list strong {
  overflow: hidden;
  color: #ffe8ea;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delete-item-list small { color: #c79299; }
.delete-item-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.055);
}
.delete-item-icon .mime-icon { width: 28px; height: 28px; }
.delete-item-icon.folder { background: rgba(232, 172, 39, .13); }
.delete-more-items {
  padding: 7px 11px;
  color: #c79299;
  font-size: 13px;
}
.danger-button {
  min-height: var(--ui-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(255, 133, 144, .42);
  border-radius: var(--ui-control-radius);
  color: #fff;
  background: linear-gradient(135deg, #dc3f50, #a91f34);
  box-shadow: 0 12px 28px rgba(166, 24, 45, .25);
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.danger-button:hover:not(:disabled) {
  border-color: rgba(255, 181, 188, .72);
  background: linear-gradient(135deg, #ef5362, #bd293e);
  box-shadow: 0 14px 32px rgba(181, 27, 50, .34);
}
.danger-button:focus-visible {
  outline: 2px solid rgba(255, 137, 148, .9);
  outline-offset: 2px;
}
.danger-button:disabled {
  opacity: .52;
  cursor: not-allowed;
}

:root[data-theme="light"] .rename-dialog.file-dialog {
  color: #1d304d;
  border-color: #b9d3f2;
  background:
    radial-gradient(circle at top left, rgba(70, 142, 235, .1), transparent 44%),
    linear-gradient(145deg, #fff, #f4f8fd);
}
:root[data-theme="light"] .rename-dialog.file-dialog .eyebrow,
:root[data-theme="light"] .rename-dialog.file-dialog h2 { color: #285c9f; }
:root[data-theme="light"] .delete-backdrop { background: rgba(67, 22, 31, .38); }
:root[data-theme="light"] .delete-dialog {
  color: #421b22;
  border-color: #e7aab2;
  background:
    radial-gradient(circle at top left, rgba(223, 70, 87, .09), transparent 43%),
    linear-gradient(145deg, #fff, #fff5f6);
  box-shadow: 0 28px 80px rgba(86, 25, 36, .2);
}
:root[data-theme="light"] .delete-dialog .eyebrow,
:root[data-theme="light"] .delete-dialog h2 { color: #9c2335; }
:root[data-theme="light"] .delete-dialog p { color: #81535a; }
:root[data-theme="light"] .delete-item-list > div:not(.delete-more-items) {
  border-color: #efccd1;
  background: rgba(255,255,255,.72);
}
:root[data-theme="light"] .delete-item-list strong { color: #4a2027; }
:root[data-theme="light"] .delete-item-list small,
:root[data-theme="light"] .delete-more-items { color: #8a5a62; }

@media (max-width: 560px) {
  .rename-dialog,
  .delete-dialog {
    grid-template-columns: 1fr;
    padding: 21px;
  }
  .rename-dialog .dialog-icon,
  .delete-dialog .dialog-icon { grid-column: 1; }
  .rename-dialog .dialog-copy,
  .delete-dialog .dialog-copy { grid-column: 1; }
  .delete-item-list > div:not(.delete-more-items) { grid-template-columns: 32px minmax(0, 1fr); }
  .delete-item-list small { grid-column: 2; }
}

.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
  cursor: help;
  opacity: .75;
  position: relative;
}
.field-help:hover::after,
.field-help:focus::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 20;
  left: 20px;
  top: -4px;
  width: 280px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(20, 25, 35, .96);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
}
