:root {
    --primary: #4a90a4;
    --primary-dark: #357a8a;
    --bg: #1a1a2e;
    --surface: #16213e;
    --text: #eee;
    --text-muted: #aaa;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --highlight: rgba(74, 144, 164, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
}

/* Header with player selector and nav */
.app-header {
    background: var(--surface);
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-selector {
    flex: 1;
    min-width: 0;
}

.player-dropdown {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
}

.player-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

.header-nav {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.8rem;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: rgba(255,255,255,0.1);
}

.app-main {
    flex: 1;
    padding: 1rem;
}

.app-version {
    text-align: right;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #999;
}

/* Tables */
.ranking-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.ranking-table th,
.ranking-table td,
.admin-table th,
.admin-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ranking-table th,
.admin-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Messages */
.message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.message.error {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.message.warning {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
}

.message.info {
    background: rgba(74, 144, 164, 0.2);
    color: var(--primary);
}

/* Admin sections */
.admin-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.admin-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

h2, h3 {
    margin-bottom: 1rem;
}

/* Current player display in forms */
.current-player {
    background: var(--surface);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.player-label {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.player-value {
    font-weight: 600;
}

/* Current best display */
.current-best-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(74, 144, 164, 0.1);
    border-radius: 4px;
}

/* Score entry feedback */
.ranking-result {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.ranking-result h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.ranking-result h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.ranking-result p {
    margin: 0.25rem 0;
}

.position-change {
    font-weight: 500;
}

.position-change.up {
    color: var(--success);
}

/* Neighbors table */
.neighbors-section {
    margin-top: 1rem;
}

.neighbors-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.neighbors-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.neighbors-table .position {
    width: 2.5rem;
    font-weight: 600;
}

.neighbors-table .player {
    font-weight: 500;
}

.neighbors-table .score {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.neighbors-table .gap {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.neighbors-table .current-player-row {
    background: var(--highlight);
}

.neighbors-table .current-player-row td {
    font-weight: 600;
}

/* Next target */
.next-target {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--warning);
}

.next-target.champion {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: #ffd700;
}

/* Confirmation dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.dialog {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
}

.dialog h3 {
    margin-bottom: 1rem;
}

.dialog p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.dialog .error-text {
    color: var(--error);
    font-weight: 500;
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.dialog-buttons .btn-primary,
.dialog-buttons .btn-secondary {
    margin-top: 0;
}

.dialog-buttons .btn-primary.selected,
.dialog-buttons .btn-secondary.selected {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.dialog-overlay:focus {
    outline: none;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Ranking tables */
.ranking-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ranking-header h3 {
    margin: 0;
    flex: 1;
}

/* Active toggle button */
.active-toggle {
    flex-shrink: 0;
}

.btn-toggle {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-toggle.active {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.btn-toggle.inactive {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.btn-toggle:hover {
    filter: brightness(1.2);
}

.btn-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Inactive banner */
.inactive-banner {
    margin-bottom: 1rem;
}

.inactive-banner p {
    margin: 0;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
}

.badge.inactive {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.no-results {
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem 0;
}

.ranking-table .position {
    font-weight: 600;
    width: 2.5rem;
    text-align: left;
}

.ranking-table .score {
    font-family: 'Courier New', monospace;
    text-align: right;
}

.ranking-table .ranking-points {
    text-align: right;
    font-weight: 600;
    width: 3.5rem;
}

.ranking-table .date {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
}

.player-tag {
    font-weight: 600;
    margin-right: 0.5rem;
}

.player-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Top 3 highlighting */
.rank-gold td:first-child {
    color: #ffd700;
}

.rank-silver td:first-child {
    color: #c0c0c0;
}

.rank-bronze td:first-child {
    color: #cd7f32;
}

.rank-gold .player-tag,
.rank-silver .player-tag,
.rank-bronze .player-tag {
    color: var(--text);
}

/* Selected player row highlighting */
.selected-player-row {
    background: var(--highlight) !important;
}

.selected-player-row td {
    font-weight: 600;
}

/* Selected machine row highlighting */
.selected-machine-row {
    background: var(--highlight) !important;
}

.selected-machine-row td {
    font-weight: 600;
}

/* Overall ranking */
.ranking-info {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.ranking-table .total-points {
    font-weight: 600;
    text-align: right;
}

.ranking-table .machine-count {
    color: var(--text-muted);
    text-align: right;
}

/* Player scores page */
.player-summary {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.player-summary h3 {
    margin-bottom: 0.5rem;
}

.summary-stats {
    color: var(--text-muted);
}

.stat-separator {
    margin: 0 0.5rem;
}

.scores-table .machine-name {
    font-weight: 500;
    text-align: left;
}

.scores-table .ranking-points {
    text-align: right;
    color: var(--primary);
    font-weight: 500;
}

.scores-table .active-status {
    text-align: center;
}

.inactive-row {
    opacity: 0.6;
}

.inactive-row .active-status {
    color: var(--error);
}

.table-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: var(--text);
}

.sortable::after {
    content: ' ↕';
    opacity: 0.3;
}

.sortable.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

.sortable.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

/* Inactive option in dropdown */
.inactive-option {
    color: var(--text-muted);
}

/* Login page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-card h1 {
    margin-bottom: 2rem;
    color: var(--primary);
}

.login-form {
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.3em;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-form input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0.2em;
}

.login-button {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.login-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.login-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Login page - Email OTP styles */
.login-form input[type="email"] {
    font-size: 1rem;
    letter-spacing: normal;
    text-align: left;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

.login-divider span {
    padding: 0 1rem;
}

.secondary-button {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-button:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pin-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.email-hint {
    text-align: center;
    margin-top: 1.5rem;
}

.otp-info {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.otp-info strong {
    color: var(--text);
}

.text-button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    transition: color 0.2s;
}

.text-button:hover:not(:disabled) {
    color: var(--primary-dark);
    text-decoration: underline;
}

.text-button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.resend-section {
    text-align: center;
    margin-top: 1.5rem;
}

.resend-section p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.back-button {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

.info-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 1rem;
    text-align: center;
}

.success-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--success);
    text-align: center;
    margin-bottom: 0.5rem;
}

.skip-button {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.skip-button:hover:not(:disabled) {
    color: var(--text);
}

/* Email reminder banner */
.email-reminder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 152, 0, 0.15);
    border-bottom: 1px solid rgba(255, 152, 0, 0.3);
    font-size: 0.9rem;
}

.email-reminder span {
    color: var(--text);
}

.reminder-link {
    color: var(--warning);
    font-weight: 600;
    text-decoration: none;
}

.reminder-link:hover {
    text-decoration: underline;
}

.reminder-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.reminder-dismiss:hover {
    color: var(--text);
}

@media (max-width: 500px) {
    .email-reminder {
        flex-wrap: wrap;
        text-align: center;
        gap: 0.5rem;
    }
    
    .email-reminder span {
        flex: 1 1 100%;
    }
}

/* Hall selection page */
.hall-select-card {
    max-width: 400px;
}

.hall-select-info {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.hall-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hall-button {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.hall-button:hover:not(:disabled) {
    background: rgba(74, 144, 164, 0.2);
    border-color: var(--primary);
}

.hall-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Header with hall name and nav */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hall-name {
    font-weight: 600;
    color: var(--primary);
}

.user-name {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.header-right {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.header-button {
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.header-button:hover {
    background: rgba(255,255,255,0.2);
    color: var(--text);
}

.logout-button:hover {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

/* Loading container */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Mobile responsiveness */
/* Own scores section (when ranking didn't improve) */
.no-improvement {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Tab navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    margin: 1rem 0;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.tab-button {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-button:hover {
    color: var(--text-color);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Trophy column */
.trophy {
    width: 2rem;
    text-align: center;
}

.trophy-inline {
    margin-right: 0.25rem;
}

/* Ranking score row highlight */
.ranking-score-row {
    background: rgba(255, 193, 7, 0.1);
}

/* Delete button */
.delete-cell {
    width: 3rem;
    text-align: center;
}

.btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-delete:hover {
    opacity: 1;
}

/* Load more button */
.load-more {
    margin-top: 1rem;
    text-align: center;
}

/* Modal dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
}

.modal-dialog h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.modal-dialog .warning-text {
    color: var(--warning);
    font-size: 0.9rem;
}

.modal-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.own-scores-section {
    margin-top: 1rem;
}

.own-scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.own-scores-table th,
.own-scores-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.own-scores-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.own-scores-table .own-position {
    width: 3rem;
    font-weight: 600;
}

.own-scores-table .ranking-icon {
    width: 2rem;
    text-align: center;
}

.own-scores-table .score {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.own-scores-table .date {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.own-scores-table .just-submitted-row {
    background: var(--highlight);
}

.own-scores-table .just-submitted-row td {
    font-weight: 600;
}

@media (max-width: 500px) {
    .header-row {
        flex-wrap: wrap;
    }
    
    .header-left {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    .header-nav {
        flex: 1;
        justify-content: flex-start;
    }
    
    .header-right {
        flex-shrink: 0;
    }
    
    .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .player-name {
        display: none;
    }
    
    .hall-name {
        font-size: 0.9rem;
    }
    
    .user-name {
        font-size: 0.75rem;
    }
}

/* MachineSelector component */
.machine-selector {
    position: relative;
}

.machine-selector-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.machine-selector-input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}

.machine-selector-input:focus {
    outline: none;
    border-color: var(--primary);
}

.machine-selector-input::placeholder {
    color: var(--text-muted);
}

.machine-selector-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.machine-selector-clear,
.machine-selector-toggle {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.9rem;
    line-height: 1;
}

.machine-selector-clear:hover,
.machine-selector-toggle:hover {
    color: var(--text);
}

.machine-selector-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.machine-selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 200;
}

.machine-selector-option {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.1s;
}

.machine-selector-option:hover,
.machine-selector-option.highlighted {
    background: rgba(74, 144, 164, 0.3);
}

.machine-selector-option.selected {
    background: rgba(74, 144, 164, 0.2);
    font-weight: 600;
}

.machine-selector-no-results {
    padding: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.machine-selector.open .machine-selector-input {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
