﻿/* --- Orbitron Font (Local) --- */
@font-face {
    font-family: 'Orbitron';
    src: url('lib/fonts/Orbitron.woff2') format('woff2');
    font-weight: 500 900;
    font-display: swap;
}

/* --- M PLUS Rounded 1c Font (Local) --- */
@font-face {
    font-family: 'M PLUS Rounded 1c';
    src: url('lib/fonts/MPLUSRounded1c-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'M PLUS Rounded 1c';
    src: url('lib/fonts/MPLUSRounded1c-Bold.woff2') format('woff2');
    font-weight: 700 900;
    font-display: swap;
}

/* --- Zen Maru Gothic Font (Local) --- */
/* Zen Maru Gothic: app.js から動的に読み込み（Olive/Mint テーマ選択時のみ） */

/* --- Accessibility Helper --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- CSS Variables --- */
:root {
    --bg-body: #121212;
    --bg-container: #1e1e1e;
    --text-main: #e0e0e0;
    --text-sub: #aaa;
    --border-color: #444;
    --bg-input: #333333;
    --text-input: #ffffff;
    --bg-card: #111;
    --accent-color: #33FF77;
    --accent-text: #33FF77;
    --accent-bg-alpha: rgba(51, 255, 119, 0.2);
    --btn-bg: #333333;
    --btn-text: #ffffff;
    --overlay-bg: #121212;
    --cal-bg: #1e1e1e;
    --cal-cell: #1e1e1e;
    --cal-cell-active: #2a2a2a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hl-box-bg: #252525;
    --icon-bg: #333333;
    --icon-fill: #ffffff;
    --date-opt-bg: rgba(37, 37, 37, 0.98);
    --date-opt-hover: rgba(255, 255, 255, 0.2);
    --btn-day-bg: #2a2a2a;
    --time-text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    --tide-text-shadow: none;
    --tide-status-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --bar-day: #FFEB3B;
    --bar-night: #1A237E;
    --bar-text: #fff;
    --fav-active: #FFD700;
    /* 繝懊ち繝ｳ逕ｨ縺ｮ螟画焚・医ム繝ｼ繧ｯ繝｢繝ｼ繝臥畑・夂區・・*/
    --nav-btn-color: #ffffff;
    --nav-btn-text-active: #000000;

    /* Graph Colors (Default Dark) */
    --graph-grid: rgba(255, 255, 255, 0.15);
    --graph-text: #aaa;
    --graph-dash: rgba(255, 255, 255, 0.7);
    --graph-fill: rgba(51, 255, 119, 0.2);
    --graph-stroke: #33FF77;
    --graph-bar-day: #FFEB3B;
    --graph-bar-night: #1A237E;
    --graph-bar-text: #fff;
    --wind-text-low: #fff;
    --wind-text-mid: #33FF77;
    --wind-text-high: #FF9800;
    --wind-text-danger: #FF3366;
    --moon-color-start: #FFE44D;
    --moon-color-end: #DAA520;
    --btn-active-shadow: none;

    /* Map Buttons */
    --map-btn-bg: #fff;
    --map-btn-border: #ccc;
    --map-btn-icon: #333;
    --map-btn-active-bg: #eee;
    --map-btn-loading: #333;
}

body.dark-grayish {
    --bg-body: #121212;
    --bg-container: #1e1e1e;
    --text-main: #d0d0d0;
    --text-sub: #888;
    --border-color: #444;
    --bg-input: #2a2a2a;
    --text-input: #d0d0d0;
    --bg-card: #181818;
    --accent-color: #aaaaaa;
    --accent-text: #aaaaaa;
    --accent-bg-alpha: rgba(170, 170, 170, 0.15);
    --btn-bg: #2a2a2a;
    --btn-text: #d0d0d0;
    --overlay-bg: #121212;
    --cal-bg: #1e1e1e;
    --cal-cell: #1e1e1e;
    --cal-cell-active: #2a2a2a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hl-box-bg: #1a1a1a;
    --icon-bg: #2a2a2a;
    --icon-fill: #d0d0d0;
    --date-opt-bg: rgba(30, 30, 30, 0.98);
    --date-opt-hover: rgba(170, 170, 170, 0.1);
    --btn-day-bg: #2a2a2a;
    --time-text-shadow: 0 0 10px rgba(170, 170, 170, 0.2);
    --tide-text-shadow: 0 0 10px rgba(170, 170, 170, 0.15);
    --tide-status-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --bar-day: #d4a843;
    --bar-night: #2a2a4a;
    --bar-text: #fff;
    --fav-active: #d4a843;
    --nav-btn-color: #d0d0d0;
    --nav-btn-text-active: #121212;

    /* Graph Colors (Dark Grayish) */
    --graph-grid: rgba(170, 170, 170, 0.12);
    --graph-text: #888;
    --graph-dash: rgba(170, 170, 170, 0.4);
    --graph-fill: rgba(170, 170, 170, 0.12);
    --graph-stroke: #aaaaaa;
    --graph-bar-day: #d4a843;
    --graph-bar-night: #2a2a4a;
    --graph-bar-text: #fff;
    --wind-text-low: #d0d0d0;
    --wind-text-mid: #33FF77;
    --wind-text-high: #FF9800;
    --wind-text-danger: #FF3366;
    --btn-active-shadow: none;

    /* Map Buttons */
    --map-btn-bg: #fff;
    --map-btn-border: #ccc;
    --map-btn-icon: #333;
    --map-btn-active-bg: #eee;
    --map-btn-loading: #333;
}

body.tokyo-retro {
    --bg-body: #211810;
    --bg-container: #322618;
    --text-main: #D8C090;
    --text-sub: #B09868;
    --border-color: #584530;
    --bg-input: #3a2e1e;
    --text-input: #D8C090;
    --bg-card: #2a2016;
    --accent-color: #E08848;
    --accent-text: #E08848;
    --accent-bg-alpha: rgba(224, 136, 72, 0.25);
    --btn-bg: #3a2e1e;
    --btn-text: #D8C090;
    --overlay-bg: #211810;
    --cal-bg: #322618;
    --cal-cell: #322618;
    --cal-cell-active: #3e3022;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hl-box-bg: #2a2016;
    --icon-bg: #3a2e1e;
    --icon-fill: #D8C090;
    --date-opt-bg: rgba(50, 38, 24, 0.98);
    --date-opt-hover: rgba(224, 136, 72, 0.12);
    --btn-day-bg: #3e3022;
    --time-text-shadow: 0 0 12px rgba(224, 136, 72, 0.35), 0 0 24px rgba(224, 136, 72, 0.15);
    --tide-text-shadow: 0 0 12px rgba(224, 136, 72, 0.3), 0 0 28px rgba(224, 136, 72, 0.15);
    --tide-status-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --bar-day: #c89838;
    --bar-night: #322618;
    --bar-text: #f0e8d8;
    --fav-active: #c89838;
    --nav-btn-color: #D8C090;
    --nav-btn-text-active: #211810;

    /* Graph Colors (Tokyo Retro) */
    --graph-grid: rgba(224, 136, 72, 0.15);
    --graph-text: #B09868;
    --graph-dash: rgba(216, 192, 144, 0.35);
    --graph-fill: rgba(224, 136, 72, 0.18);
    --graph-stroke: #E08848;
    --graph-bar-day: #c89838;
    --graph-bar-night: #322618;
    --graph-bar-text: #D8C090;
    --wind-text-low: #D8C090;
    --wind-text-mid: #8FB858;
    --wind-text-high: #E8944D;
    --wind-text-danger: #D45050;
    --moon-color-start: #E8A850;
    --moon-color-end: #C07830;
    --btn-active-shadow: none;

    /* Map Buttons */
    --map-btn-bg: #fff;
    --map-btn-border: #ccc;
    --map-btn-icon: #333;
    --map-btn-active-bg: #eee;
    --map-btn-loading: #333;
}

body.tokyo-night {
    --bg-body: #1a1b26;
    --bg-container: #24283b;
    --text-main: #c0caf5;
    --text-sub: #787c99;
    --border-color: #414868;
    --bg-input: #292e42;
    --text-input: #c0caf5;
    --bg-card: #24283b;
    --accent-color: #7aa2f7;
    --accent-text: #7aa2f7;
    --accent-bg-alpha: rgba(122, 162, 247, 0.2);
    --btn-bg: #292e42;
    --btn-text: #c0caf5;
    --overlay-bg: #1a1b26;
    --cal-bg: #24283b;
    --cal-cell: #24283b;
    --cal-cell-active: #2f3549;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --hl-box-bg: #1f2335;
    --icon-bg: #292e42;
    --icon-fill: #c0caf5;
    --date-opt-bg: rgba(36, 40, 59, 0.98);
    --date-opt-hover: rgba(122, 162, 247, 0.1);
    --btn-day-bg: #414868;
    --time-text-shadow: 0 0 10px rgba(122, 162, 247, 0.3);
    --tide-text-shadow: 0 0 10px rgba(122, 162, 247, 0.2), 0 0 20px rgba(122, 162, 247, 0.1);
    --tide-status-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --bar-day: #e0af68;
    --bar-night: #3d59a1;
    --bar-text: #fff;
    --fav-active: #e0af68;
    --nav-btn-color: #c0caf5;
    --nav-btn-text-active: #1a1b26;

    /* Graph Colors (Tokyo Night) */
    --graph-grid: rgba(120, 124, 153, 0.2);
    --graph-text: #787c99;
    --graph-dash: rgba(192, 202, 245, 0.5);
    --graph-fill: rgba(122, 162, 247, 0.2);
    --graph-stroke: #7aa2f7;
    --graph-bar-day: #e0af68;
    --graph-bar-night: #3d59a1;
    --graph-bar-text: #c0caf5;
    --wind-text-low: #c0caf5;
    --wind-text-mid: #9ece6a;
    --wind-text-high: #e0af68;
    --wind-text-danger: #f7768e;
    --moon-color-start: #b4c8e8;
    --moon-color-end: #7a8cb8;
    --btn-active-shadow: none;
}

body.dark-blue {
    --bg-body: #121212;
    --bg-container: #1e1e1e;
    --text-main: #e0e0e0;
    --text-sub: #aaa;
    --border-color: #444;
    --bg-input: #333333;
    --text-input: #ffffff;
    --bg-card: #111;
    --accent-color: #7aa2f7;
    --accent-text: #7aa2f7;
    --accent-bg-alpha: rgba(122, 162, 247, 0.2);
    --btn-bg: #333333;
    --btn-text: #ffffff;
    --overlay-bg: #121212;
    --cal-bg: #1e1e1e;
    --cal-cell: #1e1e1e;
    --cal-cell-active: #2a2a2a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hl-box-bg: #252525;
    --icon-bg: #333333;
    --icon-fill: #ffffff;
    --date-opt-bg: rgba(37, 37, 37, 0.98);
    --date-opt-hover: rgba(122, 162, 247, 0.2);
    --btn-day-bg: #2a2a2a;
    --time-text-shadow: 0 0 10px rgba(122, 162, 247, 0.3);
    --tide-text-shadow: 0 0 10px rgba(122, 162, 247, 0.2), 0 0 20px rgba(122, 162, 247, 0.1);
    --tide-status-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --bar-day: #FFEB3B;
    --bar-night: #1A237E;
    --bar-text: #fff;
    --fav-active: #FFD700;
    --nav-btn-color: #ffffff;
    --nav-btn-text-active: #000000;

    /* Graph Colors (Dark Blue - Tokyo Night Accents) */
    --graph-grid: rgba(255, 255, 255, 0.15);
    --graph-text: #aaa;
    --graph-dash: rgba(255, 255, 255, 0.7);
    --graph-fill: rgba(122, 162, 247, 0.2);
    --graph-stroke: #7aa2f7;
    --graph-bar-day: #FFEB3B;
    --graph-bar-night: #1A237E;
    --graph-bar-text: #fff;
    --wind-text-low: #fff;
    --wind-text-mid: #33FF77;
    --wind-text-high: #FF9800;
    --wind-text-danger: #FF3366;
    --btn-active-shadow: none;
}

body.light-mode {
    --bg-body: #f0f2f5;
    --bg-container: #ffffff;
    --text-main: #333333;
    --text-sub: #666;
    --border-color: #ccc;
    --bg-input: #f5f5f5;
    --text-input: #333333;
    --bg-card: #f8f9fa;
    --accent-color: #00b341;
    --accent-text: #009933;
    --accent-bg-alpha: rgba(0, 179, 65, 0.15);
    --btn-bg: #f0f0f0;
    --btn-text: #333333;
    --overlay-bg: #f8f9fa;
    --cal-bg: #ffffff;
    --cal-cell: #ffffff;
    --cal-cell-active: #eef2f6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hl-box-bg: #f0f2f5;
    --icon-bg: #f0f0f0;
    --icon-fill: #555555;
    --date-opt-bg: rgba(255, 255, 255, 0.98);
    --date-opt-hover: rgba(0, 0, 0, 0.1);
    --btn-day-bg: #e0e0e0;
    --time-text-shadow: none;
    --tide-text-shadow: none;
    --tide-status-shadow: none;
    --bar-day: #FDD835;
    --bar-night: #BBDEFB;
    --bar-text: #333;
    --fav-active: #FBC02D;
    /* 繝懊ち繝ｳ逕ｨ縺ｮ螟画焚・医Λ繧､繝医Δ繝ｼ繝臥畑・夐ｻ偵▲縺ｽ縺・げ繝ｬ繝ｼ・・*/
    --nav-btn-color: #333333;
    --nav-btn-text-active: #ffffff;

    /* Graph Colors (Light Mode) */
    --graph-grid: rgba(0, 0, 0, 0.1);
    --graph-text: #555;
    --graph-dash: rgba(0, 0, 0, 0.2);
    --graph-fill: rgba(0, 179, 65, 0.15);
    --graph-stroke: #009933;
    --graph-bar-day: #FDD835;
    --graph-bar-night: #BBDEFB;
    --graph-bar-text: #333;
    --wind-text-low: #333;
    --wind-text-mid: #1B8C3A;
    --wind-text-high: #D47800;
    --wind-text-danger: #CC2244;
    --btn-active-shadow: none;

    /* Map Buttons (Light) */
    --map-btn-bg: #ffffff;
    --map-btn-border: #bbb;
    --map-btn-icon: #555;
    --map-btn-active-bg: #e0e0e0;
    --map-btn-loading: #888;
}

body.light-sage {
    --bg-body: #F2EDE5;
    --bg-container: #FDFBF7;
    --text-main: #6B4A2E;
    --text-sub: #5C4530;
    --border-color: #D5CCBF;
    --bg-input: #EDE8E0;
    --text-input: #5C4530;
    --bg-card: #F7F3ED;
    --accent-color: #7D9B55;
    --accent-text: #5C7A3A;
    --accent-bg-alpha: rgba(93, 122, 58, 0.15);
    --btn-bg: #EAE5DD;
    --btn-text: #5C4530;
    --overlay-bg: #F7F3ED;
    --cal-bg: #FDFBF7;
    --cal-cell: #FDFBF7;
    --cal-cell-active: #E8E2D8;
    --shadow-color: rgba(61, 53, 40, 0.08);
    --hl-box-bg: #EDE8E0;
    --icon-bg: #EAE5DD;
    --icon-fill: #6B4A2E;
    --date-opt-bg: rgba(253, 251, 247, 0.98);
    --date-opt-hover: rgba(93, 122, 58, 0.12);
    --btn-day-bg: #DDD8D0;
    --time-text-shadow: none;
    --tide-text-shadow: none;
    --tide-status-shadow: none;
    --bar-day: #C8B960;
    --bar-night: #C5D5B8;
    --bar-text: #5C4530;
    --fav-active: #C8B960;
    --nav-btn-color: #5C4530;
    --nav-btn-text-active: #ffffff;

    /* Graph Colors (Light Sage) */
    --graph-grid: rgba(61, 53, 40, 0.1);
    --graph-text: #5C4530;
    --graph-dash: rgba(61, 53, 40, 0.2);
    --graph-fill: rgba(93, 122, 58, 0.3);
    --graph-stroke: #5C7A3A;
    --graph-bar-day: #C8B960;
    --graph-bar-night: #C5D5B8;
    --graph-bar-text: #5C4530;
    --wind-text-low: #5C4530;
    --wind-text-mid: #4A6A20;
    --wind-text-high: #B87A00;
    --wind-text-danger: #CC2244;
    --btn-active-shadow: none;

    /* Map Buttons (Light Sage) */
    --map-btn-bg: #FDFBF7;
    --map-btn-border: #C5BDB0;
    --map-btn-icon: #5C4530;
    --map-btn-active-bg: #DDD8D0;
    --map-btn-loading: #5C4530;
}

body.light-sage #saveBtn,
body.light-sage #shareBtn,
body.light-sage #deleteBtn {
    border: none;
    color: var(--text-main);
}

body.light-sage #saveBtn:active,
body.light-sage #shareBtn:active,
body.light-sage #deleteBtn:active,
body.light-sage #mapBtn:active {
    background: var(--nav-btn-color);
    color: var(--bg-body);
}

body.light-sage #mapBtn {
    border: none;
    color: var(--text-main);
    box-shadow: none;
}

body.light-sage .manual-gps-btn {
    border: 1px solid var(--border-color);
    background: var(--btn-bg);
    color: var(--text-main);
    padding: 8px 18px;
    border-radius: 6px;
}

body.light-sage .manual-gps-btn:active {
    background: var(--nav-btn-color);
    color: var(--bg-body);
}

body.light-mint {
    --bg-body: #EDF2F0;
    --bg-container: #f9f8f1;
    --text-main: #3A4A4A;
    --text-sub: #4A5A5A;
    --border-color: #C0D0CC;
    --bg-input: #E4ECEA;
    --text-input: #4A5A5A;
    --bg-card: #F0F5F3;
    --accent-color: #5BAABD;
    --accent-text: #3A8AAA;
    --accent-bg-alpha: rgba(74, 138, 133, 0.15);
    --btn-bg: #DDE6E4;
    --btn-text: #4A5A5A;
    --overlay-bg: #F0F5F3;
    --cal-bg: #F8FBFA;
    --cal-cell: #F8FBFA;
    --cal-cell-active: #D8E4E2;
    --shadow-color: rgba(40, 55, 52, 0.08);
    --hl-box-bg: #E4ECEA;
    --icon-bg: #DDE6E4;
    --icon-fill: #3A4A4A;
    --date-opt-bg: rgba(248, 251, 250, 0.98);
    --date-opt-hover: rgba(74, 138, 133, 0.12);
    --btn-day-bg: #D0DAD8;
    --time-text-shadow: none;
    --tide-text-shadow: none;
    --tide-status-shadow: none;
    --bar-day: #C8B960;
    --bar-night: #C5D5B8;
    --bar-text: #3A4A4A;
    --fav-active: #7DBCB5;
    --nav-btn-color: #4A5A5A;
    --nav-btn-text-active: #ffffff;

    /* Graph Colors (Light Mint) */
    --graph-grid: rgba(40, 55, 52, 0.1);
    --graph-text: #4A5A5A;
    --graph-dash: rgba(40, 55, 52, 0.2);
    --graph-fill: rgba(60, 140, 170, 0.3);
    --graph-stroke: #3A8AAA;
    --graph-bar-day: #C8B960;
    --graph-bar-night: #C5D5B8;
    --graph-bar-text: #3A4A4A;
    --wind-text-low: #4A5A5A;
    --wind-text-mid: #2A8A70;
    --wind-text-high: #B87A00;
    --wind-text-danger: #CC2244;
    --btn-active-shadow: none;

    /* Map Buttons (Light Mint) */
    --map-btn-bg: #F8FBFA;
    --map-btn-border: #B5C8C4;
    --map-btn-icon: #4A5A5A;
    --map-btn-active-bg: #D0DAD8;
    --map-btn-loading: #4A5A5A;
}

body.light-mint #saveBtn,
body.light-mint #shareBtn,
body.light-mint #deleteBtn {
    border: none;
    color: var(--text-main);
}

body.light-mint #saveBtn:active,
body.light-mint #shareBtn:active,
body.light-mint #deleteBtn:active,
body.light-mint #mapBtn:active {
    background: var(--nav-btn-color);
    color: var(--bg-body);
}

body.light-mint #mapBtn {
    border: none;
    color: var(--text-main);
    box-shadow: none;
}

body.light-mint .manual-gps-btn {
    border: 1px solid var(--border-color);
    background: var(--btn-bg);
    color: var(--text-main);
    padding: 8px 18px;
    border-radius: 6px;
}

body.light-mint .manual-gps-btn:active {
    background: var(--nav-btn-color);
    color: var(--bg-body);
}

body.light-blue {
    --bg-body: #f0f2f5;
    --bg-container: #ffffff;
    --text-main: #333333;
    --text-sub: #666;
    --border-color: #ccc;
    --bg-input: #f5f5f5;
    --text-input: #333333;
    --bg-card: #f8f9fa;
    --accent-color: #1E88E5;
    --accent-text: #1565C0;
    --accent-bg-alpha: rgba(30, 136, 229, 0.15);
    --btn-bg: #f0f0f0;
    --btn-text: #333333;
    --overlay-bg: #f8f9fa;
    --cal-bg: #ffffff;
    --cal-cell: #ffffff;
    --cal-cell-active: #eef2f6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hl-box-bg: #f0f2f5;
    --icon-bg: #f0f0f0;
    --icon-fill: #555555;
    --date-opt-bg: rgba(255, 255, 255, 0.98);
    --date-opt-hover: rgba(30, 136, 229, 0.1);
    --btn-day-bg: #e0e0e0;
    --time-text-shadow: none;
    --tide-text-shadow: none;
    --tide-status-shadow: none;
    --bar-day: #FDD835;
    --bar-night: #BBDEFB;
    --bar-text: #333;
    --fav-active: #FBC02D;
    --nav-btn-color: #333333;
    --nav-btn-text-active: #ffffff;

    /* Graph Colors (Light Blue) */
    --graph-grid: rgba(0, 0, 0, 0.1);
    --graph-text: #555;
    --graph-dash: rgba(0, 0, 0, 0.2);
    --graph-fill: rgba(30, 136, 229, 0.15);
    --graph-stroke: #1565C0;
    --graph-bar-day: #FDD835;
    --graph-bar-night: #BBDEFB;
    --graph-bar-text: #333;
    --wind-text-low: #333;
    --wind-text-mid: #1B8C3A;
    --wind-text-high: #D47800;
    --wind-text-danger: #CC2244;
    --btn-active-shadow: none;

    /* Map Buttons (Light) */
    --map-btn-bg: #ffffff;
    --map-btn-border: #bbb;
    --map-btn-icon: #555;
    --map-btn-active-bg: #e0e0e0;
    --map-btn-loading: #888;
}

body.light-black {
    --bg-body: #f0f2f5;
    --bg-container: #ffffff;
    --text-main: #333333;
    --text-sub: #666;
    --border-color: #ccc;
    --bg-input: #f5f5f5;
    --text-input: #333333;
    --bg-card: #f8f9fa;
    --accent-color: #333333;
    --accent-text: #000000;
    --accent-bg-alpha: rgba(0, 0, 0, 0.1);
    --btn-bg: #f0f0f0;
    --btn-text: #333333;
    --overlay-bg: #f8f9fa;
    --cal-bg: #ffffff;
    --cal-cell: #ffffff;
    --cal-cell-active: #eef2f6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hl-box-bg: #f0f2f5;
    --icon-bg: #f0f0f0;
    --icon-fill: #555555;
    --date-opt-bg: rgba(255, 255, 255, 0.98);
    --date-opt-hover: rgba(0, 0, 0, 0.1);
    --btn-day-bg: #e0e0e0;
    --time-text-shadow: none;
    --tide-text-shadow: none;
    --tide-status-shadow: none;
    --bar-day: #FDD835;
    --bar-night: #BBDEFB;
    --bar-text: #333;
    --fav-active: #FBC02D;
    --nav-btn-color: #333333;
    --nav-btn-text-active: #ffffff;

    /* Graph Colors (Light Black) */
    --graph-grid: rgba(0, 0, 0, 0.1);
    --graph-text: #555;
    --graph-dash: rgba(0, 0, 0, 0.2);
    --graph-fill: rgba(0, 0, 0, 0.1);
    --graph-stroke: #333333;
    --graph-bar-day: #FDD835;
    --graph-bar-night: #BBDEFB;
    --graph-bar-text: #333;
    --wind-text-low: #333;
    --wind-text-mid: #1B8C3A;
    --wind-text-high: #D47800;
    --wind-text-danger: #CC2244;
    --btn-active-shadow: none;

    /* Map Buttons (Light) */
    --map-btn-bg: #ffffff;
    --map-btn-border: #bbb;
    --map-btn-icon: #555;
    --map-btn-active-bg: #e0e0e0;
    --map-btn-loading: #888;
}

body {
    font-family: 'M PLUS Rounded 1c', 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding: 5px;
    padding-bottom: 40px;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none;
    transition: background-color 0.3s, color 0.3s
}

.container {
    background-color: var(--bg-container);
    padding: 8px 15px;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s
}

.select-row {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    margin-top: 5px;
    align-items: center
}

select.main-select {
    background: var(--bg-input);
    color: var(--text-input);
    border: 1px solid var(--border-color);
    padding: 6px 2px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    outline: none;
    text-align: center;
    -webkit-text-align-last: center;
    text-align-last: center;
    flex: 1;
    appearance: none;
    min-width: 0;
    box-sizing: border-box;
}


button.area-select-btn {
    background: var(--btn-bg);
    color: var(--text-input);
    border: none;
    padding: 6px 2px;
    font-size: 1.0rem;
    font-weight: bold;
    font-family: inherit;
    border-radius: 6px;
    outline: none;
    text-align: center;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 380px) {
    button.area-select-btn {
        font-size: 0.85rem;
    }
}

.gps-search-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
    margin: 0;
}

.area-modal-list {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.area-modal-item {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    text-align: center;
    color: var(--text-main);
    font-size: 1rem;
    transition: background 0.15s;
}

.area-modal-item:last-child {
    border-bottom: none;
}

.area-modal-item:active {
    background: var(--bg-input);
}

.area-modal-item.selected {
    background: var(--accent-color);
    color: #fff;
    font-weight: bold;
}

.area-modal-cancel {
    width: 100%;
    padding: 13px;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

/* --- 鬮倥＆330px --- */
.display-box {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    height: 330px;
    cursor: crosshair;
    touch-action: none
}

#bgGraph {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none
}

.info-layer {
    position: relative;
    z-index: 10;
    pointer-events: none
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 2px
}

.custom-date-container {
    position: relative;
    width: 38%;
    min-width: 120px;
    margin-right: 5px;
    pointer-events: auto
}

.selected-date-display {
    background: var(--btn-bg);
    border: none;
    border-radius: 6px;
    padding: 0 5px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    height: 22px;
    box-sizing: border-box;
    backdrop-filter: blur(2px)
}

.selected-date-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden
}

.date-text {
    text-align: center;
    letter-spacing: 1px;
    white-space: nowrap
}

.moon-icon-text {
    font-size: 1.2rem;
    line-height: 1;
    margin: 0 2px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
    display: inline-flex;
    align-items: center;
}

.moon-icon-text .cal-moon-svg {
    width: 22px;
    height: 22px;
}

/* --- ヘッダーの月アイコン --- */
#header-moon {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
    display: inline-flex;
    align-items: center;
}

#header-moon .cal-moon-svg {
    width: 20px;
    height: 20px;
}

body.light-mode #header-moon {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.shio-tag {
    font-size: 0.75rem;
    padding: 1px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
    min-width: 30px;
    text-align: center;
    color: var(--text-input);
    background: var(--btn-bg);
    flex-shrink: 0
}

.shio-tag.shio-oo {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

.shio-tag.shio-chu {
    color: #4ecdc4;
    border-color: rgba(78, 205, 196, 0.3);
}


.date-options-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280%;
    max-height: 300px;
    overflow-y: auto;
    background: var(--date-opt-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    z-index: 1000;
    display: none;
    margin-top: 5px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5)
}

.date-options-list.show {
    display: block
}

.date-option {
    padding: 10px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-main);
    box-sizing: border-box;
}

.date-option:last-child {
    border-bottom: none
}

.date-option.selected {
    font-weight: bold;
    background: rgba(128, 128, 128, 0.1);
}

.date-option.is-today {
    background: var(--accent-bg-alpha) !important;
    border: 2px solid var(--accent-color) !important;
    font-weight: bold;
}

.date-option:active {
    background: var(--date-opt-hover)
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex: 1
}

.tide-status {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-main);
    text-shadow: var(--tide-status-shadow);
    white-space: nowrap;
    min-width: 4.1em;
    text-align: right;
    position: relative;
    top: 2px
}

.time-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin: 45px 0 5px 0;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    text-shadow: var(--time-text-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px
}

.blink {
    animation: flash 1s step-start infinite
}

@keyframes flash {
    0% {
        opacity: 1
    }

    50% {
        opacity: 0.2
    }

    100% {
        opacity: 1
    }
}

.tide-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0;
    margin-top: 5px
}

.tide-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--accent-text);
    line-height: 1;
    text-shadow: var(--tide-text-shadow)
}

/* Font Size Overrides */
/* Large: Clock 1.25x (2.5), Tide 1.5x (6.75) */
body.fs-large .time-text {
    font-size: 2.5rem;
}

body.fs-large .tide-text {
    font-size: 6.75rem;
}

/* Small: Clock 0.75x (1.5), Tide 0.5x (2.25) */
body.fs-small .time-text {
    font-size: 1.5rem;
}

body.fs-small .tide-text {
    font-size: 2.25rem;
}

.unit {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--text-sub);
    font-weight: bold;
    width: 0;
    white-space: nowrap;
    overflow: visible;
    margin-left: 8px;
    text-align: left;
    display: inline-block
}

.hl-box {
    background: var(--hl-box-bg);
    border-radius: 6px;
    padding: 0 10px;
    margin-bottom: 5px;
    text-align: left;
    height: 100px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center
}

.hl-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    font-size: 0.8rem;
    margin: 0;
    border-bottom: 1px dashed var(--border-color);
    padding: 1px 0;
    color: var(--text-main)
}

.hl-row:last-child {
    border-bottom: none
}

.hl-cell-l {
    text-align: left
}

.hl-cell-c {
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px
}

.hl-cell-r {
    text-align: right;
    font-variant-numeric: tabular-nums
}

.high-tide {
    color: var(--text-main);
    font-weight: bold
}

.low-tide {
    color: var(--text-main);
    font-weight: bold
}

/* --- 譎る俣謫堺ｽ懷・ --- */
.time-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 5px;
    height: 44px;
    width: 100%;
    box-sizing: border-box;
}

.btn-step {
    width: 22%;
    background: var(--btn-bg);
    border: none;
    color: var(--nav-btn-color);
    font-weight: 900;
    font-family: inherit;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1.1;
    box-sizing: border-box;
    height: 100%;
}

.btn-step:active {
    background: var(--nav-btn-color);
    color: var(--nav-btn-text-active);
}

.now-btn-inline {
    flex: 1;
    background: var(--btn-bg);
    border: none;
    color: var(--nav-btn-color);
    font-weight: 900;
    font-family: inherit;
    font-size: 1rem;
    border-radius: 6px;
    margin: 0;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    height: 100%;
}

.now-btn-inline:active {
    background: var(--nav-btn-color);
    color: var(--nav-btn-text-active);
}

/* --- 繧｢繧ｯ繧ｷ繝ｧ繝ｳ繝懊ち繝ｳ繝ｻ繧ｰ繝ｪ繝・ラ --- */
.action-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 5px;
    width: 100%;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    justify-content: flex-start;
}

.icon-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1;
    background: var(--icon-bg);
    color: var(--icon-fill);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    vertical-align: top;
}

.icon-btn:active {
    background: var(--bg-input);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: none;
    transform: translateY(2px);
}

.icon-text {
    font-size: 0.6rem;
    color: var(--text-sub);
    font-weight: bold;
    margin-top: 2px;
    text-align: center;
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-icon {
    width: 70%;
    height: 70%;
    fill: currentColor;
}

.weather-icon-zoom {
    transform: scale(1.3);
    transform-origin: center;
}

.weather-icon-zoom path {
    stroke: currentColor;
}

.weather-icon-zoom circle {
    fill: currentColor;
    stroke: none;
}

.weather-icon-zoom text {
    fill: var(--icon-bg);
}

/* 險ｭ螳壹い繧､繧ｳ繝ｳ繧貞､ｧ縺阪￥ */
.gear-icon-lg {
    width: 70%;
    height: 70%;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.icon-btn:active .gear-icon-lg {
    fill: var(--text-main);
    transform: rotate(45deg);
}

.setting-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 10;
    cursor: pointer;
}

/* --- 繝・・繝槫・繧頑崛縺亥・ --- */
.theme-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
    margin-bottom: 10px;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-container);
    transition: .4s;
    border-radius: 50%;
}

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

input:checked+.slider:before {
    transform: translateX(24px);
}

.theme-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-sub);
}

#fileInput,
#galleryInput {
    display: none
}

#resultArea {
    display: none;
    margin-top: 15px;
    background: var(--bg-container);
    padding: 15px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color)
}

.scan-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    text-align: left;
    color: var(--text-main);
    line-height: 1.4;
    display: none;
}

.manual-gps-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    border: 1px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: bold;
}

.manual-gps-btn:active {
    background: var(--accent-color);
    color: var(--bg-body);
}

.comment-input {
    width: 80%;
    padding: 8px 15px;
    margin: 0 auto 10px auto;
    display: block;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-input);
    font-size: 1rem;
    text-align: center;
    outline: none
}

.comment-input::placeholder {
    color: var(--text-sub);
    font-size: 0.8rem
}

.comment-input:focus {
    border-color: var(--accent-color)
}

#resultImg {
    width: 100%;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: block;
    -webkit-touch-callout: default !important;
    -webkit-user-select: auto !important;
    user-select: auto !important;
    pointer-events: auto !important
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%
}

.btn-res {
    background: var(--btn-bg);
    border: 1px solid;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    -webkit-user-select: none;
    flex: 1;
    max-width: 150px;
    transition: all 0.2s;
}

.btn-res:disabled,
.btn-res.btn-disabled {
    background: var(--btn-bg);
    color: transparent;
    /* Completely hide text */
    cursor: default;
    opacity: 0.3;
    pointer-events: none !important;
    /* Force prevent clicks */
    border-color: var(--border-color);
}

#saveBtn {
    border-color: #00E5FF;
    color: #00E5FF;
}

#saveBtn:active {
    background: #00E5FF;
    color: var(--bg-body);
}

#shareBtn {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

#shareBtn:active {
    background: var(--accent-color);
    color: var(--bg-body);
}

#deleteBtn {
    border-color: #FF3366;
    color: #FF3366;
}

#deleteBtn:active {
    background: #FF3366;
    color: var(--bg-body);
}

#mapBtn {
    border-color: #3399FF;
    color: #3399FF;
    box-shadow: 0 0 5px rgba(51, 153, 255, 0.1);
}

#mapBtn:active {
    background: #3399FF;
    color: var(--bg-body);
}

/* ライトモード時のボタン色調整 */
body.light-mode #saveBtn,
body.light-blue #saveBtn,
body.light-black #saveBtn,
body.light-green #saveBtn {
    border-color: #0097A7;
    color: #0097A7;
    box-shadow: none;
}

body.light-mode #shareBtn,
body.light-blue #shareBtn,
body.light-black #shareBtn,
body.light-green #shareBtn {
    border-color: #2E7D32;
    color: #2E7D32;
    box-shadow: none;
}

body.light-mode #deleteBtn,
body.light-blue #deleteBtn,
body.light-black #deleteBtn,
body.light-green #deleteBtn {
    border-color: #C62828;
    color: #C62828;
    box-shadow: none;
}

body.light-mode #mapBtn,
body.light-blue #mapBtn,
body.light-black #mapBtn,
body.light-green #mapBtn {
    border-color: #1565C0;
    color: #1565C0;
    box-shadow: none;
}


#status-bar {
    font-size: 10px;
    color: var(--text-sub);
    text-align: left;
    padding: 2px 10px
}

.sw-update-banner {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: var(--bg-body);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.sw-update-banner button {
    background: var(--bg-body);
    color: var(--text-main);
    border: none;
    padding: 6px 12px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer
}

.overlay-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 7000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    color: var(--text-main);
}

.cal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--cal-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.cal-close-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.cal-nav-btn {
    background: var(--btn-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
}

.cal-title {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-main);
}

.cal-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 5px 0;
    background: var(--cal-bg);
}

.cal-day-name {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-sub);
}

.cal-main-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--cal-bg);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.cal-cell {
    min-height: 13vh;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--cal-cell);
    padding: 2px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.cal-cell:active {
    background: var(--cal-cell-active);
}

.cal-date-num {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    margin-left: 2px;
}

.cal-sun {
    color: #ff5c5c;
}

.cal-sat {
    color: #4deeea;
}

body.light-mode .cal-sat,
body.light-blue .cal-sat,
body.light-black .cal-sat {
    color: #00bcd4;
}

.cal-today {
    background: var(--accent-bg-alpha) !important;
    border: 2px solid var(--accent-color) !important;
    box-sizing: border-box;
}

.cal-selected {
    background: rgba(128, 128, 128, 0.2) !important;
    box-sizing: border-box;
}

.cal-moon-age {
    font-size: 0.55rem;
    color: #888;
    font-family: monospace;
    text-align: center;
    /* Centered */
    width: 100%;
    /* Ensure it spans the full width */
    margin-top: -2px;
    display: block;
    /* Ensure it takes up its own line */
}

.cal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    margin-top: 2px;
    width: 100%;
}

.cal-moon-svg {
    width: 80%;
    max-width: 48px;
    height: auto;
    display: block;
}

.cal-tide-name {
    font-size: 0.9rem;
    font-weight: 900;
    margin-top: 0px;
    white-space: nowrap;
    line-height: 1.1;
}

.bm-list {
    padding: 10px;
}

.bm-current-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.bm-current-info {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: bold;
}

.bm-current-btn {
    background: var(--btn-bg);
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.bm-current-btn.active {
    background: var(--accent-bg-alpha);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.bm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cal-cell);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
}

.bm-item:active {
    background: var(--cal-cell-active);
}

.bm-info {
    flex: 1;
    text-align: left;
}

.bm-pref {
    font-size: 0.8rem;
    color: var(--text-sub);
    display: block;
    margin-bottom: 2px;
}

.bm-loc {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: bold;
}

/* Light mode bookmark text - make it darker */
body.light-mode .bm-pref,
body.light-blue .bm-pref,
body.light-black .bm-pref {
    color: #333;
}

body.light-mode .date-select,
body.light-blue .date-select,
body.light-black .date-select {
    color: #333;
    background: var(--date-opt-bg);
}

.bm-del-btn {
    background: var(--btn-bg);
    border: 1px solid var(--border-color);
    color: #ff5c5c;
    border-radius: 6px;
    padding: 8px 12px;
    margin-left: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.bm-del-btn:active {
    background: var(--bg-input);
}

/* .bm-empty */
.bm-empty {
    text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: #ff5c5c;
    border-radius: 6px;
    padding: 8px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.bm-detail-view .bm-item {
    padding: 15px;
    margin-bottom: 10px;
}

.bm-detail-view .bm-pref {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.bm-detail-view .bm-loc {
    font-size: 1.2rem;
}

.bm-list-container:not(.bm-detail-view) .bm-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
}

.bm-list-container:not(.bm-detail-view) .bm-pref {
    font-size: 0.7rem;
    margin-bottom: 0;
}

.bm-list-container:not(.bm-detail-view) .bm-loc {
    font-size: 0.85rem;
}

.bm-list-container:not(.bm-detail-view) .bm-del-btn {
    padding: 4px 8px;
    margin-left: 8px;
}

#mapOverlay,
#weatherOverlay {
    z-index: 6000;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--bg-container);
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    font-family: sans-serif;
}

.leaflet-popup-content {
    margin: 10px 14px;
    text-align: center;
}

.map-popup-btn {
    background: #0277bd;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    font-weight: bold;
}

.gps-btn {
    width: 34px;
    height: 34px;
    background: var(--map-btn-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--map-btn-border);
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
}

.gps-btn:active {
    background: var(--map-btn-active-bg);
    transform: translateY(2px);
}

.gps-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    fill: var(--map-btn-icon);
}

.loc-reset-btn {
    width: 34px;
    height: 34px;
    background: var(--map-btn-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--map-btn-border);
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
}

.loc-reset-btn:active {
    background: var(--map-btn-active-bg);
    transform: translateY(2px);
}

.loc-reset-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    fill: #ff5c5c;
}

/* 繝｡繝｢繝懊ち繝ｳ */
.memo-btn {
    position: absolute;
    bottom: 80px;
    right: 15px;
    z-index: 9999;
    width: 40px;
    height: 40px;
    background: var(--map-btn-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--map-btn-border);
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.memo-btn:active {
    background: var(--map-btn-active-bg);
    transform: translateY(2px);
}

.memo-btn.active {
    background: #FFEB3B;
    border-color: #FBC02D;
}

.memo-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px;
    min-height: 26px;
    fill: var(--map-btn-icon);
}

/* 右側GPSボタン（メモの下） */
.gps-btn-right {
    position: absolute;
    bottom: 30px;
    right: 15px;
    z-index: 9999;
    width: 40px;
    height: 40px;
    background: var(--map-btn-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--map-btn-border);
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
}

.gps-btn-right:active {
    background: var(--map-btn-active-bg);
    transform: translateY(2px);
}

.gps-btn-right.active {
    background: #4ecdc4;
    border-color: #44a08d;
}

.gps-icon-right {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    fill: var(--map-btn-icon);
}

/* 鬲夊ｿｽ蜉繝懊ち繝ｳ */
.fish-add-btn {
    position: absolute;
    bottom: 130px;
    right: 15px;
    z-index: 9999;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    padding: 0;
    background: var(--map-btn-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    border: 2px solid var(--map-btn-border);
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    font-size: 20px;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    overflow: hidden;
    line-height: 1;
}

.fish-add-btn:active {
    background: var(--map-btn-active-bg);
    transform: translateY(2px);
}

.fish-add-btn.active {
    background: #4ecdc4;
    border-color: #44a08d;
}

/* 霑ｽ蜉繝｢繝ｼ繝峨ヰ繝翫・ */
.add-mode-banner {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: #fff;
    padding: 10px 15px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Leafletカスタムコントロール用スタイル */
.leaflet-custom-btn-control,
.map-layer-control {
    margin: 10px 0 0 11px !important;
}

/* 繧ｯ繝ｩ繧ｹ繧ｿ繝ｪ繝ｳ繧ｰ蛻・ｊ譖ｿ縺医・繧ｿ繝ｳ */
.cluster-toggle-btn {
    width: 34px;
    height: 34px;
    background: var(--map-btn-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--map-btn-border);
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    color: var(--map-btn-icon);
    padding: 0;
}

.cluster-toggle-btn:active {
    background: var(--map-btn-active-bg);
    transform: scale(0.95);
}

.cluster-toggle-btn.active {
    background: #4ecdc4;
    border-color: #44a08d;
    color: #fff;
}

.cluster-toggle-btn.hidden {
    background: #222;
    border-color: #555;
    color: #999;
}

.cluster-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
}

.weather-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    overflow-y: auto;
    background: var(--bg-card);
}

.weather-img-box {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #fff;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.weather-img {
    width: 100%;
    height: auto;
    display: block;
}

.weather-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 600px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.w-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--btn-bg);
    color: var(--text-main);
    font-weight: bold;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.w-btn.active {
    background: var(--btn-bg);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 5px var(--accent-bg-alpha);
}

.w-loading {
    position: absolute;
    color: var(--map-btn-loading);
    font-weight: bold;
}

.w-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 10px;
    text-align: left;
    width: 100%;
    max-width: 600px;
    line-height: 1.4;
}

/* --- Settings Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 150px;
    padding-bottom: 50%;
    z-index: 12000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 350px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--border-color);
    font-family: inherit;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-main);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-sub);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-body {
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    /* Ensure width is explicitly handled with box-sizing */
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group h3 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--text-sub);
}

.theme-select-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 1.0rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.theme-group-label {
    padding: 8px 16px 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-sub);
    background: var(--bg-input);
}



.option-row {
    display: flex;
    gap: 10px;
}

.option-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid var(--border-color);
    background: var(--btn-bg);
    /* Use btn-bg instead of bg-input */
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
    min-width: 0;
    /* Allow shrinking in flex container */
    white-space: nowrap;
    /* Prevent wrapping */
}

.option-btn.active {
    background: var(--btn-bg);
    /* No full fill */
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    box-shadow: var(--btn-active-shadow);
}

/* 上表示モード時の反転スタイル（背景塗りつぶし） */
.option-btn.active.inverted {
    background: var(--accent-color);
    color: var(--bg-body);
    border-color: var(--accent-color);
    /* box-shadow: 0 0 8px rgba(51, 255, 119, 0.5); */
    box-shadow: none;
}

/* Popup History */
.popup-history {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.85rem;
    margin: 5px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 5px 0;
    text-align: left;
}

.popup-history div {
    padding: 3px 0;
    border-bottom: 1px solid var(--bg-input);
    white-space: nowrap;
}

.popup-history div:last-child {
    border-bottom: none;
}

/* --- Toast Notification --- */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 20, 20, 0.85);
    color: #eee;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 15000;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.3s ease,
        visibility 0.3s ease,
        box-shadow 0.3s ease;
    max-width: 85%;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Success using Theme Accent */
.toast-notification.success {
    /* Use theme's accent color for border and text highlight */
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    /* Glow removed */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.toast-notification.info {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Light Mode Toast */
body.light-mode .toast-notification,
body.light-blue .toast-notification,
body.light-black .toast-notification {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode .toast-notification.success,
body.light-blue .toast-notification.success,
body.light-black .toast-notification.success {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    /* Glow removed */
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

body.light-mode .toast-notification.info,
body.light-blue .toast-notification.info,
body.light-black .toast-notification.info {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #333;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

/* --- Digital Clock (7-Segment) --- */
.digital-clock-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin: 20px auto 5px auto;
    padding: 2px;
}

/* Default (Medium) */
.digit {
    position: relative;
    width: 18px;
    height: 34px;
    transform: skewX(-6deg);
    margin: 0 1px;
}

.seg {
    position: absolute;
    background-color: rgba(128, 128, 128, 0.1);
    /* Inactive */
    border-radius: 1px;
    transition: background-color 0.1s, box-shadow 0.1s;
}

/* Light mode specific adjustment for ghost segment if needed */
body.light-sage,
body.light-mint {
    font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', 'Helvetica Neue', Arial, sans-serif;
}

body.light-sage .tide-text,
body.light-sage .unit,
body.light-mint .tide-text,
body.light-mint .unit {
    font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', sans-serif;
}

body.light-mode .seg,
body.light-blue .seg,
body.light-black .seg,
body.light-sage .seg,
body.light-mint .seg {
    background-color: rgba(0, 0, 0, 0.06);
}

/* -- Segment Active State -- */
.digit.on-a .seg.a,
.digit.on-b .seg.b,
.digit.on-c .seg.c,
.digit.on-d .seg.d,
.digit.on-e .seg.e,
.digit.on-f .seg.f,
.digit.on-g .seg.g {
    background-color: var(--text-main);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);
    z-index: 2;
}

/* Tokyo Night Theme Glow */
body.tokyo-night .digit.on-a .seg.a,
body.tokyo-night .digit.on-b .seg.b,
body.tokyo-night .digit.on-c .seg.c,
body.tokyo-night .digit.on-d .seg.d,
body.tokyo-night .digit.on-e .seg.e,
body.tokyo-night .digit.on-f .seg.f,
body.tokyo-night .digit.on-g .seg.g {
    background-color: #c0caf5;
    box-shadow: 0 0 3px rgba(122, 162, 247, 0.6);
}

/* Tokyo Retro Theme Glow */
body.tokyo-retro .digit.on-a .seg.a,
body.tokyo-retro .digit.on-b .seg.b,
body.tokyo-retro .digit.on-c .seg.c,
body.tokyo-retro .digit.on-d .seg.d,
body.tokyo-retro .digit.on-e .seg.e,
body.tokyo-retro .digit.on-f .seg.f,
body.tokyo-retro .digit.on-g .seg.g {
    background-color: #D8A870;
    box-shadow: 0 0 3px rgba(232, 139, 77, 0.6);
}

body.tokyo-retro .d-dot {
    background-color: #D8A870;
}

/* Light Mode Active */
body.light-mode .digit.on-a .seg.a,
body.light-blue .digit.on-a .seg.a,
body.light-black .digit.on-a .seg.a,
body.light-mode .digit.on-b .seg.b,
body.light-blue .digit.on-b .seg.b,
body.light-black .digit.on-b .seg.b,
body.light-mode .digit.on-c .seg.c,
body.light-blue .digit.on-c .seg.c,
body.light-black .digit.on-c .seg.c,
body.light-mode .digit.on-d .seg.d,
body.light-blue .digit.on-d .seg.d,
body.light-black .digit.on-d .seg.d,
body.light-mode .digit.on-e .seg.e,
body.light-blue .digit.on-e .seg.e,
body.light-black .digit.on-e .seg.e,
body.light-mode .digit.on-f .seg.f,
body.light-blue .digit.on-f .seg.f,
body.light-black .digit.on-f .seg.f,
body.light-mode .digit.on-g .seg.g,
body.light-blue .digit.on-g .seg.g,
body.light-black .digit.on-g .seg.g {
    background-color: #333;
    box-shadow: none;
}


/* -- Segment Positions -- */
:root {
    /* Default (Medium) */
    --seg-w: 3.5px;
    --seg-pad: 0.5px;
}

.seg.a {
    top: 0;
    left: var(--seg-w);
    right: var(--seg-w);
    height: var(--seg-w);
}

.seg.b {
    top: var(--seg-w);
    right: 0;
    height: calc(50% - var(--seg-w) - var(--seg-pad));
    width: var(--seg-w);
}

.seg.c {
    bottom: var(--seg-w);
    right: 0;
    height: calc(50% - var(--seg-w) - var(--seg-pad));
    width: var(--seg-w);
}

.seg.d {
    bottom: 0;
    left: var(--seg-w);
    right: var(--seg-w);
    height: var(--seg-w);
}

.seg.e {
    bottom: var(--seg-w);
    left: 0;
    height: calc(50% - var(--seg-w) - var(--seg-pad));
    width: var(--seg-w);
}

.seg.f {
    top: var(--seg-w);
    left: 0;
    height: calc(50% - var(--seg-w) - var(--seg-pad));
    width: var(--seg-w);
}

.seg.g {
    top: 50%;
    left: var(--seg-w);
    right: var(--seg-w);
    height: var(--seg-w);
    transform: translateY(-50%);
}

/* Colon */
.d-colon {
    width: 10px;
    height: 34px;
    /* Medium Height */
    position: relative;
    transform: skewX(-6deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.d-dot {
    width: 4.5px;
    height: 4.5px;
    background-color: var(--text-main);
    border-radius: 50%;
    opacity: 0.3;
}

.d-colon.blink .d-dot {
    opacity: 1;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Size overrides */

/* Large (approx 1.5x Medium) */
body.fs-large .digit {
    width: 27px;
    height: 52px;
    --seg-w: 3.5px;
    /* Same thickness as Medium */
}

body.fs-large .d-colon {
    height: 52px;
    width: 14px;
    gap: 12px;
}

body.fs-large .d-dot {
    width: 4.5px;
    /* Same dot size as Medium */
    height: 4.5px;
}

/* Small (approx 0.7x Medium) */
body.fs-small .digit {
    width: 13px;
    height: 24px;
    --seg-w: 2.2px;
    /* Reverted to thinner line */
}

body.fs-small .d-colon {
    height: 24px;
    width: 6px;
    gap: 5px;
}

body.fs-small .d-dot {
    width: 2.5px;
    /* Reverted to smaller dot */
    height: 2.5px;
}

/* Light mode menu text visibility fix */
body.light-mode #menuOverlay .setting-group div,
body.light-mode #menuOverlay .setting-group p,
body.light-blue #menuOverlay .setting-group div,
body.light-blue #menuOverlay .setting-group p,
body.light-black #menuOverlay .setting-group div,
body.light-black #menuOverlay .setting-group p {
    color: #444 !important;
}

body.light-mode #menuOverlay .setting-group p[style*="color:#f66"],
body.light-blue #menuOverlay .setting-group p[style*="color:#f66"],
body.light-black #menuOverlay .setting-group p[style*="color:#f66"] {
    color: #d32f2f !important;
}

body.light-mode #menuOverlay .setting-group p[style*="color:#f90"],
body.light-blue #menuOverlay .setting-group p[style*="color:#f90"],
body.light-black #menuOverlay .setting-group p[style*="color:#f90"] {
    color: #e65100 !important;
}

/* ========================================
   Marker Cluster Styles for Dark Modes
   ======================================== */

/* Base cluster improvements for all themes */
.marker-cluster {
    background-clip: padding-box;
}

.marker-cluster div {
    font-weight: bold;
    text-align: center;
}

/* Dark mode cluster styles - keep default appearance, just make text more visible */
body:not(.light-mode):not(.light-blue):not(.light-black) .marker-cluster-small div,
body:not(.light-mode):not(.light-blue):not(.light-black) .marker-cluster-medium div,
body:not(.light-mode):not(.light-blue):not(.light-black) .marker-cluster-large div {
    color: #000;
    font-weight: 900;
    text-shadow:
        0 0 1px #fff,
        0 0 1px #fff;
}

/* --- Map Layer Toggle Button --- */
.map-layer-toggle {
    position: absolute;
    top: 140px;
    left: 10px;
    z-index: 1000;
    width: 34px;
    height: 34px;
    background: var(--map-btn-bg);
    border: 2px solid var(--map-btn-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.map-layer-toggle:hover {
    background: var(--map-btn-active-bg);
}

.map-layer-toggle:active {
    background: var(--map-btn-active-bg);
}

/* 霑ｽ蜉繝｢繝ｼ繝画凾縺ｫ荳九↓遘ｻ蜍・*/
.map-layer-toggle.shifted {
    top: 220px;
}

/* --- GPS Tracking Active State --- */
.gps-btn.active {
    background-color: #2196F3 !important;
    border-color: #1976D2 !important;
}

.gps-btn.active svg {
    fill: #ffffff !important;
}

/* --- GPS Compass Marker --- */
.gps-marker-wrap {
    width: 0;
    height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gps-heading-cone {
    position: absolute;
    bottom: 0px;
    left: 50%;
    /* transform is handled by JS but initial state needed */
    /* transform: translateX(-50%) rotate(0deg); */
    /* Note: JS will set transform, so we need to include translateX(-50%) in JS or use margin */
    margin-left: -60px;
    /* half of width */
    width: 120px;
    height: 60px;
    background: radial-gradient(circle at 50% 100%, rgba(33, 150, 243, 0.8), transparent 70%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: 50% 100%;
    pointer-events: none;
    z-index: 100;
    /* Behind dot */
    transition: transform 0.2s cubic-bezier(0.1, 0.57, 0.1, 1);
    /* Smooth rotation */
}

.gps-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    background-color: #2196F3;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    z-index: 101;
    /* On top */
    transform: translate(-50%, -50%);
}

/* --- Separate Mode Layout (Clock Bottom-Left, Tide Bottom-Right) --- */
body.fs-separate .info-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

body.fs-separate .header-row {
    position: absolute;
    top: 10px;
    left: 15px;
    right: 15px;
}

body.fs-separate .digital-clock-container {
    position: absolute;
    bottom: 42px;
    left: 20px;
    margin: 0;
    z-index: 20;
    gap: 2px;
    pointer-events: none;
}

body.fs-separate .digit {
    width: 13px;
    height: 24px;
    --seg-w: 2.2px;
}

body.fs-separate .d-colon {
    height: 24px;
    width: 6px;
    gap: 5px;
}

body.fs-separate .d-dot {
    width: 2.5px;
    height: 2.5px;
}

body.fs-separate .tide-row {
    position: absolute;
    bottom: 40px;
    right: 30px;
    margin: 0;
    z-index: 20;
    flex-direction: row;
    align-items: baseline;
    pointer-events: none;
}

body.fs-separate .tide-text {
    font-size: 2.25rem;
}

body.fs-separate .unit {
    font-size: 0.8rem;
    margin-left: 5px;
    margin-top: 0;
    position: static;
}

/* --- Separate Mode Top Layout (Clock Top-Left, Tide Top-Right) --- */
body.fs-separate-top .info-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

body.fs-separate-top .header-row {
    position: absolute;
    top: 10px;
    left: 15px;
    right: 15px;
}

body.fs-separate-top .digital-clock-container {
    position: absolute;
    top: 50px;
    left: 20px;
    margin: 0;
    z-index: 20;
    gap: 2px;
    pointer-events: none;
}

body.fs-separate-top .digit {
    width: 13px;
    height: 24px;
    --seg-w: 2.2px;
}

body.fs-separate-top .d-colon {
    height: 24px;
    width: 6px;
    gap: 5px;
}

body.fs-separate-top .d-dot {
    width: 2.5px;
    height: 2.5px;
}

body.fs-separate-top .tide-row {
    position: absolute;
    top: 45px;
    right: 30px;
    margin: 0;
    z-index: 20;
    flex-direction: row;
    align-items: baseline;
    pointer-events: none;
}

body.fs-separate-top .tide-text {
    font-size: 2.25rem;
}

body.fs-separate-top .unit {
    font-size: 0.8rem;
    margin-left: 5px;
    margin-top: 0;
    position: static;
}

/* --- ストレージ使用量バー --- */
.storage-usage-area {
    margin-top: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.storage-usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.storage-usage-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.storage-usage-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.storage-usage-bar.warning {
    background: #ff9800;
}

.storage-usage-bar.danger {
    background: #f44336;
}

/* ===== 記録一覧 ===== */
.rl-tabs {
    display: flex;
    padding: 0;
    background: var(--cal-bg);
    border-bottom: 1px solid var(--border-color);
}

.rl-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: none;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
}

.rl-tab.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.rl-sort-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--cal-bg);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.rl-sort-btn {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-input);
    color: var(--text-sub);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;

    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.rl-sort-btn.active {
    background: #e8a838;
    color: #1a1a1a;
    border-color: #e8a838;
    font-weight: bold;
}

.rl-sort-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.rl-list {
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.rl-view-toggle {
    margin-left: auto;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-sub);
    font-size: 0.75rem;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    flex-shrink: 0;
}
.rl-view-toggle.active {
    background: #e8a838;
    color: #1a1a1a;
    border-color: #e8a838;
    font-weight: bold;
}

.rl-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.rl-list.rl-detail-view .rl-item {
    gap: 10px;
    padding: 12px;
    margin-bottom: 6px;
    border-radius: 8px;
}
.rl-list.rl-detail-view .rl-item-dot {
    width: 10px;
    height: 10px;
}
.rl-list.rl-detail-view .rl-item-name {
    font-size: 0.95rem;
}
.rl-list.rl-detail-view .rl-item-sub {
    display: block;
}

.rl-item:active {
    background: var(--bg-input);
}

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

.rl-item-body {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.rl-item-name {
    font-size: 0.82rem;
    font-weight: bold;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rl-item-sub {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rl-item-arrow {
    color: var(--text-sub);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rl-empty {
    text-align: center;
    color: var(--text-sub);
    padding: 40px 20px;
    font-size: 0.9rem;
}

/* 記録一覧 詳細ビュー */
.rl-detail {
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.rl-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    background: var(--cal-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.rl-detail-back {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}

.rl-detail-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--text-main);
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rl-detail-body {
    padding: 12px;
}

.rl-detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.rl-detail-section h4 {
    font-size: 0.85rem;
    color: var(--text-main);
    margin: 0 0 8px 0;
    font-weight: bold;
}

.rl-detail-info {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.6;
}

.rl-coord-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-main);
    opacity: 0.85;
}
.rl-copy-btn {
    font-family: inherit;
    font-size: 0.7rem;
    padding: 2px 8px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
}
.rl-copy-btn:active {
    background: var(--accent-color);
    color: #fff;
}

.rl-color-picker {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
    justify-content: center;
}

.rl-color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    box-sizing: content-box;
    box-shadow: none;
}

.rl-color-dot.selected {
    border-color: transparent;
    box-shadow: 0 0 0 2px #111, 0 0 0 4px #fff;
}

body.light-mode .rl-color-dot.selected,
body.light-blue .rl-color-dot.selected,
body.light-black .rl-color-dot.selected,
body.light-sage .rl-color-dot.selected,
body.light-mint .rl-color-dot.selected {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px #333;
}

.rl-catch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.05rem;
    color: var(--text-main);
}

.rl-catch-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.rl-catch-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rl-catch-btn {
    padding: 6px 20px;
    min-width: 72px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.rl-catch-btn:active {
    background: var(--bg-input);
}

.rl-catch-row:last-child {
    border-bottom: none;
}

.rl-catch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.rl-catch-header h4 {
    margin: 0;
    min-height: 1em;
    font-size: 1.05rem;
}



.rl-catch-date {
    color: var(--accent-color);
    font-weight: bold;
    min-width: 90px;
}

.rl-catch-tide {
    font-weight: bold;
}

.rl-catch-shio {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-sub);
}

.rl-action-btns {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding: 0 12px 12px;
}

.rl-action-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.rl-action-btn:active {
    background: var(--bg-input);
}

.rl-delete-btn {
    border-color: #e74c3c;
    color: #e74c3c;
}

.rl-delete-btn:active {
    background: #e74c3c;
    color: #fff;
}


.rl-memo-text {
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.rl-memo-text::-webkit-scrollbar {
    display: none;
}
.rl-memo-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 380px;
    font-family: inherit;
    font-size: 1.15rem;
    color: var(--text-main);
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 10px;
    line-height: 1.6;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
    outline: none;
}
.rl-memo-textarea::-webkit-scrollbar {
    display: none;
}

@media (max-width: 380px) {
    .rl-item-name { font-size: 0.75rem; }
    .rl-list.rl-detail-view .rl-item-name { font-size: 0.85rem; }
    .rl-list.rl-detail-view .rl-item-sub { font-size: 0.85rem; }
    .rl-sort-btn { font-size: 0.7rem; padding: 3px 8px; }
    .rl-tab { font-size: 0.8rem; }
}