/* ==========================================================================
   Linked Lamp — Web Interface Styles
   ==========================================================================
   Dark mode, glassmorphism, mobile-first design using Outfit font.
   ========================================================================== */

:root {
    --bg: #0d0f17;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-dim: #8b91a7;
    --accent: #6b4cff;
    --accent-glow: rgba(107, 76, 255, 0.35);
    --danger: #ff4757;
    --success: #2ed573;
    --nav-bg: rgba(13, 15, 23, 0.9);

    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --radius: 14px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* Hide scrollbar globally */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.desc {
    color: var(--text-dim);
    font-size: 0.82rem;
    line-height: 1.4;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    z-index: 10;
}

.app-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-dim);
    background: var(--bg-card);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #555;
    transition: var(--ease);
}

.dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.dot.partial {
    background: #ffa502;
    box-shadow: 0 0 8px #ffa502;
}

.dot.offline {
    background: var(--danger);
}

.dot.connecting {
    background: #777; /* Grey dot for connecting state */
}

.dot.mine-offline {
    background: #ff6b2e;
    box-shadow: 0 0 8px #ff6b2e;
}

/* --- Status Popup --- */
.status-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a1c28;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 200;
    animation: fadeSlideIn 0.2s ease forwards;
}

.status-popup-content h3 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-lamp-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.status-lamp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-green {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-dot-red {
    background: var(--danger);
}

.status-lamp-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text);
}

.status-lamp-label {
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* ==========================================================================
   Content Area / Views
   ========================================================================== */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1rem;
    scroll-behavior: smooth;
}

.view {
    display: none;
    animation: fadeSlideIn 0.35s ease forwards;
}

.view.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Partner View — Big Send Button
   ========================================================================== */
.main-action-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 36vh;
    padding: 2rem 0;
}

.pulse-button {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: none;
    font-family: var(--font);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(.175, .885, .32, 1.275), box-shadow 0.3s, color 0.3s;
}

.pulse-button .material-icons-round {
    font-size: 2.8rem;
    margin-bottom: 6px;
    transition: filter 0.3s;
}

.pulse-button .btn-text {
    font-weight: 600;
    font-size: 1rem;
    transition: text-shadow 0.3s;
}

/* Dynamic text colors overlayed on the button */
.pulse-button.light-text {
    color: #ffffff;
}

.pulse-button.light-text .material-icons-round {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.pulse-button.light-text .btn-text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.pulse-button.dark-text {
    color: #111111;
}

.pulse-button.dark-text .material-icons-round {
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.4));
}

.pulse-button.dark-text .btn-text {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.pulse-button:active {
    transform: scale(0.9);
}

.pulse-button::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.25s;
}

.pulse-button:active::after {
    opacity: 1;
}

.subtitle {
    margin-top: 1.2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: color 0.4s ease, opacity 0.3s ease;
}

.subtitle.receipt-pending {
    animation: subtlePulse 2s ease-in-out infinite;
}

.subtitle.receipt-confirmed {
    animation: none;
}

@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==========================================================================
   Presets Grid
   ========================================================================== */
.presets-section {
    margin-top: 0.5rem;
}

.presets-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

.preset-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    height: 52px;
    position: relative;
    overflow: hidden;
    transition: var(--ease);
}

.preset-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--preset-color, #888);
    border-radius: var(--radius) 0 0 var(--radius);
}

.preset-btn:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.08);
}

.preset-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.preset-edit-icon {
    font-size: 15px;
    color: var(--text-dim);
    margin-left: 4px;
}

.preset-btn.add-new {
    justify-content: center;
    border: 1px dashed var(--text-dim);
    color: var(--text-dim);
}

.preset-btn.add-new::before {
    display: none;
}

.preset-btn.add-new .material-icons-round {
    font-size: 1.5rem;
}

/* ==========================================================================
   Settings Cards
   ========================================================================== */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.settings-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.setting-val {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 50px;
    text-align: right;
}

/* --- Range Slider --- */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 8px 0 4px;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.custom-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
    border: none;
}

/* --- Color Wheel --- */
.color-wheel-wrapper {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

.selected-color-preview {
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 1px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    transition: .35s;
    border-radius: 26px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .35s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background: var(--accent);
}

input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

.night-mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expandable-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    animation: fadeSlideIn 0.3s;
}

/* --- Time Pickers --- */
.time-row {
    display: flex;
    gap: 12px;
}

.time-block {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.time-block label {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

input[type="time"] {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1rem;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* --- Timezone Select --- */
.timezone-select {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    min-width: 140px;
}

.timezone-select option {
    background: #1a1a2e;
    color: #fff;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.action-btn {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--ease);
}

.action-btn.primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.action-btn.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.action-btn.outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.action-btn:active {
    transform: scale(0.97);
}

/* ==========================================================================
   Full-Screen Modal (Presets)
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    inset: 0;
    background: var(--bg);
}

.fullscreen-modal {
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text);
    display: flex;
    padding: 4px;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.preset-name-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1.05rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.preset-name-input:focus {
    border-color: var(--accent);
}

.preset-modal-actions {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* ==========================================================================
   Time Picker Modal (Clock UI)
   ========================================================================== */
.timepicker-modal {
    background: #1a1a24;
    width: 320px;
    border-radius: 20px;
    padding: 24px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.timepicker-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 24px;
    color: var(--text-dim);
}

.tp-part {
    cursor: pointer;
    border-radius: 8px;
    padding: 0 8px;
    transition: color 0.2s, background 0.2s;
}

.tp-part.active {
    color: var(--accent);
    background: rgba(107, 76, 255, 0.15);
}

.tp-ampm {
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    font-weight: 600;
    margin-left: 8px;
}

.am-pm-btn {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-dim);
    transition: var(--ease);
}

.am-pm-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.clock-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.clock-face {
    width: 240px;
    height: 240px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.clock-center {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 38%;
    background: var(--accent);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    pointer-events: none;
}

.clock-hand::after {
    content: '';
    position: absolute;
    top: -14px;
    left: -14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
}

.clock-number {
    position: absolute;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--text);
    cursor: pointer;
    transform: translate(-50%, -50%);
    /* Base translation applied before top/left */
    transition: background 0.2s, color 0.2s;
    user-select: none;
    z-index: 20;
}

.clock-number:hover {
    background: rgba(255, 255, 255, 0.1);
}

.clock-number.active {
    color: white;
}

.time-display {
    font-size: 1.2rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    transition: border 0.2s;
}

.time-block:active .time-display {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.primary-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    border: none;
    font-weight: 600;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: none;
    font-weight: 600;
}

.danger-btn {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-weight: 600;
}

/* ==========================================================================
   Bottom Navigation
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 50;
    max-width: 480px;
    margin: 0 auto;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item .material-icons-round {
    font-size: 1.4rem;
    margin-bottom: 1px;
}

.nav-item span:not(.material-icons-round) {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--accent);
}

/* ==========================================================================
   Rotary Dial (Duration Picker)
   ========================================================================== */
.dial-container {
    width: 240px;
    height: 240px;
    margin: 20px auto;
    position: relative;
    background: radial-gradient(circle, #2a2d35 0%, #17191e 100%);
    border-radius: 50%;
    box-shadow: inset 0 6px 15px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(255, 255, 255, 0.03);
}

.dial-svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg); /* JS handles rotation logically */
    overflow: visible;
}

.dial-track {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.05); /* Faint background track */
    stroke-width: 12;
}

.dial-progress {
    fill: transparent;
    stroke: var(--accent);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dasharray 0.05s linear;
    filter: drop-shadow(0 0 10px rgba(107, 76, 255, 0.8)); /* Subtle purple glow */
}

.dial-knob {
    fill: #ffffff;
    stroke: var(--accent);
    stroke-width: 4;
    cursor: grab;
    transition: cx 0.05s linear, cy 0.05s linear;
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
}

.dial-knob:hover {
    fill: #f5f5f5;
    transform: scale(1.05);
    transform-origin: center;
}

.dial-knob:active {
    cursor: grabbing;
    fill: #e8e8e8;
}

/* ==========================================================================
   Color Cycle Preset — Mode Toggle (Segmented Control)
   ========================================================================== */
.cycle-mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.cycle-mode-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.cycle-mode-btn .material-icons-round {
    font-size: 1rem;
}

.cycle-mode-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ==========================================================================
   Color Cycle Preset — Color Entry List
   ========================================================================== */
.cycle-colors-section {
    display: none;
}

.cycle-colors-section.visible {
    display: block;
    animation: fadeSlideIn 0.3s ease forwards;
}

.color-entry-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 4px;
}

.color-entry {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    position: relative;
    transition: var(--ease);
}

.color-entry.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 2px 12px var(--accent-glow);
}

.color-entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.color-entry-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.color-entry-dot:hover {
    transform: scale(1.1);
}

.color-entry.selected .color-entry-dot {
    border-color: var(--accent);
}

.color-entry-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.color-entry-hex {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: monospace;
    opacity: 0.7;
}

.color-entry-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px;
    display: flex;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.color-entry-remove:hover {
    opacity: 1;
    color: var(--danger);
}

.color-entry-durations {
    display: flex;
    gap: 8px;
}

.duration-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.duration-field label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duration-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    gap: 4px;
}

.duration-input-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    text-align: left;
    -moz-appearance: textfield;
}

.duration-input-wrap input::-webkit-outer-spin-button,
.duration-input-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.duration-input-wrap .unit {
    font-size: 0.75rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* Add Color Button */
.btn-add-color {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed var(--text-dim);
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--ease);
    margin-bottom: 1rem;
}

.btn-add-color:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-add-color .material-icons-round {
    font-size: 1.1rem;
}

/* ==========================================================================
   Preset Button — Multi-Dot Indicator (for cycle presets)
   ========================================================================== */
.preset-color-dots {
    display: flex;
    gap: 4px;
    margin-left: auto;
    align-items: center;
    flex-shrink: 0;
}

.preset-color-dots .mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.preset-color-dots .dots-overflow {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-left: 1px;
}

/* Cycle icon on preset button */
.preset-cycle-icon {
    font-size: 13px !important;
    color: var(--text-dim);
    margin-right: 2px;
    opacity: 0.6;
}

/* ==========================================================================
   PWA Install Prompt Overlay
   ========================================================================== */
.pwa-install-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(13, 15, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeSlideIn 0.35s ease forwards;
}

.pwa-install-content {
    max-width: 360px;
    padding: 40px 30px;
    text-align: center;
}

.pwa-install-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(107, 76, 255, 0.12);
    border: 1px solid rgba(107, 76, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.pwa-install-content h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.pwa-instructions {
    text-align: left;
    margin: 20px 0;
}

.pwa-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.pwa-step:last-child {
    border-bottom: none;
}

.pwa-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-step > span:last-child {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    padding-top: 3px;
}

.pwa-dismiss-link a {
    transition: color 0.2s;
}

.pwa-dismiss-link a:hover {
    color: var(--text) !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   Account Switcher Modal
   ========================================================================== */
.account-switcher-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--ease);
}

.account-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.account-item.active {
    border-color: var(--accent);
    background: rgba(107, 76, 255, 0.08);
    box-shadow: 0 0 0 1px var(--accent), 0 2px 12px var(--accent-glow);
    cursor: default;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.account-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.account-badge {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-delete-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    transition: var(--ease);
    opacity: 0.5;
}

.account-delete-btn:hover {
    opacity: 1;
    color: var(--danger);
    background: rgba(255, 71, 87, 0.1);
}

/* ==========================================================================
   UID Input Modal
   ========================================================================== */
.uid-input-modal {
    animation: fadeSlideIn 0.35s ease forwards;
}