/* Desktop professional UI redesign
   Active on desktop only so the mobile bottom-sheet experience stays intact. */

@media (min-width: 761px) {
  :root {
    --navy-950: #173b2a;
    --navy-900: #214b35;
    --navy-800: #2b5d41;
    --blue-700: #2f704a;
    --blue-500: #368457;
    --cyan-100: #eaf4ed;
    --slate-900: #18231d;
    --slate-700: #48574f;
    --slate-500: #6b786f;
    --slate-300: #cbd5ce;
    --slate-200: #dce4df;
    --slate-100: #f5f8f6;
    --white: #ffffff;
    --red-600: #c83d3d;
    --green-600: #268253;
    --amber-500: #d99614;
    --info-600: #2f6fa3;
    --surface-app: #edf2ef;
    --surface-subtle: #f6f8f7;
    --surface-hover: #eef4f0;
    --border-soft: #d8e0db;
    --shadow-soft: 0 1px 2px rgba(20, 45, 31, .04), 0 7px 20px rgba(20, 45, 31, .055);
    --shadow-popover: 0 18px 45px rgba(20, 37, 27, .18);
    --radius-md: 12px;
    --radius-sm: 9px;
    --desktop-left-panel: 324px;
    --desktop-right-panel: 276px;
  }

  html,
  body {
    font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--slate-900);
    background: var(--surface-app);
    font-size: 14px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  button,
  input,
  select,
  textarea {
    font-family: inherit;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 3px solid rgba(54, 132, 87, .22) !important;
    outline-offset: 2px;
  }

  /* Compact, professional application header */
  .topbar {
    min-height: 64px;
    height: 64px;
    grid-template-columns: minmax(250px, 1fr) auto auto minmax(164px, auto);
    gap: 18px;
    padding: 8px 16px;
    background: #173b2a;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 3px 16px rgba(16, 41, 28, .13);
  }

  .brand-block {
    gap: 10px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 3px 8px rgba(4, 21, 12, .2));
  }

  .brand-copy {
    display: grid;
    align-content: center;
    gap: 1px;
  }

  .eyebrow {
    display: none;
  }

  .topbar h1 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.012em;
  }

  .topbar-subtitle {
    margin-top: 1px;
    color: rgba(234, 244, 237, .7);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 400;
  }

  .mode-switch {
    gap: 3px !important;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
  }

  .mode-button {
    width: auto !important;
    height: 38px !important;
    min-height: 38px;
    padding: 0 13px !important;
    gap: 8px !important;
    border-radius: 7px !important;
    color: rgba(237, 247, 240, .74);
    font-size: 13px;
    font-weight: 600;
    box-shadow: none !important;
  }

  .mode-button .button-label {
    display: inline !important;
  }

  .mode-button .mode-icon {
    width: 18px !important;
    height: 18px !important;
  }

  .mode-button.active {
    color: #173b2a;
    background: #f8fbf9;
  }

  .topbar-actions {
    justify-content: flex-end;
    gap: 6px !important;
  }

  .topbar-button,
  .topbar-button.strong {
    width: 38px !important;
    height: 38px !important;
    min-height: 38px;
    padding: 0 !important;
    border-radius: 9px !important;
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(239, 248, 242, .88);
    background: rgba(255, 255, 255, .055);
    box-shadow: none;
  }

  .topbar-button:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .11);
  }

  .topbar-button.strong {
    color: #173b2a;
    border-color: #d9e9de;
    background: #eaf4ed;
  }

  .topbar-button.strong:hover {
    color: #173b2a;
    background: #f8fbf9;
  }

  .topbar-button .button-symbol,
  .topbar-button .report-button-symbol {
    width: 19px !important;
    height: 19px !important;
  }

  .topbar-status {
    position: absolute;
    z-index: 710;
    top: 14px;
    left: 14px;
    max-width: min(280px, calc(100% - 28px));
    gap: 6px;
    padding: 7px 11px;
    border: 1px solid rgba(23, 59, 42, .11);
    border-radius: 10px;
    color: #3e5146;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 28px rgba(20, 45, 31, .12);
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: .78;
    display: flex;
    align-items: center;
  }

  .status-dot {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 3px rgba(38, 130, 83, .13);
  }

  /* Balanced three-column workspace */
  .workspace,
  body[data-mode="visual"] .workspace {
    grid-template-columns: var(--desktop-left-panel) minmax(440px, 1fr) var(--desktop-right-panel) !important;
    background: var(--surface-app);
    transition: grid-template-columns .22s ease;
  }

  body[data-left-collapsed="true"] .workspace,
  body[data-mode="visual"][data-left-collapsed="true"] .workspace {
    grid-template-columns: 0 minmax(560px, 1fr) var(--desktop-right-panel) !important;
  }

  body[data-right-collapsed="true"] .workspace,
  body[data-mode="visual"][data-right-collapsed="true"] .workspace {
    grid-template-columns: var(--desktop-left-panel) minmax(560px, 1fr) 0 !important;
  }

  body[data-left-collapsed="true"][data-right-collapsed="true"] .workspace,
  body[data-map-focus="true"] .workspace,
  body[data-mode="visual"][data-left-collapsed="true"][data-right-collapsed="true"] .workspace {
    grid-template-columns: 0 minmax(700px, 1fr) 0 !important;
  }

  .sidebar,
  .data-drawer,
  .visual-drawer {
    min-width: 0;
    padding: 12px;
    background: var(--surface-subtle);
    scrollbar-width: thin;
    scrollbar-color: #becac2 transparent;
  }

  .sidebar::-webkit-scrollbar,
  .data-drawer::-webkit-scrollbar,
  .visual-drawer::-webkit-scrollbar,
  .report-modal-body::-webkit-scrollbar,
  .statistics-modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .sidebar::-webkit-scrollbar-thumb,
  .data-drawer::-webkit-scrollbar-thumb,
  .visual-drawer::-webkit-scrollbar-thumb,
  .report-modal-body::-webkit-scrollbar-thumb,
  .statistics-modal-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #bdc9c1;
    background-clip: content-box;
  }

  .sidebar {
    border-right: 1px solid var(--border-soft);
  }

  .data-drawer,
  .visual-drawer {
    border-left: 1px solid var(--border-soft);
  }

  /* Accordion panels */
  .panel {
    margin-bottom: 9px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 45, 31, .025);
  }

  .panel:hover {
    border-color: #cbd7cf;
  }

  .panel-ornament {
    display: none !important;
  }

  .panel-heading {
    min-height: 51px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 10px 9px 13px;
    border-bottom: 1px solid var(--border-soft);
    background: #fbfcfb;
    cursor: pointer;
    user-select: none;
  }

  .panel.collapsed .panel-heading {
    border-bottom-color: transparent;
  }

  .panel-heading:hover {
    background: var(--surface-hover);
  }

  .panel-heading > div:first-child {
    min-width: 0;
  }

  .panel-heading h2,
  .drawer-header h2 {
    margin-top: 1px;
    color: var(--slate-900);
    font-size: 14px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.006em;
  }

  .section-kicker,
  .panel-heading .section-kicker,
  .drawer-header .section-kicker {
    color: #738078;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .105em;
  }

  .panel-heading-actions {
    gap: 5px;
  }

  .panel-body {
    padding: 13px;
  }

  .panel-collapsible.collapsed .panel-body {
    display: none;
  }

  .panel-toggle {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #42534a;
    background: transparent;
    font-size: 0 !important;
  }

  .panel-toggle::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 9px;
    width: 8px;
    height: 8px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease, top .18s ease;
  }

  .panel-toggle[aria-expanded="false"]::before,
  .panel.collapsed .panel-toggle::before {
    top: 11px;
    transform: rotate(-45deg);
  }

  .panel-toggle:hover {
    color: #214b35;
    background: #eaf2ed;
  }

  .field-panel .panel-heading-actions .button.small {
    min-height: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  /* Consistent component system */
  .button,
  .file-button,
  button.button {
    min-height: 40px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .08s ease;
  }

  .button:active,
  .file-button:active {
    transform: translateY(1px);
  }

  .button.primary,
  .button:not(.secondary):not(.danger):not(.ghost) {
    border-color: #2f704a;
    color: #fff;
    background: #2f704a;
  }

  .button.primary:hover,
  .button:not(.secondary):not(.danger):not(.ghost):hover {
    border-color: #285f3f;
    background: #285f3f;
  }

  .button.secondary,
  .file-button,
  .button.ghost {
    border-color: #cfd9d2;
    color: #294839;
    background: #fff;
  }

  .button.secondary:hover,
  .file-button:hover,
  .button.ghost:hover {
    border-color: #aebfb4;
    background: #f2f7f4;
  }

  .button.danger,
  .text-button.danger {
    color: #b83232;
  }

  .button.danger {
    border-color: #efcaca;
    background: #fff8f8;
  }

  .button.danger:hover {
    border-color: #dda8a8;
    background: #feeeee;
  }

  .text-button {
    min-height: 32px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
  }

  label,
  .field-label {
    color: #394b41;
    font-size: 12.5px;
    font-weight: 600;
  }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    min-height: 40px;
    border: 1px solid #cfd9d2;
    border-radius: 8px;
    color: #1d2b23;
    background: #fff;
    font-size: 13.5px;
    box-shadow: 0 1px 1px rgba(20, 45, 31, .025);
  }

  input:hover,
  select:hover,
  textarea:hover {
    border-color: #b5c3ba;
  }

  input:focus,
  select:focus,
  textarea:focus {
    border-color: #368457;
    box-shadow: 0 0 0 3px rgba(54, 132, 87, .11);
  }

  input[type="checkbox"],
  input[type="radio"] {
    accent-color: #2f704a;
  }

  .helper-text,
  small,
  .raster-status {
    color: #6b786f;
    font-size: 12px;
    line-height: 1.48;
    font-weight: 400;
  }

  .field-hero-card,
  .quick-tip,
  .raster-control-block,
  .owner-vertex-input-card,
  .hardware-session-card,
  .visual-advanced-settings,
  .owner-manual-settings {
    border: 1px solid #dce5df;
    border-radius: 9px;
    background: #f7faf8;
    box-shadow: none;
  }

  .field-hero-card {
    padding: 10px 11px;
  }

  .field-hero-card strong {
    color: #203c2d;
    font-size: 14px;
    font-weight: 700;
  }

  .hero-label,
  .map-card-kicker {
    color: #748078;
    font-size: 10px;
    font-weight: 700;
  }

  .hero-metrics,
  .map-card-meta {
    color: #496357;
    font-size: 11px;
    font-weight: 600;
  }

  .input-stepper {
    gap: 5px;
  }

  .step-chip {
    padding: 5px 8px;
    color: #506057;
    background: #edf3ef;
    font-size: 11px;
    font-weight: 600;
  }

  .step-chip.active {
    color: #204e34;
    background: #dceee2;
  }

  details > summary {
    color: #334a3e;
    font-size: 12.5px;
    font-weight: 650;
  }

  .count-badge,
  .status-badge,
  .mode-pill {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
  }

  /* Right-side data panel */
  .drawer-header {
    position: sticky;
    z-index: 3;
    top: -12px;
    align-items: center;
    margin: -12px -12px 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(246, 248, 247, .97);
    backdrop-filter: blur(9px);
  }

  .drawer-header .panel-heading-actions {
    align-items: center;
  }

  .quick-tip {
    margin-bottom: 10px;
    padding: 10px;
  }

  .quick-tip strong {
    font-size: 12.5px;
    font-weight: 700;
  }

  .quick-tip span {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .points-list,
  .field-summary-list {
    display: grid;
    gap: 8px;
  }

  .point-card,
  .field-summary-card,
  .owner-card,
  .owner-vertex-card {
    border-color: #d9e2dc !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(20, 45, 31, .025) !important;
  }

  .point-card:hover,
  .field-summary-card:hover,
  .owner-card:hover,
  .owner-vertex-card:hover {
    border-color: #b9c9be !important;
    box-shadow: 0 5px 15px rgba(20, 45, 31, .06) !important;
  }

  .drawer-actions {
    position: sticky;
    bottom: -12px;
    margin: 12px -12px -12px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border-soft);
    background: rgba(246, 248, 247, .97);
    backdrop-filter: blur(9px);
  }

  /* Map surface and compact tools */
  .map-area {
    position: relative;
    min-width: 0;
    background: #dfe7e2;
    box-shadow: inset 0 0 0 1px rgba(23, 59, 42, .05);
  }

  /* Leaflet zoom container — offset below kartu sawah */
  .leaflet-top.leaflet-left {
    top: 158px;
    left: 14px;
  }

  .leaflet-control-zoom a,
  .leaflet-control-layers-toggle {
    color: #284538;
  }

  .leaflet-bar {
    overflow: hidden;
    border: 1px solid rgba(23, 59, 42, .16) !important;
    border-radius: 9px !important;
    box-shadow: 0 7px 20px rgba(20, 45, 31, .12) !important;
  }

  /* Scale control styling — bottom-left of map area */
  .leaflet-control-scale {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 3px 6px;
    border: 1px solid rgba(23, 59, 42, .16);
    box-shadow: 0 4px 12px rgba(20, 45, 31, .1);
    font-size: 11px;
    color: #244333;
  }

  .leaflet-control-scale-line {
    border: none !important;
    background: none !important;
    color: inherit;
    font-size: inherit;
    padding: 0;
  }

  .map-workspace-card {
    top: 58px;
    left: 14px;
    min-width: 164px;
    padding: 9px 11px;
    border: 1px solid rgba(23, 59, 42, .13);
    border-radius: 10px;
    color: #244333;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(20, 45, 31, .12);
    backdrop-filter: blur(10px);
  }

  .map-workspace-card strong {
    margin-top: 2px;
    font-size: 13.5px;
    font-weight: 700;
  }

  .map-card-meta {
    margin-top: 5px;
  }

  .map-quick-toolbar,
  .map-floating-toolbar {
    display: none !important;
  }

  .desktop-map-toolbar {
    position: absolute;
    z-index: 720;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(23, 59, 42, .14);
    border-radius: 11px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(20, 45, 31, .12);
    backdrop-filter: blur(10px);
  }

  .desktop-map-tool {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #365045;
    background: transparent;
  }

  .desktop-map-tool:hover,
  .desktop-map-tool[aria-expanded="true"],
  .desktop-map-tool.active {
    color: #214b35;
    background: #e8f1eb;
  }

  .desktop-map-tool svg,
  .desktop-popover-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .desktop-map-tool::after {
    content: attr(aria-label);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 9;
    padding: 6px 8px;
    border-radius: 7px;
    color: #fff;
    background: rgba(24, 35, 29, .96);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -3px);
    transition: opacity .14s ease, transform .14s ease;
  }

  .desktop-map-tool:hover::after,
  .desktop-map-tool:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .desktop-map-popover {
    position: absolute;
    z-index: 721;
    top: 64px;
    right: 14px;
    width: 252px;
    padding: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--shadow-popover);
    backdrop-filter: blur(12px);
  }

  .desktop-map-popover[hidden] {
    display: none;
  }

  .desktop-popover-title {
    padding: 6px 8px 8px;
    color: #718078;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  .desktop-popover-item {
    width: 100%;
    min-height: 40px;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    color: #2f4439;
    background: transparent;
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
  }

  .desktop-popover-item:hover,
  .desktop-popover-item.active {
    background: #edf4ef;
  }

  .desktop-popover-meta {
    color: #758178;
    font-size: 10.5px;
    font-weight: 500;
  }

  .desktop-layer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 3px;
  }

  .desktop-layer-chip {
    min-height: 42px;
    padding: 5px 4px;
    border: 1px solid #d9e2dc;
    border-radius: 8px;
    color: #4d5f55;
    background: #fff;
    font-size: 11px;
    font-weight: 650;
  }

  .desktop-layer-chip:hover {
    border-color: #b5c6bb;
    background: #f4f8f5;
  }

  .desktop-layer-chip.active {
    border-color: #8bb59a;
    color: #214b35;
    background: #e5f1e9;
    box-shadow: 0 0 0 1px rgba(47, 112, 74, .07);
  }

  .map-mode-badge {
    top: 14px;
    padding: 6px 9px;
    border: 1px solid rgba(23, 59, 42, .12);
    border-radius: 8px;
    color: #355045;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 5px 18px rgba(20, 45, 31, .08);
    font-size: 11px;
    font-weight: 650;
    backdrop-filter: blur(9px);
  }

  .map-instruction {
    max-width: min(580px, calc(100% - 140px));
    padding: 8px 11px;
    border: 1px solid rgba(23, 59, 42, .12);
    border-radius: 9px;
    color: #3f5147;
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 5px 18px rgba(20, 45, 31, .08);
    font-size: 11.5px;
    font-weight: 500;
    backdrop-filter: blur(9px);
  }

  .map-legend {
    border: 1px solid rgba(23, 59, 42, .13);
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(20, 45, 31, .1);
    backdrop-filter: blur(10px);
  }

  /* Desktop modal refinement */
  .report-modal,
  .statistics-modal {
    padding: 22px;
    background: rgba(16, 30, 22, .58);
    backdrop-filter: blur(4px);
  }

  .report-modal-shell,
  .statistics-modal-shell {
    overflow: hidden;
    border: 1px solid rgba(23, 59, 42, .14);
    border-radius: 15px;
    background: #f7f9f8;
    box-shadow: 0 26px 80px rgba(11, 29, 18, .28);
  }

  .report-modal-header,
  .statistics-modal-header {
    min-height: 66px;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-soft);
    background: #fff;
  }

  .report-modal-header h2,
  .statistics-modal-header h2 {
    font-size: 17px;
    font-weight: 700;
  }

  .report-modal-body,
  .statistics-modal-body {
    padding: 16px 18px 20px;
  }

  .report-section-card,
  .statistics-section,
  .statistics-card {
    border-color: #dbe3de;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 45, 31, .025);
  }

  .statistics-card strong {
    color: #1d3d2b;
    font-weight: 700;
  }

  .statistics-table-wrapper {
    border: 1px solid #dbe3de;
    border-radius: 10px;
  }

  .statistics-table thead th {
    color: #415249;
    background: #edf3ef;
    font-size: 11px;
    font-weight: 700;
  }

  .statistics-table tbody td {
    font-size: 12px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: #506057;
    background: #f1f5f2;
  }

  /* Hide mobile shell on desktop even if a stale class is present */
  .mobile-header,
  .mobile-bottom-nav,
  .mobile-bottom-sheet,
  .mobile-sheet-backdrop {
    display: none !important;
  }
}

@media (min-width: 761px) and (max-width: 1199px) {
  :root {
    --desktop-left-panel: 300px;
    --desktop-right-panel: 248px;
  }

  .topbar {
    grid-template-columns: minmax(190px, 1fr) auto auto minmax(128px, auto) !important;
    gap: 10px;
    padding-inline: 12px;
  }

  .topbar-subtitle {
    display: none;
  }

  .workspace,
  body[data-mode="visual"] .workspace {
    grid-template-columns: var(--desktop-left-panel) minmax(390px, 1fr) var(--desktop-right-panel) !important;
  }

  .panel-body {
    padding: 11px;
  }
}

@media (min-width: 761px) and (max-width: 1023px) {
  :root {
    --desktop-left-panel: 286px;
    --desktop-right-panel: 236px;
  }

  .workspace,
  body[data-mode="visual"] .workspace {
    grid-template-columns: var(--desktop-left-panel) minmax(360px, 1fr) var(--desktop-right-panel) !important;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .topbar h1 {
    font-size: 15px;
  }

  .mode-button {
    padding-inline: 9px !important;
  }

  .mode-button .button-label {
    display: none !important;
  }
}

/* Desktop-only elements must never leak into the mobile bottom-sheet layout. */
@media (max-width: 760px) {
  .desktop-map-toolbar,
  .desktop-map-popover {
    display: none !important;
  }
}

@media (min-width: 761px) {
  .topbar .mode-switch .mode-button .button-label {
    display: inline-flex !important;
  }

  .map-mode-badge.input,
  .map-mode-badge.visual {
    color: #315044 !important;
    border-color: rgba(23, 59, 42, .13) !important;
    background: rgba(255, 255, 255, .92) !important;
  }

  .data-drawer .drawer-header .text-button.danger {
    max-width: 74px;
    min-height: 30px;
    padding-inline: 5px;
    line-height: 1.15;
    text-align: center;
  }

  .desktop-map-tool::after,
  .mode-button::after,
  .topbar-button::after {
    max-width: 210px;
  }
}

/* Keep the selected right panel available on compact PC screens.
   The original stylesheet hid it below 1120 px, which left an empty third column. */
@media (min-width: 761px) and (max-width: 1120px) {
  body[data-mode="input"] .data-drawer.mode-input-only {
    display: block !important;
  }

  body[data-mode="visual"] .visual-drawer.mode-visual-only {
    display: block !important;
  }

  body[data-right-collapsed="true"] .data-drawer,
  body[data-right-collapsed="true"] .visual-drawer,
  body[data-map-focus="true"] .data-drawer,
  body[data-map-focus="true"] .visual-drawer {
    display: block !important;
  }
}

@media (min-width: 761px) and (max-width: 1080px) {
  :root {
    --desktop-left-panel: 278px;
    --desktop-right-panel: 228px;
  }

  .workspace,
  body[data-mode="visual"] .workspace {
    grid-template-columns: var(--desktop-left-panel) minmax(390px, 1fr) var(--desktop-right-panel) !important;
  }

  .sidebar,
  .data-drawer,
  .visual-drawer {
    padding-inline: 10px;
  }

  .drawer-header {
    margin-inline: -10px;
    padding-inline: 10px;
  }
}

@media (min-width: 761px) {
  /* Mobile-specific quick chips are redundant on desktop; the map toolbar and
     parameter selector remain the primary controls. */
  .mobile-visual-quick {
    display: none !important;
  }

  .owner-manual-settings,
  .visual-advanced-settings {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #dce5df;
    border-radius: 9px;
    background: #f8faf9;
  }

  .owner-manual-settings > summary,
  .visual-advanced-settings > summary {
    min-height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 9px 11px;
    color: #344c3f;
    background: #f4f7f5;
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
  }

  .owner-manual-settings > summary::-webkit-details-marker,
  .visual-advanced-settings > summary::-webkit-details-marker {
    display: none;
  }

  .owner-manual-settings > summary::after,
  .visual-advanced-settings > summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease;
  }

  .owner-manual-settings[open] > summary::after,
  .visual-advanced-settings[open] > summary::after {
    transform: rotate(225deg);
  }

  .owner-manual-settings > .owner-vertex-input-card,
  .visual-advanced-settings > .visual-advanced-body {
    margin: 0;
    padding: 11px;
    border: 0;
    border-top: 1px solid #e1e8e3;
    border-radius: 0;
    background: #fff;
  }

  .report-modal-header,
  .statistics-modal-header {
    color: #18231d !important;
  }

  .report-modal-header .section-kicker,
  .statistics-modal-header .section-kicker {
    color: #2f704a !important;
  }

  .report-modal-header .icon-button,
  .statistics-modal-header .icon-button {
    color: #4b5c52 !important;
    background: #f0f4f1 !important;
  }

  .report-modal-header .icon-button:hover,
  .statistics-modal-header .icon-button:hover {
    color: #173b2a !important;
    background: #e3ece6 !important;
  }
}
