:root {
  --bg-color: #0b0909;
  --card-bg: #161616;
  --accent-blue: #007bff;
  --neon-green: #39ff14;
  --neon-yellow: #fff200;
  --text-main: #ffffff;
  --text-dim: #9e9e9e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  overflow-x: hidden;
}

/* כותרת האפליקציה */
.app-header {
  background-color: #121212;
  padding: 20px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.header-titles { min-width: 0; }

.gate-location {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 4px;
}

.brand {
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-content h1 {
  margin: 2px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#user-name {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.icon-btn:active { background: #222; }

/* Section menu (⋮) in the gate management screen */
.section-menu-wrap { position: relative; }

.section-menu {
  display: none;
  position: absolute;
  top: 46px;
  left: 0;
  min-width: 200px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 6px;
  z-index: 300;
}
.section-menu.open { display: block; }

.section-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  text-align: right;
  padding: 12px 14px;
  cursor: pointer;
}
.section-menu-item:active { background: #262626; }
.section-menu-item.active {
  color: var(--accent-blue);
  font-weight: 700;
  background: rgba(0, 123, 255, 0.1);
}
.section-menu-item .check { visibility: hidden; }
.section-menu-item.active .check { visibility: visible; }

/* Login screen — shown only while signed out */
#login-container {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 28px 22px;
}

.login-brand {
  font-size: 1.8rem;
  letter-spacing: 0.5px;
  text-align: center;
}

.login-title {
  margin: 6px 0 24px;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-dim);
  text-align: center;
}

.login-btn { margin-top: 14px; }

.search-bar {
  margin-top: 15px;
}

.search-bar input {
  width: 100%;
  padding: 12px;
  background: #222;
  border: 1px solid #333;
  border-radius: 10px;
  color: white;
  outline: none;
}

/* כרטיס שער - ה-Card המנצח */
/* הכרטיסייה עצמה */
.gate-card {
    background: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.gate-chip {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}
.chip-red    { background: #ff2020; color: #fff; }
.chip-yellow { background: #f0a500; color: #000; }

.gate-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* מעטפת הכפתורים */
.gate-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px; /* רווח בין השורות */
}

/* Command sent feedback flash */
@keyframes cmd-flash {
    0%   { filter: brightness(1); }
    30%  { filter: brightness(2.2); box-shadow: 0 0 18px var(--neon-green); }
    100% { filter: brightness(1); box-shadow: none; }
}
.cmd-sent {
    animation: cmd-flash 0.55s ease-out forwards;
    pointer-events: none; /* prevent double-tap during animation */
}

/* כפתור פתח - תמיד לכל הרוחב */
.open-btn.full-width {
    width: 100%;
    padding: 18px; /* כפתור גדול ונוח למגע */
    font-size: 1.2rem;
    font-weight: bold;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
.open-btn:active {
    background: #00cc55 !important;
    transform: scale(0.96);
}

/* שורת הכפתורים המשניים */
.secondary-actions-row {
    display: flex;
    gap: 10px; /* רווח בין הכפתורים בשורה */
    width: 100%;
}

.secondary-actions-row .btn-secondary {
    flex: 1; /* זה החלק הקריטי - כל כפתור יקבל רוחב שווה */
    padding: 12px 5px;
    background: #252525;
    color: #fff;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
}

/* כפתור גלגל השיניים */
.settings-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 5px;
}
/* מצב רכב מזוהה */
.car-outline-on svg {
    stroke: var(--neon-yellow) !important;
    filter: drop-shadow(0 0 8px var(--neon-yellow));
    opacity: 1;
}

.car-outline-off svg {
    stroke: var(--text-dim) !important; /* עכשיו המכונית תשתמש באפור הבהיר שהגדרת */
    filter: none !important;
    opacity: 0.2; /* שים לב שהיא עדיין תהיה שקופה מעט, בהתאם לעיצוב המקורי */
}
/* מוודא שהמיכל ממקם את ה-SVG במרכז */
#car-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}
/* מצבי לדים נוספים */
.led.off { background-color: #333; box-shadow: none; } /* אפור פנוי */
.led.warning { background-color: var(--neon-yellow); box-shadow: 0 0 10px var(--neon-yellow); } /* רכב על הלופ */
.led.error { background-color: #ff0000; box-shadow: 0 0 10px #ff0000; } /* חסימה/עצור */
.led.blink { animation: blinker 0.8s linear infinite; } /* הבהבה לפתיחה/סגירה */


@keyframes blinker {
  50% { opacity: 0; }
}

/* כפתורי שליטה מרובים בכרטיס */
.gate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.btn-secondary {
  background: #222;
  border: 1px solid #444;
  color: white;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.8rem;
}

/* סליידר שער בעבודה */
.gate-progress-container {
  width: 100%;
  background: lab(13.23% 0 0);
  height: 8px;
  border-radius: 4px;
  margin: 15px 0;
  overflow: hidden;
}
.gate-progress-bar {
  height: 100%;
  background: var(--accent-blue);
  width: 0%; /* ישתנה ב-JS */
  transition: width 0.5s ease-in-out;
  box-shadow: 0 0 8px var(--accent-blue);
}
/* סקשנים בדף ניהול */
.admin-section {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #252525;
}

.admin-section h3 {
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* גריד לכפתורי Latch */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.btn-latch {
    background: #252525;
    border: 1px solid #444;
    color: white;
    padding: 10px 5px;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-latch.active {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.3);
}

/* נתונים טכניים */
.tech-data .data-item {
    font-size: 0.85rem;
    color: var(--text-dim);
}
.tech-data .data-item span {
    color: var(--neon-yellow);
    float: left;
    font-family: monospace;
}

.safety-grid-full {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
/* תפריט תחתון */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #121212;
  display: flex;
  justify-content: space-around;
  padding: 15px;
  border-top: 1px solid #222;
}
.gate-progress-container {
  width: 100%;
  background: #222; /* רקע כהה למסילה */
  height: 12px;     /* גובה משמעותי */
  border-radius: 6px;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #333;
}

.gate-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), #00d4ff);
  width: 0%; /* מתחיל מאפס */
  transition: width 0.5s ease-in-out;
  box-shadow: 0 0 10px var(--accent-blue);
}
.nav-item {
  color: var(--text-dim);
  font-weight: 400;
}

.nav-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.nav-item.active {
  color: var(--accent-blue);
  font-weight: 700;
}
/* מבטל רקע לבן שנוצר לעיתים ב-SVG */
svg {
    background: transparent !important;
}

/* מוודא שהכרטיסייה של ה-Gauge תמיד כהה */
.card {
    background-color: var(--card-bg) !important;
    color: white;
}
/* מצב בסיסי - מנעולים כבויים */
.lock-icon svg {
    transition: all 0.4s ease;
    stroke: #9e9e9e !important; /* אפור בינוני - שיהיה אפשר לראות אותם */
    stroke-width: 2.5px;      /* עובי קו ברור */
    opacity: 0.4;             /* לא שקוף מדי */
    display: block;           /* מוודא שה-SVG תופס מקום */
    margin: auto;
}

/* FCC - סגור (אדום זרחני) */
.fcc-active svg {
    stroke: #ff4d4d !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 8px #ff4d4d); /* הילה אדומה */
}

/* FCA - פתוח (ירוק זרחני) */
.fca-active svg {
    stroke: #39ff14 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 8px #39ff14); /* הילה ירוקה */
}
/* המכולה שדואגת לפריסה מלאה */
.secondary-actions-row {
    display: flex;       /* הופך את התצוגה לגמישה */
    width: 100%;        /* תופס את כל רוחב הכרטיסייה */
    gap: 10px;          /* רווח נקי בין הכפתורים */
    justify-content: space-between; /* מחלק את הרווח ביניהם */
}

/* הגדרת הכפתורים עצמם */
.secondary-actions-row .btn-secondary {
    flex: 1;            /* זה החלק הקריטי: כל כפתור "נדחף" לתפוס מקום שווה */
    padding: 12px 5px;  /* הגדלתי מעט את הגובה שיהיה נח ללחיצה */
    background: #222;
    border: 1px solid #444;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;  /* טקסט מעט גדול יותר */
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

/* אפקט לחיצה קטן שירגיש טוב בטלפון */
.secondary-actions-row .btn-secondary:active {
    background: #333;
    transform: scale(0.95);
}
.net-item {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid #252525;
    transition: all 0.3s ease;
}

.net-icon svg {
    stroke: #444; /* כבוי כברירת מחדל */
    margin-left: 15px;
    transition: all 0.3s ease;
}

/* --- מצב ברירת מחדל לאייקונים (כבוי) --- */
.net-icon svg path { 
    stroke: #333; 
    transition: stroke 0.3s ease, filter 0.3s ease; 
}

/* --- LTE (סלולר) - צהוב/ירוק זרחני לפי רמות --- */

/* רמה 1: קו ראשון בלבד */
#lte-svg.signal-1 .bar-1 { stroke: var(--neon-yellow) !important; filter: drop-shadow(0 0 3px var(--neon-yellow)); }

/* רמה 2: שני קווים */
#lte-svg.signal-2 .bar-1, #lte-svg.signal-2 .bar-2 { stroke: var(--neon-yellow) !important; filter: drop-shadow(0 0 4px var(--neon-yellow)); }

/* רמה 3: שלושה קווים */
#lte-svg.signal-3 .bar-1, #lte-svg.signal-3 .bar-2, #lte-svg.signal-3 .bar-3 { 
    stroke: var(--neon-yellow) !important; 
    filter: drop-shadow(0 0 5px var(--neon-yellow)); 
}

/* רמה 4: ארבעה קווים */
#lte-svg.signal-4 .bar-1, #lte-svg.signal-4 .bar-2, #lte-svg.signal-4 .bar-3, #lte-svg.signal-4 .bar-4 { 
    stroke: var(--neon-yellow) !important; 
    filter: drop-shadow(0 0 6px var(--neon-yellow)); 
}

/* רמה 5: קליטה מלאה - כולם ירוק זרחני */
#lte-svg.signal-5 path { 
    stroke: #39ff14 !important; 
    filter: drop-shadow(0 0 8px #39ff14); 
}

/* --- Wi-Fi (ירוק זרחני) --- */
#net-wifi.active .net-icon svg path {
    stroke: var(--neon-green) !important;
    filter: drop-shadow(0 0 8px var(--neon-green));
}

/* --- Bluetooth (כחול זרחני) --- */
#net-ble.active .net-icon svg path {
    stroke: #00d4ff !important;
    filter: drop-shadow(0 0 8px #00d4ff);
}

.net-label { font-size: 0.8rem; color: #888; display: block; }
.net-value { font-size: 0.95rem; font-weight: bold; color: #fff; 
}
.config-select,
.config-input {
    width: 100%;
    box-sizing: border-box;
    background: #252525;
    border: 1px solid #444;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.check-item {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.check-item input { margin-left: 10px; }

/* עיצוב הסוויץ' (Toggle) */
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-blue); }
input:checked + .slider:before { transform: translateX(24px); }
/* כבוי כברירת מחדל */
.tab-content {
    display: none;
}

/* מוצג רק כשיש לו את הקלאס active */
.tab-content.active {
    display: block;
}

/* עיצוב הכפתור הפעיל למעלה */
.tab-btn.active {
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
    font-weight: bold;
}
.user-item-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
}

.user-main-info {
    display: flex;
    flex-direction: column;
}

.user-name-text {
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
}

.user-phone-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: monospace;
}

.badge {
    background: rgba(0, 123, 255, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.delete-user-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    filter: grayscale(1);
    transition: 0.2s;
}

.delete-user-btn:hover { filter: grayscale(0); transform: scale(1.1); }
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid var(--accent-blue);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 30px rgba(0, 123, 255, 0.3);
}

.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-size: 0.85rem; color: #888; margin-bottom: 5px; }
.input-group input {
    width: 100%; background: #222; border: 1px solid #444; color: #fff;
    padding: 12px; border-radius: 10px; box-sizing: border-box;
}

.checkbox-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    background: #222; padding: 15px; border-radius: 10px; margin-top: 5px;
}

.check-container { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }

.modal-actions {
    display: flex; justify-content: space-between; margin-top: 25px;
}
.admin-badge {
    background: var(--accent-blue);
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.admin-border {
    border-right: 4px solid var(--accent-blue) !important;
}
.led-power,
.led-offline {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.led-power {
    background-color: #00ff66;
    box-shadow: 0 0 8px #00ff66;
    animation: pulse-green 2s infinite;
}

.led-offline {
    background-color: #ff4d4d;
    box-shadow: 0 0 4px rgba(255, 77, 77, 0.6);
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 5px #39ff14; opacity: 0.7; }
    50% { transform: scale(1.1); box-shadow: 0 0 15px #39ff14; opacity: 1; }
    100% { transform: scale(0.95); box-shadow: 0 0 5px #39ff14; opacity: 0.7; }
}

.power-status-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(57, 255, 20, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(57, 255, 20, 0.2);
}

/* Toast notification */
#settings-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
    white-space: nowrap;
}
#settings-toast.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
#settings-toast.toast-success {
    background: rgba(0,200,80,0.15);
    border: 1px solid rgba(0,200,80,0.5);
    color: #00c850;
}
#settings-toast.toast-error {
    background: rgba(255,77,77,0.15);
    border: 1px solid rgba(255,77,77,0.5);
    color: #ff4d4d;
}

#alert-banner {
    background: rgba(255,32,32,0.12);
    border: 1px solid rgba(255,32,32,0.4);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
}
.alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,32,32,0.15);
    transition: background 0.2s;
}
.alert-row:last-child { border-bottom: none; }
.alert-row:active { background: rgba(255,32,32,0.2); }
.alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-text { flex: 1; color: #ff4444; font-size: 0.9rem; font-weight: 600; }
.alert-chips { display: flex; gap: 4px; flex-wrap: wrap; }

/* לוח זמנים */
.schedules-list-container { display: flex; flex-direction: column; gap: 12px; }
.sched-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 14px;
    transition: opacity 0.2s;
}
.sched-disabled { opacity: 0.45; }
.sched-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.sched-name { font-weight: 700; font-size: 0.95rem; }
.sched-days { display: flex; gap: 5px; margin-bottom: 8px; }
.sched-day {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #333;
    color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.sched-day.active { background: var(--accent-blue); color: #fff; }
.sched-details { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-dim); }
.sched-cmd { background: rgba(0,123,255,0.15); color: var(--accent-blue); padding: 2px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }

/* Modal labels and inputs */
.modal-label {
    display: block;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 600;
}
.modal-input {
    width: 100%;
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
}
.modal-input:focus { border-color: var(--accent-blue); }
.modal-input::placeholder { color: #555; }

.btn-scan {
    flex-shrink: 0;
    width: 44px; height: 44px;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 10px;
    color: var(--accent-blue);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
}
.btn-scan:active { background: #2a2a2a; }

/* BLE connect button on gate card */
.ble-btn {
    flex-shrink: 0;
    width: 32px; height: 32px;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    color: #666;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.ble-btn:active { background: #2a2a2a; }
.ble-btn.ble-connected {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(0, 123, 255, 0.12);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.35);
}

/* Settings screen */
.settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.15s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: rgba(255,255,255,0.05); }
.settings-row-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.settings-row-label { flex: 1; font-size: 0.95rem; color: #fff; }
.settings-row-arrow { color: #555; font-size: 1.3rem; }

/* time picker inside schedule modal */
.time-picker-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; direction: ltr; }
.time-sel {
    flex: 1;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 1.1rem;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}
.time-colon { font-size: 1.4rem; font-weight: 700; color: var(--text-dim); flex-shrink: 0; }

/* Gate state drawing (replaces the arc gauge): closed = red, open = green, fault = orange */
.gate-visual {
  --c: #777;
  max-width: 300px;
  margin: 6px auto 0;
}
.gate-visual.closed  { --c: #ff4d4d; }
.gate-visual.open    { --c: #39ff14; }
.gate-visual.partial { --c: #fff200; }
.gate-visual.moving  { --c: #3b9bff; }
.gate-visual.fault   { --c: #ff8a1f; }

.gate-svg { width: 100%; height: auto; display: block; overflow: hidden; }
.gv-ground { stroke: #333; stroke-width: 2; }
.gv-post { fill: #1a1a1a; stroke: #3a3a3a; stroke-width: 2; }
.gv-leaf { transition: transform 0.8s ease; }
.gv-leaf-body { fill: var(--c); fill-opacity: 0.15; stroke: var(--c); stroke-width: 2.5; transition: stroke 0.4s, fill 0.4s; }
.gv-bars { stroke: var(--c); stroke-width: 2; opacity: 0.6; transition: stroke 0.4s; }
.gate-visual.moving .gv-leaf-body,
.gate-visual.fault .gv-leaf-body { animation: gv-pulse 1s ease-in-out infinite; }
@keyframes gv-pulse { 50% { fill-opacity: 0.4; } }

.gate-state-text {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c);
  text-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
  transition: color 0.4s;
}

.limit-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.limit-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #333;
  border-radius: 20px;
  background: #121212;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.limit-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #444;
  transition: background 0.3s, box-shadow 0.3s;
}
.limit-pill.on { color: #fff; }
.limit-pill.lim-close.on .limit-dot { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.limit-pill.lim-open.on .limit-dot  { background: #39ff14; box-shadow: 0 0 8px #39ff14; }

/* Log mode toggle (live / history) */
.log-mode-btn { opacity: 0.6; }
.log-mode-btn.active { opacity: 1; border-color: var(--accent-blue); color: var(--accent-blue); }

/* History filter chips */
#hist-chips .btn-secondary.active { border-color: var(--accent-blue); color: var(--accent-blue); }