/* @import "tailwindcss"; */

/* lightモードの時 */
:root {
    --app-bg: 232 232 232;
    --app-text: 0 0 0;
    --app-leftshadow: -6px -6px 12px rgba(255, 255, 255, 1);
    --app-rightshadow: 6px 6px 12px rgba(197, 197, 197, 1);
    --app-footer-basecircle-shadow: 0 -6px 8px -2px rgba(255, 255, 255, 1);
    --app-footer-circle-top-shadow: 0 -4px 8px rgba(255, 255, 255, 1);
    --app-footer-circle-bottom-shadow: 0 4px 10px rgba(197, 197, 197, 1);
    --app-mainbutton-shadow: 6px 6px 12px rgba(197, 197, 197, 1),
        -6px -6px 12px rgba(255, 255, 255, 1);
    --app-footer-safe-space: 128px;
}

/* ダークモードの時 */
html[data-theme="dark"] {
    --app-bg: 33 33 33;
    --app-text: 255 255 255;
    --app-leftshadow: -6px -6px 12px rgba(47, 47, 47, 1);
    --app-rightshadow: 6px 6px 12px rgba(0, 0, 0, 1);
    --app-footer-basecircle-shadow: 0 -6px 8px -2px rgba(47, 47, 47, 1);
    --app-footer-circle-top-shadow: 0 -4px 8px rgba(47, 47, 47, 1);
    --app-footer-circle-bottom-shadow: 0 4px 12px rgba(0, 0, 0, 1);
}

body {
    padding-bottom: calc(var(--app-footer-safe-space) + env(safe-area-inset-bottom));
}

/* shadow共通 */
.app-shadow {
    box-shadow: var(--app-leftshadow), var(--app-rightshadow);
}

.footer-circle-shadow {
    box-shadow: var(--app-footer-basecircle-shadow);
}

.footer-circle-button-shadow {
    box-shadow: var(--app-footer-circle-top-shadow), var(--app-footer-circle-bottom-shadow);
}

/* =========================
   Ledger Switcher
========================= */
.ledger-switcher {
    background: rgb(var(--app-bg));
    color: rgb(var(--app-text));
    border-radius: 22px;
    box-shadow: var(--app-leftshadow), var(--app-rightshadow);
    overflow: hidden;
}

.ledger-switcher__btn {
    width: 100%;
    min-height: 44px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    background: transparent;
    color: inherit;
    border: none;
}

.ledger-switcher__btn:active {
    transform: translateY(1px);
    filter: brightness(0.985);
}

.ledger-switcher__badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    color: rgb(var(--app-text));
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

html[data-theme="dark"] .ledger-switcher__badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ledger-switcher__menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    opacity: 0;
    pointer-events: none;
    transition: max-height 200ms ease, padding 200ms ease, opacity 120ms ease;
}

.ledger-switcher__option {
    width: 100%;
    text-align: left;
    padding: 10px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.ledger-switcher__option:hover {
    opacity: 0.75;
}

.ledger-switcher.is-open .ledger-switcher__menu {
    max-height: 420px;
    padding: 8px 12px 12px;
    opacity: 1;
    pointer-events: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .ledger-switcher.is-open .ledger-switcher__menu {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ニューモーフィズムパネル */
.neu-panel {
    width: 100%;
    box-sizing: border-box;

    background-color: rgba(224, 224, 224, 1);

    border-radius: clamp(28px, 10vw, 80px) clamp(28px, 10vw, 80px) 0 0;

    box-shadow: inset 4px 4px 10px rgba(188, 188, 188, 1),
        inset -4px -4px 10px rgba(255, 255, 255, 1);

    border: 2px solid rgb(206, 206, 206);
    color: rgba(77, 77, 77, 1);

    padding: 50px clamp(16px, 6vw, 42px);
    margin: 0 auto;
}

/* card 共通 */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--rounded-box, 1rem)
}

/* 認証フォーム共通 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 16px;
}

/* Input（ライト/ダーク共通） */
.input {
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 15px;
    padding: 1em;
    background-color: rgba(255, 255, 255, 1);
    box-shadow: inset 2px 5px 10px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.input:focus {
    transform: scale(1.02);
    box-shadow: inset 2px 4px 10px rgba(0, 0, 0, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

/* btn */
.btn {
    width: 100%;
    height: 50px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    padding: 16px 42px;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn:active {
    transform: translateY(2px);
    filter: brightness(0.98);
}

/* light */
/* orange */
html[data-theme="light"] .btn-main {
    background: #FF9400;
    color: #fff;
    box-shadow: var(--app-mainbutton-shadow);
}

/* gray */
html[data-theme="light"] .btn-sub {
    background: #e8e8e8;
    color: #111;
    box-shadow: var(--app-mainbutton-shadow);
}

/* red */
html[data-theme="light"] .btn-red {
    background: #ff383c;
    color: #fff;
    box-shadow: var(--app-mainbutton-shadow);
}

/* black */
html[data-theme="light"] .btn-black {
    background: #111;
    color: #fff;
    box-shadow: var(--app-mainbutton-shadow);
}

/* light　押下 */
/* orange */
html[data-theme="light"] .btn-main:active {
    box-shadow: inset 4px 4px 8px #d4571c, inset -4px -4px 8px #ff8a4a;
}

/* gray */
html[data-theme="light"] .btn-sub:active {
    color: #666;
    box-shadow: inset 4px 4px 12px #c5c5c5, inset -4px -4px 12px #fff;
}

/* red */
html[data-theme="light"] .btn-red:active {
    box-shadow: inset 4px 4px 8px #cc2d30, inset -4px -4px 8px #ff6b6e;
}

/* dark */
/* orange */
html[data-theme="dark"] .btn-main {
    background: #FF9400;
    color: #fff;
    border: 1px solid #737373;
    box-shadow: 6px 6px 12px #000, -6px -6px 12px #2f2f2f;
}

/* black */
html[data-theme="dark"] .btn-sub {
    background: #212121;
    color: #fff;
    border: 1px solid #212121;
    box-shadow: 6px 6px 12px #000, -6px -6px 12px #2f2f2f;
}

/* red */
html[data-theme="dark"] .btn-red {
    background: #ff383c;
    color: #fff;
    border: 1px solid #737373;
    box-shadow: 6px 6px 12px #000, -6px -6px 12px #2f2f2f;
}

/* dark　押下 */
/* orange */
html[data-theme="dark"] .btn-main:active {
    box-shadow: inset 4px 4px 8px #d4571c, inset -4px -4px 8px #ff8a4a;
}

/* black */
html[data-theme="dark"] .btn-sub:active {
    color: #666;
    box-shadow: inset 4px 4px 12px #000, inset -4px -4px 12px #1f1f1f;
}

/* red */
html[data-theme="dark"] .btn-red:active {
    box-shadow: inset 4px 4px 8px #cc2d30, inset -4px -4px 8px #ff6b6e;
}

/* account modals: force light button styles */
.modal-light .btn-main {
    background: #FF9400;
    color: #fff;
    border: none;
    box-shadow: var(--app-mainbutton-shadow);
}

.modal-light .btn-sub {
    background: #e8e8e8;
    color: #111;
    border: none;
    box-shadow: var(--app-mainbutton-shadow);
}

.modal-light .btn-red {
    background: #ff383c;
    color: #fff;
    border: none;
    box-shadow: var(--app-mainbutton-shadow);
}

.modal-light .btn-main:active {
    box-shadow: inset 4px 4px 8px #d4571c, inset -4px -4px 8px #ff8a4a;
}

.modal-light .btn-sub:active {
    color: #666;
    box-shadow: inset 4px 4px 12px #c5c5c5, inset -4px -4px 12px #fff;
}

.modal-light .btn-red:active {
    box-shadow: inset 4px 4px 8px #cc2d30, inset -4px -4px 8px #ff6b6e;
}

/* dark theme override: keep modal buttons light */
html[data-theme="dark"] .modal-light .btn-main {
    background: #FF9400;
    color: #fff;
    border: none;
    box-shadow: var(--app-mainbutton-shadow);
}

html[data-theme="dark"] .modal-light .btn-sub {
    background: #e8e8e8;
    color: #111;
    border: none;
    box-shadow: var(--app-mainbutton-shadow);
}

html[data-theme="dark"] .modal-light .btn-red {
    background: #ff383c;
    color: #fff;
    border: none;
    box-shadow: var(--app-mainbutton-shadow);
}

html[data-theme="dark"] .modal-light .btn-main:active {
    box-shadow: inset 4px 4px 8px #d4571c, inset -4px -4px 8px #ff8a4a;
}

html[data-theme="dark"] .modal-light .btn-sub:active {
    color: #666;
    box-shadow: inset 4px 4px 12px #c5c5c5, inset -4px -4px 12px #fff;
}

html[data-theme="dark"] .modal-light .btn-red:active {
    box-shadow: inset 4px 4px 8px #cc2d30, inset -4px -4px 8px #ff6b6e;
}


/* =========================
   アカウント画面専用
========================= */


/* 設定行のベース */
/* 設定行のベース */
.setting-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 左ブロックと右ブロックを両端へ */
    gap: 12px;

    padding: 9px 18px;
    border-radius: 18px;

    background: rgb(var(--app-bg));
    color: rgb(var(--app-text));
    border: none;
}

/* 押下時 */
.setting-btn:active {
    transform: translateY(1px);
    filter: brightness(0.985);
}

/* 左側：アイコン＋文字 */
.setting-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* 右側：丸ボタンや矢印 */
.setting-right {
    display: flex;
    /* 横並びにする */
    align-items: center;
    /* 縦中央揃え */
    gap: 8px;
    /* ボタン同士の間隔 */
    flex-shrink: 0;
    /* 左の文字が長くても潰れないようにする */
}

/* 左側のアイコン枠 */
.setting-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;

    color: rgb(var(--app-text));
    opacity: 0.9;
}

/* テキスト（長い場合は・・・にする） */
.setting-text {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右側の丸いボタン（更新アイコン/矢印アイコン） */
.setting-action,
.setting-next {
    width: 44px;
    height: 44px;
    border-radius: 999px;

    background: rgb(var(--app-bg));
    color: rgb(var(--app-text));
    display: grid;
    place-items: center;

    border: none;
}


/* トグル */
.switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 4em;
    height: 2.2em;
    border-radius: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 背景 */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-color: #2a2a2a;
    transition: 0.4s;
    border-radius: 30px;
    overflow: hidden;
}

/* つまみ（before） */
.slider:before {
    position: absolute;
    content: "";
    height: 1.2em;
    width: 1.2em;
    border-radius: 20px;

    left: 0.5em;
    bottom: 0.5em;

    transition: 0.4s;
    transition-timing-function: cubic-bezier(0.81, -0.04, 0.38, 1.5);

    box-shadow: inset 8px -4px 0px 0px #fff;
}

/* チェック時：背景色昼 */
.switch input:checked+.slider {
    background-color: #00a6ff;
}

/* チェック時：太陽 */
.switch input:checked+.slider:before {
    transform: translateX(1.8em);
    box-shadow: inset 15px -4px 0px 15px #ffcf48;
}

/* 星 */
.star {
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    width: 5px;
    height: 5px;
    transition: all 0.4s;
}

.star_1 {
    left: 2.5em;
    top: 0.5em;
}

.star_2 {
    left: 2.2em;
    top: 1.2em;
}

.star_3 {
    left: 3em;
    top: 0.9em;
}

/* チェック時：星を消す（昼） */
.switch input:checked~.slider .star {
    opacity: 0;
}

/* 雲 */
.cloud {
    width: 3.5em;
    position: absolute;
    bottom: -1.4em;
    left: -1.1em;
    opacity: 0;
    transition: all 0.4s;
}

/* チェック時：雲を出す */
.switch input:checked~.slider .cloud {
    opacity: 1;
}

/* ===== Category: 選択中の見た目 ===== */

/* 選択中：丸を塗りつぶし */
.cat-pick.is-selected .cat-pick-circle {
    background: var(--c);
    border-color: var(--c);
}

/* 選択中：文字は白（style="color: var(--c)" に勝つ） */
.cat-pick.is-selected .cat-inner {
    color: #fff !important;
}

/* SVGは fill/stroke を触らず、見た目だけ白化 */
.cat-pick.is-selected .cat-inner svg {
    filter: brightness(0) invert(1);
}

/* other_exp の ￥ は選択時も見えるように調整 */
.cat-pick.is-selected .cat-inner svg.other-exp-icon {
    filter: none;
}

.cat-pick.is-selected .cat-inner svg.other-exp-icon .yen-mark {
    fill: var(--c) !important;
}

/* ===== List: Category Icon ===== */
.list-category-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
}

.list-category-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.list-category-label {
    height: 14px;
    display: grid;
    place-items: center;
    line-height: 1;
    text-align: center;
}

/* アイコン＋文字の塊を固定2段にする */
.cat-col {
    width: 40px;
    display: grid;
    grid-template-rows: 24px 14px;
    justify-items: center;
    align-items: center;
    row-gap: 4px;
}


/* Chrome / Safari */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
}

input[type="date"]::-webkit-clear-button {
    display: none;
}

/* Firefox */
input[type="date"] {
    appearance: none;
    -moz-appearance: textfield;
}

.date-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 0.001;
    /* 0だとOSによって反応しない時ある */
    cursor: pointer;
}

.date-native {
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
}

.no-footer .app-footer {
    display: none;
}
