:root {
    --h1-size: clamp(16px, 3vw, 24px); 
    --calendar-gap: 5px;
    --active-button-bg: #9b6d4c;
    --active-button-bg-rgb: 155, 109, 76;
    --active-button-text: #fff;
    --bg-color: #fdfaf5;
    --cell-bg: #fffdfa;
    --cell-border: #6d5b4a;
    --cell-selected-bg: #e6dccb;
    --footer-ad-bg: #d4c7b8;
    --footer-bg: #e8e0d5;
    --header-bg: #6d5b4a;
    --highlight-bg: #eecfa3;
    --link-color: #9b6d4c;
    --modal-overlay-bg: rgba(0, 0, 0, 0.7);
    --palette-btn-border: #d4c7b8;
    --selected-bg: #e0d8c0;
    --sudoku-grid-bg: #6d5b4a;
    --toggle-bg-off: #d4c7b8;
    --toggle-bg-on: #9b6d4c;
    --main-h-color: #9b6d4c;
    --initial-color: #4B3F33;
    --text-color: #705d4e;
    --palette-btn-bg: var(--active-button-bg); 
    --palette-btn-color: #fff; 
}

:root[data-theme="dark"] {
    --active-button-bg: #0056b3;
    --active-button-bg-rgb: 0, 86, 179;
    --active-button-text: #fff;
    --bg-color: #2c2c2c;
    --cell-bg: #3c3c3c;
    --cell-border: #1a1a1a;
    --cell-selected-bg: #5a5a5a;
    --footer-ad-bg: #4a4a4a;
    --footer-bg: #3a3a3a;
    --header-bg: #1a1a1a;
    --highlight-bg: #777777;
    --link-color: #7aa2e3; 
    --modal-overlay-bg: rgba(0, 0, 0, 0.9);
    --palette-btn-border: #5a5a5a;
    --selected-bg: #FFFFFF;
    --sudoku-grid-bg: #1a1a1a;
    --toggle-bg-off: #5a5a5a;
    --toggle-bg-on: var(--active-button-bg); 
    --main-h-color: #a0c3ff;
    --initial-color: #fff;
    --text-color: #cccccc;
    --palette-btn-bg: var(--active-button-bg); 
    --palette-btn-color: var(--active-button-text); 

}


:root[data-theme="dark"] .calendar-day-header {
    background-color: var(--header-bg);
    color: #fff;
}

:root[data-theme="dark"] .calendar-grid .calendar-cell:nth-child(7n+1) {
    background-color: #800000;
}

:root[data-theme="dark"] .calendar-grid .calendar-cell:nth-child(7n) {
    background-color: #004085;
}

:root[data-theme="dark"] .calendar-grid .calendar-day-header:nth-child(7n+1) {
    background-color: #800000;
    color: #fff;
}

:root[data-theme="dark"] .calendar-grid .calendar-day-header:nth-child(7n) {
    background-color: #004085;
    color: #fff;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Noto Sans', sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}
button {
    cursor: pointer;
    font-family: 'Noto Sans', sans-serif;
    margin: 0;
    padding: 0;
}

main {
    margin: 0 auto;
    max-width: 960px;
    padding: 10px;
    width: 100%;
    font-size: clamp(14px, 2vw, 16px); 
}

main a {
    color: inherit;
    text-decoration: underline; 
}

main a:hover {
    text-decoration: underline; 
}

main h1,
main h2,
main h3,
main h4 {
    color: var(--main-h-color);
    margin-bottom: 0.5em;
}

main h1 {
    font-size: var(--h1-size);
    margin-top: 20px; 
    text-align: center;
}

main h2 {
    font-size: calc(var(--h1-size) * 0.9); 
    margin-top: 1.5em;
}

main h3 {
    font-size: calc(var(--h1-size) * 0.8); 
    margin-top: 1.5em;
}

main h4 {
    font-size: calc(var(--h1-size) * 0.7); 
    margin-top: 1em;
}


footer {
    background: var(--footer-bg);
    font-size: 0.8em;
    padding: 10px 20px;
    text-align: center;
    transition: background-color 0.3s;
    width: 100%;
    line-height: 1;
}

footer a {
    color: inherit;
    text-decoration: none; 
    padding: 0 5px; 
}

footer a:hover {
    text-decoration: underline; 
}

footer a::after {
    content: "｜"; 
    padding-left: 5px; 
}

footer a:last-child::after {
    content: none;
}

.footer-info{
	text-align: right;
}

.contents-width {
    margin: auto;
    max-width: 480px;
    width: 100%;
}

header {
    align-items: center;
    background: var(--header-bg);
    padding: 10px;
    transition: background-color 0.3s;
    width: 100%;
}

header div.contents-width {
    color: rgba(255, 255, 255, 0.9);
    display: flex !important;
    font-size: clamp(14px, 2vw, 24px);
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
}

header div.contents-width > div {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

header h2 {
    font-size: 1rem;
    line-height: 1rem;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left;
}

header h2 a {
    color: #fff;
    text-decoration: none;
}

header .contents-width h2,
header .contents-width span,
header .contents-width > div {
    margin: 0 !important;
    padding: 0 !important;
}

header .contents-width span {
    font-size: 0.6rem;
}

.footer-ad {
	display: none;
    background: var(--footer-ad-bg);
    bottom: 0;
    color: var(--text-color);
    height: 100px;
    left: 0;
    padding: 10px;
    position: fixed;
    text-align: center;
    width: 100%;
    z-index: 1000;
}
.modal {
    align-items: center;
    background-color: var(--modal-overlay-bg);
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    overflow: auto;
    position: fixed;
    top: 0;
    transition: opacity 0.3s ease-out;
    width: 100%;
    z-index: 1000;
}

.modal.is-active {
    display: flex;
    opacity: 1;
}

.modal.is-active .modal-content {
    transform: scale(1);
}

.modal-content {
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    max-width: 500px;
    padding: 20px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
    width: 90%;
    max-height: 90vh; 
    overflow-y: auto; 
}

.close-button {
    color: var(--text-color);
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 10px;
}

.close-button:hover,
.close-button:focus {
    color: var(--link-color);
    text-decoration: none;
}

#calendar-modal {
    display: none;
}

#calendar-modal.is-active {
    display: flex;
}

.calendar-active-day {
    background-color: var(--active-button-bg);
    color: var(--active-button-text);
    font-weight: bold;
}

.calendar-active-day a {
    color: var(--active-button-text);
}

.calendar-cell {
    aspect-ratio: 1 / 1;
    background-color: var(--footer-bg);
    border-radius: 5px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    text-align: center;
    width: auto;
}

.calendar-cell.future-day {
    cursor: default;
    opacity: 0.5;
    pointer-events: none;
}

.calendar-cell.selected-day {
    background-color: var(--active-button-bg) !important;
    color: var(--active-button-text) !important;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    background-color: var(--footer-bg);
    border-radius: 5px;
    box-sizing: border-box;
    text-align: center;
}

.calendar-day a {
    align-items: center;
    color: var(--link-color);
    display: flex;
    height: 100%;
    justify-content: center;
    padding: 0;
    text-decoration: none;
}

.calendar-day:hover {
    background-color: var(--cell-selected-bg);
    cursor: pointer;
}

.calendar-day.placehold {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day-header {
    aspect-ratio: 1 / 1;
    background-color: var(--header-bg);
    box-sizing: border-box;
    color: #fff;
    font-weight: bold;
    height: 30px;
    line-height: 30px;
    padding: 0;
    text-align: center;
    width: 100%;
}

.calendar-grid,
.calendar-grid *,
.modal-content {
    box-sizing: border-box;
}

.calendar-grid {
    box-sizing: border-box;
    display: grid;
    gap: 4px; 
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;
    overflow: hidden;
    grid-template-columns: repeat(7, minmax(0, 1fr)); 
    width: 100%;
    grid-template-rows: repeat(6, 1fr); 
}
.calendar-grid .calendar-cell:nth-child(7n+1) {
    background-color: #ffdddd;
}

.calendar-grid .calendar-cell:nth-child(7n) {
    background-color: #ddf4ff;
}

.calendar-grid .calendar-day-header:nth-child(7n+1) {
    background-color: #e74c3c;
    color: #fff;
}

.calendar-grid .calendar-day-header:nth-child(7n) {
    background-color: #3498db;
    color: #fff;
}

.calendar-nav {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-right: 40px;
}

.calendar-nav button {
    background: var(--active-button-bg);
    border: none;
    border-radius: 5px;
    color: var(--active-button-text);
    cursor: pointer;
    padding: 5px 10px;
}

.calendar-nav button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.calendar-nav h3 {
    font-size: 1.2rem;
    margin: 0;
}

.home{
	text-align: center;
}

.daily-links { 
    margin-top: 20px;
    display: flex;
    width: 100%;
    justify-content: center;
}

.daily-links ul {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    gap: 10px;
}

.daily-links li {
    flex: 1;
    text-align: center;
    border-radius: 8px; 
    background: var(--toggle-bg-on);
    margin-bottom: 5px;
}

.daily-links a { 
    color: var(--bg-color);
    text-decoration: none; 
    display: block; 
    padding: 5px;   
    border-radius: 8px; 
}

.daily-links a:hover { 
    text-decoration: underline; 
}

.daily-links.historical {
    display: block !important;
    width: 100%;
}

.daily-links.historical > p {
    display: block !important;
    margin: 1em 0; 
    text-align: center; 
}

.controls-container {
    display: flex;       
    justify-content: space-between; 
    align-items: stretch;
    width: 100%;         
    gap: 5px;
    margin-bottom: 10px;
}

.controls-container > div {
    flex: 1; 
    min-width: 0;
}
.calendar-button-wrapper {
    text-align: left;
}

#timer {
    display: flex;
    justify-content: flex-end; 
    align-items: center; 
    font-size: 1.2em;
    font-weight: bold;
    text-align: right;
}

#open-calendar-button, 
#difficulty-display-button {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--toggle-bg-on);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: clamp(12px, 1.8vw, 14px);
}

#difficulty-display-button span {
    color: #fff;
}


.calendar-wrapper { flex-basis: 30%; flex-grow: 1; flex-shrink: 1; }

.difficulty-buttons {
    display: flex; gap: 2px; flex-basis: 70%; flex-grow: 1; flex-shrink: 1; width: 100%; margin-bottom: 0 !important;
}

.difficulty-buttons button {
    height: 24px; display: flex; align-items: center; justify-content: center; white-space: nowrap; margin: 0; padding: 0 5px; width: 100%; flex-shrink: 0; 
    flex-grow: 1; flex-basis: 0; 
}

.difficulty-buttons button.active { background: var(--active-button-bg); color: var(--active-button-text); }

.number-palette { 
    display: grid; 
    gap: 4px;
    justify-content: center; 
    margin-top: 10px;
    grid-template-columns: repeat(9, 1fr); 
}

.number-palette button { 
    aspect-ratio: 1 / 1; 
    background: var(--palette-btn-bg); 
    border: 1px solid var(--palette-btn-border); 
    border-radius: 8px;
    color: var(--palette-btn-color); 
    font-size: clamp(16px, 3vw, 24px); 
    transition: background-color 0.3s, color 0.3s; 
    width: 100%;
    max-width: 50px; 
    max-height: 50px; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


.number-palette button:disabled, .number-palette button.completed { opacity: 0.4; cursor: not-allowed; }

.number-palette button.erase-button {
    padding: 8px; 
    width: 44px;
    height: 44px;
    background: var(--toggle-bg-on); 
    border: none; 
    border-radius: 50%;
}

.number-palette button.erase-button svg {
    width: 100%;  
    height: 100%; 
    box-sizing: border-box; 
    pointer-events: none;
    fill: #fff; 
}

.sudoku-grid {
    aspect-ratio: 1 / 1; background: var(--sudoku-grid-bg); border: 5px solid var(--cell-border); border-radius: 10px; display: grid; font-weight: bold; gap: 1.5px; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); margin: 0.5rem auto; max-width: 640px; overflow: hidden; width: 100%; position: relative; 
}

.sudoku-grid .cell {
    position: relative;
    transform: translateZ(0); 
    overflow: hidden; 
    align-items: center; background: var(--cell-bg); cursor: pointer; display: flex; font-size: clamp(16px, 3.5vw, 36px); justify-content: center; transition: background-color 0.3s; user-select: none; 
}

.sudoku-grid .cell::before,
.sudoku-grid .cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.sudoku-grid .cell::before {
    background-color: var(--highlight-bg);
}

.sudoku-grid .cell.highlight-related::before {
    opacity: 1;
}

.sudoku-grid .cell::after {
    background-color: var(--cell-selected-bg);
}
.sudoku-grid .cell.highlight-value::after {
    opacity: 1;
}

.sudoku-grid .cell:nth-child(3n) { border-right: 3px solid var(--cell-border); }
.sudoku-grid .cell:nth-child(9n) { border-right: 1px solid var(--cell-border); }
.sudoku-grid div.cell:nth-child(n + 19):nth-child(-n + 27), .sudoku-grid div.cell:nth-child(n + 46):nth-child(-n + 54) { border-bottom: 3px solid var(--cell-border); }

.sudoku-grid .cell .main-value {
    display: flex; justify-content: center; align-items: center; width: 100%; height: 100%;
    font-weight: normal; 
    position: relative;
    z-index: 2;
}
.sudoku-grid .cell.initial .main-value { 
    font-weight: bolder; 
    color: var(--initial-color); 
}
.sudoku-grid .cell.initial { cursor: default; }

.sudoku-grid .cell.selected { background-color: var(--selected-bg); outline: none; position: relative; z-index: 10; }

.sudoku-grid .cell.error .main-value { color: #d9534f; }
[data-theme='dark'] .sudoku-grid .cell.error .main-value { color: #ff6b6b; }


.cell-notes {
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 0px; padding: 2px; width: 100%; height: 100%; box-sizing: border-box;
    position: relative;
    z-index: 2;
}
.cell-note-item {
    font-size: clamp(0.5rem, 1.1vw, 0.9rem); text-align: center; line-height: 1; color: var(--text-color); opacity: 0.8; user-select: none;
}


.sudoku-wrapper { align-items: center; display: flex; flex-direction: column; padding-bottom: 100px; }

.toggle-checkbox { display: none; }
.toggle-checkbox:checked + .toggle-label { background-color: var(--toggle-bg-on); }
.toggle-container { display: inline-block; vertical-align: middle; }

.toggle-label {
    background-color: var(--toggle-bg-off); border-radius: 1.5rem; cursor: pointer; display: block; 
    height: 1.5rem;
    width: 4rem;
    position: relative; transition: background-color 0.4s;
}

.toggle-switch-handle {
    background-color: #fff; bottom: 2px; height: 1.25rem; width: 1.25rem; left: 2px; 
    position: absolute; z-index: 1; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2); transition: transform 0.4s; 
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch-handle {
    transform: translateX(2.5rem);
}

.toggle-label > .toggle-icon { display: none; }

.toggle-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    width: 0.8rem; height: 0.8rem;
    fill: var(--toggle-bg-on); 
    opacity: 0; 
    transition: opacity 0.2s; 
    z-index: 2; 
}

#dark-mode-toggle-container .toggle-checkbox:not(:checked) + .toggle-label .toggle-icon.off-icon { opacity: 1; }
#dark-mode-toggle-container .toggle-checkbox:checked + .toggle-label .toggle-icon.on-icon { opacity: 1; }

#dark-mode-toggle-container .toggle-label {
    height: 24px;
    width: 48px;
    border-radius: 12px;
}

#dark-mode-toggle-container .toggle-switch-handle {
    height: 20px;
    width: 20px;
    top: 2px;
    left: 2px;
}

#dark-mode-toggle-container .toggle-checkbox:checked + .toggle-label .toggle-switch-handle {
    transform: translateX(24px); 
}

#notes-mode-toggle-container .toggle-checkbox:not(:checked) + .toggle-label .toggle-icon.icon-value { opacity: 1; }
#notes-mode-toggle-container .toggle-checkbox:checked + .toggle-label .toggle-icon.icon-notes { opacity: 1; }

#notes-mode-toggle-container .toggle-label {
    height: 44px;
    width: 88px;
    border-radius: 22px;
}

#notes-mode-toggle-container .toggle-switch-handle {
    height: 38px;
    width: 38px;
    top: 3px;
    left: 3px;
}

#notes-mode-toggle-container .toggle-checkbox:checked + .toggle-label .toggle-switch-handle {
    transform: translateX(44px); 
}

#notes-mode-toggle-container .toggle-icon {
    width: 20px; 
    height: 20px;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    fill: var(--toggle-bg-on); 
    opacity: 0; 
    transition: opacity 0.2s; 
    z-index: 2; 
}

#notes-mode-toggle-container {
    display: flex;         
    align-items: center;   
    gap: 10px;             
    justify-content: center; 
    margin-top: 10px;
}

.difficulty-options {
    display: none; 
}
.difficulty-options.is-open {
    display: block;
}

.difficulty-selector-wrapper {
    position: relative;
    display: inline-block;
    text-align: center;
}

#difficulty-display-button {
    cursor: pointer;
    padding: 0 12px;
    box-sizing: border-box;
}

.difficulty-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--cell-border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 100%;
    box-sizing: border-box;
}

.difficulty-options.is-open {
    display: block;
}

.difficulty-options button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-color);
}

.difficulty-options button:hover {
    background-color: var(--cell-selected-bg);
}

.difficulty-options button.active {
    background-color: var(--selected-bg);
    font-weight: bold;
}

.toggle-switch-handle svg path {
    fill: var(--toggle-bg-on); 
    transition: fill 0.3s ease;
}

.toggle-switch-handle svg {
    width: 20px; 
    height: 20px;
}

.toggle-switch-handle svg:last-child {
    display: none;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch-handle svg:first-child {
    display: none;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch-handle svg:last-child {
    display: block;
}

.erase-button,
#undo-button {
    width: 44px;
    height: 44px;
    border-radius: 50%; 
    background: var(--toggle-bg-on); 
    border: none; 
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    padding: 0;
}

.erase-button:hover,
#undo-button:hover {
    opacity: 0.8;
}

.erase-button svg,
#undo-button svg {
    width: 24px;
    height: 24px;
}

.erase-button svg path,
#undo-button svg path {
    fill: #fff;
    transition: fill 0.3s ease;
}

.sudoku-grid .cell {
    position: relative;
    transform: translateZ(0);
    overflow: hidden;
    align-items: center;
    background: var(--cell-bg);
    cursor: pointer;
    display: flex;
    font-size: clamp(16px, 3.5vw, 36px);
    justify-content: center;
    transition: background-color 0.3s;
    user-select: none;
    z-index: 2;
}
.sudoku-grid .cell::before,
.sudoku-grid .cell::after,
.sudoku-grid .cell .selected-overlay {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sudoku-grid .cell::before {
    background-color: var(--highlight-bg);
    z-index: 1;
}
.sudoku-grid .cell.highlight-related::before {
    opacity: 0.4;
}

.sudoku-grid .cell::after {
    background-color: var(--cell-selected-bg);
    z-index: 2;
}
.sudoku-grid .cell.highlight-value::after {
    opacity: 1;
}

.sudoku-grid .cell .selected-overlay {
    background-color: var(--selected-bg);
    z-index: 3;
}
.sudoku-grid .cell.selected .selected-overlay {
    opacity: 1;
}

.sudoku-grid .cell.selected::before {
    opacity: 1;
}

.sudoku-grid .cell.selected {
    z-index: 10;
}

.sudoku-grid .cell .main-value,
.cell-notes {
    position: relative;
    z-index: 20;
}

[data-theme="dark"] main a {
    color: #fff !important; 
}

#completion-message-en {
    transition: opacity 0.3s ease-out;
}

#completion-message-en {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 
        1px 1px 3px rgba(0, 0, 0, 0.5),
        -1px -1px 3px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    #completion-message-en {
        font-size: 2rem;
    }
}

.sudoku-grid .cell.highlight-value::before {
    opacity: 1;
}

.sudoku-grid .cell {
    position: relative;
    transform: translateZ(0);
    overflow: hidden;
    align-items: center;
    background: var(--cell-bg);
    cursor: pointer;
    display: flex;
    font-size: clamp(16px, 3.5vw, 36px);
    justify-content: center;
    transition: background-color 0.3s;
    user-select: none;
    z-index: 2;
}

.sudoku-grid .cell::before,
.sudoku-grid .cell::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sudoku-grid .cell::before {
    background-color: var(--highlight-bg);
    z-index: 1;
}
.sudoku-grid .cell.highlight-related::before {
    opacity: 0.4;
}

.sudoku-grid .cell::after {
    background-color: var(--selected-bg);
    z-index: 3;
}

.sudoku-grid .cell.selected::after,
.sudoku-grid .cell.highlight-value::after {
    opacity: 0.1;
}


.sudoku-grid .cell.selected {
    z-index: 10;
}

/* ナビ全体を3分割 */
.daily-nav {
  display: flex;
  justify-content: space-between; /* 左中右に3分割 */
  align-items: center;
  margin: 1.5em 0;
  gap: 0.5rem;
  text-align: center;
}

/* 各リンク共通 */
.nav-link {
  flex: 1;                          /* 均等幅 */
  padding: 0.5em 0.8em;
  border-radius: 12px;              /* 角丸 */
  border: 1px solid var(--toggle-bg-on); /* 線は細めでトグル色 */
  text-decoration: none;
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  display: inline-block;
  background-color: transparent;    /* 背景なし */
  color: var(--toggle-bg-on);       /* 文字色はトグルON時の背景色 */
  transition: border-color 0.3s, color 0.3s;
}

/* small部分をブロック表示 */
.nav-link small {
  display: block;
  font-size: 0.7em;
  color: var(--text-color);         /* small内はメイン文字色 */
  margin-top: 0.2em;
}

/* アクティブリンク（必要に応じて強調） */
.nav-link.active {
  border-color: var(--toggle-bg-on);
}

/* 非活性リンク */
.nav-link.disabled {
	opacity: 0.25;
}

:root[data-theme="dark"] .nav-link {
    color: var(--main-h-color) !important;
}

:root[data-theme="dark"] .nav-link small {
    color: var(--text-color) !important;
}
.footer-pwa {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background-color: rgba(var(--active-button-bg-rgb), 0.5);
  color: #ffffff;
  padding: 0.75em;
  font-size: 0.95rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.footer-pwa-icon {
  width: 20%;
  height: auto;
  flex-shrink: 0;
  border-radius: 0.5rem;
}

/* ← これを追加 */
.footer-pwa-text {
  display: flex;
  flex-direction: column; /* 縦方向に配置 */
  gap: 0.4em;             /* 段落の間隔 */
}

.footer-pwa p {
  margin: 0;
  line-height: 1.4em;
  text-align: left;
  font-size: 0.9em;
}
#iosGuide{
	margin-top: 0.5em;
}