html,
body {
    margin: 0 !important;
    padding: 0 !important;

    width: 100%;
    height: 100%;

    overflow: hidden;
}

body {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#map {
    position: fixed !important;

    top: 0;
    left: 0;

    width: 100vw !important;
    height: 100vh !important;

    z-index: 1;
}

#bottomMenu {

    position: fixed;

    left: 0;                 /* changed from 12px */
    right: 0;                /* changed from 12px */
    bottom: 12px;

    width: calc(100% - 24px); /* keeps the 12px gutters on phones */
    max-width: 480px;         /* the mobile cap */
    margin-left: auto;        /* center when wider than the cap */
    margin-right: auto;

    background: rgba(255,255,255,0.98);

    border-radius: 24px 24px 18px 18px;

    padding: 16px;

    z-index: 9999;

    box-shadow: 0 10px 35px rgba(0,0,0,0.28);

    backdrop-filter: blur(6px);

    transform: translateY(130%);
    transition: transform 0.28s ease;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

#bottomMenu.show {
    transform: translateY(0);
}

#bottomMenu button {

    width: 100%;

    padding: 16px;

    border: 0;

    border-radius: 16px;

    font-size: 17px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

#btnAddPivot {
    background: #2e7d5a;
    color: white;
}

#btnControlPivot {
    background: #4f7ea8;
    color: white;
}

#btnRefreshPivots {
    background: #5f9ea0;
    color: white;
}

#btnMyLocation {
    background: #607d8b;
    color: white;
}

#btnCancel {
    background: #8a8a8a;
    color: white;
}

#bottomMenu button:active {
    transform: scale(0.98);
}


#farmSheet {

    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;          /* NEW */
    max-width: 480px;     /* NEW — mobile cap */
    margin-left: auto;    /* NEW — center on wide screens */
    margin-right: auto;   /* NEW */

    height: 320px;

    background: white;

    border-radius: 24px 24px 0 0;

    z-index: 9998;

    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);

    padding: 16px;

    overflow-y: auto;
}


#farmHandle {

    width: 60px;
    height: 6px;

    background: #cfcfcf;

    border-radius: 20px;

    margin: 0 auto 16px auto;
}

#farmSheet h3 {

    margin-top: 0;

    font-size: 22px;
}

#farmSearch {

    width: 100%;

    padding: 12px;

    border: 1px solid #ddd;

    border-radius: 14px;

    margin-bottom: 14px;

    font-size: 16px;

    box-sizing: border-box;
}

.farmItem {

    padding: 14px;

    border-radius: 16px;

    background: #f5f7f8;

    margin-bottom: 10px;

    cursor: pointer;

    transition: 0.2s;
}

.farmItem:active {

    transform: scale(0.98);
}

.farmTitle {

    font-size: 18px;
    font-weight: 600;
}

.farmInfo {

    color: #666;

    margin-top: 4px;

    font-size: 14px;
}
.pivotInfo {
    min-width: 220px;
    font-family: Arial;
}

.pivotInfo h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #0b4f2f;
}

.pivotInfo div {
    font-size: 14px;
    margin-bottom: 5px;
}
.appDialogOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,0.45);

    z-index: 20000;

    display: none;

    align-items: center;
    justify-content: center;
}

.appDialog {
    width: 86%;
    max-width: 360px;

    background: white;

    border-radius: 22px;

    padding: 22px;

    box-shadow: 0 10px 40px rgba(0,0,0,0.35);

    text-align: center;

    font-family: Arial, sans-serif;
}

.appDialog h3 {
    margin: 0 0 10px 0;

    font-size: 22px;

    color: #0b4f2f;
}

.appDialog p {
    margin: 0 0 20px 0;

    font-size: 16px;

    color: #444;
}

.appDialogButtons {
    display: flex;

    gap: 12px;
}

.appDialogButtons button {
    flex: 1;

    padding: 14px;

    border: 0;

    border-radius: 14px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.dialogCancel {
    background: #d0d7dc;
    color: #333;
}

.dialogConfirm {
    background: #0b4f2f;
    color: white;
}
.mqttStatus {
    position: fixed;

    top: 14px;
    right: 14px;

    z-index: 9999;

    width: 22px;
    height: 22px;

    padding: 0;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.95);

    box-shadow: 0 4px 14px rgba(0,0,0,0.25);

    display: flex;
    align-items: center;
    justify-content: center;
}

#mqttStatusDot {
    width: 14px;
    height: 14px;

    border-radius: 50%;

    background: #999;
}

#mqttStatusText {
    display: none;
}

.mqttStatus.connected #mqttStatusDot {
    background: #1f8f4d;
}

.mqttStatus.connecting #mqttStatusDot {
    background: #d99000;
}

.mqttStatus.offline #mqttStatusDot {
    background: #b00020;
}

.mqttStatus.error #mqttStatusDot {
    background: #b00020;
}
#wpadminbar {
    display: none !important;
}

html {
    margin-top: 0 !important;
}

body {
    margin-top: 0 !important;
}

#pivotControlSheet {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 480px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}