/* 申し込み・パスワードを忘れたとき・2段階認証・請求・退会・運営者の画面に追加した分で、足りない部品だけ。
   色・文字・角の丸みは public/style.css の変数をそのまま使う。 */

/* ── ログインの前の画面（申し込み など）。形は、ログインの画面と同じ */
.acct-gate .gate-art { justify-content: flex-start; }
.gate-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.gate-points li { display: flex; gap: 10px; align-items: flex-start; color: #c4c9d0; font-size: 0.94rem; }
.gate-points .ic { color: #8fa4ff; flex: none; margin-top: 4px; }
.login.signup { width: min(440px, 100%); gap: 14px; }
.login label small { font-weight: 400; color: var(--sub); font-size: 0.78rem; line-height: 1.6; }
.login label small [data-code-url] { display: block; font-family: var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.login label.agree { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 0.9rem; color: var(--ink-2); }
.login label.agree input { width: 18px; height: 18px; flex: none; margin: 4px 0 0; }
.login .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.login .for { color: var(--ink-2); font-size: 0.88rem; margin-top: -6px; }
.login .contact { color: var(--ink); font-weight: 700; }
.login.done { width: min(520px, 100%); }
.login.done .once { max-width: none; }
.login.done .once dd small { display: block; font-family: var(--font); font-size: 0.78rem; color: var(--sub); user-select: none; }
.login a.btn, .login button.btn.ghost { display: inline-flex; justify-content: center; }
.login input.otp, input.otp { font-family: var(--mono); font-size: 1.3rem; letter-spacing: 0.18em; }
form.inline input.otp { width: 190px; height: 42px; }

/* ── 2段階認証の設定 */
.steps2fa { list-style: none; padding: 0; margin: 0 0 14px; counter-reset: s; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); max-width: 900px; }
.steps2fa > li { counter-increment: s; padding: 16px 18px 16px 58px; position: relative; border-bottom: 1px solid var(--rule-2); }
.steps2fa > li:last-child { border-bottom: 0; }
.steps2fa > li::before { content: counter(s); position: absolute; left: 18px; top: 15px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-weight: 600; display: grid; place-items: center; font-size: 0.9rem; }
.steps2fa > li > p { color: var(--sub); font-size: 0.88rem; margin-top: 2px; }
.steps2fa form { margin-top: 10px; }
.qrbox { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.qrbox .qr { border: 1px solid var(--rule); border-radius: var(--r); padding: 6px; background: #fff; line-height: 0; }
.qrbox > div:last-child { flex: 1 1 260px; min-width: 0; }
.qrbox .secret { font-size: 1.05rem; color: var(--ink); background: var(--sunken); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; margin-top: 6px; user-select: all; overflow-wrap: anywhere; }
.qrbox .url { font-size: 0.74rem; overflow-wrap: anywhere; user-select: all; }
.recovery { list-style: none; padding: 16px 20px; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 20px; max-width: 720px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); font-size: 1.15rem; color: var(--ink); }
.recovery li { user-select: all; }

/* ── 請求 */
.cfacts.bill, .cfacts.bk { margin-bottom: 0; }
.cfacts dd.path { overflow-wrap: anywhere; }
/* バックアップ: 長いフォルダ名は 1 段まるごと使う（スマホで細かく折れない）。見出しには入れず、下の行に出す */
@media (max-width: 820px) {
  .cfacts.bk > .wide { grid-column: 1 / -1; }
}
.bkpath { overflow-wrap: anywhere; margin: -4px 0 10px; }
.cfacts dd a { color: var(--accent-ink); }
.monthnav { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
.monthnav b { font-family: var(--mono); font-size: 1rem; min-width: 8.5em; text-align: center; }
.monthnav .btn { padding: 0 8px; }
.list.invs td .del { display: inline-flex; margin-left: 4px; vertical-align: middle; }
.list.invs select { height: 32px; font-size: 0.86rem; font-weight: 700; }
.list.invs select.st-ok { color: var(--ok); }
.list.invs select.st-ng { color: var(--bad); }
.list td small.warn { color: var(--bad); font-weight: 700; }
details.addinv { margin-top: 18px; }
.block.late > h2 { color: var(--bad); }
.block.late > h2 small { font-weight: 400; color: var(--sub); font-size: 0.84rem; }
.block > h2 small { font-weight: 400; color: var(--sub); font-size: 0.82rem; overflow-wrap: anywhere; }
.sub.months a { margin-right: 4px; }
.grid.prices { max-width: 760px; }
.yenin { display: flex; align-items: center; gap: 8px; }
.yenin input { text-align: right; font-family: var(--mono); }
.yenin i { font-style: normal; color: var(--sub); font-size: 0.86rem; white-space: nowrap; font-weight: 400; }

/* ── 運営者の画面: メニューの数、印、絞り込み */
.side nav a .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #d9530f; color: #fff; font-style: normal; font-family: var(--mono); font-size: 0.74rem; font-weight: 600; display: grid; place-items: center; }
.mark-signup, .mark-leave { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 4px; font-family: var(--font); font-size: 0.72rem; font-weight: 700; line-height: 1.7; background: var(--accent-soft); color: var(--accent-ink); }
.mark-leave { background: var(--bad-soft); color: var(--bad); }
.list td small .mono { color: var(--sub); }
.origin { margin: -8px 0 14px; color: var(--ink-2); font-size: 0.9rem; }
.origin .mark-signup { margin: 0 10px 0 0; }
.sub.sorts { margin-top: 10px; }
.filters.logf .range { display: flex; align-items: center; gap: 6px; color: var(--sub); }
.filters.logf input[type="search"] { flex: 1 1 220px; min-width: 180px; }
.list.operators td.opact { white-space: nowrap; }
.list.operators td.opact form { display: inline-flex; margin-left: 4px; }
details.purge { margin: 6px 0 0; text-align: right; }
details.purge form { justify-content: flex-end; text-align: left; }
.health { list-style: none; padding: 0; margin: 0 0 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); max-width: 900px; }
.health li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.health li:last-child { border-bottom: 0; }
.health li b { min-width: 7.5em; }
.health li span:last-child { color: var(--ink-2); font-size: 0.9rem; }
.howto { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; color: var(--ink-2); max-width: 100ch; }
.mailhead { margin-bottom: 14px; }
.mailhead dd small { display: block; font-size: 0.8rem; }
.mailbody { margin: 0; max-width: 900px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); font-size: 0.95rem; line-height: 1.8; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; }

/* ── 退会 */
.leave-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; max-width: 900px; }
.leave-steps > li { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 10px; }
.leave-steps > li > p { color: var(--ink-2); font-size: 0.92rem; }

/* ── 請求書（A4 縦） */
.inv-page { background: #e9e7e1; margin: 0; }
.inv-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; }
.inv-tools .flash { margin: 0; flex: 1 1 320px; }
.inv-sheet { width: 210mm; min-height: 297mm; margin: 0 auto 30px; background: #fff; color: #111; padding: 22mm 18mm 18mm; box-shadow: var(--shadow-lg); font-size: 10.5pt; line-height: 1.7; }
.inv-sheet header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 6mm; }
.inv-sheet h1 { font-size: 22pt; letter-spacing: 0.4em; }
.inv-meta { display: grid; grid-template-columns: max-content max-content; gap: 1mm 5mm; font-size: 9.5pt; }
.inv-meta dt { color: #555; }
.inv-meta dd { text-align: right; }
.inv-parties { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12mm; margin-top: 10mm; }
.inv-to .name { font-size: 15pt; font-weight: 700; border-bottom: 1px solid #111; padding-bottom: 2mm; margin-bottom: 4mm; }
.inv-to .name span { font-size: 11pt; font-weight: 400; margin-left: 4mm; }
.inv-total { display: flex; justify-content: space-between; align-items: baseline; gap: 6mm; margin: 7mm 0 3mm; padding: 3mm 4mm; background: #f1f1ef; border-top: 1px solid #111; border-bottom: 1px solid #111; }
.inv-total dt { font-size: 10pt; font-weight: 700; }
.inv-total dd { font-family: var(--mono); font-size: 20pt; font-weight: 600; }
.inv-total dd span { font-family: var(--font); font-size: 10pt; font-weight: 400; margin-left: 2mm; }
.inv-to .due b { font-family: var(--mono); font-size: 11.5pt; }
.inv-from { font-size: 9.5pt; }
.inv-from .name { font-size: 12pt; font-weight: 700; margin-bottom: 2mm; }
.inv-lines { width: 100%; border-collapse: collapse; margin-top: 12mm; }
.inv-lines th { background: #111; color: #fff; font-size: 9pt; font-weight: 700; padding: 2mm 3mm; text-align: left; }
.inv-lines th.r, .inv-lines td.r { text-align: right; }
.inv-lines td { padding: 3.5mm 3mm; border-bottom: 1px solid #bbb; vertical-align: top; }
.inv-lines td.r { font-family: var(--mono); white-space: nowrap; }
.inv-lines td small { display: block; color: #555; font-size: 8.5pt; }
.inv-sum { margin: 5mm 0 0 auto; border-collapse: collapse; min-width: 72mm; }
.inv-sum th { text-align: left; font-weight: 400; padding: 1.5mm 3mm; color: #333; }
.inv-sum td { text-align: right; font-family: var(--mono); padding: 1.5mm 3mm; white-space: nowrap; }
.inv-sum tr.total th, .inv-sum tr.total td { font-weight: 700; font-size: 12pt; border-top: 1px solid #111; padding-top: 2.5mm; }
.inv-taxnote { text-align: right; font-size: 8.5pt; color: #555; margin-top: 2mm; }
.inv-pay, .inv-note { margin-top: 10mm; }
.inv-pay h2, .inv-note h2 { font-size: 9.5pt; border-bottom: 1px solid #111; padding-bottom: 1mm; margin-bottom: 2.5mm; }
.inv-pay .small { font-size: 8.5pt; color: #555; margin-top: 1.5mm; }

@media (max-width: 820px) {
  .monthnav { width: 100%; }
  .qrbox { gap: 12px; }
  .steps2fa > li { padding: 14px 14px 14px 50px; }
  .steps2fa > li::before { left: 14px; }
  form.inline.wrap > .lbl, form.inline.wrap > .lbl input, form.inline.wrap > .lbl select { width: 100%; }
  .filters.logf .range { width: 100%; }
  .filters.logf .range input { flex: 1; min-width: 0; }
  .list.operators td.opact { white-space: normal; }
  details.purge, details.purge form { text-align: left; justify-content: flex-start; }
  /* 請求の表は、狭い画面では 1 件を 1 つの札にする */
  .list.invs thead, .list.lates thead, .list.reqs thead, .list.mails thead, .list.notices thead, .list.logins thead, .list.operators thead { display: none; }
  .list.invs tr, .list.lates tr, .list.reqs tr, .list.mails tr, .list.notices tr, .list.logins tr, .list.operators tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule-2); }
  .list.invs td, .list.lates td, .list.reqs td, .list.mails td, .list.notices td, .list.logins td, .list.operators td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .list.invs td:nth-child(1), .list.lates td:nth-child(1) { grid-column: 1; }
  .list.invs td:nth-child(2), .list.lates td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  .list.invs td:nth-child(3)::before, .list.lates td:nth-child(3)::before { content: "期限 "; font-family: var(--font); color: var(--sub); }
  .list.invs td:nth-child(3), .list.lates td:nth-child(3) { grid-column: 1 / -1; font-size: 0.84rem; }
  .list.invs td:nth-child(4) { grid-column: 1; }
  .list.invs td:nth-child(5) { grid-column: 2; align-self: center; }
  /* 消す・取り消すは、字の付いたボタンにして、請求書のボタンから離す（押し間違えない） */
  .list.invs td:nth-child(5) { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
  .list.invs td .del { margin-left: 0; }
  .list.invs td .del .btn, .list.notices td form .btn.ng { height: 40px; }
  .list.lates td:nth-child(4) { grid-column: 1 / -1; }
  .list.reqs td, .list.mails td, .list.notices td, .list.logins td { grid-column: 1 / -1; }
  .list.reqs td:nth-child(1), .list.mails td:nth-child(1), .list.logins td:nth-child(1) { font-size: 0.8rem; }
  .list.operators td:nth-child(1) { grid-column: 1; }
  .list.operators td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  .list.operators td:nth-child(n + 3) { grid-column: 1 / -1; }
  .list.operators td:nth-child(3)::before { content: "最終ログイン "; font-family: var(--font); }
}
/* 請求書をスマホで見るときの形。画面のときだけ（A4 の紙は幅が 794px 相当なので、screen を付けないと、印刷にもスマホの形が当たって崩れる） */
@media screen and (max-width: 820px) {
  .inv-page { background: #fff; }
  .inv-sheet { width: auto; min-height: 0; margin: 0; padding: 18px 16px 40px; box-shadow: none; font-size: 0.92rem; }
  .inv-sheet header { flex-direction: column; gap: 8px; }
  .inv-parties { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .inv-lines th:nth-child(2), .inv-lines td:nth-child(2), .inv-lines th:nth-child(3), .inv-lines td:nth-child(3) { display: none; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  .noprint, .inv-tools { display: none !important; }
  .inv-page { background: #fff; }
  .inv-sheet { box-shadow: none; margin: 0; width: 210mm; min-height: 0; }
  /* バックアップコードを印刷するとき: メニューを外して、コードだけにする */
  body:has(.recovery) .side, body:has(.recovery) .mtop, body:has(.recovery) .bar, body:has(.recovery) .flash { display: none !important; }
  body:has(.recovery) .app { display: block; }
}

/* 細かい手直し: 数字の欄の例の文字は、ふつうの字で。メールの欄は、切れない幅に */
input.otp::placeholder { letter-spacing: 0; font-family: var(--font); font-size: 0.9rem; }
form.inline .lbl input[type="email"], form.inline input[type="email"] { width: min(320px, 100%); }
form.inline.wrap + .sub { margin-top: 10px; }
.cfacts dd.path { font-family: var(--mono); font-size: 0.8rem; font-weight: 400; line-height: 1.5; }
.cfacts dd.path .tag { font-family: var(--font); }
.howto { list-style: decimal; }
@media (max-width: 820px) {
  /* 下のメニューの数は、絵の右上に重ねる（メニューの高さを変えない） */
  .side nav a .badge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 0.68rem; }
  .list.operators tr.me td { background: none; }
}
@media (max-width: 820px) { .list.ops-list td:nth-child(4) small { display: block; margin-left: 0; } }

/* ── ログインの手前の知らせ（会社が見つからない・止めている・メールを確かめた など）。ログインの画面と同じ形 */
.gate-form .login.notice { padding: 0; max-width: none; width: min(440px, 100%); justify-items: stretch; gap: 14px; }
.gate-form .login.notice > .ic { width: 36px; height: 36px; color: var(--warn); }
.gate-form .login.notice.ok > .ic { color: var(--ok); }
.gate-form .login.notice h2 { font-size: 1.4rem; line-height: 1.5; }
.gate-form .login.notice > p:not(.flash) { color: var(--ink-2); margin-top: -4px; font-size: 0.95rem; }
.gate-form .login.notice > p.sub { color: var(--sub); font-size: 0.88rem; }
.gate-form .login.notice .btn { justify-self: start; padding: 0 22px; }
@media (max-width: 820px) { .gate-form .login.notice .btn { justify-self: stretch; } }

/* 細かい手直し（最後の通し確認） */
.tfbox > .sub, .block > .sub + form.tfstart { max-width: 78ch; }
form.tfstart { margin-top: 14px; }
/* メールの欄: ラベルの幅が中身で決まるので、欄が細くなって例が切れていた */
form.inline .lbl:has(input[type="email"]) { flex: 0 1 320px; }
form.inline .lbl input[type="email"] { width: 100%; }
/* 申し込み: しまってある会社コードの欄 */
.login details.codebox { margin: 0; font-size: 0.86rem; }
.login details.codebox > summary { cursor: pointer; color: var(--accent-ink); }
.login details.codebox > label { margin-top: 10px; }
/* 運営者の会社の画面: あらましの札は 3 つずつ。プランの補足は、次の行に */
.cfacts.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cfacts.six dd:not(.small) small.line { display: block; }
@media (max-width: 820px) { .cfacts.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.planlines { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.88rem; color: var(--ink-2); }
.planlines + .sub { margin-top: 10px; }

/* 発行元が入っていない・見本のままの請求書（運営の画面だけで見せる）。斜めの「見本」の印 */
.inv-sheet.inv-sample { position: relative; }
.inv-stamp { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); margin: 0; padding: 6px 28px; border: 6px solid #c0331fcc; border-radius: 12px; color: #c0331fcc; font-size: 4.2rem; font-weight: 700; letter-spacing: 0.3em; pointer-events: none; z-index: 2; }
/* メールとパスワードの欄の幅をそろえる */
form.eqw .lbl { flex: 1 1 260px; max-width: 360px; }
form.eqw .lbl input { width: 100%; }
/* バックアップの画面（スマホ）: 上の札は全部、横いっぱいにそろえる */
@media (max-width: 820px) { .cfacts.bk { grid-template-columns: minmax(0, 1fr); } }
