:root {
  --navy: #182a52;        /* ブランドの紺（1a 安心・誠実） */
  --navy-deep: #101d3b;
  --blue: #182a52;        /* 主要アクション＝紺 */
  --blue-dark: #101d3b;
  --blue-light: #e8ecf5;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e3e8f1;
  --bg: #f4f6fa;          /* ごく薄いブルーグレー */
  --card: #ffffff;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(35, 31, 20, .05), 0 6px 18px rgba(35, 31, 20, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans JP", -apple-system, "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

/* ===== ヘッダー ===== */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--navy);
  color: #fff;
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 2px 12px rgba(16, 29, 59, .25);
}
.app-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 720px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text strong { display: block; font-size: 20px; font-weight: 900; line-height: 1.2; letter-spacing: .02em; }
.brand-text small { font-size: 11px; opacity: .7; letter-spacing: .02em; }

/* ===== ビュー ===== */
.view { max-width: 720px; margin: 0 auto; padding: 18px 16px; }
.section-title {
  font-size: 15px; font-weight: 800; letter-spacing: .02em;
  margin: 6px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 12px; }

/* ===== カード ===== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: .02em;
  line-height: 1.4;
}
.card p { margin: 6px 0; font-size: 14px; }

/* 紺のヒーロー（全幅・単色） */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--navy), #1f3563);
  border-radius: 0; border: 0;
  margin: -18px -16px 20px;  /* .view のパディングを打ち消して全幅に */
  padding: 28px 20px 26px;
  box-shadow: none;
}
.hero-badge {
  display: inline-block; margin-bottom: 14px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px; padding: 5px 12px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.hero h2 { margin: 0 0 8px; font-size: 26px; font-weight: 900; letter-spacing: .01em; line-height: 1.5; color: #fff; }
.hero p { margin: 0; font-size: 13px; line-height: 1.8; color: rgba(255, 255, 255, .85); }
.hero-price {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.hero-price .hp-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.hero-price .hp-row { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.hero-price .hp-amount { font-size: 30px; font-weight: 900; color: var(--navy); }
.hero-price .hp-note { font-size: 12px; color: #999; }
.hero-price .hp-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ===== ご利用の流れ（シンプルな行リスト） ===== */
.flow-card { padding: 6px 16px; }
.flow-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid #ecf0f7;
  font-size: 14px;
}
.flow-row:last-child { border-bottom: 0; }
.flow-row .f-num { color: var(--navy); font-weight: 800; font-size: 13px; flex-shrink: 0; }
.flow-row small { display: block; font-size: 12px; color: var(--muted); }

/* ===== ステップ（ホーム） ===== */
.step {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer;
  width: 100%; text-align: left; font-family: inherit; font-size: inherit; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.step:active { transform: scale(.985); }
.step .s-num {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(40, 86, 200, .18);
}
.step.done .s-num { background: #ddf3e4; color: var(--green); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .2); }
.step strong { font-size: 15px; display: block; letter-spacing: .02em; }
.step small { font-size: 12px; color: var(--muted); }
.step .s-check { margin-left: auto; font-size: 20px; align-self: center; }

/* ===== フォーム ===== */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; letter-spacing: .02em; }
.field .req {
  color: #fff; background: var(--navy); font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px;
  letter-spacing: .08em;
}
.field .hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
input, select, textarea {
  width: 100%; padding: 12px 13px; border: 1px solid #ccd4e3; border-radius: 11px;
  font-size: 16px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 86, 200, .16);
  background: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* セグメント切替（退職届/退職願） */
.seg { display: flex; background: #e8ebf2; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button {
  flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px;
  font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: color .15s ease;
}
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(35, 31, 20, .14); }

/* ===== ボタン ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 18px; border: 0; border-radius: 13px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; width: 100%; letter-spacing: .04em;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(24, 42, 82, .28);
}
.btn-primary:active { background: var(--navy-deep); transform: translateY(1px); box-shadow: 0 1px 4px rgba(24, 42, 82, .3); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(35, 31, 20, .05); }
.btn-ghost:active { background: #f0f3f9; }
.btn-sm { padding: 8px 13px; font-size: 13px; width: auto; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn-row .btn { flex: 1; }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .03em; }
.badge-green { background: #ddf3e4; color: var(--green); }
.badge-amber { background: #fdeece; color: var(--amber); }
.badge-blue { background: var(--blue-light); color: var(--blue); }

/* ===== チェックリスト ===== */
.chk {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid #ecf0f7; cursor: pointer;
}
.chk:last-child { border-bottom: 0; }
.chk input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--blue); }
.chk .c-body { font-size: 14px; }
.chk .c-body small { display: block; font-size: 11px; color: var(--muted); }
.chk input:checked ~ .c-body { color: var(--muted); text-decoration: line-through; }
.chk input:checked ~ .c-body small { text-decoration: none; }
/* フォーム内のチェック（同意・オプション）は取り消し線を付けない */
.chk.chk-plain input:checked ~ .c-body { color: inherit; text-decoration: none; }
.progress { height: 10px; background: #e3e8f1; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), #2c4a8f); border-radius: 999px; transition: width .5s; }

/* ===== アコーディオン（知識） ===== */
details.qa {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 16px; box-shadow: var(--shadow); margin-bottom: 10px;
}
details.qa summary {
  padding: 15px 0; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before { content: "▸"; color: var(--navy); transition: transform .15s; }
details.qa[open] summary::before { transform: rotate(90deg); }
details.qa .qa-body { padding: 0 0 15px; font-size: 13px; color: #43413a; }
details.qa .qa-body p { margin: 6px 0; }

/* ===== 縦書きプレビュー ===== */
.preview-wrap {
  background: #e8ebf2;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px; overflow-x: auto;
  box-shadow: inset 0 1px 4px rgba(35, 31, 20, .07);
}
.paper {
  writing-mode: vertical-rl;
  background: #fff; box-shadow: 0 3px 14px rgba(35, 31, 20, .2);
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  color: #111; margin: 0 auto;
  width: 100%; max-width: 420px; aspect-ratio: 210/297;
  padding: 6% 7%;
  display: flex; flex-direction: column; /* vertical-rl では column = 右→左 */
  font-size: clamp(9px, 2.6vw, 14px); line-height: 2.1;
  letter-spacing: .12em;
}
.paper .p-title { font-size: 1.6em; letter-spacing: .5em; margin-left: 2em; padding-top: 3em; }
.paper .p-gigi { align-self: flex-end; margin-left: .5em; }
.paper .p-body { margin-left: 1.5em; text-indent: 1em; }
.paper .p-date { margin-left: .5em; padding-top: 1em; }
.paper .p-signer { align-self: flex-end; margin-left: 2em; }
.paper .p-signer .p-seal { color: #b91c1c; border: 1px solid #b91c1c; border-radius: 50%; font-size: .6em; padding: .3em; margin-top: .8em; display: inline-block; }
.paper .p-sigimg { width: 2em; max-height: 8em; object-fit: contain; margin-top: .6em; }
.paper .p-to { font-size: 1.1em; padding-top: 1em; }

/* ===== 封筒見本 ===== */
.env {
  writing-mode: vertical-rl;
  background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 3px 14px rgba(35, 31, 20, .18);
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  color: #111; margin: 0 auto; position: relative;
  width: 60%; max-width: 240px; aspect-ratio: 120/235;
  padding: 8% 6%;
  display: flex; flex-direction: column;
  font-size: clamp(8px, 2.4vw, 13px); line-height: 1.9;
}
.env .e-addr { font-size: .85em; padding-top: 2em; text-orientation: upright; }
.env .e-name { font-size: 1.25em; margin-left: 1.5em; padding-top: 4em; font-weight: 600; }
.env .e-naka {
  position: absolute; left: 6%; bottom: 4%;
  writing-mode: vertical-rl; color: #1d4ed8; border: 1.5px solid #1d4ed8;
  padding: .5em .2em; font-size: .8em; font-weight: 700;
}
.env .e-back-from { font-size: .8em; padding-top: 6em; text-orientation: upright; }
.env-label { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 16px; }

/* ===== リスト項目（追跡・管理） ===== */
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-title { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item-body { font-size: 14px; margin-top: 8px; }
.badge-gray { background: #eceff5; color: var(--muted); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .e-ico { font-size: 48px; }
.empty p { margin: 12px 0 0; font-size: 14px; }

/* ===== フィルタチップ（管理） ===== */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ===== 振込案内 ===== */
.bank-box {
  background: #f5f8ff; border: 1px solid #ccd8ef; border-radius: var(--radius);
  padding: 16px; margin: 14px 0;
  box-shadow: var(--shadow);
}
.bank-box h3 {
  margin: 0 0 8px; font-size: 15px;
}
.bank-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.bank-table th, .bank-table td { border: 1px solid #ccd8ef; padding: 8px 10px; text-align: left; background: #fff; }
.bank-table th { width: 30%; font-size: 12px; color: var(--muted); font-weight: 700; }

/* ===== 署名キャンバス ===== */
.sign-wrap { border: 2px dashed #c4cfe3; border-radius: 12px; background: #fff; position: relative; }
#signPad { width: 100%; height: 180px; display: block; touch-action: none; border-radius: 12px; }
.sign-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; pointer-events: none; }

/* ===== モーダル ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 20, 32, .5); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.modal {
  background: #fff; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 22px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 800; letter-spacing: .02em; }

.icon-btn {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff;
  width: 40px; height: 40px; border-radius: 11px; font-size: 18px; cursor: pointer;
}
.icon-btn:active { background: rgba(255,255,255,.3); }

/* ===== 郵送ガイド ===== */
.mail-opt { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.mail-opt .m-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.mail-opt p { margin: 6px 0 0; font-size: 12px; color: #43413a; }

/* ===== タブバー ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -3px 14px rgba(35, 31, 20, .07);
}
.tab {
  flex: 1; background: none; border: 0; padding: 10px 0 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 10px; font-family: inherit;
  position: relative; letter-spacing: .06em;
}
.tab::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%;
  height: 3px; border-radius: 0 0 3px 3px;
  background: transparent; transition: background .15s ease;
}
.tab .tab-ico { font-size: 21px; filter: grayscale(1); opacity: .55; transition: filter .15s ease, opacity .15s ease; }
.tab.active { color: var(--blue); font-weight: 700; }
.tab.active::before { background: var(--navy); }
.tab.active .tab-ico { filter: none; opacity: 1; }

/* ===== トースト ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 13px;
  z-index: 60; box-shadow: 0 6px 18px rgba(16, 29, 59, .35); animation: fadeIn .2s;
  letter-spacing: .02em;
}
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

hr.div { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ===== 印刷 ===== */
#printArea { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { padding: 0; background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }

  /* 退職届（A4縦・縦書き） */
  .pr-letter {
    writing-mode: vertical-rl;
    width: 210mm; height: 296mm; padding: 30mm 25mm;
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
    color: #000; font-size: 14pt; line-height: 2.4; letter-spacing: .15em;
    display: flex; flex-direction: column;
  }
  .pr-letter .p-title { font-size: 22pt; letter-spacing: .5em; margin-left: 3em; padding-top: 3em; }
  .pr-letter .p-gigi { align-self: flex-end; margin-left: 1em; }
  .pr-letter .p-body { margin-left: 2em; text-indent: 1em; }
  .pr-letter .p-date { margin-left: 1em; padding-top: 1em; }
  .pr-letter .p-signer { align-self: flex-end; margin-left: 3em; }
  .pr-letter .p-signer .p-seal { color: #999; border: 1px dashed #999; border-radius: 50%; font-size: 8pt; padding: .4em; margin-top: 1em; display: inline-block; }
  .pr-letter .p-sigimg { width: 16mm; max-height: 60mm; object-fit: contain; margin-top: 5mm; }
  .pr-letter .p-to { font-size: 15pt; padding-top: 1em; }

  /* 添え状（A4横書き） */
  .pr-cover {
    width: 210mm; height: 296mm; padding: 30mm 25mm;
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
    color: #000; font-size: 11.5pt; line-height: 2;
  }
  .pr-cover .c-date { text-align: right; }
  .pr-cover .c-to { margin-top: 1em; }
  .pr-cover .c-from { text-align: right; margin-top: 1em; }
  .pr-cover h1 { text-align: center; font-size: 15pt; font-weight: 600; letter-spacing: .3em; margin: 2em 0 1.5em; }
  .pr-cover .c-body { text-indent: 1em; }
  .pr-cover .c-ki { text-align: center; font-weight: 600; margin: 2em 0 .5em; }
  .pr-cover .c-items { width: 60%; margin: 0 auto; }
  .pr-cover .c-ijo { text-align: right; margin-top: 1.5em; }

  /* 宛名（封筒書き写し用見本 A4） */
  .pr-env { width: 210mm; height: 296mm; padding: 20mm; font-family: "Yu Mincho", "YuMincho", serif; color: #000; }
  .pr-env h2 { font-size: 13pt; font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; }
  .pr-env .env { width: 90mm; aspect-ratio: 120/235; max-width: none; font-size: 11pt; margin: 8mm auto; box-shadow: none; }
}
