/* LOCATION MASTER - App Pages CSS (app, billing, settings, profile, records, etc.) */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    touch-action: manipulation;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    font-size: 0.9em;
}

.bold { font-weight: 700 !important; }
.light { font-weight: 300 !important; }

/* ─── Header (dark green, fixed) ─────────────────────────── */
header {
    background: #1a2a3e;
    color: white;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    width: 100%;
}

.header-inner,
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    text-decoration: none;
    letter-spacing: .06em;
    display: flex;
    align-items: center;
    height: 60px;
}

.logo span { color: #2d7dd2; margin-left: 0.3em; }

/* Navigation */
nav { margin-left: auto; }

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

nav a:hover,
nav a.active { color: #2d7dd2; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    z-index: 2001;
}

.mobile-only { display: none; }

/* Nav icon */
.nav-icon { display: inline; font-size: 1.1em; vertical-align: middle; }
.nav-text { display: none; vertical-align: middle; margin-left: 6px; }

/* ─── Main Content ────────────────────────────────────────── */
main {
    margin-top: 60px;
    position: relative;
    width: 100%;
    padding: 30px 0 80px 0;
    min-height: calc(100vh - 120px);
}

/* Content pages: constrain width and center */
main > h1,
main > .subtitle,
main > .content {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

main > .subtitle {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 2em;
}

/* Map page: body背景を暗くして地図の隙間を目立たなくする */
body:has(#app-container) {
    background: #1a1a2e;
}

/* Map page override — only when #app-container present */
main:has(#app-container) {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100dvh - 60px - env(safe-area-inset-bottom, 0px));
}

/* Page content (billing, settings, profile, records) */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2em 1em;
    width: 100%;
}

h1 {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.8em;
    font-weight: 800;
    margin-bottom: 0.1em;
    text-align: center;
    letter-spacing: .06em;
    color: #1a2a3e;
}

h1 span.light,
h1 span:not(.bold) {
    color: #2d7dd2;
    font-weight: 400;
}

h2 {
    color: #1a2a3e;
    margin-bottom: 1.5em;
}

.content {
    background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
    padding: 2px 45px 40px 45px !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    font-size: 0.95em;
}

.mission-section {
    margin-bottom: 2em;
    text-align: center;
    padding-top: 1.5em;
}

.mission-section h2 {
    text-align: center;
    padding-left: 0;
    margin-top: 0 !important;
    margin-bottom: 1em !important;
}

.subtitle::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2d7dd2, #6bb5e8);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ─── Map Section ─────────────────────────────────────────── */
.map-section {
    flex: 1;
    position: relative;
    background: white;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
}

/* GPS Status Overlay */
.gps-status-overlay {
    position: fixed;
    top: 65px;
    right: 10px;
    width: auto;
    height: 36px;
    border-radius: 20px;
    padding: 0 12px;
    gap: 8px;
    background: #2d7dd2;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
}

.gps-status-overlay.active-good { background: #4CAF50; }
.gps-status-overlay.active-bad  { background: #FFB300; }

.gps-status-overlay .material-icons {
    font-size: 22px;
    color: white;
}

#gpsStatusText {
    font-size: 0.62em;
    font-weight: 700;
    color: white;
    line-height: 1;
    text-align: center;
}

#gpsClockText {
    display: block;
    font-size: 0.85em;
    font-weight: 700;
    color: white;
    letter-spacing: 0.03em;
}

.gps-reload-btn {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: white;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}
.gps-reload-btn .material-icons { font-size: 18px; color: white; }

/* ─── Control Section ─────────────────────────────────────── */
.control-section {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    display: flex;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-record,
.btn-save {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #1a2a3e;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 46, 30, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover { background: #e9ecef; }

.btn-record {
    flex: 2;
    background: #2d7dd2;
    color: white;
    font-size: 1.1em;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-record:active { background: #d63850; }

.btn-save {
    flex: 1;
    background: #1a2a3e;
    color: white;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-save:active:not(:disabled) { background: #1e3a5f; }

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Hunt Master specific buttons */
.btn-hunt {
    flex: 0.6;
    background: #1a2a3e;
    color: white;
    font-size: 1.1em;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-hunt.hunting { background: #2d7dd2; }

.btn-hunt.hunting::after {
    content: '\A(長押しして停止)';
    white-space: pre;
    font-size: 0.7em;
    display: block;
    margin-top: 4px;
}

.btn-hunt:active:not(.hunting) { background: #1e3a5f; }

.btn-catch {
    flex: 1.4;
    background: #16213E;
    color: white;
    font-size: 1.1em;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-catch:disabled { background: #ccc; cursor: not-allowed; }
.btn-catch:active:not(:disabled) { background: #1a2a3e; }

.btn-sighting {
    background: #1a2a3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s;
}

.btn-sighting:hover { background: #1e3a5f; }

.btn-current-location {
    position: fixed;
    bottom: 125px;
    right: 10px;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 1.5em;
    z-index: 1500;
    transition: all 0.3s;
}

.btn-current-location:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-current-location:active { transform: scale(0.95); }

/* Small buttons */
.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-edit { background: #FF9800; color: white; }
.btn-edit:hover { background: #F57C00; }

.btn-nav { background: #4CAF50; color: white; }
.btn-nav:hover { background: #45a049; }

.btn-load { background: #1a2a3e; color: white; }
.btn-load:hover { background: #1e3a5f; }

.btn-delete { background: #2d7dd2; color: white; }
.btn-delete:hover { background: #d63850; }

/* ─── Modal ───────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 60px;
    overflow-y: auto;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    padding: 1.5em;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content-wide { max-width: 800px; }

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1em;
    color: #1a2a3e;
    flex-shrink: 0;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 1em;
}

.modal-buttons {
    display: flex;
    gap: 1em;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-top: 1em;
}

/* ─── Route List ──────────────────────────────────────────── */
#routeList {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1em;
}

.route-item {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 0.5em;
}

.route-item-info { flex: 1; }
.route-item-name { font-weight: 600; color: #1a2a3e; margin-bottom: 0.3em; }
.route-item-details { font-size: 0.85em; color: #666; margin-bottom: 0.5em; }

.route-item-actions {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    font-size: 0.9em;
}

/* Edit Stop */
.edit-stop-item {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 0.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-stop-info { flex: 1; font-size: 0.9em; }

#editStopsList {
    overflow-y: auto;
    margin-bottom: 1em;
    padding-bottom: 150px;
    -webkit-overflow-scrolling: touch;
}

#editMapContainer { touch-action: pan-x pan-y; }

/* ─── Form Styles ─────────────────────────────────────────── */
.form-group { margin-bottom: 0.8em; }

.form-group label {
    display: block;
    margin-bottom: 0.3em;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a2a3e;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #1a2a3e;
}

/* ─── Records List ────────────────────────────────────────── */
.record-item {
    background: #f8f9fa;
    padding: 1.5em;
    border-radius: 8px;
    margin-bottom: 1em;
    border-left: 4px solid #1a2a3e;
}

.record-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.record-item-header h3 { margin: 0; color: #1a2a3e; font-size: 1.1em; }
.record-duration { color: #666; font-size: 0.9em; }

.record-item-details {
    display: flex;
    gap: 1.5em;
    margin-bottom: 1em;
    font-size: 0.9em;
    color: #666;
}

.record-item-actions { display: flex; gap: 0.5em; }

/* Record Cards */
.record-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.record-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

.record-header h3 { margin: 0; font-size: 1.1em; color: #1a2a3e; }
.record-body p { margin: 0.5em 0; color: #666; font-size: 0.95em; }

/* ─── Sighting ────────────────────────────────────────────── */
.sighting-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.sighting-row select {
    padding: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: 500;
}

.sighting-row input[type="text"] {
    padding: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.3em;
    grid-column: 1;
}

.sighting-row input[type="number"] {
    padding: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.3em;
    text-align: center;
    font-weight: 600;
    grid-column: 2;
}

.sighting-row .sighting-count-select { grid-column: 2; }
.sighting-row .sighting-count-manual { grid-column: 2; }

.sighting-row button {
    padding: 18px 20px;
    background: #2d7dd2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5em;
    font-weight: bold;
    grid-column: 3;
}

/* ─── Footer (dark, fixed) ────────────────────────────────── */
footer {
    background: #1a2a3e;
    color: white;
    height: 60px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover { color: #6bb5e8; }

.copyright { color: #6b7280; font-size: 0.7rem; }
.copyright a { color: #6b7280; text-decoration: none; transition: color 0.3s; }
.copyright a:hover { color: #999; }

/* ─── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    .nav-text { display: inline; }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a2a3e;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    nav ul.show { display: flex; }
    .mobile-only { display: block; }

    main { padding: 0; }

    #app-container { padding: 0; }

    .route-actions { flex-direction: column; }

    .btn-primary,
    .btn-secondary { width: 100%; }

    .footer-container {
        padding: 0 15px !important;
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
    }

    .footer-links { display: none; }
    .copyright { text-align: center; }

    .btn-sighting {
        right: 60px;
        padding: 6px 12px;
        font-size: 0.85em;
    }
}


/* === LOCATION MASTER map/modal additions === */
.pin-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    position: absolute;
    right: 146px;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 4px;
    display: none;
}

.pin-btn .material-icons {
    font-size: 22px;
    color: white;
}

.pin-btn + .pin-btn {
    right: 108px;
}

.pin-btn + .pin-btn + .pin-btn {
    right: 70px;
}

.pin-btn:active {
    color: #E94560;
}

.mobile-only {
    display: none;
}

/* Main Content */

#app-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100dvh - 60px - env(safe-area-inset-bottom, 0px));
}

/* Map Section */
.map-section {
    flex: 1;
    position: relative;
    background: white;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
}

.gps-status-overlay {
    position: fixed;
    top: 71px;
    right: 10px;
    width: auto;
    height: 36px;
    border-radius: 20px;
    padding: 0 12px;
    gap: 8px;
    background: #E94560;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
}

.gps-status-overlay.active-good { background: #4CAF50; }
.gps-status-overlay.active-bad  { background: #FFB300; }

.gps-status-overlay .material-icons {
    font-size: 22px;
    color: white;
}

#gpsStatusText {
    font-size: 0.62em;
    font-weight: 700;
    color: white;
    line-height: 1;
    text-align: center;
}

/* Material Icons sizing in map buttons */
.btn-toggle-points .material-icons,
.landmark-filter-btn .material-icons {
    font-size: 22px;
    color: white !important;
}

.btn-center-location .material-icons,
.btn-map-search .material-icons,
.btn-voice-search .material-icons {
    font-size: 33px;
    color: white !important;
}

.btn-center-location {
    position: fixed;
    bottom: 18px;
    right: 10px;
    width: 66px;
    height: 66px;
    background: #1a2a3e;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    line-height: 1;
    transition: bottom 0.25s ease;
}

.btn-center-location:active {
    background: #1e3a5f;
}

.btn-center-location.follow-active {
    background: #2d7dd2;
    color: white;
}

.btn-center-location.follow-active:active {
    background: #1e5fa0;
}

body.recording-mode .btn-center-location {
    bottom: 103px;
}


.btn-toggle-points {
    position: fixed;
    bottom: 92px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: #1a2a3e;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    line-height: 1;
    opacity: 1;
    transition: opacity 0.2s, bottom 0.25s ease;
}

.btn-toggle-points.hidden {
    opacity: 0.35;
}

.btn-toggle-points:active {
    background: #1e3a5f;
}

body.recording-mode .btn-toggle-points {
    bottom: 177px;
}

.btn-add-landmark {
    position: fixed;
    bottom: 92px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: #1a2a3e;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    line-height: 1;
    transition: bottom 0.25s ease;
}

.btn-add-landmark:active {
    background: #1e3a5f;
}

body.recording-mode .btn-add-landmark {
    bottom: 177px;
}

.btn-busstop-toggle {
    position: fixed;
    bottom: 248px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: #1a2a3e;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    line-height: 1;
    transition: background 0.2s, bottom 0.25s ease;
}
.btn-busstop-toggle.active {
    background: #f97316;
}
.btn-busstop-toggle:active {
    background: #1e3a5f;
}
body.recording-mode .btn-busstop-toggle {
    bottom: 333px;
}

#btnYomiList {
    position: fixed;
    bottom: 144px;
    right: 10px;
    z-index: 1500;
    transition: bottom 0.25s ease;
}

body.recording-mode #btnYomiList {
    bottom: 229px;
}

.landmark-filter-btn {
    width: 44px;
    height: 44px;
    background: #1a2a3e;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    line-height: 1;
}

.landmark-filter-btn:active {
    background: #1e3a5f;
}

#landmarkFilterDot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.landmark-filter-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: #1a2a3e;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    padding: 0.4em 0;
    min-width: 160px;
    max-height: 320px;
    overflow-y: auto;
}

.landmark-filter-menu button {
    display: block;
    width: 100%;
    padding: 0.45em 1em;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
    color: white;
}

.landmark-filter-menu button.active {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.landmark-label {
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

.landmark-list-header {
    font-size: 0.75em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.6em 0.5em 0.25em;
    margin-top: 0.4em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.03em;
}
.landmark-list-header:first-child {
    margin-top: 0;
}

/* Control Section */
.btn-cancel-record {
    background: #E94560;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1em;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}
.btn-cancel-record:active {
    background: #d63850;
}

/* Map Search */
.map-search-wrapper {
    position: fixed;
    top: 71px;
    left: 10px;
    z-index: 1500;
    display: flex;
    align-items: center;
}

.btn-map-search {
    width: 66px;
    height: 66px;
    background: #1a2a3e;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    transition: border-radius 0.25s ease;
}

.map-search-input {
    width: 0;
    padding: 0;
    height: 66px;
    border: none;
    outline: none;
    font-size: 1rem;
    background: #1a2a3e;
    color: white;
    border-radius: 0;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    transition: width 0.25s ease, padding 0.25s ease;
    overflow: hidden;
}

.btn-voice-search {
    width: 0;
    height: 66px;
    background: #1a2a3e;
    border: none;
    border-radius: 0 33px 33px 0;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.25s ease;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.map-search-wrapper.expanded .btn-voice-search {
    width: 66px;
}

.btn-voice-search.listening {
    color: #E94560;
    animation: mic-pulse 1s ease-in-out infinite;
}

.map-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.map-search-wrapper.expanded .btn-map-search {
    border-radius: 33px 0 0 33px;
}

.map-search-wrapper.expanded .map-search-input {
    width: 200px;
    padding: 0 14px;
}


/* Search Results Dropdown */
.search-results-list {
    position: absolute;
    top: 44px;
    left: 0;
    width: 288px;
    background: #1a2a3e;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1600;
    max-height: 220px;
    overflow-y: auto;
}

.search-result-item {
    padding: 14px 16px;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
    color: white;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.search-result-item.no-result {
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.control-section {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    display: flex;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-record,
.btn-save {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #1a2a3e;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.4);
}

.btn-secondary {
    background: #E94560;
    color: white;
}

.btn-secondary:hover {
    background: #d63850;
}

.btn-record {
    flex: 2;
    background: #E94560;
    color: white;
    font-size: 1.1em;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.btn-record .record-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.3);
    transition: none;
    pointer-events: none;
}

.btn-record.holding .record-progress {
    width: 100%;
    transition: width 1s linear;
}

.btn-record:active {
    background: #d63850;
}

.btn-save {
    flex: 1;
    background: #1a2a3e;
    color: white;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-save:active:not(:disabled) {
    background: #2a2a3e;
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a2a3e;
    color: white;
    padding: 2em;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    margin-bottom: 80px;
}

.modal-content-wide {
    max-width: 800px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1em;
    color: white;
    flex-shrink: 0;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 1em;
    background: #1a2a3e;
    color: white;
}

.modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-with-mic {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.5em;
}

.input-with-mic input {
    flex: 1;
    width: auto !important;
    min-width: 0;
    margin-bottom: 0 !important;
}

.btn-mic {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-mic .material-icons {
    font-size: 20px;
}

.btn-mic.listening {
    background: #E94560;
    border-color: #E94560;
    animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233,69,96,0.6); }
    50%       { box-shadow: 0 0 0 8px rgba(233,69,96,0); }
}

.modal-buttons {
    display: flex;
    gap: 1em;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-top: 1em;
}

/* Route List */
#routeList {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 1em;
}

/* Reservation List */
#reservationList {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 1em;
}

/* Landmark List */
#landmarkList {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 1em;
}

/* Landmark Color Picker */
.landmark-category-select {
    width: 100%;
    padding: 0.6em 0.75em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.95em;
    margin-bottom: 1em;
    color: white;
    background: #1a2a3e;
    cursor: pointer;
}

.route-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.45em 0.75em;
    border-radius: 6px;
    margin-bottom: 0.25em;
}

.route-item-info {
    display: flex;
    align-items: center;
    gap: 0.5em;
    min-width: 0;
}

.route-item-name {
    font-weight: 600;
    color: white;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9em;
}

.route-item-details {
    display: none;
}

.route-item-actions {
    display: flex;
    gap: 0.3em;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.btn-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon .material-icons {
    font-size: 20px;
}

.btn-icon.btn-icon-primary .material-icons {
    color: white;
}

.btn-edit {
    background: #FF9800;
    color: white;
}

.btn-edit:hover {
    background: #F57C00;
}

.btn-nav {
    background: #4CAF50;
    color: white;
}

.btn-nav:hover {
    background: #45a049;
}

.btn-load {
    background: white;
    color: #1a2a3e;
}

.btn-load:hover {
    background: #e9ecef;
}

.btn-delete {
    background: #E94560;
    color: white;
}

.btn-delete:hover {
    background: #d63850;
}

/* Edit Stop Item */
.edit-stop-item {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 0.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-stop-info {
    flex: 1;
    font-size: 0.9em;
}

#editStopsList {
    overflow-y: auto;
    margin-bottom: 1em;
    padding-bottom: 150px;
    -webkit-overflow-scrolling: touch;
}

#editMapContainer {
    touch-action: pan-x pan-y;
}

/* Footer */
footer {
    background: #1a2a3e;
    color: white;
    height: 60px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    width: 100%;
}

.footer-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    box-sizing: border-box !important;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #E94560;
}

.copyright {
    color: #666;
    font-size: 0.7rem;
}

/* Map crosshair for point placement */
.map-crosshair {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 1400;
}

.map-crosshair::before,
.map-crosshair::after {
    content: '';
    position: absolute;
    background: #FF9800;
    border-radius: 2px;
}

.map-crosshair::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.map-crosshair::after {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.btn-add-point {
    display: none;
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 28px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Reservation Mode Indicator */
.reservation-mode-indicator {
    display: none;
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF9800;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 1500;
    font-size: 0.85em;
    white-space: nowrap;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reservation-mode-indicator button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0;
    line-height: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 15px !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .pin-btn {
        display: block;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a2a3e;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    nav ul.show {
        display: flex;
    }

    .nav-text {
        display: inline;
    }

    .mobile-only {
        display: block;
    }

    main {
        padding: 0;
    }

    #app-container {
        padding: 1em;
    }

    .route-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    footer {
        display: none;
    }

    .footer-container {
        padding: 0 15px !important;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-links {
        gap: 1rem;
    }
}

/* Desktop: shift map buttons above footer (60px) */
@media (min-width: 769px) {
    .btn-center-location                         { bottom: 78px; }
    .btn-add-landmark                            { bottom: 152px; }
    #btnYomiList                                 { bottom: 204px; }
    .btn-busstop-toggle                          { bottom: 308px; }
    body.recording-mode .btn-center-location     { bottom: 163px; }
    body.recording-mode .btn-add-landmark        { bottom: 237px; }
    body.recording-mode #btnYomiList             { bottom: 289px; }
    body.recording-mode .btn-busstop-toggle      { bottom: 393px; }
}

.nav-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 4px 0;
    padding: 0 !important;
}

.landmark-new-parent-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8f8f8;
    color: #333;
}

.landmark-parent-header {
    font-size: 0.8rem;
    color: #666;
    padding: 4px 8px 2px 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: #f5f5f5;
    border-left: 3px solid #ddd;
    margin: 4px 0 2px;
}

/* 横画面専用ピンは縦画面では非表示 */
#landscapePins { display: none; }

/* ─── Landscape Mode (横画面) ──────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px),
       (display-mode: standalone) and (orientation: landscape) {
    /* ヘッダー・フッター完全非表示 */
    header, footer {
        display: none !important;
    }

    /* html/bodyも余白ゼロ・フル幅 */
    html, body {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #000 !important;
    }

    /* 地図フル画面 */
    main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100dvh;
    }
    #app-container {
        width: 100% !important;
        height: 100dvh !important;
    }

    /* 列車ティッカー：PCの display:none !important を解除し、左下に角丸ボックス表示 */
    .train-ticker-mob[style*="flex"] {
        display: flex !important;
        position: fixed !important;
        bottom: 12px !important;
        left: 8px !important;
        width: 320px !important;
        max-width: calc(100vw - 70px) !important;
        padding: 6px 12px !important;
        background: rgba(26,42,62,0.92) !important;
        border-radius: 20px !important;
        gap: 6px !important;
        font-size: 0.78em;
        z-index: 1500;
        box-shadow: 0 2px 8px rgba(0,0,0,0.4);
        overflow: hidden;
    }
    /* dest部分：長い時はスクロール */
    .train-ticker-mob[style*="flex"] #tickerDestMob {
        overflow: hidden;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
        animation: ticker-scroll 8s linear infinite;
    }
    @keyframes ticker-scroll {
        0%   { transform: translateX(0); }
        30%  { transform: translateX(0); }
        70%  { transform: translateX(calc(-100% + 120px)); }
        100% { transform: translateX(calc(-100% + 120px)); }
    }

    /* 検索ボタン：左上 */
    .map-search-wrapper {
        top: 8px;
        left: 8px;
    }

    /* GPSオーバーレイ：右上 → 横長ピルに変形 */
    .gps-status-overlay {
        top: 8px;
        right: 10px;
        width: auto;
        height: 36px;
        border-radius: 20px;
        padding: 0 12px;
        gap: 8px;
        background: rgba(26, 42, 62, 0.92) !important;
    }
    .gps-status-overlay.active-good { background: rgba(76, 175, 80, 0.85) !important; }
    .gps-status-overlay.active-bad  { background: rgba(255, 179, 0, 0.85) !important; }
    .gps-status-overlay #gpsStatusIcon { font-size: 16px; }
    .gps-status-overlay #gpsStatusText { font-size: 0.78em; display: block !important; }
    #gpsClockText { display: block; }
    .gps-reload-btn { display: flex; }

    /* 3色ピン：左側、検索ボタンの下に縦並び */
    #landscapePins {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        left: 8px;
        top: 82px;
        gap: 8px;
        z-index: 1500;
    }
    #landscapePins button {
        width: 44px;
        height: 44px;
        background: #1a2a3e;
        border: none;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* 右側FABボタン群：下から積み上げ（!importantでデスクトップ値を上書き）*/
    .btn-center-location {
        position: fixed !important;
        right: 10px !important;
        bottom: 8px !important;
    }
    .btn-add-landmark   { right: 10px !important; bottom: 82px !important; }
    #btnYomiList        { right: 10px !important; bottom: 134px !important; }
    .fab-train          { right: 10px !important; bottom: 186px !important; }
    .btn-busstop-toggle { display: none !important; }

    /* モーダルを画面中央固定 */
    .modal {
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    /* バス停ヒント非表示 */
    #busstopHint {
        display: none !important;
    }
}

/* ===== busstopHint (from inline) ===== */
@media (min-width: 769px) { #busstopHint { display: none !important; } }

/* ===== 列車ティッカー (from inline) ===== */
.ticker-icon { font-size: 1.1rem; color: #6bb5e8; flex-shrink: 0; }
.ticker-content { flex: 1; display: flex; align-items: center; gap: 6px; overflow: hidden; min-width: 0; }
.ticker-time { font-size: 0.95rem; font-weight: 700; font-family: 'Montserrat', monospace; white-space: nowrap; flex-shrink: 0; }
.ticker-type {
    font-size: 0.65rem; font-weight: 700;
    background: #2d7dd2; border-radius: 4px;
    padding: 2px 5px; white-space: nowrap; flex-shrink: 0;
}
.ticker-dest { font-size: 0.85rem; color: #cde; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-dist {
    font-size: 0.7rem; font-weight: 700;
    background: #f0a500; color: #1a2a3e;
    border-radius: 12px; padding: 2px 8px;
    white-space: nowrap; flex-shrink: 0;
}
.train-ticker {
    flex: 1; min-width: 0;
    display: flex; align-items: center;
    gap: 8px; padding: 0 10px;
    color: white; overflow: hidden;
}
@media (max-width: 768px) {
    .train-ticker { display: none !important; }
}
.train-ticker-mob {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 7px 60px 7px 90px;
    background: #1a2a3e; color: white;
    width: 100%; box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
}
.ticker-dest-wrap {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}
#tickerDestMob {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 10s linear infinite;
}
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(0); }
    80%  { transform: translateX(-100%); }
    100% { transform: translateX(-100%); }
}
@media (min-width: 769px) {
    .train-ticker-mob { display: none !important; }
}
@media (max-width: 768px) {
    main:has(#app-container) {
        flex-direction: column;
        align-items: stretch;
        height: calc(100vh - 60px);
    }
    #app-container {
        flex: 1;
        height: auto !important;
        min-height: 0;
    }
}

/* ===== .fab-train (from inline) ===== */
.fab-train {
    display: none;
    position: fixed;
    bottom: 196px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: #1a2a3e;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1500;
    transition: background 0.2s;
}
.fab-train:active { background: #1e3a5f; }
.fab-train { display: flex; }
.fab-train.active { background: #2d7dd2; }
@media (min-width: 769px) {
    .fab-train { bottom: 256px; }
    body.recording-mode .fab-train { bottom: 341px; }
}

/* ===== 共通ナビ (from inline pages) ===== */
.nav-logout { color: #E94560 !important; }

/* ===== タブUI (legal, info) ===== */
.page-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 2em; }
.page-tab { padding: 0.7em 1.4em; cursor: pointer; font-weight: 500; font-size: 0.9em; color: #888; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.2s, border-color 0.2s; }
.page-tab.active { color: #E94560; border-bottom-color: #E94560; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ===== .important ハイライトボックス ===== */
.important { background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%); border-left: 4px solid #E94560; padding: 1.5em; margin: 1.5em 0; border-radius: 4px; }
.important strong { color: #E94560; display: block; margin-bottom: 0.5em; }

/* ===== 特定商取引法テーブル ===== */
.tokusho-table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.tokusho-table th { width: 30%; background: #f4f4f8; padding: 0.9em 1em; text-align: left; font-size: 0.88em; font-weight: 600; color: #444; border: 1px solid #e0e0e0; vertical-align: top; }
.tokusho-table td { padding: 0.9em 1em; font-size: 0.88em; color: #555; border: 1px solid #e0e0e0; line-height: 1.7; }
@media (max-width: 600px) { .tokusho-table th, .tokusho-table td { display: block; width: 100%; } .tokusho-table th { border-bottom: none; } }

/* ===== Billing ページ ===== */
.billing-card { background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%); border-radius: 16px; padding: 2.5em 2em; margin: 2em 0; color: #fff; text-align: center; position: relative; overflow: hidden; }
.billing-card::before { content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%; background: radial-gradient(circle, rgba(74,144,226,0.1) 0%, transparent 70%); pointer-events: none; }
.status-badge { display: inline-block; padding: 0.4em 1.2em; border-radius: 20px; font-size: 0.85em; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 1em; }
.status-badge.trial  { background: rgba(255,193,7,0.2); border: 1px solid rgba(255,193,7,0.5); color: #ffc107; }
.status-badge.active { background: linear-gradient(135deg, #0f9b58 0%, #34a853 100%); color: #fff; }
.status-badge.admin  { background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%); color: #fff; }
.status-badge.free   { background: rgba(255,255,255,0.15); color: #ccc; border: 1px solid rgba(255,255,255,0.2); }
#status-text  { font-size: 1em; color: rgba(255,255,255,0.85); margin: 0.8em 0 0.4em; }
#valid-until  { font-size: 0.9em; color: rgba(255,255,255,0.6); margin-bottom: 1.5em; }
#subscribe-btn { display: inline-block; background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%); color: #fff; border: none; padding: 0.9em 2.5em; border-radius: 8px; font-size: 1em; font-weight: 600; cursor: pointer; transition: all 0.3s; letter-spacing: 0.02em; }
#subscribe-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(74,144,226,0.4); }
#subscribe-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.billing-message { display: none; padding: 1em 1.5em; border-radius: 8px; margin-bottom: 1.5em; font-size: 0.95em; text-align: center; }
.billing-message.success  { background: rgba(15,155,88,0.1); border: 1px solid rgba(15,155,88,0.3); color: #0f9b58; }
.billing-message.canceled { background: rgba(233,69,96,0.1); border: 1px solid rgba(233,69,96,0.3); color: #E94560; }
.plan-details { margin: 2em 0; }
.plan-details h3 { margin-bottom: 1em; }
.plan-feature { display: flex; align-items: center; padding: 0.6em 0; color: #555; font-size: 0.95em; }
.plan-feature .check { color: #0f9b58; margin-right: 0.8em; font-weight: bold; }
.price-tag { font-size: 2.5em; font-weight: 700; color: #1A1A2E; margin: 0.3em 0; }
.price-tag .currency { font-size: 0.4em; font-weight: 400; vertical-align: super; }
.price-tag .period { font-size: 0.3em; font-weight: 300; color: #888; }
#billing-loading { text-align: center; padding: 3em 0; color: #888; }
.danger-zone { margin-top: 3em; padding-top: 2em; border-top: 1px solid #eee; }
.danger-zone h2 { color: #E94560 !important; }
.danger-zone p { font-size: 0.85em; color: #888; margin-bottom: 1em; line-height: 1.6; }
#delete-account-btn { background: #E94560; color: #fff; border: none; padding: 0.6em 1.5em; border-radius: 6px; font-size: 0.85em; cursor: pointer; transition: all 0.3s; }
#delete-account-btn:hover { background: #d63851; }
#cancel-subscription-btn { background: transparent; color: #888; border: 1px solid #ccc; padding: 0.6em 1.5em; border-radius: 6px; font-size: 0.85em; cursor: pointer; transition: all 0.3s; margin-top: 1em; }
#cancel-subscription-btn:hover { border-color: #E94560; color: #E94560; }
#cancel-subscription-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== User テーブル (users.html / billing.html 共通) ===== */
.user-table { width: 100%; border-collapse: collapse; margin-top: 1em; }
.user-table th { text-align: left; font-size: 0.8em; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 0.5em 0.8em; border-bottom: 2px solid #eee; }
.user-table td { padding: 0.9em 0.5em; border-bottom: 1px solid #f0f0f0; font-size: 0.9em; vertical-align: middle; }
.role-badge { display: inline-block; padding: 0.2em 0.8em; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.role-badge.admin      { background: #e8f0fe; color: #1967d2; }
.role-badge.dispatcher { background: #fef9e7; color: #b7770d; border: 1px solid #fce38a; }
.role-badge.driver     { background: #f0f0f0; color: #666; }
.actions { display: flex; gap: 0.5em; }
.btn-sm { padding: 0.3em 0.9em; border-radius: 5px; font-size: 0.82em; cursor: pointer; border: 1px solid; transition: all 0.2s; background: transparent; }
.btn-sm.edit { border-color: #4a90e2; color: #4a90e2; }
.btn-sm.edit:hover { background: #4a90e2; color: #fff; }
.btn-sm.del  { border-color: #E94560; color: #E94560; }
.btn-sm.del:hover { background: #E94560; color: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 160px auto; gap: 0.8em; align-items: end; margin-bottom: 1em; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-group label { display: block; font-size: 0.8em; color: #666; margin-bottom: 0.35em; font-weight: 500; }
.form-group input, .form-group select { width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 0.6em 0.9em; font-size: 0.9em; outline: none; transition: border-color 0.2s; background: #fff; }
.form-group input:focus, .form-group select:focus { border-color: #4a90e2; }
.btn-primary { background: linear-gradient(135deg, #1A1A2E 0%, #2d2d4e 100%); color: #fff; border: none; padding: 0.65em 1.5em; border-radius: 6px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,26,46,0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.msg { font-size: 0.85em; margin-top: 0.8em; padding: 0.6em 1em; border-radius: 6px; display: none; }
.msg.success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.msg.error   { background: #fff5f5; border: 1px solid #fca5a5; color: #dc2626; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-footer { display: flex; gap: 0.8em; justify-content: flex-end; margin-top: 1.2em; }
.btn-cancel { background: transparent; border: 1px solid #ddd; color: #666; padding: 0.6em 1.3em; border-radius: 6px; font-size: 0.9em; cursor: pointer; }
#users-loading { text-align: center; padding: 2em; color: #888; }
/* billing.html の u-prefix 版（同じスタイル、別セクション用） */
.u-actions { display: flex; gap: 0.5em; }
.u-form-row { display: grid; grid-template-columns: 1fr 1fr 160px auto; gap: 0.8em; align-items: end; margin-bottom: 1em; }
@media (max-width: 640px) { .u-form-row { grid-template-columns: 1fr; } }
.u-form-group label { display: block; font-size: 0.8em; color: #666; margin-bottom: 0.35em; font-weight: 500; }
.u-form-group input, .u-form-group select { width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 0.6em 0.9em; font-size: 0.9em; outline: none; transition: border-color 0.2s; background: #fff; }
.u-form-group input:focus, .u-form-group select:focus { border-color: #4a90e2; }
.u-btn-primary { background: linear-gradient(135deg, #1A1A2E 0%, #2d2d4e 100%); color: #fff; border: none; padding: 0.65em 1.5em; border-radius: 6px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.u-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,26,46,0.3); }
.u-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.u-msg { font-size: 0.85em; margin-top: 0.8em; padding: 0.6em 1em; border-radius: 6px; display: none; }
.u-msg.success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.u-msg.error   { background: #fff5f5; border: 1px solid #fca5a5; color: #dc2626; }
.u-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.u-modal-overlay.show { display: flex; }
.u-modal { background: #fff; border-radius: 12px; padding: 2em; width: 100%; max-width: 400px; margin: 1em; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.u-modal h3 { margin-bottom: 1.2em; color: #1A1A2E; }
.u-modal-footer { display: flex; gap: 0.8em; justify-content: flex-end; margin-top: 1.2em; }
.u-btn-cancel { background: transparent; border: 1px solid #ddd; color: #666; padding: 0.6em 1.3em; border-radius: 6px; font-size: 0.9em; cursor: pointer; }
#users-loading-b { text-align: center; padding: 2em; color: #888; }


/* ===== ダークモード (body.dark-mode) ===== 本格対応まで無効 ===== */
