/* 「？使い方」（2026-10-19 NOBU「各ページのヘルプ作って」「動く矢印でここを押せ」）。
   ボタンはいつも光らせて目立たせる（NOBU）。
   ログイン画面は app.css を読まないので、見た目はこのファイルだけで足りるようにしてある。 */

.help-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 42px;
    padding: 0 12px;
    border: 2px solid #f0a500;
    border-radius: 12px;
    background: #fff7e0;
    color: #6b4200;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    animation: help-glow 1.6s ease-out infinite;
}
.help-open:focus-visible {
    outline: 3px solid #26332a;
    outline-offset: 2px;
}
.help-open-mark {
    font-size: 17px;
}

@keyframes help-glow {
    0%   { box-shadow: 0 0 0 0 rgba(240, 165, 0, .75); }
    70%  { box-shadow: 0 0 0 10px rgba(240, 165, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(240, 165, 0, 0); }
}

/* ホームはスマホで上の帯を消しているので、その画面だけ右上に置く */
.help-open--home {
    display: none;
}
@media (max-width: 760px) {
    .help-open--home {
        display: inline-flex;
        position: absolute;
        top: calc(37px + env(safe-area-inset-top));
        /* 右上のベル（.home8-bell・幅52px）の左に置く。重ねるとベルが押せない */
        right: 82px;
        z-index: 30;
    }
}
/* 狭いスマホでは「？」だけにして、上の帯からはみ出さないようにする */
@media (max-width: 359px) {
    .help-open-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .help-open {
        padding: 0 10px;
    }
}

/* ---------- 説明の窓 ---------- */
.help-panel {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 18, .5);
}
.help-panel[hidden] {
    display: none;
}
.help-sheet {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 18px;
    background: #fff;
    color: #26332a;
    font-size: 16px;
    line-height: 1.7;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .3);
    overflow-wrap: anywhere;
}
@media (max-width: 760px) {
    .help-panel {
        align-items: flex-end;
        padding: 0;
    }
    .help-sheet {
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
    }
}
.help-sheet h2 {
    margin: 0 0 8px;
    font-size: 20px;
}
.help-sheet h3 {
    margin: 16px 0 6px;
    font-size: 16px;
}
.help-sheet p {
    margin: 0;
}
.help-sheet ol,
.help-sheet ul {
    margin: 0;
    padding-left: 1.4em;
}
.help-sheet li + li {
    margin-top: 4px;
}
.help-notes {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7e0;
}
.help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.help-actions button,
.help-tour-buttons button {
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.help-close {
    background: #ecf3ee;
    color: #26332a;
}

/* ---------- 「▶ やってみる」（2026-10-20 NOBU：使い方の窓の外に出す） ---------- */
/* 見出しの右に置く。見出しが長いときは下の行へ回る */
.help-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}
.help-tour-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: #c62828;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(198, 40, 40, .25);
}
.help-tour-open:focus-visible {
    outline: 3px solid #26332a;
    outline-offset: 2px;
}
/* ホームは「作業を記録する」の上に1行で置く（右寄せ） */
.help-home-tour {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.help-home-tour:empty {
    display: none;
}
.help-tour-hint {
    margin-top: 12px !important;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fdecea;
    font-weight: 700;
}

/* ---------- 動く矢印の案内 ---------- */
.help-tour-target {
    outline: 4px solid #ffb300 !important;
    outline-offset: 3px !important;
    border-radius: 6px;
}
.help-tour-arrow {
    position: fixed;
    z-index: 1001;
    width: 48px;
    height: 48px;
    margin-left: -24px;
    pointer-events: none;
    color: #e53935;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
    animation: help-bounce-down .8s ease-in-out infinite alternate;
}
.help-tour-arrow.is-up {
    animation-name: help-bounce-up;
}
.help-tour-arrow svg {
    display: block;
    width: 48px;
    height: 48px;
}
@keyframes help-bounce-down {
    from { transform: translateY(-10px); }
    to   { transform: translateY(0); }
}
@keyframes help-bounce-up {
    from { transform: translateY(10px) rotate(180deg); }
    to   { transform: translateY(0) rotate(180deg); }
}
.help-tour-bubble {
    position: fixed;
    z-index: 1002;
    left: 50%;
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 24px));
    transform: translateX(-50%);
    padding: 14px 16px;
    border-radius: 14px;
    background: #26332a;
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    overflow-wrap: anywhere;
}
@media (min-width: 761px) {
    .help-tour-bubble {
        bottom: 24px;
    }
}
/* 吹き出しの位置は public/js/help.js が指す場所の上（入らなければ下）に決める（2026-10-20）。
   吹き出しの文の部分は押しても下の画面に届くようにし、押せるのは吹き出しのボタンだけにする。
   吹き出しが画面のボタンに重なっても、案内とは別に画面を進められるように（NOBU「案内がついてこない」） */
.help-tour-bubble {
    pointer-events: none;
}
.help-tour-bubble button {
    pointer-events: auto;
}
.help-tour-count {
    margin: 0 0 4px;
    font-size: 13px;
    opacity: .8;
}
.help-tour-text {
    margin: 0;
    font-weight: 700;
}
.help-tour-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.help-tour-buttons .help-tour-next {
    background: #ffb300;
    color: #26332a;
}
.help-tour-buttons .help-tour-stop {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

@media print {
    .help-open,
    .help-tour-open,
    .help-panel,
    .help-tour-arrow,
    .help-tour-bubble {
        display: none !important;
    }
}
