/* 契約獲得くん — design foundation (approved 2026-11-03, docs/design/mock).
 * One small stylesheet, no framework. Shared by the site, storage and error layouts. */

:root {
  /* color: warm paper + ink, the logo's red as the brand, its lightning amber as the spark */
  --paper: #faf8f4;
  --paper-2: #f3efe8;
  --card: #ffffff;
  --ink: #1b1e25;
  --ink-2: #474d5a;
  --muted: #7b8190;
  --line: #e8e3da;
  --line-2: #d9d3c7;
  --brand: #c4303b;
  --brand-ink: #9f1e2a;
  --brand-soft: #fbeceb;
  --spark: #f2a516;
  --spark-soft: #fff4dc;
  --ok: #1d7f55;
  --ok-soft: #e4f3ea;
  --wait: #6d7280;
  --wait-soft: #eff0f2;
  --danger: #b42318;
  --danger-soft: #fdecea;

  --font: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow-1: 0 1px 2px rgba(27, 30, 37, .06), 0 1px 1px rgba(27, 30, 37, .04);
  --shadow-2: 0 2px 4px rgba(27, 30, 37, .04), 0 10px 30px -12px rgba(27, 30, 37, .18);
  --shadow-3: 0 4px 10px rgba(27, 30, 37, .06), 0 28px 60px -24px rgba(27, 30, 37, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* aliases kept for templates written before this stylesheet */
  --accent: var(--brand);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "palt" 1;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.35; margin: 0; letter-spacing: .01em; word-break: auto-phrase; text-wrap: balance; }
.nowrap { white-space: nowrap; }
p { margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 999px;
  font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(196, 48, 59, .55); }
.btn-primary:hover { background: var(--brand-ink); box-shadow: 0 10px 22px -8px rgba(196, 48, 59, .6); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); border-color: var(--ink-2); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn-quiet:hover { color: var(--ink); background: var(--paper-2); }
.btn-danger { background: var(--card); color: var(--danger); border-color: #f1c4bf; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 16px; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-wait { background: var(--wait-soft); color: var(--wait); }
.chip-new { background: var(--spark-soft); color: #9a6200; }

/* ---------- flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); font-weight: 700; font-size: 14px; border: 1px solid; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: #c4e5d2; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #f4c8c3; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.control, select.select, textarea.textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card);
  font: 400 15px/1.5 var(--font); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.control:hover, select.select:hover, textarea.textarea:hover { border-color: #c4bcae; }
.control:focus, select.select:focus, textarea.textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
textarea.textarea { min-height: 120px; resize: vertical; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; }
.logo img { height: 36px; width: auto; }

/* ---------- reveal ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.reveal { animation: rise .7s var(--ease) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .18s; } .d3 { animation-delay: .3s; } .d4 { animation-delay: .45s; }
@media (prefers-reduced-motion: reduce) { .reveal, .notice { animation: none !important; } html { scroll-behavior: auto; } }

/* ==============================================================   PUBLIC SITE
   ===================================================================== */
.topbar { background: var(--ink); color: #c9ccd3; font-size: 12.5px; }
.topbar .inner { max-width: 1160px; margin: 0 auto; padding: 6px 24px; display: flex; justify-content: flex-end; gap: 22px; }
.topbar a { color: #fff; text-decoration: none; }

.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a.link { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.site-nav a.link:hover, .site-nav a.link[aria-current] { color: var(--ink); background: var(--paper-2); }
.site-nav .btn { margin-left: 6px; }
.menu-toggle { display: none; }

.section { max-width: 1160px; margin: 0 auto; padding: 96px 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--brand); }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; }
.section-title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 900; margin-top: 12px; }
.lead { color: var(--ink-2); font-size: 16.5px; margin-top: 16px; max-width: 46em; }

/* hero */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -10%; right: -10%; bottom: 0; width: 70vw; max-width: 900px;
  background: radial-gradient(closest-side, rgba(242, 165, 22, .20), transparent 70%), radial-gradient(closest-side at 70% 60%, rgba(196, 48, 59, .14), transparent 70%);
  pointer-events: none;
}
.hero .inner { position: relative; max-width: 1160px; margin: 0 auto; padding: 72px 24px 88px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 900; letter-spacing: -.01em; margin-top: 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--spark-soft) 62%); }
.hero .lead { font-size: 17px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .assure { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; font-size: 13px; color: var(--muted); }
.hero .assure span::before { content: "✓"; color: var(--ok); font-weight: 900; margin-right: 6px; }

/* the notification visual */
.stack { position: relative; min-height: 470px; }
.notice {
  position: absolute; left: 0; right: 0; margin: 0 auto; max-width: 420px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: 20px 22px; animation: rise .8s var(--ease) both;
}
.notice.n1 { top: 0; rotate: -3deg; translate: -34px 0; scale: .92; opacity: .6; animation-delay: .1s; }
.notice.n2 { top: 70px; rotate: 2deg; translate: 36px 0; scale: .96; opacity: .85; animation-delay: .25s; }
.notice.n3 { top: 150px; animation-delay: .45s; }
.notice .head { display: flex; align-items: center; gap: 12px; }
.notice .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.notice .icon svg { width: 22px; height: 22px; }
.notice .subject { font-weight: 900; font-size: 14.5px; }
.notice .time { font-size: 12px; color: var(--muted); }
.notice dl { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; margin: 16px 0 0; font-size: 13.5px; }
.notice dt { color: var(--muted); }
.notice dd { margin: 0; font-weight: 700; }
.notice .spark { position: absolute; right: -14px; top: -16px; width: 46px; height: 46px; border-radius: 50%; background: var(--spark); color: var(--ink); display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(242, 165, 22, .8); }
.notice .spark svg { width: 24px; height: 24px; }

/* what-is + features */
.what { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.what .body { font-size: 16.5px; color: var(--ink-2); }
.what .body strong { color: var(--ink); background: linear-gradient(transparent 64%, var(--spark-soft) 64%); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; font-weight: 900; margin-top: 18px; }
.feature p { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; }

/* moment band */
.band { background: var(--ink); color: #e8e9ec; }
.band .section { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.band .eyebrow { color: var(--spark); }
.band .section-title { color: #fff; }
.band .lead { color: #b7bbc4; }
.timeline { display: grid; gap: 12px; }
.tl { display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.tl .t { font-family: var(--mono); font-size: 13px; color: var(--spark); }
.tl .w { font-size: 14px; }
.tl .w b { color: #fff; }
.tl .d { font-size: 12px; color: #9aa0ab; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; counter-reset: step; }
.step { position: relative; padding: 30px 26px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.step .num { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--brand); letter-spacing: .1em; }
.step h3 { font-size: 19px; font-weight: 900; margin-top: 10px; }
.step p { color: var(--ink-2); margin-top: 10px; font-size: 14.5px; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -14px; width: 8px; height: 8px; border-top: 2px solid var(--line-2); border-right: 2px solid var(--line-2); transform: translateY(-50%) rotate(45deg); }

/* cases */
.quote { margin-top: 40px; padding: 32px 36px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--brand-soft), var(--spark-soft)); position: relative; }
.quote p { font-size: clamp(18px, 2.2vw, 23px); font-weight: 900; }
.quote cite { display: block; margin-top: 10px; font-style: normal; color: var(--ink-2); font-size: 14px; }
.quote::before { content: "“"; position: absolute; top: -18px; left: 22px; font-size: 90px; line-height: 1; color: var(--brand); font-family: Georgia, serif; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.case { padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 12px; }
.case .who { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.case .who .ico { width: 42px; height: 42px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-2); }
.case .who .ico svg { width: 22px; height: 22px; }
.case .who small { display: block; font-family: var(--mono); color: var(--muted); font-size: 11.5px; font-weight: 500; }
.case p { color: var(--ink-2); font-size: 14.5px; flex: 1; }
.case a { font-weight: 700; color: var(--brand); text-decoration: none; font-size: 14px; }
.case a:hover { text-decoration: underline; }

/* cta band */
.cta-band { margin: 0 24px 96px; }
.cta-band .inner { max-width: 1112px; margin: 0 auto; padding: 56px; border-radius: var(--r-lg); background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.cta-band .inner::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 165, 22, .55), transparent); }
.cta-band h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 900; }
.cta-band p { opacity: .9; margin-top: 6px; }
.cta-band .btn { background: #fff; color: var(--brand); position: relative; z-index: 1; }
.cta-band .btn:hover { background: var(--spark-soft); }

/* footer */
.site-footer { background: var(--ink); color: #b7bbc4; font-size: 14px; }
.site-footer .inner { max-width: 1160px; margin: 0 auto; padding: 56px 24px 28px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 14px; letter-spacing: .06em; }
.site-footer a { color: #e3e5e9; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .logo-pill { display: inline-block; background: #fff; border-radius: 10px; padding: 6px 10px; margin-bottom: 16px; }
.site-footer .logo-pill img { height: 30px; }
.site-footer .copyright { max-width: 1160px; margin: 0 auto; padding: 18px 24px 28px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12.5px; color: #8b909b; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-2); text-decoration: none; color: var(--ink); }

/* =====================================================================
   STORAGE APP (logged in)
   ===================================================================== */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--card) 247px, var(--line) 247px 248px, transparent 248px); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; background: var(--card); border-right: 1px solid var(--line); }
.side .logo { padding: 4px 10px 18px; }
.side .logo img { height: 32px; }
.side .share { margin: 0 4px 16px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14.5px; color: var(--ink-2); transition: background-color .15s, color .15s; }
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .8; }
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a[aria-current] { background: var(--brand-soft); color: var(--brand-ink); }
.nav a[aria-current] svg { opacity: 1; }
.nav .count { margin-left: auto; font-size: 12px; font-family: var(--mono); color: var(--muted); }
.side .foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: grid; gap: 8px; }
.side .foot a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.side .foot a:hover { color: var(--brand); }

.main { min-width: 0; }
.page-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 36px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 22px; font-weight: 900; }
.page-head .sub { font-size: 13px; color: var(--muted); }
.page { padding: 28px 36px 64px; max-width: 1180px; }
.mobile-bar, .tabbar { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 24px; }
.card.flush { padding: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.stat { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.stat b { font-family: var(--mono); font-size: 16px; color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1 1 240px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.toolbar .search .control { padding-left: 38px; min-height: 40px; }
.toolbar select.select { width: auto; min-height: 40px; padding: 6px 34px 6px 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: 700 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fdfcfa; white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: #fdfbf7; }
.table tbody tr.is-selected { background: var(--brand-soft); }
.table .check { width: 44px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.file-title { font-weight: 900; text-decoration: none; color: var(--ink); }
.file-title:hover { color: var(--brand); text-decoration: underline; }
.file-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.file-meta > * { white-space: nowrap; }
.table td.cust { white-space: nowrap; }
.ext { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--paper-2); color: var(--ink-2); text-transform: uppercase; }
.seen { display: grid; gap: 4px; justify-items: start; }
.seen small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.url { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; }
.url code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding: 0 4px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.copy { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-left: 1px solid var(--line); background: var(--card); padding: 7px 12px; font: 700 12.5px var(--font); color: var(--brand); cursor: pointer; transition: background-color .15s; }
.copy:hover { background: var(--brand-soft); }
.copy svg { width: 15px; height: 15px; }
.copy.done { color: var(--ok); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--ink-2); text-decoration: none; border: 1px solid transparent; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

.bulk[hidden] { display: none; }
.bulk { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--ink); color: #fff; border-radius: 0 0 var(--r) var(--r); font-size: 14px; }
.bulk .btn-danger { margin-left: auto; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 10px; text-decoration: none; font-family: var(--mono); font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); background: var(--card); }
.pager a:hover { border-color: var(--ink-2); }
.pager [aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-3); transition: opacity .2s, transform .25s var(--ease); pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* upload */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.form-card { padding: 28px; display: grid; gap: 26px; }
.form-step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.form-step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--mono); font-weight: 700; font-size: 13px; }
.form-step .body { display: grid; gap: 10px; min-width: 0; }
.form-step h2 { font-size: 16px; font-weight: 900; padding-top: 4px; }
.combo { position: relative; }
.combo select.select { appearance: none; padding-right: 40px; }
.combo::after { content: ""; position: absolute; right: 16px; top: 20px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.add-customer { border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 14px; display: grid; gap: 10px; background: var(--paper); }
.add-customer .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linkish { background: none; border: 0; padding: 0; font: 700 13.5px var(--font); color: var(--brand); cursor: pointer; justify-self: start; display: inline-flex; gap: 6px; align-items: center; }
.linkish:hover { text-decoration: underline; }
.drop { display: grid; place-items: center; gap: 8px; text-align: center; padding: 34px 20px; border: 2px dashed var(--line-2); border-radius: var(--r); background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(232, 227, 218, .25) 10px 20px), var(--paper); transition: border-color .2s, background-color .2s; cursor: pointer; }
.drop:hover { border-color: var(--brand); }
.drop .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow-2); color: var(--brand); }
.drop .ico svg { width: 26px; height: 26px; }
.drop strong { font-size: 15px; }
.chosen { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.chosen .meta { font-size: 12px; color: var(--muted); }
.chosen .linkish { margin-left: auto; font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--line); padding-top: 22px; }

.aside-card { padding: 22px; display: grid; gap: 14px; }
.aside-card h3 { font-size: 15px; font-weight: 900; }
.mail { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); font-size: 13px; overflow: hidden; }
.mail .mhead { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.mail .mbody { padding: 12px 14px; display: grid; gap: 6px; color: var(--ink-2); }
.mail .mbody b { color: var(--ink); }

.done-card { padding: 34px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.done-card .badge { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.done-card .badge svg { width: 32px; height: 32px; }
.done-card h2 { font-size: 22px; font-weight: 900; }
.big-url { display: flex; width: 100%; max-width: 560px; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--card); }
.big-url code { flex: 1; min-width: 0; padding: 14px 16px; font-family: var(--mono); font-size: 14px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.big-url .copy { border-left: 2px solid var(--ink); padding: 0 20px; font-size: 14px; background: var(--ink); color: #fff; }
.big-url .copy:hover { background: var(--brand); }
.big-url .copy.done { background: var(--ok); color: #fff; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 960px) {
  .hero .inner, .what, .band .section { grid-template-columns: 1fr; }
  .features, .steps, .cases { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { display: none; }
  .site-footer .inner { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar { display: none; }
  .site-header .inner { padding: 10px 16px; }
  .logo img { height: 30px; }
  .menu-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); }
  .site-header.open .site-nav { display: flex; }
  .site-nav .btn { margin: 6px 0 0; }
  .section { padding: 64px 16px; }
  .hero .inner { padding: 40px 16px 56px; gap: 36px; }
  .hero h1 { font-size: 28px; }
  .stack { min-height: 0; }
  .notice.n1, .notice.n2 { display: none; }
  .notice.n3 { position: relative; max-width: none; }
  .big-url { flex-direction: column; }
  .big-url code { white-space: normal; word-break: break-all; text-align: center; }
  .big-url .copy { border-left: 0; border-top: 2px solid var(--ink); padding: 14px; justify-content: center; }
  .cta-band { margin: 0 16px 64px; }
  .cta-band .inner { padding: 32px 24px; flex-direction: column; align-items: flex-start; }
  .quote { padding: 28px 22px; }

  .app { grid-template-columns: 1fr; background: none; }
  .side { display: none; }
  .mobile-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
  .mobile-bar .logo img { height: 28px; }
  .page-head { position: static; padding: 18px 16px 6px; border: 0; background: none; backdrop-filter: none; }
  .page-head { flex-wrap: wrap; }
  .page-head .btn { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
  .page { padding: 12px 16px 96px; }
  .tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; text-decoration: none; font-size: 10.5px; font-weight: 700; color: var(--muted); }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current] { color: var(--brand); }

  /* table -> cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { position: relative; padding: 14px 14px 12px 46px; border-bottom: 1px solid var(--line); }
  .table td { padding: 0; border: 0; }
  .table td.check { position: absolute; left: 14px; top: 16px; width: auto; }
  .table td + td { margin-top: 8px; }
  .table td.actions { position: absolute; right: 8px; top: 8px; margin: 0; }
  .table tr { padding-right: 88px; }
  .table td.url-cell { margin-right: -74px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat { flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: var(--r-sm); font-size: 11.5px; }
  .table td.cust::before { content: "送付先 "; color: var(--muted); font-size: 12px; }
  .table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; }
  .url code { max-width: 52vw; }
  .row-actions { justify-content: flex-start; }
  .form-card { padding: 20px 16px; }
  .add-customer .row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .toolbar select.select, .seg { width: 100%; }
  .seg button { flex: 1; }
}

/* =====================================================================
   CakePHP FormHelper markup (div.input > label + control, .error-message)
   ===================================================================== */
div.input { display: grid; gap: 6px; margin-bottom: 16px; }
div.input > label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
div.input.required > label::after { content: " *"; color: var(--brand); }
div.input input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
div.input select, div.input textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card);
  font: 400 15px/1.5 var(--font); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
div.input textarea { min-height: 120px; resize: vertical; }
div.input input:focus, div.input select:focus, div.input textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
div.input.checkbox { display: flex; align-items: center; gap: 8px; }
div.input.checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
div.input.error input, div.input.error select, div.input.error textarea { border-color: var(--danger); }
.error-message { font-size: 12.5px; font-weight: 700; color: var(--danger); }
form button:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: 700 15px/1 var(--font); cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(196, 48, 59, .55); transition: background-color .2s;
}
form button:not([class]):hover { background: var(--brand-ink); }

/* Flash (element/flash/*: div.message.success|error|warning|info) */
.message { display: block; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r); border: 1px solid; font-weight: 700; font-size: 14px; cursor: pointer; }
.message.success { background: var(--ok-soft); color: var(--ok); border-color: #c4e5d2; }
.message.error { background: var(--danger-soft); color: var(--danger); border-color: #f4c8c3; }
.message.warning { background: var(--spark-soft); color: #8a5a00; border-color: #f3dca6; }
.message:not(.success):not(.error):not(.warning) { background: #eef4fb; color: #1e4e79; border-color: #cfe0f2; }
.message.hidden { display: none; }
.site-flash { max-width: 1160px; margin: 16px auto 0; padding: 0 24px; }

/* small helpers for templates */
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack-sm { display: grid; gap: 8px; }
.card-body { padding: 24px; }
.narrow { max-width: 440px; margin: 40px auto; }
.auth-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-head { padding: 16px 24px; }
.auth-head .logo img { height: 34px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.auth-foot a { color: var(--brand); font-weight: 700; }

/* error pages */
main.section h1 { font-size: 24px; font-weight: 900; margin-bottom: 12px; }
main.section > p { color: var(--ink-2); }

/* mobile bar: share + contact + logout (the side menu is hidden on phones) */
.mobile-actions { display: flex; align-items: center; gap: 4px; }

/* WI-13 site pages */
.site-cases { padding-top: 0; }
.site-faq { max-width: 900px; }
.site-faq-list { display: grid; gap: 12px; margin-top: 36px; }
.site-faq-list details { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-1); overflow: hidden; }
.site-faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; font-weight: 900; cursor: pointer; list-style: none; }
.site-faq-list summary::-webkit-details-marker { display: none; }
.site-faq-list summary::after { content: "+"; flex: none; color: var(--brand); font-size: 24px; line-height: 1; }
.site-faq-list details[open] summary::after { content: "−"; }
.site-faq-list summary:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.site-faq-answer { padding: 0 24px 22px; color: var(--ink-2); }
.site-faq-answer p + p { margin-top: 12px; }
.site-faq-answer a { color: var(--brand); font-weight: 700; }
@media (max-width: 760px) {
  .site-faq-list summary { padding: 18px 16px; }
  .site-faq-answer { padding: 0 16px 18px; }
}
/* WI-24 contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; margin-top: 36px; align-items: start; }
.contact-form { padding: 28px; }
.contact-aside { padding: 26px; display: grid; gap: 12px; }
.contact-aside h2 { font-size: 18px; font-weight: 900; }
.contact-aside h3 { font-size: 15px; font-weight: 900; margin-top: 8px; }
.contact-aside dl { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.contact-aside dt { color: var(--muted); }
.contact-aside dd { margin: 0; color: var(--ink-2); }
.contact-aside a { color: var(--brand); font-weight: 700; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }

/* WI-19 customers */
.form-narrow { max-width: 560px; }
.form-narrow .form-actions { margin-top: 8px; }
.confirm-lead { font-size: 16px; margin-bottom: 16px; }
.confirm-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.confirm-counts div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.confirm-counts dt { font-size: 12.5px; color: var(--muted); }
.confirm-counts dd { margin: 4px 0 0; font-family: var(--mono); font-size: 20px; font-weight: 700; }
.confirm-delete .flash { margin-bottom: 12px; }
.card.flush .pager { padding: 0 14px 14px; justify-content: center; }

/* WI-16/17/18: file list, detail and upload */
.empty-row { padding: 24px 14px; color: var(--muted); text-align: center; }
.add-customer[hidden], .chosen[hidden] { display: none; }
.drop.drag-over { border-color: var(--brand); background: var(--brand-soft); }
.drop:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.copy-fallback { position: fixed; left: -10000px; top: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-card { display: grid; gap: 18px; min-width: 0; }
.detail-card h3, .form-step h3 { font-size: 16px; font-weight: 900; }
.detail-list { display: grid; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-card form { margin-top: 16px; }
.view-list { padding: 0; margin: 0; list-style: none; }
.view-list li { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.view-list li span { overflow-wrap: anywhere; }
.done-card { margin-bottom: 20px; }
.done-card h3 { font-size: 22px; font-weight: 900; }
.big-url { max-width: 100%; }
.big-url code { overflow-wrap: anywhere; }
.aside-card .mhead svg { width: 18px; height: 18px; color: var(--brand); vertical-align: -4px; margin-right: 6px; }
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 100px minmax(0, 1fr); }
  .add-customer .row { grid-template-columns: 1fr; }
  .list-foot { align-items: flex-start; }
  .list-foot .pager { max-width: 100%; flex-wrap: wrap; }
}
.drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
/* segmented control / inline links inside forms: not the default form button */
form .seg button { min-height: 0; padding: 7px 14px; border-radius: 999px; background: transparent; color: var(--ink-2); box-shadow: none; font: 700 13px var(--font); }
form .seg button:hover { background: var(--card); }
form .seg button[aria-pressed="true"], form .seg button.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.linkish svg { width: 16px; height: 16px; flex: none; }

/* WI-15/20 dashboard and logs */
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-stats .stat { min-width: 0; display: grid; gap: 4px; align-content: center; padding: 18px 20px; border-radius: var(--r); text-decoration: none; box-shadow: var(--shadow-1); }
.dashboard-stats .stat:hover { border-color: var(--brand); }
.dashboard-stats .stat b { font-size: 28px; line-height: 1.2; }
.dashboard-stats .stat span { line-height: 1.4; }
.dashboard-recent { margin-bottom: 18px; }
.dashboard-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dashboard-section-head h3, .dashboard-guide h3 { font-size: 18px; font-weight: 900; }
.dashboard-section-head a, .dashboard-guide a, .logs-filter-note a { color: var(--brand); font-weight: 700; }
.dashboard-empty { padding: 24px 20px; color: var(--muted); }
.dashboard-guide ol { margin: 16px 0 0; padding-left: 1.5em; color: var(--ink-2); line-height: 1.8; }
.dashboard-guide li + li { margin-top: 6px; }
.dashboard-recent-table td, .logs-table td { overflow-wrap: anywhere; }
.dashboard-recent-date, .logs-date { white-space: nowrap; }
.logs-filter-note { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 14px; background: var(--brand-soft); }
.logs-toolbar { align-items: end; }
.logs-toolbar label { display: grid; gap: 6px; min-width: 140px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.logs-toolbar label:nth-child(1), .logs-toolbar label:nth-child(2) { flex: 1 1 180px; }
.logs-toolbar .select { width: 100%; }
.logs-toolbar .btn { min-height: 40px; }
.logs-device { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.logs-device svg { width: 18px; height: 18px; flex: none; }
.logs-id { color: var(--muted); font-size: 12px; }
.logs-empty-row td { padding: 24px 14px; color: var(--muted); text-align: center; }
.logs-pager { padding: 0 14px 16px; }
@media (max-width: 760px) {
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-stats .stat { align-items: start; padding: 14px; }
  .dashboard-recent-table tr, .logs-table tr { padding-right: 14px; }
  .dashboard-recent-table td[data-label]::before, .logs-table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; font-weight: 700; }
  .logs-table td.cust::before { content: "顧客名 "; }
  .logs-table .logs-empty-row { padding: 20px 14px; }
  .logs-table .logs-empty-row td { text-align: left; padding: 0; }
  .logs-toolbar label, .logs-toolbar label:nth-child(1), .logs-toolbar label:nth-child(2) { flex: 1 1 100%; width: 100%; }
  .logs-toolbar .btn { width: 100%; }
}
/* phone cards: rows without a selection checkbox need no left gutter */
@media (max-width: 760px) {
  .table tr:not(:has(td.check)) { padding-left: 14px; }
}

/* WI-21 account */
.account-card { max-width: 680px; }
.account-details { margin: 0; }
.account-details > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.account-details > div:first-child { padding-top: 0; }
.account-details > div:last-child { border-bottom: 0; padding-bottom: 0; }
.account-details dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.account-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.account-mobile-edit { display: none; }
.account-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.account-links form { margin: 0; }
.account-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.account-password { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.account-password summary { width: fit-content; color: var(--brand); font-weight: 700; cursor: pointer; }
.account-password-fields { padding-top: 20px; }
.account-auth-title { margin-bottom: 24px; font-size: 23px; font-weight: 900; text-align: center; }
.account-auth-submit { width: 100%; margin-top: 8px; }
.account-auth-card .auth-foot + .auth-foot { margin-top: 6px; }
@media (max-width: 760px) {
  .account-mobile-edit { display: inline-flex; margin-top: 20px; }
  .account-details > div { grid-template-columns: 1fr; gap: 2px; padding: 14px 0; }
  .account-form-actions .btn { flex: 1; }
  .account-password-fields .btn { width: 100%; }
}
