/* =====================================================================
   Douwee 共通スタイル
   ===================================================================== */
:root {
  --brand: #4338ca;
  --brand-600: #3730a3;
  --brand-50: #eef0ff;
  --brand-100: #e0e3ff;
  --accent: #f59e0b;
  --ink: #1f2330;
  --ink-2: #4b5163;
  --ink-3: #7a8094;
  --line: #e4e6ef;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #0f9d6b;
  --ok-50: #e7f7f0;
  --warn: #b45309;
  --warn-50: #fff6e5;
  --err: #d6334a;
  --err-50: #fdecee;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 6px 24px rgba(20, 24, 50, .06);
  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 15px; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-3); }
.mono { font-family: var(--mono); word-break: break-all; }
[hidden] { display: none !important; }

/* ---------- ボタン ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; font: inherit; font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; border-radius: 999px; padding: .7em 1.4em; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--brand-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #c9cddc; background: #fafbff; }
.btn.soft { background: var(--brand-50); color: var(--brand); }
.btn.soft:hover { background: var(--brand-100); }
.btn.danger { background: #fff; color: var(--err); border-color: #f2c4cb; }
.btn.small { padding: .4em .9em; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.big { font-size: 1.05rem; padding: .9em 1.6em; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }

/* ---------- フォーム ---------- */
label { display: block; font-weight: 700; font-size: .9rem; margin: 0 0 .35em; }
.req::after { content: "必須"; font-size: .7rem; font-weight: 700; color: #fff; background: var(--err); border-radius: 4px; padding: .05em .45em; margin-left: .5em; vertical-align: .1em; }
.opt::after { content: "任意"; font-size: .7rem; font-weight: 700; color: var(--ink-3); background: #eceef4; border-radius: 4px; padding: .05em .45em; margin-left: .5em; vertical-align: .1em; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=month], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid #d5d8e3; border-radius: 10px; padding: .65em .8em; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-100); border-color: var(--brand); }
textarea { resize: vertical; min-height: 6em; line-height: 1.7; }
.field { margin-bottom: 1.1em; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: .3em; }
.row { display: flex; gap: .75em; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.check { display: flex; gap: .7em; align-items: flex-start; font-weight: 700; cursor: pointer; }
.check input { width: 1.35em; height: 1.35em; margin: .15em 0 0; accent-color: var(--brand); flex: none; }
.switch { display: flex; gap: .7em; align-items: flex-start; font-weight: 400; cursor: pointer; }
.switch input { width: 1.15em; height: 1.15em; margin-top: .25em; accent-color: var(--brand); flex: none; }
.otp-input { font-family: var(--mono); font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; max-width: 12em; }

/* ---------- カード・レイアウト ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5em; }
.narrow { max-width: 460px; margin: 0 auto; }
.center { text-align: center; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 1em; }
.notice { border-radius: 10px; padding: .8em 1em; font-size: .9rem; margin-bottom: 1em; }
.notice.info { background: var(--brand-50); color: #2d2a7a; }
.notice.ok { background: var(--ok-50); color: #0b6b49; }
.notice.warn { background: var(--warn-50); color: #7a3e06; }
.notice.err { background: var(--err-50); color: #9b1c30; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .15em .7em; background: #eceef4; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.err { background: var(--err-50); color: var(--err); }
.badge.brand { background: var(--brand-50); color: var(--brand); }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: .01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4em; }
.logo .dot { width: .85em; height: .85em; border-radius: 50%; background: var(--brand); box-shadow: inset -.18em -.18em 0 rgba(0,0,0,.18); position: relative; }
.logo .dot::after { content: ""; position: absolute; left: .22em; top: .18em; width: .3em; height: .18em; border-left: .1em solid #fff; border-bottom: .1em solid #fff; transform: rotate(-45deg); }
.simple { display: flex; min-height: 100vh; align-items: center; padding: 24px 16px; }
.simple main { width: 100%; }
.spinner { width: 1em; height: 1em; border: .16em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2330; color: #fff; padding: .7em 1.2em; border-radius: 999px; font-size: .9rem; z-index: 100; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--err); }

/* ---------- サイトヘッダー ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.topbar nav { display: flex; gap: 1.2em; align-items: center; font-size: .9rem; }
.topbar nav a { color: var(--ink-2); text-decoration: none; }
.topbar nav a:hover { color: var(--brand); }
.topbar nav a.btn, .topbar nav a.btn:hover { color: #fff; }
.footer { color: var(--ink-3); font-size: .8rem; padding: 32px 0 48px; }
.footer a { color: var(--ink-3); margin-right: 1.2em; }

/* ---------- LP ---------- */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 400px at 80% -10%, #e5e7ff 0%, transparent 60%), linear-gradient(#fff, var(--bg)); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -.01em; margin-bottom: .45em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 1.1rem; color: var(--ink-2); margin-bottom: 1.6em; }
.hero .price-note { font-size: .85rem; color: var(--ink-3); margin-top: .8em; }
.mock { background: #fff; border-radius: 22px; box-shadow: 0 20px 60px rgba(40, 40, 120, .15); padding: 20px; border: 1px solid var(--line); max-width: 360px; margin-left: auto; }
.mock .bar { height: 10px; border-radius: 6px; background: #eceef4; margin: 8px 0; }
.mock .bar.s { width: 60%; }
.mock .bar.m { width: 85%; }
.mock .title { font-weight: 800; margin: 4px 0 12px; }
.mock .agree { display: flex; align-items: center; gap: 10px; background: var(--brand-50); border-radius: 12px; padding: 12px; font-weight: 700; margin: 16px 0 12px; font-size: .9rem; }
.mock .box { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); position: relative; flex: none; }
.mock .box::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(45deg); }
.mock .done { display: flex; gap: 10px; align-items: center; font-size: .82rem; color: var(--ink-2); background: var(--ok-50); padding: 10px 12px; border-radius: 12px; }
.section { padding: 64px 0; }
.section h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); text-align: center; margin-bottom: .3em; }
.section .sub { text-align: center; color: var(--ink-2); margin-bottom: 2.4em; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .num { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; }
.feature h3 { margin-bottom: .4em; }
.feature p { color: var(--ink-2); font-size: .92rem; margin: 0; }
.compare { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .92rem; }
.compare th, .compare td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: #fafbfe; font-size: .85rem; color: var(--ink-2); }
.compare td.us { background: #f7f7ff; font-weight: 700; }
.price-card { max-width: 440px; margin: 0 auto; text-align: center; }
.price-card .amount { font-size: 2.6rem; font-weight: 800; }
.price-card ul { text-align: left; padding-left: 1.2em; color: var(--ink-2); }
.uses { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.uses span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .45em 1em; font-size: .9rem; }
.cta { background: var(--brand); color: #fff; border-radius: 24px; padding: 48px 24px; text-align: center; }
.cta h2 { color: #fff; }
.cta .btn { background: #fff; color: var(--brand); }

/* ---------- 管理画面 ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 16px 64px; max-width: 1180px; margin: 0 auto; }
.sidenav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.sidenav button { text-align: left; background: none; border: 0; font: inherit; padding: .65em .9em; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-weight: 700; display: flex; align-items: center; gap: .6em; }
.sidenav button:hover { background: #eef0f6; }
.sidenav button.active { background: var(--brand-50); color: var(--brand); }
.sidenav .ico { width: 1.2em; text-align: center; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-title h1 { margin: 0; font-size: 1.4rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .k { font-size: .8rem; color: var(--ink-3); font-weight: 700; }
.stat .v { font-size: 1.8rem; font-weight: 800; }
.tlist { display: grid; gap: 12px; }
.titem { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.titem h3 { margin: 0 0 .2em; }
.titem .url { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); word-break: break-all; }
.titem.archived { opacity: .6; }
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; color: var(--ink-3); background: #fafbfe; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 22, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 16px; cursor: pointer; font: inherit; }
.choice:hover { border-color: var(--brand); background: #fbfbff; }
.choice b { display: block; margin-bottom: .2em; }
.choice span { font-size: .85rem; color: var(--ink-3); }
.choice .em { font-size: 1.4rem; display: block; margin-bottom: .2em; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor textarea.body { min-height: 420px; font-size: 14px; }
.fields-list { display: grid; gap: 8px; }
.frow { display: grid; grid-template-columns: 1fr 120px auto auto; gap: 8px; align-items: center; }
.frow input, .frow select { padding: .45em .6em; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: .4em 0 .6em; }
.chip { font: inherit; font-size: .78rem; background: var(--brand-50); color: var(--brand); border: 0; border-radius: 999px; padding: .25em .8em; cursor: pointer; }
.chip.sys { background: #eef7f2; color: #0b6b49; }
.preview { background: #fafbfe; border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-height: 520px; overflow: auto; white-space: pre-wrap; font-size: .88rem; }
.ph { background: #fff3c4; border-radius: 4px; padding: 0 .2em; }
.ph.sys { background: #dff3ea; }
.qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 12px; }
.drop { border: 2px dashed #c8cce0; border-radius: 14px; padding: 28px; text-align: center; cursor: pointer; background: #fafbff; }
.drop.over { border-color: var(--brand); background: var(--brand-50); }

/* ---------- 同意フォーム（スマホ優先） ---------- */
.form-page { max-width: 720px; margin: 0 auto; padding: 16px 16px 80px; }
.form-head { display: flex; align-items: center; gap: 12px; padding: 12px 0 16px; }
.form-head img { max-height: 44px; max-width: 160px; object-fit: contain; }
.form-head .co { font-weight: 700; color: var(--ink-2); }
.steps { display: flex; gap: 6px; margin: 0 0 16px; }
.steps span { flex: 1; text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink-3); border-bottom: 3px solid var(--line); padding-bottom: 6px; }
.steps span.on { color: var(--brand); border-color: var(--brand); }
.doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; max-height: 55vh; overflow-y: auto; white-space: pre-wrap; font-size: .92rem; line-height: 1.85; }
.doc .ph { background: #fff3c4; }
.doc .ph.filled { background: #e6f5ee; }
.scroll-hint { font-size: .8rem; color: var(--warn); margin: .5em 0 0; }
.agree-box { background: var(--brand-50); border-radius: 12px; padding: 14px 16px; margin: 1.2em 0; }
.agree-box.disabled { opacity: .55; }
.confirm-table { width: 100%; border-collapse: collapse; margin-bottom: 1em; font-size: .92rem; }
.confirm-table th, .confirm-table td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: left; vertical-align: top; }
.confirm-table th { width: 38%; color: var(--ink-3); font-weight: 700; font-size: .85rem; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); margin: 8px auto 16px; position: relative; }
.done-mark::after { content: ""; position: absolute; left: 23px; top: 14px; width: 14px; height: 26px; border-right: 5px solid #fff; border-bottom: 5px solid #fff; transform: rotate(45deg); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; }

/* ---------- 検証ページ ---------- */
.result { border-radius: 14px; padding: 18px; margin-top: 16px; }
.result.ok { background: var(--ok-50); border: 1px solid #b7e6d2; }
.result.ng { background: var(--err-50); border: 1px solid #f3c1c9; }
.result dl { display: grid; grid-template-columns: 9em 1fr; gap: 6px 12px; margin: .8em 0 0; font-size: .9rem; }
.result dt { color: var(--ink-3); }
.result dd { margin: 0; word-break: break-all; }

/* ---------- 文書ページ（規約など） ---------- */
.legal { max-width: 820px; margin: 32px auto; padding: 32px; }
.legal h2 { font-size: 1.05rem; margin-top: 1.8em; }
.legal ol, .legal ul { padding-left: 1.4em; }
.draft-note { background: var(--warn-50); color: #7a3e06; border-radius: 10px; padding: .8em 1em; font-size: .88rem; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .mock { margin: 0 auto; }
  .grid3, .stats { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; padding-top: 12px; }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .sidenav button { white-space: nowrap; }
  .editor { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .titem { grid-template-columns: 1fr; }
  .topbar nav .hide-sm { display: none; }
  .compare { font-size: .82rem; }
  .compare th, .compare td { padding: 10px; }
  .legal { padding: 20px; margin: 16px; }
}
@media (max-width: 520px) {
  body { font-size: 15px; }
  .card { padding: 1.15em; }
  .frow { grid-template-columns: 1fr 96px; }
  .frow .req-toggle, .frow .del { grid-column: auto; }
  .result dl { grid-template-columns: 1fr; }
  .result dt { margin-top: .4em; }
}
