:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1c1c1c;
  background: #f4f6f5;
  font-size: 14px;
  --ink: #1c1c1c;
  --muted: #686d6a;
  --line: #e3e7e4;
  --line-strong: #cfd6d1;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --accent: #00b14f;
  --accent-dark: #009944;
  --accent-soft: #e7f8ee;
  --gold: #f2a900;
  --gold-soft: #fff7df;
  --danger: #d63838;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgb(20 30 24 / .04), 0 8px 24px rgb(20 30 24 / .05);
  --shadow-lg: 0 18px 50px rgb(20 30 24 / .13);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f6f5; }
button, input, textarea, select { font: inherit; }
button {
  min-height: 40px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 9px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
button:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 6px 16px rgb(0 177 79 / .2); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--surface); color: #383d3a; border-color: var(--line-strong); box-shadow: none; }
button.secondary:hover { background: var(--accent-soft); border-color: #a9dfbf; color: var(--accent-dark); }
button.danger { color: var(--danger); border-color: #efb9b9; background: var(--surface); }
button.danger:hover { color: #a82424; border-color: #e69b9b; background: var(--danger-soft); }
button.icon { min-height: 36px; background: transparent; border-color: transparent; color: #454a47; font-size: 24px; padding: 0 8px; box-shadow: none; }
button:disabled { opacity: .52; cursor: wait; box-shadow: none; transform: none; }

main { max-width: 1500px; margin: 0 auto; padding: 24px 28px 48px; }
.hidden { display: none !important; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.login { min-height: calc(100vh - 72px); display: grid; place-items: center; }
.login-panel { width: min(430px, 100%); padding: 32px; box-shadow: var(--shadow-lg); border-top: 3px solid var(--accent); }
.login-panel > p { margin: 20px 0 24px; }
.login-panel button { width: 100%; margin-top: 18px; }

h1, h2, p { margin-top: 0; }
h1 { font-size: 25px; line-height: 1.15; margin-bottom: 0; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.3; margin-bottom: 5px; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.55; }
code { color: #27623f; background: var(--accent-soft); border: 1px solid #cbead7; border-radius: 4px; padding: 2px 5px; }

label { display: grid; gap: 7px; font-weight: 700; color: #333835; font-size: 13px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 11px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { line-height: 1.55; resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #aab5ae; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(0 177 79 / .14); }
.error { color: var(--danger); min-height: 18px; margin: 9px 0 0; }
.form-error { margin: 0; font-size: 11px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 18px 20px;
  color: white;
  background: var(--accent);
  border: 1px solid #00a449;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
header h1 { color: white; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  background: #ffffff;
  border: 1px solid rgb(255 255 255 / .7);
  border-radius: 7px;
  font-size: 18px;
  font-weight: 900;
}
.eyebrow { display: block; color: rgb(255 255 255 / .82); font-size: 10px; font-weight: 800; margin-bottom: 3px; }
.login-panel .eyebrow { color: var(--accent); }
.login-panel .brand-mark { color: #ffffff; background: var(--accent); border-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.system-status { display: flex; align-items: center; gap: 7px; color: white; font-size: 12px; font-weight: 700; }
.system-status i { width: 8px; height: 8px; border-radius: 50%; background: white; box-shadow: 0 0 0 4px rgb(255 255 255 / .2); }
header button.secondary { color: var(--accent-dark); background: #ffffff; border-color: #ffffff; }
header button.secondary:hover { color: #ffffff; background: var(--accent-dark); border-color: var(--accent-dark); }

.tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 26px;
  padding: 5px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tabs button {
  min-height: 42px;
  color: #646a66;
  background: transparent;
  border: 0;
  border-radius: 5px;
  padding: 8px 10px;
  box-shadow: none;
  font-size: 12px;
}
.tabs button:hover { color: var(--accent-dark); background: var(--accent-soft); box-shadow: none; }
.tabs button.active { color: var(--accent-dark); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.mobile-tab-picker { display: none; }
.mobile-app-nav { display: none; }

.tab-content { animation: reveal .2s ease; }
@keyframes reveal { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-title h2 { font-size: 21px; }
.section-title p { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.stat:nth-child(2)::before { background: var(--gold); }
.stat:nth-child(3)::before { background: #2788d8; }
.stat:nth-child(4)::before { background: #00a6a6; }
.stat:nth-child(5)::before { background: #8b62c7; }
.stat:nth-child(6)::before { background: #e05a3f; }
.stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.stat strong { display: block; margin-top: 8px; color: var(--ink); font-size: 23px; line-height: 1; }
.dashboard-stats { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 14px; }
.dashboard-block { min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-sm); }
.dashboard-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dashboard-block-head h2 { margin: 0; font-size: 14px; }
.dashboard-block-head button { min-height: 32px; padding: 5px 8px; font-size: 10px; }
.dashboard-list { display: grid; gap: 6px; max-height: min(50vh, 440px); overflow-y: auto; padding-right: 3px; }
.dashboard-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.dashboard-row-main { min-width: 0; display: grid; gap: 3px; }
.dashboard-row-main strong, .dashboard-row-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-row-main strong { font-size: 12px; }
.dashboard-row-main span, .dashboard-row-main small { color: var(--muted); font-size: 9px; }
.dashboard-row-value { flex: 0 0 auto; display: grid; justify-items: end; gap: 5px; }
.dashboard-row-value strong { font-size: 12px; }
.dashboard-row-value .status { min-height: 0; padding: 3px 5px; font-size: 8px; }
.stock-summary { min-width: 58px; flex: 0 0 auto; display: grid; justify-items: end; gap: 2px; }
.stock-summary strong { font-size: 18px; line-height: 1; }
.stock-summary span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.stock-summary.ready strong { color: var(--accent-dark); }
.stock-summary.low strong { color: #a36f00; }
.stock-summary.out strong { color: var(--danger); }
.empty-state.compact { padding: 20px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: min(72vh, 780px);
  overflow-y: auto;
  align-content: start;
  padding: 2px 6px 8px 2px;
  scrollbar-gutter: stable;
}
.card-grid::-webkit-scrollbar, .stock-files-list::-webkit-scrollbar { width: 7px; }
.card-grid::-webkit-scrollbar-thumb, .stock-files-list::-webkit-scrollbar-thumb { background: #b8c7be; border-radius: 6px; }
.card-grid::-webkit-scrollbar-track, .stock-files-list::-webkit-scrollbar-track { background: #edf1ee; border-radius: 6px; }
.products-grid, .users-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.data-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 16px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.data-card:hover { border-color: #b9dec8; box-shadow: 0 10px 28px rgb(20 40 28 / .09); transform: translateY(-1px); }
.order-card { border-top: 3px solid var(--accent); }
.product-card { border-top: 3px solid #f2a900; }
.user-card { border-top: 3px solid #2788d8; }
.announcement-card { border-top: 3px solid #8b62c7; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-heading > div { min-width: 0; }
.card-heading strong { display: block; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; }
.card-kicker { display: block; color: #747b77; font-size: 9px; font-weight: 900; margin-bottom: 5px; text-transform: uppercase; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card-meta span { color: #606762; background: #f4f7f5; border: 1px solid #e5eae7; border-radius: 4px; padding: 4px 7px; font-size: 10px; font-weight: 600; }
.card-section { display: grid; gap: 5px; padding-top: 12px; border-top: 1px solid #e9eeeb; min-width: 0; }
.card-section > span, .product-numbers span { color: #777e79; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.card-section strong { overflow-wrap: anywhere; }
.item-list { display: grid; gap: 7px; }
.order-card .item-list { max-height: 130px; overflow-y: auto; padding-right: 3px; }
.item-list div { display: flex; justify-content: space-between; gap: 10px; }
.item-list strong { font-weight: 650; }
.item-list b { color: var(--accent); white-space: nowrap; }
.product-numbers, .user-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.product-numbers div, .user-details div { background: var(--surface-soft); border: 1px solid #e7ece9; border-radius: 5px; padding: 11px; min-width: 0; }
.product-numbers span, .product-numbers strong, .user-details span, .user-details strong { display: block; }
.user-details span { color: #777e79; font-size: 10px; text-transform: uppercase; font-weight: 700; }
.product-numbers strong, .user-details strong { margin-top: 4px; font-size: 16px; overflow-wrap: anywhere; }
.availability { background: #f2f4f3; color: #68706b; border: 1px solid #e1e6e3; border-radius: 4px; padding: 4px 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.availability.active { color: var(--accent-dark); background: var(--accent-soft); border-color: #bde8ce; }
.empty-state { grid-column: 1 / -1; background: var(--surface); border: 1px dashed #bfc9c3; border-radius: 7px; color: var(--muted); padding: 34px; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 2px; }
.actions button { min-height: 36px; padding: 7px 10px; font-size: 12px; }

.status { min-height: 34px; color: #515854; font-size: 11px; font-weight: 750; padding: 6px 8px; border: 1px solid #dde4df; border-radius: 5px; background: #f3f5f4; }
.status.paid { color: var(--accent-dark); background: var(--accent-soft); border-color: #bde8ce; }
.status.waiting { color: #825c00; background: var(--gold-soft); border-color: #f0d99b; }
.tool-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 1fr auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  background: #eef5f1;
  border: 1px solid #d8e6dd;
  border-radius: 7px;
}
.tool-row span { color: #5d6660; padding-bottom: 11px; font-size: 12px; }
.form-panel { max-width: 680px; padding: 22px; display: grid; gap: 18px; }
.status-box { border-left: 3px solid #7d8781; background: #f2f5f3; border-radius: 4px; padding: 13px; color: #4c554f; }
.status-box.ready { border-color: var(--accent); background: var(--accent-soft); color: #08783b; }
.note { font-size: 11px; margin: 0; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.history-title { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.announcement-text { margin: 0; color: #363c38; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; max-height: 155px; overflow-y: auto; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-picker .emoji-option { width: 36px; min-height: 34px; padding: 3px; color: var(--ink); background: var(--surface-soft); border-color: var(--line); font-size: 17px; box-shadow: none; }
.emoji-picker .emoji-option:hover { background: var(--accent-soft); border-color: #bde8ce; box-shadow: none; }
.announcement-image-preview, .announcement-card-image { width: 100%; max-height: 260px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr); gap: 16px; align-items: start; }
.notification-form { max-width: 760px; }
.security-form { max-width: 760px; }
.banner-form { max-width: 760px; }
.banner-preview { width: 100%; max-height: 240px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notification-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.welcome-preview { padding: 22px; border-top: 3px solid #2788d8; }
.welcome-preview p { color: #303632; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin: 16px 0; }
.preview-buttons { display: grid; gap: 7px; }
.preview-buttons span { display: block; text-align: center; color: var(--accent-dark); background: var(--accent-soft); border: 1px solid #bde8ce; border-radius: 5px; padding: 9px; font-weight: 700; }

dialog { width: min(540px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 8px; padding: 0; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(20 25 22 / .55); }
dialog form { display: grid; gap: 15px; padding: 22px; }
.stock-dialog-content { display: grid; gap: 14px; padding: 22px; }
.stock-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.stock-files-list { display: grid; gap: 7px; max-height: min(52vh, 500px); overflow-y: auto; padding-right: 3px; }
.stock-file-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 10px; background: var(--surface-soft); border: 1px solid #e3e9e5; border-radius: 5px; cursor: pointer; }
.stock-file-row:hover { border-color: #b9dec8; background: var(--accent-soft); }
.stock-file-row input { width: auto; }
.stock-file-row span, .stock-file-row strong, .stock-file-row small { display: block; min-width: 0; }
.stock-file-row strong { overflow-wrap: anywhere; font-size: 12px; }
.stock-file-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-actions { justify-content: flex-end; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
#toast { position: fixed; right: 20px; bottom: 20px; max-width: min(380px, calc(100% - 32px)); background: #232824; color: white; padding: 12px 15px; border: 1px solid #343b36; border-radius: 6px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; transform: translateY(6px); }
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) {
  .products-grid, .users-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-stats { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  main { padding: 8px 8px 86px; }
  header { align-items: center; padding: 10px 11px; margin-bottom: 9px; gap: 8px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 15px; }
  header h1 { font-size: 16px; }
  .eyebrow { font-size: 8px; margin-bottom: 1px; }
  .header-actions { align-items: flex-end; flex-direction: column; }
  .system-status { font-size: 10px; }
  header button.secondary { min-height: 32px; padding: 5px 9px; font-size: 11px; }
  .tabs { display: none; }
  .mobile-tab-picker { display: none; }
  .mobile-app-nav {
    position: fixed;
    z-index: 20;
    inset: auto 8px max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    padding: 5px;
    background: #ffffff;
    border: 1px solid #cfe6d8;
    border-radius: 8px;
    box-shadow: 0 12px 35px rgb(20 40 28 / .18);
  }
  .mobile-app-nav button {
    position: relative;
    min-width: 0;
    min-height: 52px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: #68706b;
    background: transparent;
    border: 0;
    border-radius: 6px;
    padding: 4px 1px 3px;
    box-shadow: none;
    font-size: 8px;
    line-height: 1;
  }
  .mobile-app-nav button:hover { color: var(--accent); background: var(--accent-soft); border-color: transparent; box-shadow: none; }
  .mobile-app-nav button.active { color: var(--accent); background: var(--accent-soft); }
  .mobile-app-nav button.active::before { content: ""; position: absolute; top: 0; width: 20px; height: 2px; background: var(--accent); border-radius: 0 0 3px 3px; }
  .mobile-app-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-app-nav span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
  .section-title { align-items: center; flex-direction: row; margin-bottom: 10px; gap: 8px; }
  .section-title h2 { font-size: 16px; margin-bottom: 1px; }
  .section-title p { font-size: 10px; line-height: 1.35; }
  .section-title button { width: auto; min-height: 34px; padding: 6px 9px; font-size: 11px; flex: 0 0 auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 9px 10px; }
  .stat span { font-size: 9px; }
  .stat strong { margin-top: 4px; font-size: 17px; }
  .card-grid, .products-grid, .users-grid { grid-template-columns: 1fr; }
  .dashboard-layout { gap: 8px; }
  .dashboard-block { padding: 9px; }
  .dashboard-list { max-height: min(34dvh, 300px); gap: 5px; }
  .dashboard-row { padding: 7px; gap: 6px; }
  .dashboard-row-main strong { font-size: 10px; }
  .dashboard-row-main span, .dashboard-row-main small { font-size: 8px; }
  .dashboard-row-value strong { font-size: 10px; }
  .stock-summary { min-width: 45px; }
  .stock-summary strong { font-size: 15px; }
  .card-grid { gap: 8px; max-height: calc(100dvh - 210px); padding-right: 4px; }
  .data-card { padding: 10px; gap: 8px; }
  .card-heading { align-items: flex-start; flex-direction: row; gap: 7px; }
  .card-heading strong { font-size: 13px; line-height: 1.25; }
  .card-kicker { font-size: 8px; margin-bottom: 2px; }
  .order-status { width: min(44%, 145px); min-height: 32px; padding: 4px 5px; }
  .card-meta { gap: 4px; }
  .card-meta span, .availability { padding: 3px 5px; font-size: 9px; }
  .card-section { gap: 3px; padding-top: 7px; }
  .card-section > span, .product-numbers span, .user-details span { font-size: 8px; }
  .item-list { gap: 4px; font-size: 11px; }
  .order-card .item-list { max-height: 82px; }
  .product-numbers, .user-details { grid-template-columns: 1fr 1fr; gap: 5px; }
  .product-numbers div, .user-details div { padding: 7px; }
  .product-numbers strong, .user-details strong { margin-top: 2px; font-size: 13px; }
  .announcement-text { max-height: 105px; font-size: 11px; line-height: 1.45; }
  .emoji-picker { gap: 4px; }
  .emoji-picker .emoji-option { width: 32px; min-height: 31px; font-size: 15px; }
  .announcement-image-preview, .announcement-card-image { max-height: 145px; }
  .tool-row { grid-template-columns: 1fr; padding: 10px; gap: 8px; margin-bottom: 10px; }
  .tool-row span { padding-bottom: 0; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .upload-stock, .actions .manage-stock { grid-column: auto; }
  .actions button { width: 100%; min-height: 34px; padding: 5px 6px; font-size: 10px; }
  .settings-layout { grid-template-columns: 1fr; gap: 8px; }
  #bot-settings-tab .section-title { margin-bottom: 7px; }
  #bot-settings-tab .history-title { margin-top: 12px; padding-top: 12px; }
  #bot-settings-tab .form-panel { padding: 10px; gap: 9px; }
  #bot-settings-tab label { gap: 4px; font-size: 11px; }
  #welcome-message { height: 105px; min-height: 105px; padding: 8px; font-size: 11px; line-height: 1.4; }
  #bot-settings-tab .form-footer { align-items: center; flex-direction: row; gap: 8px; }
  #bot-settings-tab .form-footer button { width: auto; min-height: 34px; padding: 6px 9px; font-size: 10px; }
  .welcome-preview { padding: 10px; }
  .welcome-preview p { max-height: 68px; overflow-y: auto; margin: 7px 0; font-size: 10px; line-height: 1.4; }
  .preview-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .preview-buttons span { padding: 5px 3px; font-size: 9px; line-height: 1.25; }
  .notification-form .status-box { padding: 8px; font-size: 10px; }
  .notification-form input { min-height: 34px; padding: 6px 8px; font-size: 11px; }
  .notification-form .note { font-size: 9px; line-height: 1.35; }
  .notification-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .notification-actions button:first-child { grid-column: auto; }
  .notification-actions button { min-height: 34px; padding: 5px 3px; font-size: 9px; }
  .banner-preview { max-height: 125px; }
  .banner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .banner-actions button { min-height: 34px; padding: 5px 6px; font-size: 10px; }
  .security-form .split { grid-template-columns: 1fr 1fr; gap: 6px; }
  .security-form input { min-height: 34px; padding: 6px 8px; font-size: 11px; }
  .form-panel { padding: 16px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer button { width: 100%; min-height: 44px; }
  dialog form { padding: 16px; }
  .stock-dialog-content { padding: 16px; }
  .stock-toolbar { align-items: stretch; flex-direction: column; }
  .split { grid-template-columns: 1fr; }
  #toast { right: 12px; bottom: 12px; }
}

@media (max-width: 420px) {
  .header-actions .system-status { display: none; }
  .section-title p { display: none; }
  .card-grid { max-height: calc(100dvh - 185px); }
}
