:root {
  --bg: #10161b;
  --panel: #182129;
  --panel-2: #1e2a35;
  --line: #2c3a46;
  --text: #e8f0f7;
  --sub: #9eb0bf;
  --primary: #18a06f;
  --accent: #4ab1ff;
  --warn: #f2bc54;
  --danger: #f06f68;
  --r: 10px;
}
body.light-theme {
  --bg: #f2f5f8;
  --panel: #ffffff;
  --panel-2: #f7fafd;
  --line: #dbe4ec;
  --text: #22313d;
  --sub: #657a8d;
  --primary: #148861;
  --accent: #2b80d8;
  --warn: #cb9430;
  --danger: #cb4e48;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow-x: hidden; }
body { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); overflow: hidden; font-size: 15px; }

.app-shell { height: 100%; display: grid; grid-template-columns: 280px 1fr; }
.app-sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.brand { display: flex; align-items: center; gap: 16px; font-weight: 700; padding: 12px 4px; font-size: 32px; }
.brand i { color: var(--primary); }

.current-account {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.account-dropdown { position: relative; display: none; max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }
.account-dropdown.show { display: block; }
.account-option { padding: 8px 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.account-option:hover { background: rgba(255,255,255,0.04); }
.account-option.active { color: var(--primary); }

.nav-list { display: grid; gap: 8px; }
.nav-item {
  border: 1px solid transparent; border-radius: var(--r); padding: 8px 10px; color: var(--sub);
  text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 17px;
}
.nav-item:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; }

.sidebar-foot { margin-top: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); padding: 8px 10px; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.conn { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.dot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.dot.online { background: #22d181; }
.dot.offline { background: #f16661; }
.uptime-mini { display: none; }
.system-time { display: block; text-align: right; margin: 0; color: var(--sub); font-size: 16px; font-weight: 600; }

.app-main { display: grid; grid-template-rows: 64px 1fr; min-width: 0; max-width: 100%; overflow-x: hidden; }
.topbar { border-bottom: 1px solid var(--line); background: var(--panel); padding: 0 14px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { margin: 0; font-size: 22px; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--panel-2); color: var(--sub); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--primary); }

.page-wrap { overflow: auto; padding: 14px; max-width: 100%; overflow-x: hidden; }
.page { display: none; }
.page.active { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-head h3 { margin: 0; font-size: 16px; display: flex; gap: 6px; align-items: center; }
.dashboard-grid .card-head h3 { font-size: 20px; }

.compact-status {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 12px;
}
.status-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel-2);
  min-height: 78px; display: flex; flex-direction: column; justify-content: center;
}
.status-item.stretch { grid-column: span 2; }
.status-head { display: flex; align-items: center; gap: 6px; }
.si { width: 14px; text-align: center; font-size: 13px; opacity: .95; }
.si.coin { color: #f0b84f; }
.si.level { color: #ffd86b; }
.si.exp { color: #4ab1ff; }
.si.total { color: #56d4a0; }
.si.time { color: #bca9ff; }
.si.rate { color: #7fe2dd; }
.status-item .k { font-size: 15px; color: var(--sub); }
.status-item .v { font-size: 28px; font-weight: 700; margin-top: 3px; line-height: 1.2; }
.status-item .s { font-size: 14px; color: var(--sub); margin-top: 3px; }
.status-item .gain-gold { color: var(--primary); font-weight: 600; }
.exp-inline #stat-exp { color: var(--primary); font-weight: 600; }
.status-account {
  margin-top: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}
.status-account-item .status-account { margin-top: 0; }
.status-account img,
.status-account #topbar-account-fallback {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  flex-shrink: 0;
}
.status-account img { object-fit: cover; border: 1px solid var(--line); background: #fff; }
.status-account #topbar-account-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(24,160,111,.2); color: var(--text); font-size: 26px; font-weight: 700;
}
.status-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.status-account #topbar-account-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  color: var(--text);
}
.status-account #topbar-account-status {
  font-size: 15px;
  color: var(--sub);
}

@media (min-width: 981px) {
  .dashboard-grid > .logs-card { margin-bottom: 0; }
  #page-dashboard .compact-status { margin-bottom: 22px; }
  #page-dashboard .dashboard-grid {
    grid-template-columns: 1.75fr 0.65fr;
    column-gap: 18px;
    row-gap: 22px;
    align-items: stretch;
  }
  #page-dashboard .side-stack { gap: 20px; }
  #page-dashboard .dashboard-grid .card { margin-bottom: 18px; }
  #page-dashboard .side-stack .card-head h3 { font-size: 26px; }
  #page-dashboard .ops-list .op-stat { padding: 12px 14px; }
  #page-dashboard .ops-list .op-stat .label { font-size: 18px; }
  #page-dashboard .ops-list .op-stat .count { font-size: 20px; }
  #page-dashboard .switch-item { font-size: 19px; }
  .app-sidebar { padding: 12px; gap: 12px; }
  .brand { font-size: 34px; }
  .brand i { font-size: 36px; }
  .current-account {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
  }
  .account-dropdown { max-height: 280px; }
  .account-option {
    padding: 10px 12px;
    font-size: 15px;
  }
  .nav-list { gap: 10px; }
  .nav-item { padding: 10px 12px; font-size: 18px; }
  .compact-status {
    grid-template-columns: 0.9fr 0.9fr 1.1fr 1.1fr 0.9fr 0.9fr;
    gap: 22px;
  }
  .compact-status .status-item {
    padding: 10px;
  }
  .status-account {
    gap: 12px;
  }
  .status-account img,
  .status-account #topbar-account-fallback {
    width: 94px;
    height: 94px;
  }
  .status-account #topbar-account-fallback {
    font-size: 32px;
  }
  .status-account #topbar-account-name {
    max-width: 300px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
  }
  .status-account #topbar-account-status {
    font-size: 17px;
    line-height: 1.2;
  }
}
.exp-inline { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.inline-select { margin-left: 4px; font-size: 12px; border: none; background: transparent; color: var(--sub); }
.progress { width: 100%; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; margin-top: 4px; }
body.light-theme .progress { background: rgba(0,0,0,0.08); }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3ea9ff, #6ad7ff); }

.dashboard-grid { display: grid; grid-template-columns: 1.45fr .95fr; gap: 14px; align-items: stretch; }
.side-stack { display: grid; gap: 14px; }
.logs-card { display: flex; flex-direction: column; min-height: 0; height: auto; max-height: none; }

.logs-container {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
  height: clamp(420px, calc(100vh - 340px), 940px);
  min-height: 420px;
  max-height: 940px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: Consolas, monospace; font-size: 15px; background: var(--panel-2);
  flex: 1;
}
.log-row { display: flex; gap: 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: var(--sub); min-width: 70px; }
.log-tag { color: var(--accent); min-width: 60px; }
.log-msg { flex: 1; word-break: break-all; }
.log-row.warn .log-msg { color: var(--warn); }

.log-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  overflow: visible;
  padding-bottom: 0;
  justify-content: flex-end;
}
.log-filter-select,
.log-filter-input {
  height: 32px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  background: transparent;
  border-color: var(--line);
  color: var(--sub);
}
.log-filter-select {
  width: 96px;
  min-width: 96px;
}
.log-filter-input {
  width: 112px;
  min-width: 112px;
  transition: width 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.log-filter-input:focus {
  width: 140px;
  color: var(--text);
  border-color: var(--primary);
}
.log-filter-select:focus {
  color: var(--text);
  border-color: var(--primary);
}

.form-control { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); padding: 7px 9px; font-size: 14px; }
.form-control:focus { outline: none; border-color: var(--primary); }

.ops-list { display: grid; gap: 8px; }
.ops-list { min-height: 220px; align-content: start; }
.op-stat { display: flex; justify-content: space-between; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.op-stat .count { color: var(--accent); font-weight: 700; }

.switches-list { display: grid; gap: 16px; }
.switch-item { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.switch-item input { display: none; }
.slider { width: 38px; height: 20px; border-radius: 999px; background: #3a4652; position: relative; border: 1px solid var(--line); }
.slider::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: .18s; }
.switch-item input:checked + .slider { background: rgba(24,160,111,.75); border-color: rgba(24,160,111,.85); }
.switch-item input:checked + .slider::before { left: 20px; }
.friend-sub-controls { margin-left: 10px; padding-left: 12px; border-left: 2px dashed var(--line); display: grid; gap: 14px; }
.friend-sub-controls.disabled { opacity: .5; pointer-events: none; }

.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(.94); }
.btn-sm { font-size: 13px; padding: 6px 9px; }
.btn-ghost { background: transparent; }
.actions-group { display: flex; gap: 5px; flex-wrap: wrap; }

.summary { margin-bottom: 6px; text-align: right; color: var(--sub); font-size: 13px; }
.farm-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(104px,1fr)); gap: 8px; }
.land-cell { position: relative; border-radius: 10px; border: 2px solid transparent; background: var(--panel-2); min-height: 88px; padding: 6px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.land-cell .id { position: absolute; left: 5px; top: 5px; font-size: 10px; }
.land-cell .needs { position: absolute; right: 5px; bottom: 5px; font-size: 10px; background: var(--danger); color: #fff; padding: 1px 4px; border-radius: 6px; }
.plant-name { font-size: 14px; font-weight: 700; }
.phase-name, .land-meta { font-size: 12px; opacity: .9; }
.land-cell.harvestable { border-color: #f3be4f; }
.land-cell.dead { opacity: .66; }
.land-cell.land-level-0 { background: #2b2f33; border-color: #454f58; color: #d5dde4; }
.land-cell.land-level-1 { background: #6e5716; border-color: #8c6f1e; color: #f7e7b5; }
.land-cell.land-level-2 { background: #6b1e1e; border-color: #8b2a2a; color: #ffe6e6; }
.land-cell.land-level-3 { background: #141414; border-color: #090909; color: #eaeaea; }
.land-cell.land-level-4 { background: #6f5b16; border-color: #8f7420; color: #f9e8a8; }
body.light-theme .land-cell.land-level-0 { background: #d7d7d7; border-color: #bdbdbd; color: #333; }
body.light-theme .land-cell.land-level-1 { background: #f2c14e; border-color: #d8a730; color: #2b1e00; }
body.light-theme .land-cell.land-level-2 { background: #d9534f; border-color: #b53a37; color: #fff5f5; }
body.light-theme .land-cell.land-level-3 { background: #2f2f2f; border-color: #1b1b1b; color: #f0f0f0; }
body.light-theme .land-cell.land-level-4 { background: #d4af37; border-color: #b9962f; color: #2d2300; }

.friends-list { display: grid; gap: 6px; }
.friend-item { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); overflow: hidden; }
.friend-header { display: flex; justify-content: space-between; padding: 8px 10px; cursor: pointer; }
.friend-header:hover { filter: brightness(1.05); }
.friend-header .preview { font-size: 13px; color: var(--sub); }
.friend-header .preview.has-work { color: var(--primary); font-weight: 700; }
.friend-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 8px; }
.friend-actions .btn { font-size: 12px; padding: 4px 8px; }

.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 8px; }
.acc-item { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 10px; }
.acc-item .name { font-weight: 700; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 10px; }
.settings-grid .full { grid-column: 1/-1; }
.checkbox-inline { display: inline-flex; gap: 8px; align-items: center; }
.save-btn { width: 100%; }
.compact-select { width: 140px; }

/* Settings page readability */
#page-settings .card-head h3 { font-size: 24px; }
#page-settings .settings-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 16px 20px; }
#page-settings .form-group { margin-bottom: 6px; }
#page-settings .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  color: var(--text);
  line-height: 1.35;
}
#page-settings .form-control {
  font-size: 17px;
  padding: 12px 12px;
  min-height: 46px;
  border-radius: 10px;
}
#page-settings #strategy-select,
#page-settings #seed-select,
#page-settings #interval-farm,
#page-settings #interval-friend {
  width: 300px;
  max-width: 100%;
}
#page-settings .checkbox-inline { gap: 10px; font-size: 18px; }
#page-settings .checkbox-inline input[type="checkbox"] { width: 18px; height: 18px; }
#page-settings .save-btn { margin-top: 14px; font-size: 18px; padding: 12px 14px; }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.55); z-index: 100; }
.modal.show { display: flex; }
.modal-content { width: min(92vw, 500px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.chart-modal { width: min(95vw, 760px); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-header h3 { margin: 0; font-size: 17px; }
.close-modal { cursor: pointer; font-size: 22px; color: var(--sub); }
.close-modal:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tab-btn { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--sub); padding: 7px 10px; cursor: pointer; font-size: 14px; }
.tab-btn.active { background: var(--primary); color: #fff; border-color: transparent; }
.qr-wrap { min-height: 250px; display: grid; place-items: center; gap: 8px; }
.qr-display { display: grid; place-items: center; gap: 8px; }
#qr-code-img { width: 220px; height: 220px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* Add account modal (desktop-first) */
#modal-add-acc .modal-content {
  width: min(92vw, 640px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
#modal-add-acc .modal-body {
  overflow: auto;
  padding-right: 2px;
}
#modal-add-acc #tab-manual,
#modal-add-acc #tab-qrcode {
  padding-top: 2px;
}
#modal-add-acc #tab-qrcode .form-group {
  margin-bottom: 10px;
}
#modal-add-acc #qr-container {
  min-height: 320px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px;
}
#modal-add-acc #qr-code-display {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#modal-add-acc #qr-status {
  text-align: center;
  font-size: 13px;
  color: var(--sub);
}
#modal-add-acc .modal-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.login-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.6); z-index: 120; }
.login-overlay.show { display: flex; }
.login-card { width: min(90vw, 330px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { font-size: 13px; color: var(--sub); margin: 3px 0 8px; }
.login-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); padding: 8px 10px; }
.login-input:focus { outline: none; border-color: var(--primary); }
.login-error { min-height: 20px; color: var(--danger); font-size: 13px; margin-top: 6px; }
.login-btn { width: 100%; }

.value-changed, .value-changed-gold { animation: bump .4s ease; display: inline-block; }
@keyframes bump { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(124,148,170,.45); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1280px) {
  .compact-status { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .status-item.stretch { grid-column: span 2; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow: auto; overflow-x: hidden; padding-left: 10px; padding-right: 10px; }
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .app-shell { height: auto; min-height: 100dvh; }
  .app-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 8px;
    gap: 8px;
  }
  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 26px;
    padding: 8px 6px 6px;
  }
  .brand i { font-size: 28px; }
  .current-account { padding: 7px 9px; font-size: 14px; }
  .account-dropdown { max-height: 180px; }
  .nav-list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow-x: hidden;
    gap: 4px;
  }
  .nav-item { justify-content: center; padding: 7px 6px; font-size: 13px; }
  .nav-item span { display: none; }
  .sidebar-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
  }
  .uptime-mini, .system-time { margin-top: 0; white-space: nowrap; }

  .app-main { grid-template-rows: 54px auto; min-height: 0; }
  .topbar { padding: 0 10px; }
  .topbar h1 { font-size: 18px; }
  .page-wrap { padding: 10px; overflow: visible; }
  .card { padding: 10px; margin-bottom: 10px; }

  .compact-status { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .status-item.stretch { grid-column: span 2; }
  .status-item { min-height: 72px; padding: 8px; }
  .status-item .k { font-size: 13px; }
  .status-item .v { font-size: 24px; }
  .status-item .s { font-size: 13px; }

  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .side-stack { gap: 12px; }
  .logs-card { height: auto; max-height: none; }
  .logs-container { height: 320px; min-height: 320px; max-height: 320px; font-size: 14px; }
  .card-head { flex-wrap: wrap; gap: 6px; }
  .card-head h3 { font-size: 16px; }
  .dashboard-grid .card-head h3 { font-size: 18px; }
  .log-filters {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .log-filter-select, .log-filter-input {
    flex: 1 1 120px;
    width: auto;
    min-width: 0;
  }
  .log-filter-input:focus { width: auto; }

  .switches-list { gap: 12px; }
  .switch-item { font-size: 15px; }
  .friend-sub-controls { gap: 10px; }
  .actions-group { gap: 6px; }
  .btn { font-size: 14px; }
  .btn-sm { font-size: 13px; }

  .farm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .land-cell { min-height: 82px; }
  .plant-name { font-size: 13px; }
  .phase-name, .land-meta { font-size: 11px; }

  .accounts-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; gap: 8px; }
  .compact-select { width: 100%; }
  .modal-content { width: min(96vw, 560px); }
  #modal-add-acc .modal-content { width: min(96vw, 560px); max-height: 92vh; }
  #modal-add-acc #qr-container { min-height: 260px; }

  #page-settings .card-head h3 { font-size: 20px; }
  #page-settings .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  #page-settings .form-group label { font-size: 16px; margin-bottom: 6px; }
  #page-settings .form-control { font-size: 16px; min-height: 42px; padding: 10px 10px; }
  #page-settings .checkbox-inline { font-size: 16px; }
  #page-settings .save-btn { font-size: 16px; padding: 11px 12px; }
}

@media (max-width: 640px) {
  body { padding-left: 8px; padding-right: 8px; }
  .nav-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .nav-item { padding: 6px 4px; }
  .topbar h1 { font-size: 17px; }
  .status-account img,
  .status-account #topbar-account-fallback { width: 44px; height: 44px; }
  .status-account #topbar-account-name { max-width: 140px; }

  .compact-status { grid-template-columns: 1fr; }
  .status-item.stretch { grid-column: span 1; }
  .status-item { min-height: 66px; }
  .status-item .v { font-size: 22px; }

  .logs-container { height: 280px; min-height: 280px; max-height: 280px; font-size: 13px; }
  .log-time { min-width: 62px; }
  .log-tag { min-width: 52px; }

  .farm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-group { width: 100%; }
  .actions-group .btn { flex: 1 1 calc(50% - 6px); }
  .switch-item { font-size: 14px; }
  .modal-content { width: 96vw; padding: 8px; }
  #modal-add-acc .modal-content { width: 96vw; padding: 8px; max-height: 94vh; }
  #modal-add-acc #qr-container { min-height: 220px; padding: 10px; }
  #qr-code-img { width: 190px; height: 190px; }
  .login-card { width: 94vw; padding: 12px; }
}
