/* ============================================================
   Bekito勤怠 — design system
   Brand: ink navy / copper / cream / signal green (BRAND.md §7)
   Server-rendered, no JS build step. 「小さくても、匠。」
   ============================================================ */

:root {
  --navy: #2b3a4a;
  --navy-deep: #22303e;
  --navy-soft: #46586b;
  --copper: #b45f2f;
  --copper-dark: #96491f;
  --copper-soft: #f4e3d7;
  --cream: #faf6f0;
  --paper: #ffffff;
  --line: #e8e0d5;
  --line-strong: #d8cdbe;
  --ink: #26303a;
  --ink-soft: #5a6470;
  --green: #2f7d4f;
  --green-soft: #e4f0e8;
  --amber: #a3690e;
  --amber-soft: #f7ecd7;
  --red: #a83a32;
  --red-soft: #f8e7e5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(43, 58, 74, .05), 0 4px 16px rgba(43, 58, 74, .06);
  --shadow-lift: 0 2px 4px rgba(43, 58, 74, .07), 0 12px 32px rgba(43, 58, 74, .10);
  --font-ja: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  --font-ui: var(--font-ja);
  --font-en: "Inter", var(--font-ui);
  font-size: 16px;
}

html:lang(en), html:lang(fil), html:lang(id), html:lang(pt-br), html:lang(vi), html:lang(uz) { --font-ui: "Inter", var(--font-ja); }
html:lang(zh-hans) { --font-ui: "Noto Sans SC", var(--font-ja); }
html:lang(ne) { --font-ui: "Noto Sans Devanagari", sans-serif; }
html:lang(my) { --font-ui: "Noto Sans Myanmar", sans-serif; }
html:lang(ko) { --font-ui: "Noto Sans KR", var(--font-ja); }
html:lang(si) { --font-ui: "Noto Sans Sinhala", sans-serif; }
html:lang(ta) { --font-ui: "Noto Sans Tamil", sans-serif; }
html:lang(th) { --font-ui: "Noto Sans Thai", sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
html, body { overflow-x: hidden; }  /* belt-and-suspenders against horizontal scroll */
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* sticky footer: page fills the viewport, footer pinned to the bottom */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }        /* grows to push the footer down */
.footer { flex-shrink: 0; }
img { max-width: 100%; height: auto; }
p, li, dd, summary, h1, h2, h3, .btn { overflow-wrap: break-word; }  /* break only over-long words, at boundaries first */

::selection { background: var(--copper-soft); color: var(--copper-dark); }

/* Every control acknowledges the initial press, including plain links and
   disclosure widgets that do not use the .btn component. Network-bound links
   and submits receive a persistent spinner from interaction-feedback.js. */
:is(a, button, summary, [role="button"]):not([aria-disabled="true"]):active {
  filter: brightness(.88);
  opacity: .82;
}
:is(input, select, textarea):not(:disabled):active { border-color: var(--copper); }
:is(a, button, summary, [role="button"], input, select, textarea) { -webkit-tap-highlight-color: rgba(180, 95, 47, .22); }
body.is-page-pending { cursor: progress; }
.page-progress {
  position: fixed; z-index: 200; inset: 0 0 auto; height: 4px;
  overflow: hidden; pointer-events: none;
  background: rgba(244, 227, 215, .92);
  box-shadow: 0 1px 5px rgba(43, 58, 74, .18);
}
.page-progress::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 42%;
  background: linear-gradient(90deg, var(--copper-dark), var(--copper), #d99562);
  animation: page-progress-slide .9s ease-in-out infinite;
}
.page-progress[hidden] { display: none; }
@keyframes page-progress-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(350%); }
}
:is(a, button).is-pending { pointer-events: none; }
:is(a, button).is-pending::after {
  content: ""; display: inline-block; flex: none; vertical-align: -.12em;
  width: .85em; height: .85em; margin-left: .45em;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: btn-spin .7s linear infinite;
}
input.is-pending { opacity: .6; pointer-events: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: max(.6rem, env(safe-area-inset-top)) max(clamp(1rem, 3vw, 2.4rem), env(safe-area-inset-right)) .6rem max(clamp(1rem, 3vw, 2.4rem), env(safe-area-inset-left));
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.brand {
  display: inline-flex; align-items: baseline; gap: .12em;
  flex: none; white-space: nowrap;
  color: #fff; text-decoration: none;
  font-family: var(--font-en);
  font-weight: 700; font-size: 1.18rem; letter-spacing: .01em;
}
.brand .brand-ja { font-family: var(--font-ja); font-weight: 700; }
.brand .brand-dot {
  width: .42em; height: .42em; border-radius: 2px;
  background: var(--copper); display: inline-block;
  margin-left: .18em; transform: translateY(-.05em);
}
.nav { display: flex; gap: .15rem; flex-wrap: wrap; align-items: center; }
.nav a {
  color: #cfd6dd; text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: .38rem .7rem; border-radius: 8px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.nav-lang { display: none; }  /* only surfaces inside the mobile menu */
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; flex: none; }
.topbar-guide { color: #cfd6dd; text-decoration: none; font-size: .9rem; padding: .38rem .6rem; }
.topbar-guide:hover { color: #fff; }
.lang-form { margin: 0; }
.lang-form select {
  background: rgba(255,255,255,.07); color: #e6ebf0;
  border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
  padding: .3rem .5rem; font-size: .82rem; font-family: inherit; max-width: none;
}

/* hamburger (mobile only) */
.nav-toggle { display: none; }
.nav-toggle { flex-direction: column; gap: 4px; width: 34px; height: 34px;
  align-items: center; justify-content: center; border-radius: 8px; cursor: pointer;
  border: 0; padding: 0; background: transparent; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: #cfd6dd; border-radius: 2px; transition: .2s; }
.nav-toggle:hover span { background: #fff; }

/* account dropdown */
.account-menu { position: relative; }
.account-menu > summary {
  display: flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none;
  padding: .25rem .4rem; border-radius: 999px; transition: background .15s;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { background: rgba(255,255,255,.09); }
.account-menu .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--copper); color: #fff; font-family: var(--font-en); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .82rem;
}
.account-email { font-size: .82rem; color: #cfd6dd; font-family: var(--font-en); max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu .caret { color: #9daebc; font-size: .7rem; }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60;
  min-width: 15rem; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift);
  padding: .4rem; overflow: hidden;
}
.account-dropdown .dropdown-head { font-size: .78rem; color: var(--ink-soft); padding: .5rem .7rem .3rem; font-family: var(--font-en); word-break: break-all; }
.account-dropdown a, .account-dropdown .dropdown-logout, .account-dropdown .dropdown-action {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; box-sizing: border-box;
  padding: .55rem .7rem; border-radius: 8px; color: var(--ink); text-decoration: none;
  font-size: .92rem; background: none; border: none; cursor: pointer; font-family: inherit;
}
.account-dropdown a:hover, .account-dropdown .dropdown-logout:hover, .account-dropdown .dropdown-action:hover { background: var(--cream); }
.account-dropdown hr { border: none; border-top: 1px solid var(--line); margin: .3rem 0; }
.account-dropdown .dropdown-logout { color: var(--red); }
.account-dropdown .dropdown-action { color: var(--navy); }
.account-dropdown form { margin: 0; }

/* ---------- Layout ---------- */
/* width:100% is required because as a flex child of <body>, auto side-margins
   would otherwise shrink the element to its content width. */
.container { width: 100%; max-width: 1180px; margin: 2.2rem auto 3rem; padding: 0 clamp(1rem, 4vw, 2rem); }
/* Data-dense ops screens (inbox, compliance, shifts, close…) use more of the
   screen — a narrow reading measure wastes half a wide monitor. */
.container-wide { width: 100%; max-width: min(1600px, 95vw); margin: 2.2rem auto 3rem; padding: 0 clamp(1rem, 3vw, 2rem); }
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  margin-top: 4rem;
  padding: 2.4rem max(clamp(1rem, 4vw, 2.4rem), env(safe-area-inset-right)) max(2.8rem, env(safe-area-inset-bottom)) max(clamp(1rem, 4vw, 2.4rem), env(safe-area-inset-left));
  color: var(--ink-soft); font-size: .86rem;
}
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; justify-content: space-between; align-items: flex-start; }
.footer a { color: var(--ink-soft); }
.footer .powered { font-family: var(--font-en); font-weight: 600; color: var(--navy); }
.footer .powered a { color: inherit; text-decoration: none; }
.footer .powered a:hover { color: var(--copper); }
.footer-meta { margin-top: .2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }

h1 { font-size: clamp(1.45rem, 3vw, 1.8rem); font-weight: 700; letter-spacing: .01em; margin: .2rem 0 1.4rem; color: var(--navy); }
h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 1rem; color: var(--navy); display: flex; align-items: center; gap: .5em; }
/* Headings are clean typography — no decorative marker before the text. An
   icon (nav / key sections) may sit inline, but there is no copper square. */
h3 { font-size: 1rem; color: var(--navy); margin: 1.2rem 0 .5rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1.4rem; margin-bottom: 1.4rem; }
/* size cards to their own content (don't stretch a short/empty card to match
   a tall sibling — that leaves a big empty box). */
.grid-top { align-items: start; }
.section .grid, .hero .grid { margin-bottom: 0; }  /* landing sections handle their own spacing */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.grid > * { min-width: 0; }
.grid .card { margin-bottom: 0; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
/* i18n robustness: translated labels (en/pt-BR/vi/uz) run longer than Japanese.
   Keep tables scrollable inside their card and buttons within their container
   so nothing overflows the layout at any width. */
.card:has(table) { overflow-x: auto; }
.btn { max-width: 100%; }
th, td { text-align: left; padding: .62rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  color: var(--ink-soft); font-weight: 600; font-size: .78rem;
  letter-spacing: .04em; text-transform: none;
  border-bottom: 2px solid var(--line-strong);
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td, table tr:hover td { background: #fdfaf5; }

/* ---------- Buttons ---------- */
/* margins so adjacent buttons (and wrapped rows) never touch */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  margin: 0 .5rem .5rem 0; vertical-align: middle;
  background: var(--navy); color: #fff;
  border: 1px solid var(--navy);
  border-radius: 10px;
  padding: .56rem 1.25rem;
  font-size: .95rem; font-weight: 600; font-family: inherit; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--navy-deep); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; }
.btn:disabled, button:disabled {
  opacity: .55; cursor: default; pointer-events: none;
  transform: none; box-shadow: none;
}
/* a button waiting on the network shows a small spinner after its label */
.btn-busy::after {
  content: ""; flex: none;
  width: .85em; height: .85em; margin-left: .1em;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-copper { background: var(--copper); border-color: var(--copper); }
.btn-copper:hover { background: var(--copper-dark); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { background: var(--paper); border-color: var(--navy-soft); box-shadow: var(--shadow); }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #8d2f28; }
.btn-big { font-size: 1.1rem; padding: .9rem 2rem; border-radius: 14px; }
.btn-sm { padding: .4rem 1rem; font-size: .88rem; margin-bottom: 0; }
/* explicit button row: use where several actions sit together */
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn-row .btn { margin: 0; }

/* ---------- Badges & stamps ---------- */
.badge {
  display: inline-block; border-radius: 999px;
  padding: .12rem .7rem; font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-muted { background: #efe9df; color: var(--ink-soft); }
.stamp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 4.6em; height: 4.6em; border-radius: 50%;
  border: 3px solid var(--copper); color: var(--copper);
  font-weight: 700; font-size: .8rem; line-height: 1.25; text-align: center;
  transform: rotate(-6deg);
}

/* ---------- Messages ---------- */
.messages { width: 100%; max-width: 1180px; margin: 1rem auto 0; padding: 0 clamp(1rem, 4vw, 2rem); }
.msg { padding: .65rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: .5rem; border: 1px solid transparent; font-size: .92rem; }
.msg-success { background: var(--green-soft); color: var(--green); border-color: #cfe4d6; }
.msg-error { background: var(--red-soft); color: var(--red); border-color: #eccfcb; }
.msg-info, .msg-warning { background: var(--amber-soft); color: var(--amber); border-color: #ecd9b4; }
.connectivity-status {
  position: sticky; top: 3.5rem; z-index: 45; width: 100%;
  padding: .55rem 1rem; text-align: center; font-size: .86rem; font-weight: 600;
  color: #5b3b08; background: var(--amber-soft); border-bottom: 1px solid #ecd9b4;
}

/* ---------- Forms ---------- */
form label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin: .7rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=month], input[type=file], select, textarea {
  width: 100%; max-width: 28rem;
  padding: .55rem .75rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: var(--paper); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-soft);
}
form p { margin: .9rem 0 0; }
.form-stack {
  display: grid;
  gap: .75rem;
  max-width: 28rem;
}
.form-stack input:not([type=checkbox]):not([type=radio]),
.form-stack select,
.form-stack textarea {
  max-width: 100%;
}
.form-stack .btn {
  justify-self: start;
  margin: 0;
}

/* ---------- Switch (toggle checkboxes) ---------- */
/* Every standalone boolean checkbox renders as an iOS-style switch. */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none; cursor: pointer; vertical-align: middle;
  width: 2.4rem; height: 1.35rem; border-radius: 999px;
  background: var(--line-strong); border: none; margin: 0 .1rem;
  transition: background .2s ease;
}
input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: calc(1.35rem - 4px); height: calc(1.35rem - 4px); border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
input[type=checkbox]:checked { background: var(--green); }
input[type=checkbox]:checked::after { transform: translateX(calc(2.4rem - 1.35rem)); }
input[type=checkbox]:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; }
/* a label wrapping a switch lays out inline with a gap */
label.switch { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; color: var(--ink); cursor: pointer; }
label.switch input[type=checkbox] { margin: 0; }

/* ---------- Data / derivation ---------- */
.mono, .kpi-value, td.mono, .punch-clock {
  font-family: "Inter", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.derivation {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .8rem; line-height: 1.7;
  background: #f7f2ea;
  border-left: 3px solid var(--copper);
  padding: .8rem 1rem; margin-top: .5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: pre-wrap; color: var(--ink);
}
details.explain > summary {
  cursor: pointer; color: var(--copper-dark); font-size: .85rem; font-weight: 600;
  list-style: none;
}
details.explain > summary::before { content: "▸ "; }
details.explain[open] > summary::before { content: "▾ "; }
details.explain > summary:hover { text-decoration: underline; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: .15rem; }
.kpi .kpi-value { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi .kpi-label { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- Meter (36協定 pace) ---------- */
.meter { height: 10px; background: #eee5d8; border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .4s; }
.meter.warn > span { background: var(--amber); }
.meter.danger > span { background: var(--red); }

/* ---------- Inbox ---------- */
.inbox-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem .3rem; border-bottom: 1px solid var(--line);
}
.inbox-item:last-of-type { border-bottom: none; }
.inbox-item .grow { flex: 1; min-width: 14rem; }
.inbox-actions { display: flex; gap: .5rem; margin-left: auto; }
.inbox-actions .btn { margin: 0; }
.alert-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.alert-actions .btn { margin: 0; }
.issue-preview p { margin: .4rem 0; }
.issue-details { margin-top: .75rem; }
.issue-details summary { color: var(--copper-dark); cursor: pointer; font-weight: 600; }
.issue-details p { margin: .4rem 0; }
.muted { color: var(--ink-soft); font-size: .88rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.invite-link {
  width: 100%; max-width: 100%; margin-top: .45rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem;
  padding: .4rem .6rem; background: #f7f2ea; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: text;
}
.member-edit > summary { list-style: none; display: inline-block; cursor: pointer; }
.member-edit > summary::-webkit-details-marker { display: none; }
.member-edit[open] { border: 1px solid var(--line); border-radius: 10px; background: #fdfaf5; padding: .6rem .75rem; min-width: 16rem; }
.member-edit[open] > summary { margin-bottom: .3rem; }
.member-edit-form label { display: block; margin-top: .5rem; font-size: .85rem; }
.member-edit-form select { width: 100%; }
.member-edit-form p { margin: .6rem 0 .4rem; }

/* ---------- Punch page ---------- */
.punch-page { position: relative; text-align: center; padding: 2.6rem 1rem 4rem; }
.punch-clock { font-size: clamp(3rem, 9vw, 4.4rem); font-weight: 700; color: var(--navy); letter-spacing: .02em; }
.punch-page .btn-big { min-width: 11rem; margin: .35rem; }

/* current-state chip: 未出勤 / 出勤中 / 休憩中 / 退勤済み (+ elapsed h:mm) */
.punch-state {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem 1.1rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem;
  background: #efe9df; color: var(--ink-soft);
  transition: background .25s, color .25s;
}
.punch-state .state-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink-soft); flex: none; }
.punch-state .state-timer { font-size: .88rem; font-weight: 600; opacity: .8; }
.punch-state[data-state="working"] { background: var(--green-soft); color: var(--green); }
.punch-state[data-state="working"] .state-dot { background: var(--green); animation: state-pulse 2.2s ease-in-out infinite; }
.punch-state[data-state="break"] { background: var(--amber-soft); color: var(--amber); }
.punch-state[data-state="break"] .state-dot { background: var(--amber); animation: state-pulse 3.2s ease-in-out infinite; }
.punch-state[data-state="done"] { background: var(--copper-soft); color: var(--copper-dark); }
.punch-state[data-state="done"] .state-dot { background: var(--copper); }
@keyframes state-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 125, 79, .35); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
.punch-state.chip-pop { animation: chip-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chip-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* the expected next action breathes gently; an armed (confirm-pending) button wiggles */
.punch-page .btn { transition: background .2s, transform .15s cubic-bezier(.3, 1.5, .5, 1), box-shadow .2s; }
.punch-page .btn:hover { transform: translateY(-2px); }
.punch-page .btn:active { transform: translateY(1px) scale(.96); }
.punch-page .btn.btn-copper.punch-expected { box-shadow: 0 6px 20px rgba(180, 95, 47, .28); }
.btn-armed { animation: btn-wiggle .4s ease; outline: 3px dashed var(--copper); outline-offset: 3px; }
@keyframes btn-wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-1deg); }
  75% { transform: translateX(4px) rotate(1deg); }
}
.punch-confirm[hidden] { display: none; }
.punch-confirm {
  display: inline-block; max-width: 30em;
  background: var(--copper-soft); color: var(--copper-dark);
  border-radius: 999px; padding: .45rem 1.2rem;
  font-size: .88rem; font-weight: 600;
}

/* hanko stamp slammed over the clock on every successful punch */
.punch-stamp {
  position: absolute; left: 50%; top: 6.4rem;
  margin-left: -2.3em; z-index: 5; pointer-events: none;
  background: var(--paper); opacity: 0;
}
.punch-stamp.stamp-slam { animation: stamp-slam 1.15s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes stamp-slam {
  0% { opacity: 0; transform: scale(2.1) rotate(-22deg); }
  22% { opacity: 1; transform: scale(.92) rotate(-7deg); }
  34% { transform: scale(1.04) rotate(-6deg); }
  46% { transform: scale(1) rotate(-6deg); }
  78% { opacity: 1; transform: scale(1) rotate(-6deg); }
  100% { opacity: 0; transform: scale(1) rotate(-6deg) translateY(-8px); }
}

/* ============================================================
   Landing page
   ============================================================ */
.hero {
  background:
    linear-gradient(rgba(250,246,240,.92), rgba(250,246,240,.97)),
    repeating-linear-gradient(0deg, transparent 0 39px, #efe7db 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #efe7db 39px 40px);
  border-bottom: 1px solid var(--line);
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 4vw, 2.4rem) clamp(3rem, 6vw, 5rem);
  text-align: center;
}
.hero-inner { max-width: 880px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .82rem; font-weight: 700; letter-spacing: .08em;
  color: var(--copper-dark);
  background: var(--copper-soft);
  border-radius: 999px; padding: .3rem 1rem; margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.3rem);
  line-height: 1.32; margin: 0 0 1.1rem; color: var(--navy); letter-spacing: .01em;
}
.hero h1 .accent { color: var(--copper); }
.hero .lede { font-size: clamp(1rem, 2.1vw, 1.2rem); color: var(--ink-soft); max-width: 40em; margin: 0 auto 2.2rem; }
.hero .cta-row { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.hero .promise {
  margin-top: 2.6rem; display: inline-block;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.6rem; font-weight: 600; color: var(--navy);
}
.hero .promise .quote { color: var(--copper-dark); }

.section { padding: clamp(2.6rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2.4rem); }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2.center { justify-content: center; text-align: center; font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: .6rem; }
.section .section-lede { text-align: center; color: var(--ink-soft); max-width: 44em; margin: 0 auto 2.6rem; }

.pillar { text-align: left; }
.pillar .pillar-num { font-family: var(--font-en); font-weight: 700; font-size: .8rem; color: var(--copper); letter-spacing: .1em; }
.pillar h3 { margin: .3rem 0 .5rem; font-size: 1.08rem; }
.pillar p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

.feature-item { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 0; border-bottom: 1px dashed var(--line); }
.feature-item:last-child { border-bottom: none; }
.feature-item .f-mark { color: var(--green); font-weight: 700; flex: none; margin-top: .1em; }
.feature-item strong { color: var(--navy); }
.feature-item .muted { display: block; }

/* an engineer's memo with a hanko seal — not a "callout box" */
.honesty {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 6rem 1.6rem 1.8rem;
  box-shadow: var(--shadow);
}
.honesty h3 { margin-top: 0; }
.honesty-stamp {
  position: absolute; top: 1.15rem; right: 1.3rem;
  transform: rotate(8deg);
  opacity: .88;
  /* pressed-in-ink irregularity: the ring is slightly heavier at the bottom */
  box-shadow: inset 0 -1px 0 var(--copper);
}
@media (max-width: 560px) {
  .honesty { padding: 1.3rem 4.4rem 1.3rem 1.15rem; }
  .honesty-stamp { font-size: .62rem; top: .9rem; right: .8rem; }
}

.price-card { position: relative; display: flex; flex-direction: column; }
.price-card .plan-name { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.price-card .plan-price { font-family: var(--font-en); font-size: 2rem; font-weight: 700; color: var(--navy); margin: .4rem 0 0; font-variant-numeric: tabular-nums; }
.price-card .plan-price small { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.price-card ul { padding-left: 1.2em; margin: .8rem 0 1.2rem; color: var(--ink-soft); font-size: .9rem; flex: 1; }
.price-card.featured { border: 2px solid var(--copper); box-shadow: var(--shadow-lift); }
.price-card .plan-tag {
  position: absolute; top: -0.8rem; left: 1.2rem;
  background: var(--copper); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 999px; padding: .15rem .8rem;
}

.faq-item { border-bottom: 1px solid var(--line); padding: .3rem 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: .8rem 0; list-style: none; display: flex; gap: .6em; transition: color .15s; }
.faq-item summary:hover { color: var(--copper-dark); }
.faq-item summary:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; border-radius: 6px; }
.faq-item summary::before { content: "Q."; color: var(--copper); font-family: var(--font-en); }
.faq-item .faq-a { padding: 0 0 1rem 1.8em; color: var(--ink-soft); }

.landing-cta {
  text-align: center;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2.4rem, 5vw, 3.6rem) 1.5rem;
}
.landing-cta h2 { color: #fff; justify-content: center; }
.landing-cta h2::before { display: none; }
.landing-cta p { color: #b9c4cf; max-width: 38em; margin: .5rem auto 1.8rem; }

/* ---------- Guide ---------- */
.guide-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.4rem; align-items: start; }
.guide-body { min-width: 0; }  /* let the 1fr track shrink instead of overflowing */
.guide-toc { position: sticky; top: 5rem; font-size: .9rem; }
.guide-toc a { display: block; color: var(--ink-soft); text-decoration: none; padding: .3rem .8rem; border-left: 2px solid var(--line); }
.guide-toc a:hover { color: var(--copper-dark); border-left-color: var(--copper); }
.guide-body .card { scroll-margin-top: 5.5rem; }
.guide-step { display: flex; gap: 1rem; padding: .7rem 0; }
.guide-step .step-num {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--navy); color: #fff; font-family: var(--font-en); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
kbd, code {
  font-family: ui-monospace, monospace; font-size: .84em;
  background: #f2ece3; border: 1px solid var(--line-strong);
  border-radius: 5px; padding: .08em .4em;
}
@media (max-width: 860px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; display: flex; flex-wrap: wrap; gap: .3rem; }
  .guide-toc a { border-left: none; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .9rem; }
}

/* ---------- Role-based visual guides ---------- */
.guide-hero {
  max-width: 780px; margin: 1.3rem auto 2rem; text-align: center;
}
.guide-hero h1 { margin: .25rem 0 .65rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.2; }
.guide-hero > p:not(.eyebrow) { max-width: 43em; margin: 0 auto; color: var(--ink-soft); line-height: 1.85; }
.guide-hero .btn-row { justify-content: center; margin-top: 1.3rem; }
.guide-hero-compact { margin-bottom: 1.5rem; }
.guide-hero-compact h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }

.guide-breadcrumb {
  display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem;
  color: var(--ink-soft); font-size: .84rem;
}
.guide-breadcrumb a { color: var(--copper-dark); }

.guide-audience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.guide-audience-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(135px, 34%); gap: 1.2rem;
  overflow: hidden; min-height: 430px; padding: 1.5rem 0 0 1.5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.guide-audience-copy { display: flex; flex-direction: column; align-items: flex-start; padding-bottom: 1.5rem; }
.guide-audience-card h2 { margin: .45rem 0 .6rem; }
.guide-audience-card p { color: var(--ink-soft); }
.guide-audience-card .btn { margin-top: auto; }
.guide-audience-card > img {
  align-self: end; width: 100%; height: auto; max-height: 390px; object-fit: cover; object-position: top;
  border: 7px solid var(--navy); border-bottom: 0; border-right: 0; border-radius: 22px 0 0 0;
  box-shadow: -10px -6px 28px rgba(25, 39, 52, .14);
}
.guide-role {
  display: inline-flex; padding: .25rem .65rem; border-radius: 999px;
  background: var(--copper-soft); color: var(--copper-dark); font-size: .76rem; font-weight: 700;
}
.guide-check-list { margin: .4rem 0 1.25rem; padding: 0; list-style: none; color: var(--ink-soft); }
.guide-check-list li { position: relative; margin: .45rem 0; padding-left: 1.55rem; }
.guide-check-list li::before {
  content: "✓"; position: absolute; left: 0; top: .03rem; width: 1.08rem; height: 1.08rem;
  display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green);
  font-size: .7rem; font-weight: 700;
}
.guide-help-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.25rem;
}
.guide-help-card h2 { margin-bottom: .35rem; }
.guide-help-card p { margin: 0; color: var(--ink-soft); }

.guide-tour {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 390px); align-items: center; gap: clamp(1.5rem, 5vw, 4.5rem);
  overflow: hidden; margin: 1.5rem 0; padding: clamp(1.4rem, 4vw, 3rem);
  color: #fff; background: linear-gradient(145deg, var(--navy-deep), var(--navy)); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); outline: none;
}
/* on the navy panel the default light-peach pill would be peach-on-peach —
   restyle it dark-pill + light text for contrast */
.guide-tour .eyebrow { color: #f4c9a6; background: rgba(180, 95, 47, .3); }
.guide-tour h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); }
.guide-tour-copy > p:not(.eyebrow) { color: #e2e8ee; line-height: 1.8; }
.guide-tour-hint { font-size: .8rem; color: #c3cdd6; }
.guide-tour-lang-note { color: #f4c9a6; }
.guide-tour-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: 1.1rem; }
.guide-tour-controls .btn { border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.06); }
.guide-tour-controls [data-tour-status] { min-width: 3.3rem; text-align: center; font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.guide-tour-toggle {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.2rem; padding: .35rem .7rem;
  border: 1px solid rgba(255,255,255,.28); color: #e2e8ee; background: transparent;
  border-radius: 7px; cursor: pointer; font: inherit; font-size: .78rem;
}
.guide-tour-toggle:hover, .guide-tour-toggle:focus-visible { color: #fff; background: rgba(255,255,255,.1); }
.guide-tour-toggle:focus-visible { outline: 3px solid rgba(239,183,143,.55); }
.guide-tour-controls [data-tour-status] { color: #e2e8ee; }
.guide-tour-dots { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.guide-tour-dot {
  width: 2rem; height: .42rem; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.34); cursor: pointer; transition: width .2s ease, background .2s ease;
}
.guide-tour-dot.is-active { width: 3.5rem; background: #efb78f; }
.guide-tour-dot:focus-visible { outline: 3px solid rgba(239,183,143,.55); outline-offset: 3px; }
.guide-tour-progress { overflow: hidden; height: 3px; margin-top: .9rem; background: rgba(255,255,255,.16); border-radius: 999px; }
.guide-tour-progress span { display: block; width: 100%; height: 100%; background: #efb78f; transform: scaleX(0); transform-origin: left; }
.guide-tour-progress span.is-running { animation: guide-tour-progress var(--tour-duration) linear forwards; }
@keyframes guide-tour-progress { to { transform: scaleX(1); } }

.guide-tour-stage { min-height: 650px; display: grid; place-items: center; touch-action: pan-y; }
.guide-tour-slide { width: 100%; margin: 0; animation: guide-slide-in .38s ease both; }
.guide-phone-frame {
  width: min(290px, 100%); margin: 0 auto; padding: 8px; background: #101820;
  border-radius: 28px; box-shadow: 0 24px 55px rgba(0,0,0,.35);
}
.guide-phone-frame img { display: block; width: 100%; height: auto; border-radius: 21px; }
.guide-tour-slide figcaption { display: flex; flex-direction: column; gap: .18rem; margin-top: 1rem; text-align: center; }
.guide-tour-slide figcaption strong { color: #fff; }
.guide-tour-slide figcaption span { color: #c7d0d8; font-size: .82rem; line-height: 1.65; }
@keyframes guide-slide-in { from { opacity: 0; transform: translateX(18px); } }

.guide-section-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: 1.6rem 0;
}
.guide-section-nav a {
  padding: .45rem .85rem; color: var(--navy); background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none; font-size: .82rem; font-weight: 600;
}
.guide-section-nav a:hover { color: var(--copper-dark); border-color: var(--copper); }
.guide-section-nav a:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; }
.guide-task-list { display: grid; gap: 1rem; max-width: 980px; margin: 0 auto; }
.guide-task {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 1.2rem; scroll-margin-top: 5.5rem;
}
.guide-task-number {
  width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: var(--navy); font: 700 1.1rem var(--font-en);
}
.guide-task-content > .eyebrow { margin: .15rem 0 .2rem; }
.guide-task-content > h2 { margin-top: 0; }
.guide-steps { display: grid; gap: .15rem; margin: 1rem 0 1.2rem; padding: 0; list-style: none; counter-reset: guide-step; }
.guide-steps li {
  position: relative; display: grid; gap: .2rem; padding: .8rem .8rem .8rem 3rem;
  border-bottom: 1px solid var(--line); counter-increment: guide-step;
}
.guide-steps li::before {
  content: counter(guide-step); position: absolute; left: .65rem; top: .8rem;
  width: 1.55rem; height: 1.55rem; display: grid; place-items: center; border-radius: 50%;
  color: var(--copper-dark); background: var(--copper-soft); font: 700 .78rem var(--font-en);
}
.guide-steps li > span { color: var(--ink-soft); line-height: 1.75; }
.guide-result, .guide-warning {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .75rem; padding: .9rem 1rem; border-radius: 9px;
}
.guide-result { color: #175d43; background: var(--green-soft); }
.guide-warning { color: #79521f; background: var(--amber-soft); }
.guide-callout { margin-top: 1rem; padding: 1rem; background: var(--cream); border-left: 3px solid var(--copper); border-radius: 0 8px 8px 0; }
.guide-callout p { margin: .25rem 0 0; color: var(--ink-soft); }
.guide-troubleshooting { display: grid; gap: .7rem; }
.guide-troubleshooting > div { padding: .8rem 1rem; background: var(--cream); border-radius: 8px; }
.guide-troubleshooting dt { font-weight: 700; color: var(--navy); }
.guide-troubleshooting dd { margin: .25rem 0 0; color: var(--ink-soft); line-height: 1.7; }
.guide-contact { margin-top: 1.2rem; font-weight: 600; }
.guide-check-list-large { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1.2rem; }
.guide-final-check { border-color: #acd7c6; }
.guide-final-check .guide-task-number { background: var(--green); }

@media (max-width: 900px) {
  .guide-audience-grid { grid-template-columns: 1fr; }
  .guide-audience-card { min-height: 390px; }
  .guide-tour { grid-template-columns: 1fr; }
  .guide-tour-stage { min-height: 0; }
}

/* ================= Legal and data handling ================= */
.legal-hero {
  max-width: 820px; margin: 1.2rem auto 2rem; padding: clamp(2.2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
  text-align: center;
}
.legal-hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); margin: .6rem 0 1rem; letter-spacing: -.035em; }
.legal-hero p { max-width: 42em; margin: 0 auto; color: var(--ink-soft); line-height: 1.9; }
.legal-card-grid {
  max-width: 1100px; margin: 0 auto 3rem; padding: 0 clamp(1rem, 4vw, 2rem);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.legal-card {
  display: flex; min-height: 250px; flex-direction: column; padding: 1.5rem;
  color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease;
}
.legal-card:hover { transform: translateY(-3px); border-color: var(--copper); }
.legal-card-number { font-family: var(--font-en); color: var(--copper-dark); font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.legal-card h2 { margin: 1.1rem 0 .6rem; font-size: 1.3rem; }
.legal-card p { color: var(--ink-soft); line-height: 1.75; font-size: .9rem; }
.legal-card-link { margin-top: auto; color: var(--copper-dark); font-weight: 700; font-size: .88rem; }
.legal-contact-strip {
  max-width: 1068px; margin: 0 auto 4rem; padding: 1.2rem 1.4rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; background: var(--navy); color: #fff; border-radius: var(--radius);
}
.legal-contact-strip strong, .legal-contact-strip span { display: block; }
.legal-contact-strip span { margin-top: .2rem; color: #d9e0e6; font-size: .84rem; }
.legal-layout { margin-top: 1rem; }
.legal-document-head { margin-bottom: 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.legal-document-head h1 { margin-top: .55rem; }
.legal-effective { color: var(--ink-soft); font-family: var(--font-en); font-size: .78rem; font-weight: 600; }
.legal-document .doc-prose { max-width: 50em; }
.legal-document .doc-prose blockquote {
  margin: 0 0 1.4rem; padding: .9rem 1.1rem; background: var(--copper-soft);
  border-left: 3px solid var(--copper); color: var(--navy);
}
@media (max-width: 760px) {
  .legal-card-grid { grid-template-columns: 1fr; }
  .legal-card { min-height: 210px; }
  .legal-contact-strip { margin-left: 1rem; margin-right: 1rem; align-items: flex-start; flex-direction: column; }
}
@media (max-width: 600px) {
  .guide-hero { text-align: left; }
  .guide-hero .btn-row { justify-content: flex-start; }
  .guide-audience-card { grid-template-columns: minmax(0, 1fr) 105px; gap: .75rem; padding: 1.1rem 0 0 1.1rem; }
  .guide-audience-card > img { max-height: 310px; border-width: 5px; }
  .guide-help-card { align-items: flex-start; flex-direction: column; }
  .guide-tour { margin-left: calc(-1 * var(--space, 1rem)); margin-right: calc(-1 * var(--space, 1rem)); border-radius: 0; padding: 1.35rem 1rem 1.6rem; }
  .guide-phone-frame { width: min(280px, 82vw); }
  .guide-section-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; scroll-snap-type: x proximity; }
  .guide-section-nav a { flex: none; scroll-snap-align: start; }
  .guide-task { grid-template-columns: 2.4rem minmax(0, 1fr); gap: .7rem; padding: 1rem .85rem; }
  .guide-task-number { width: 2.35rem; height: 2.35rem; font-size: .9rem; }
  .guide-steps li { padding-left: 2.65rem; }
  .guide-result, .guide-warning { grid-template-columns: 1fr; gap: .2rem; }
  .guide-check-list-large { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .footer, .guide-tour-controls, .guide-tour-dots, .guide-tour-progress, .guide-section-nav, .guide-hero .btn-row { display: none !important; }
  .guide-tour { color: #111; background: #fff; box-shadow: none; border: 1px solid #ccc; }
  .guide-tour h2, .guide-tour-slide figcaption strong { color: #111; }
  .guide-tour-copy > p:not(.eyebrow), .guide-tour-slide figcaption span { color: #444; }
  .guide-task { break-inside: avoid; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-tour-slide { animation: none; }
  .guide-tour-progress span.is-running { animation: none; }
  .guide-tour-dot { transition: none; }
}

/* ================= Responsive: tablet & phone ================= */
/* The header collapses by measurement, not a fixed breakpoint: nav labels vary
   wildly by language (pt-BR admin nav is ~2x the Japanese one) and by role, so
   inline JS in base.html steps through full row → .nav-tight (compact row) →
   .nav-collapsed (hamburger), keeping the first state whose nav fits one row. */
.topbar.nav-tight { gap: .7rem; }
.topbar.nav-tight .nav a { font-size: .85rem; padding: .34rem .55rem; }
.topbar.nav-tight .lang-form select { font-size: .78rem; }
.topbar.nav-tight .account-email { display: none; }   /* avatar only when tight */
.topbar.nav-collapsed { flex-wrap: wrap; gap: .5rem 1rem; row-gap: .4rem; }
.topbar.nav-collapsed .brand { order: 1; }
.topbar.nav-collapsed .topbar-right { order: 2; margin-left: auto; }
.topbar.nav-collapsed .nav-toggle { display: flex; order: 3; }
.topbar.nav-collapsed .nav {
  order: 4; width: 100%; display: none; flex-direction: column; gap: .1rem;
  padding: .4rem 0 .2rem; border-top: 1px solid rgba(255,255,255,.12);
}
.topbar.nav-collapsed .nav.is-open { display: flex; }
.topbar.nav-collapsed .nav a { width: 100%; padding: .62rem .7rem; font-size: .95rem; }
/* language picker moves out of the cramped top row into the menu */
.topbar.nav-collapsed .topbar-lang { display: none; }
.topbar.nav-collapsed .nav-lang { display: block; width: 100%; margin: .5rem 0 .2rem; padding: .5rem .7rem 0; border-top: 1px solid rgba(255,255,255,.12); }
.topbar.nav-collapsed .nav-lang select { width: 100%; max-width: 100%; }
.topbar.nav-collapsed .account-email { display: none; }   /* avatar only on mobile */
@media (max-width: 1100px) {
  .card { overflow-x: auto; }          /* wide tables scroll within the card */
  .price-card { overflow: visible; }   /* never holds a table — keep the plan tag hanging over the edge */
  .container { margin: 1.3rem auto 2rem; }
}

.checklist-toggle { display: inline-flex; align-items: center; gap: .45rem; margin: .15rem 0; }
.checklist-toggle button {
  border: 0; background: transparent; color: var(--copper-dark); padding: .2rem;
  min-width: 2rem; min-height: 2rem; cursor: pointer; font: inherit;
}
.checklist-toggle button:focus-visible { outline: 3px solid var(--copper-soft); border-radius: 6px; }
@media (max-width: 560px) {
  .card { padding: 1.1rem 1.15rem; }
  h1 { margin-bottom: 1rem; }
  .kpi .kpi-value { font-size: 1.6rem; }
  .lang-form select { max-width: 8.5rem; }
  input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
  input[type=number], input[type=month], select, textarea { max-width: 100%; }
  .btn, .nav a, .account-menu > summary { min-height: 44px; }
  .inbox-item { flex-wrap: wrap; align-items: flex-start; gap: .65rem; }
  .inbox-item .grow { min-width: 0; flex: 1 1 calc(100% - 3.2rem); }
  .inbox-actions { width: 100%; margin-left: 3.2rem; }
  .inbox-actions .btn { flex: 1; }
  .alert-actions { width: 100%; margin-left: 0; }
  .alert-actions input { flex: 1; min-width: 0; }

  .mobile-card-table, .mobile-card-table tbody { display: block; }
  .mobile-card-table > thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  /* Older tables placed their header row directly in tbody. New semantic
     tables use <thead>; never hide their first actual data row. */
  .mobile-card-table:not(:has(> thead)) > tbody > tr:first-child,
  .mobile-card-table:not(:has(> thead)) > tr:first-child { display: none; }
  .mobile-card-table tr { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .mobile-card-table tr:last-child { border-bottom: 0; }
  .mobile-card-table td {
    display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start;
    border: 0; padding: .28rem 0; text-align: right; overflow-wrap: anywhere;
  }
  .mobile-card-table td::before {
    content: attr(data-label); color: var(--ink-soft); font-size: .78rem;
    font-weight: 600; text-align: left; flex: 0 0 6.2rem;
  }
  .mobile-card-table td details { max-width: 12rem; }
}

@media (display-mode: standalone) {
  .topbar { padding-top: max(.75rem, env(safe-area-inset-top)); }
  .footer { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
}

/* ---------- Guide screenshots ---------- */
figure.shot { margin: 1rem 0 0.4rem; }
figure.shot img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow); background: var(--paper);
}
figure.shot figcaption { font-size: .8rem; color: var(--ink-soft); margin-top: .4rem; text-align: center; }

/* ---------- Misc ---------- */
a { color: var(--copper-dark); }
hr { border: none; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { position: fixed; left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 100; }

/* ============================================================
   Auth pages (allauth — all pages via templates/allauth/layouts/base.html)
   ============================================================ */
.auth-main {
  width: 100%;
  max-width: 27rem;
  margin: 3.5rem auto 4rem;
  padding: 2.2rem 2.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.auth-main h1 { font-size: 1.35rem; margin-top: 0; }
.auth-main p { color: var(--ink-soft); font-size: .92rem; }
.auth-main form { margin-top: 1rem; }
.auth-main input:not([type=checkbox]):not([type=radio]) { max-width: 100%; margin-bottom: .7rem; }
.auth-main label { margin: .2rem 0 .25rem; }
/* raw allauth buttons (signup, reset, mfa element pages) — NOT our .btn buttons */
.auth-main button:not(.btn), .auth-main a.button:not(.btn) {
  display: block; width: 100%;
  background: var(--navy); color: #fff;
  border: 1px solid var(--navy); border-radius: 10px;
  padding: .62rem 1.2rem; font-size: .98rem; font-weight: 600; font-family: inherit;
  cursor: pointer; margin-top: .4rem; text-align: center; text-decoration: none;
}
.auth-main button:not(.btn):hover { background: var(--navy-deep); }
.auth-main form[class*=signup] button[type=submit]:not(.btn),
.auth-main button[form=login]:not(.btn), .auth-main form.login button[type=submit]:not(.btn) { background: var(--copper); border-color: var(--copper); }
.auth-main hr { margin: 1.4rem 0; }
.auth-main ul { padding-left: 1.2em; color: var(--ink-soft); font-size: .9rem; }
.auth-main a { color: var(--copper-dark); }

/* Account-management pages (email / password / 2FA / passkeys / sessions):
   one clean, medium-width card in the full app chrome. */
main.manage-page {
  width: 100%; max-width: 54rem;
  margin: 2.5rem auto 4rem;
  padding: 2.1rem clamp(1.3rem, 4vw, 2.4rem) 2.4rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
}
main.manage-page h1 { font-size: 1.4rem; margin-top: 0; }
main.manage-page table { margin-top: .6rem; }
main.manage-page form { margin-top: 1rem; }
main.manage-page button:not(.btn), main.manage-page [type=submit]:not(.btn) {
  display: inline-flex; align-items: center; gap: .45em;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  border-radius: 10px; padding: .55rem 1.2rem; font-size: .95rem; font-weight: 600;
  font-family: inherit; cursor: pointer; margin: .2rem .4rem .4rem 0;
}
main.manage-page button.btn-danger, main.manage-page [type=submit].btn-danger { background: var(--red); border-color: var(--red); }
.ua-cell { white-space: normal; overflow-wrap: break-word; font-size: .82rem; color: var(--ink-soft); line-height: 1.5; }
/* account-management headings/buttons breathe (buttons never touch the next heading) */
main.manage-page h2 { margin-top: 1.8rem; }
main.manage-page h2:first-child { margin-top: 0; }
main.manage-page button:not(.btn), main.manage-page [type=submit]:not(.btn) { margin: .2rem .55rem .7rem 0; }

/* auth checkboxes (remember-me etc.) keep the global switch styling; lay the
   label out inline next to the switch instead of stacking. */
.auth-main label:has(input[type=checkbox]) { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; color: var(--ink); margin: .2rem 0; }
.auth-main input[type=checkbox] { margin-bottom: 0; }

/* Form fields fill their card — no dead space on the right of a narrow card
   (was: inputs capped at 28rem inside a 40rem card / half-width grid column). */
.card form input:not([type=checkbox]):not([type=radio]),
.card form select, .card form textarea { max-width: 100%; }

/* ============================================================
   Redesigned login / entrance card
   ============================================================ */
.auth-main { position: relative; z-index: 1; max-width: 26rem; padding: 2.4rem 2.4rem 2.2rem; }
.auth-card-inner { display: flex; flex-direction: column; }
.auth-head { margin-bottom: 1.2rem; }
.auth-badge {
  display: inline-flex; align-items: baseline; gap: .02em;
  font-family: var(--font-en); font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  color: var(--copper-dark); background: var(--copper-soft);
  padding: .28rem .75rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.auth-badge-ja { font-family: var(--font-ja); }
.auth-head h1 { font-size: 1.55rem; margin: 0 0 .35rem; letter-spacing: .01em; }
.auth-sub { color: var(--ink-soft); font-size: .92rem; margin: 0; line-height: 1.6; }
.auth-form { margin-top: .2rem; display: flex; flex-direction: column; }
.auth-form > label { margin: .85rem 0 .35rem; }
.auth-form input:not([type=checkbox]) { max-width: 100%; margin-bottom: 0; }
.auth-pw-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: .85rem; }
.auth-pw-row label { margin: 0 0 .35rem; }
.auth-forgot { font-size: .8rem; font-weight: 600; text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }
.auth-remember { margin: 1.1rem 0 .1rem; font-size: .9rem; cursor: pointer; }
.auth-submit { width: 100%; margin: 1.2rem 0 0; padding: .72rem 1.2rem; font-size: 1rem; }
.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0; color: var(--ink-soft); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-passkey { width: 100%; margin: 0; }
.auth-signup { text-align: center; font-size: .9rem; color: var(--ink-soft); margin: 1.5rem 0 0; }
.auth-errors { background: var(--red-soft); color: var(--red); border: 1px solid #eccfcb; border-radius: var(--radius-sm); padding: .6rem .9rem; font-size: .88rem; margin-bottom: .7rem; }
.auth-field-error { color: var(--red); font-size: .82rem; margin-top: .3rem; }

/* ============================================================
   Landing v2 — product-first
   ============================================================ */
.hero-product {
  background:
    radial-gradient(60% 50% at 75% 20%, rgba(180, 95, 47, .10), transparent 70%),
    linear-gradient(rgba(250,246,240,.9), rgba(250,246,240,.98)),
    repeating-linear-gradient(0deg, transparent 0 39px, #efe7db 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #efe7db 39px 40px);
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.4rem) clamp(3rem, 6vw, 5rem);
}
.hero-grid {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-product h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.28; margin: 1rem 0 1.1rem; color: var(--navy); }
.hero-product h1 .accent { color: var(--copper); }
.hero-product .lede { font-size: clamp(.98rem, 1.8vw, 1.12rem); color: var(--ink-soft); margin: 0 0 1.8rem; max-width: 34em; }
.hero-product .cta-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-product .sub-note { margin-top: 1.1rem; font-size: .84rem; color: var(--ink-soft); }

/* --- app mockup window --- */
.mock-window {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(43,58,74,.16), 0 4px 12px rgba(43,58,74,.08);
  overflow: hidden;
  transform: rotate(.6deg);
}
.mock-bar { display: flex; align-items: center; gap: .4rem; background: var(--navy); padding: .55rem .9rem; }
.mock-bar i { width: .62rem; height: .62rem; border-radius: 50%; background: #5a6c7e; }
.mock-bar i:first-child { background: var(--copper); }
.mock-bar .mock-url {
  margin-left: .6rem; flex: 1; font-family: var(--font-en); font-size: .68rem; color: #9daebc;
  background: rgba(255,255,255,.08); border-radius: 6px; padding: .15rem .7rem;
}
.mock-body { padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: .9rem; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.mock-title { font-weight: 700; color: var(--navy); font-size: .95rem; }
.mock-panel { border: 1px solid var(--line); border-radius: 10px; padding: .8rem .95rem; }
.mock-panel .mono { font-size: .85rem; }
.mock-derivation {
  font-family: ui-monospace, monospace; font-size: .72rem; line-height: 1.75;
  background: #f7f2ea; border-left: 3px solid var(--copper);
  border-radius: 0 8px 8px 0; padding: .65rem .85rem; color: var(--ink);
  white-space: pre; overflow-x: auto;
}
.mock-alert {
  display: flex; gap: .6rem; align-items: center;
  background: var(--amber-soft); border: 1px solid #ecd9b4; border-radius: 10px;
  padding: .6rem .85rem; font-size: .8rem; color: var(--amber); font-weight: 600;
}

/* --- stats band --- */
.stats-band { background: var(--navy); color: #fff; padding: clamp(1.8rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2.4rem); }
.stats-inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; text-align: center; }
.stat .stat-value { font-family: var(--font-en); font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .stat-value .unit { font-size: .55em; font-weight: 600; color: #b9c4cf; margin-left: .1em; }
.stat .stat-label { font-size: .8rem; color: #9daebc; margin-top: .15rem; }

/* --- pipeline (§2 module map) --- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; align-items: stretch; }
.pipe-step { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.pipe-step .pipe-num { font-family: var(--font-en); font-weight: 700; font-size: .72rem; color: var(--copper); letter-spacing: .12em; }
.pipe-step h3 { margin: .25rem 0 .35rem; font-size: .98rem; }
.pipe-step p { margin: 0; font-size: .82rem; color: var(--ink-soft); line-height: 1.6; }
.pipe-step::after {
  content: "→"; position: absolute; right: -0.85rem; top: 50%; transform: translateY(-50%);
  color: var(--copper); font-weight: 700; z-index: 2;
  animation: arrow-flow 3.2s ease-in-out infinite;
}
.pipe-step:nth-child(1)::after { animation-delay: 0s; }
.pipe-step:nth-child(2)::after { animation-delay: .55s; }
.pipe-step:nth-child(3)::after { animation-delay: 1.1s; }
.pipe-step:nth-child(4)::after { animation-delay: 1.65s; }
@keyframes arrow-flow {
  0%, 55%, 100% { opacity: .45; transform: translateY(-50%) translateX(0); }
  25% { opacity: 1; transform: translateY(-50%) translateX(3px); }
}
.pipe-step:last-child::after { display: none; }
@media (max-width: 1000px) { .pipe-step::after { display: none; } }

/* --- feature cards with icons --- */
.feature-card { display: flex; flex-direction: column; gap: .5rem; }
.feature-card .f-icon {
  width: 2.6rem; height: 2.6rem; border-radius: 10px;
  background: var(--copper-soft); color: var(--copper-dark);
  display: flex; align-items: center; justify-content: center;
}
.feature-card .f-icon svg { width: 1.35rem; height: 1.35rem; }
.feature-card h3 { margin: .3rem 0 0; font-size: 1.02rem; }
.feature-card p { margin: 0; font-size: .88rem; color: var(--ink-soft); }

/* --- regime chips --- */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip {
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: .32rem 1rem; font-size: .85rem; font-weight: 600; color: var(--navy);
}
.chip .ok { color: var(--green); margin-right: .3em; }

/* --- comparison table --- */
.compare { overflow-x: auto; }
.compare table { min-width: 640px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; }
.compare th, .compare td { padding: .8rem 1rem; }
.compare thead th { background: var(--navy); color: #fff; border-bottom: none; font-size: .85rem; }
.compare thead th.us { background: var(--copper); }
.compare td.us { background: #fdf6ef; font-weight: 600; color: var(--navy); }
.compare td { font-size: .88rem; }

/* --- hero platform note (links to #apps) --- */
.hero-platforms {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-top: 1.2rem; padding: .45rem 1rem .45rem .8rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  font-size: .84rem; font-weight: 600; color: var(--navy);
  text-decoration: none; box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.hero-platforms:hover { border-color: var(--copper); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.hero-platforms .hp-icons { display: inline-flex; gap: .25rem; color: var(--copper-dark); }
.hero-platforms .hp-icons svg { width: 1.05em; height: 1.05em; }

/* --- mobile apps section --- */
.apps-section {
  background:
    radial-gradient(55% 60% at 22% 30%, rgba(180, 95, 47, .08), transparent 70%),
    linear-gradient(rgba(250,246,240,.92), rgba(250,246,240,.97)),
    repeating-linear-gradient(0deg, transparent 0 39px, #efe7db 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #efe7db 39px 40px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;   /* floating chips may poke out on narrow screens */
}
.apps-grid {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
@media (max-width: 900px) {
  .apps-grid { grid-template-columns: 1fr; }
  .apps-visual { order: 2; margin-top: 1rem; }
}
.apps-copy h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 1rem 0 .6rem; }
.apps-lede { color: var(--ink-soft); max-width: 36em; margin: 0 0 1.4rem; }
.apps-features { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: .9rem; }
.apps-features li { display: flex; gap: .85rem; align-items: flex-start; }
.apps-features .af-icon {
  flex: none; width: 2.3rem; height: 2.3rem; border-radius: 9px;
  background: var(--copper-soft); color: var(--copper-dark);
  display: flex; align-items: center; justify-content: center;
}
.apps-features .af-icon svg { width: 1.2rem; height: 1.2rem; }
.apps-features strong { display: block; color: var(--navy); font-size: .96rem; }
.apps-features .muted { display: block; font-size: .85rem; }

.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.store-badge {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--navy); color: #fff;
  border-radius: 10px; padding: .45rem 1rem .45rem .8rem;
}
.store-badge svg { width: 1.5rem; height: 1.5rem; flex: none; }
.store-badge-text { display: flex; flex-direction: column; line-height: 1.25; font-weight: 700; font-size: .82rem; }
.store-badge-text small { font-family: var(--font-en); font-weight: 600; font-size: .68rem; color: #b9c4cf; }
.store-note { flex-basis: 100%; font-size: .8rem; color: var(--ink-soft); margin-top: .1rem; }

/* phone frame around the canvas screen */
.phone-tilt { position: relative; width: fit-content; margin: 0 auto; transition: transform .25s ease; will-change: transform; }
.phone {
  position: relative;
  width: min(280px, 72vw); aspect-ratio: 9 / 19;
  border-radius: 46px;
  background: linear-gradient(160deg, #34455a, var(--navy-deep));
  padding: 11px;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.08),
    0 30px 70px rgba(43,58,74,.28), 0 6px 18px rgba(43,58,74,.14);
}
.phone::before { /* side button */
  content: ""; position: absolute; right: -2px; top: 22%;
  width: 3px; height: 3.2rem; border-radius: 3px; background: #22303e;
}
.phone-notch {
  position: absolute; top: 21px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 20px; border-radius: 11px;
  background: var(--navy-deep); z-index: 2;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.05);
}
.phone-screen { display: block; width: 100%; height: 100%; border-radius: 36px; background: var(--cream); }

.float-chip {
  position: absolute; z-index: 3;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-lift);
  padding: .35rem .95rem; font-size: .8rem; font-weight: 700; color: var(--navy);
  white-space: nowrap;
  animation: chip-float 5.5s ease-in-out infinite alternate;
}
.float-chip .ok { color: var(--green); margin-right: .35em; }
/* chips sit above the phone and over the empty bottom of the screen —
   zones the canvas never draws content into, at any width */
.float-chip-1 { top: -.9rem; left: -1.2rem; }
.float-chip-2 { bottom: 6%; right: -1.4rem; animation-delay: -2.7s; animation-duration: 6.5s; }
@keyframes chip-float { from { transform: translateY(-5px); } to { transform: translateY(6px); } }

/* --- scroll reveal --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Icons (Lucide, inline sprite) ---------- */
.icon { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a .icon { width: 1.05em; height: 1.05em; margin-right: .35em; vertical-align: -0.16em; opacity: .85; }
.nav a:hover .icon, .nav a.active .icon { opacity: 1; }
h2 .icon { color: var(--copper); width: 1.1em; height: 1.1em; }
h2.center .icon { color: var(--copper); }
.btn .icon { width: 1.05em; height: 1.05em; }
.icon-hidden { position: absolute; width: 0; height: 0; overflow: hidden; }
.stat-ico { color: var(--copper); width: 1.4rem; height: 1.4rem; }

/* ---------- Motion polish ---------- */
main .card { animation: card-in .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }

/* Approval / exception rows animate in with a subtle stagger, and lift on hover
   with a copper spine so the actionable queue feels alive. */
.inbox-item {
  transition: background .15s ease, box-shadow .2s ease, transform .1s ease, padding-left .15s ease;
  border-left: 2px solid transparent; border-radius: 8px;
  animation: row-in .4s cubic-bezier(.2,.7,.3,1) both;
}
.inbox-item:hover {
  background: #fdfaf5; border-left-color: var(--copper);
  padding-left: .8rem; box-shadow: var(--shadow);
}
.inbox-item:nth-child(1) { animation-delay: .02s; }
.inbox-item:nth-child(2) { animation-delay: .06s; }
.inbox-item:nth-child(3) { animation-delay: .10s; }
.inbox-item:nth-child(4) { animation-delay: .14s; }
.inbox-item:nth-child(5) { animation-delay: .18s; }
.inbox-item:nth-child(6) { animation-delay: .22s; }
.inbox-item:nth-child(n+7) { animation-delay: .26s; }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
/* approve/reject buttons get a springy press */
.inbox-item .btn { transition: background .15s, transform .12s cubic-bezier(.3,1.5,.5,1), box-shadow .15s; }
.inbox-item .btn:hover { transform: translateY(-1px); }
.inbox-item .btn:active { transform: translateY(1px) scale(.97); }
.badge-danger { animation: none; }
.badge.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--red-soft); } 50% { box-shadow: 0 0 0 4px transparent; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  main .card { animation: none; }
  .float-chip { animation: none; }
  .pipe-step::after { animation: none; }
  .phone-tilt { transition: none; }
  .punch-state .state-dot { animation: none !important; }
  .punch-state.chip-pop { animation: none; }
  .btn-armed { animation: none; }
  .punch-page .btn { transition: background .2s; }
  .punch-page .btn:hover, .punch-page .btn:active { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* ============================================================
   Guided tenant setup and staged imports
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.setup-shell { max-width: 1380px; }
.page-heading {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem;
  margin-bottom: 1.4rem;
}
.page-heading h1 { margin: .25rem 0 .45rem; font-size: clamp(1.65rem, 3vw, 2.2rem); }
.page-heading .eyebrow { margin: 0; padding: .2rem .75rem; }
.page-heading .lead { max-width: 52rem; margin: 0; color: var(--ink-soft); font-size: 1rem; }
.setup-form { display: grid; gap: 1rem; }
.setup-section {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 1rem;
  margin: 0; overflow: visible;
}
.setup-section-number {
  width: 2.35rem; height: 2.35rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font: 700 .9rem var(--font-en);
}
.setup-section-body { min-width: 0; }
.form-grid { display: grid; gap: .85rem 1rem; align-items: start; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-span-2 { grid-column: span 2; }
.field { min-width: 0; }
.field label { margin-top: 0; }
.field-help { margin-top: .28rem; color: var(--ink-soft); font-size: .78rem; line-height: 1.5; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--red); }
.field-error-text, .text-danger { color: var(--red); font-size: .82rem; font-weight: 600; }
.text-warn { color: var(--amber); font-size: .82rem; }
.text-ok { color: var(--green); font-size: .82rem; font-weight: 600; }
.required-mark { margin-left: .2rem; color: var(--red); }
.sticky-action-bar {
  position: sticky; bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1rem .4rem 1.2rem; border: 1px solid var(--line-strong);
  border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-lift);
  backdrop-filter: blur(12px);
}
.sticky-action-bar p { margin: 0 0 .5rem; color: var(--ink-soft); font-size: .85rem; }
.setup-progress { padding: 1.7rem; }
.setup-progress-head, .setup-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
}
.setup-progress-head h2, .setup-card-head h2 { margin-bottom: .35rem; }
.setup-progress-head .eyebrow, .setup-card-head .eyebrow { margin: 0 0 .45rem; padding: .16rem .65rem; }
.setup-percent { font: 700 2rem var(--font-en); color: var(--navy); }
.progress-track { height: 10px; overflow: hidden; margin: .75rem 0 1.35rem; border-radius: 999px; background: #eee5d8; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.setup-checklist { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem; margin: 0; padding: 0; }
.setup-checklist li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .65rem; border: 1px solid var(--line); border-radius: 10px; }
.setup-checklist li.is-done { background: #fbfdfb; }
.setup-check { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; background: var(--amber-soft); color: var(--amber); font: 700 .78rem var(--font-en); }
.is-done .setup-check { background: var(--green-soft); color: var(--green); }
.setup-checklist a { display: block; color: var(--navy); font-weight: 700; text-decoration: none; }
.setup-checklist a:hover { color: var(--copper-dark); text-decoration: underline; }
.setup-checklist small { display: block; color: var(--ink-soft); line-height: 1.4; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; padding: .15rem .62rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.status-ok { color: var(--green); background: var(--green-soft); }
.status-warn { color: var(--amber); background: var(--amber-soft); }
.status-danger { color: var(--red); background: var(--red-soft); }
.setup-ready { margin-top: 1rem; padding: .65rem .9rem; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.setup-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); align-items: start; gap: 1.4rem; }
.setup-main, .setup-side { min-width: 0; }
.setup-side { position: sticky; top: 5rem; }
.setup-work-card { scroll-margin-top: 5.5rem; overflow: visible; }
.setup-side-card h2 { font-size: 1rem; }
.btn-full { width: 100%; margin-right: 0; }
.weekday-fieldset { margin: 1rem 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; }
.weekday-fieldset legend { padding: 0 .35rem; color: var(--ink-soft); font-size: .84rem; font-weight: 600; }
.weekday-fieldset > div { display: flex; flex-wrap: wrap; gap: .7rem 1rem; }
.weekday-fieldset label, .field:has(input[type=checkbox]) label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--ink); font-weight: 500; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; margin: .8rem 0 1rem; }
.checkbox-row label { margin: 0; color: var(--ink); font-weight: 500; }
.setup-details { margin-top: 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fdfaf5; }
.setup-details > summary { cursor: pointer; padding: .65rem .85rem; color: var(--copper-dark); font-weight: 700; }
.setup-details > summary:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; }
.setup-details > form, .setup-details > ul, .setup-details > p { margin: 0; padding: .2rem .85rem .9rem; }
.stacked-form { display: grid; gap: .75rem; }
.stacked-form .field label { margin-top: 0; }
.plain-check-list { padding-left: 1.2rem; color: var(--ink-soft); font-size: .88rem; }
.plain-check-list li { margin-bottom: .45rem; }
.master-summary-grid, .import-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.master-summary-grid > div, .import-summary > div { min-width: 0; padding: .7rem .8rem; border-radius: 10px; background: var(--cream); }
.master-summary-grid strong, .import-summary strong { display: block; color: var(--navy); font: 700 1.35rem var(--font-en); }
.master-summary-grid span, .import-summary span { display: block; color: var(--ink-soft); font-size: .78rem; font-weight: 600; }
.master-summary-grid small { display: block; overflow: hidden; margin-top: .25rem; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.inline-details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.inline-details-grid .setup-details { margin-top: 0; }
.import-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.4rem; margin-bottom: 1.4rem; }
.import-layout .card { margin: 0; }
.upload-form { display: grid; gap: .45rem; }
.upload-form label { margin-top: 0; }
.import-columns { overflow-wrap: anywhere; white-space: normal; }
.import-preview { overflow: visible !important; scroll-margin-top: 5.5rem; }
.import-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.import-summary .has-error { background: var(--red-soft); }
.import-errors { margin: .9rem 0; padding: .75rem 1rem; border: 1px solid #eccfcb; border-radius: 10px; background: var(--red-soft); color: var(--red); }
.import-errors ul { margin: .35rem 0 0; padding-left: 1.2rem; max-height: 13rem; overflow: auto; }
.table-scroll { width: 100%; overflow-x: auto; }
.table-scroll:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; }
.row-error td { background: #fff8f7; }
.import-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.template-links { display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0 1rem; }
.template-links a { padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); font-size: .82rem; font-weight: 600; text-decoration: none; }
.activation-form { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(220px, 1fr) auto; align-items: end; gap: .8rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.activation-form .btn { margin: 0; min-height: 43px; }
.assignment-history { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.assignment-history p { margin: .35rem 0; }
.route-chip-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.route-chip-list span { padding: .25rem .65rem; border-radius: 999px; background: var(--cream); color: var(--ink-soft); font-size: .78rem; }
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; }
.tenant-card { margin: 0; display: flex; flex-direction: column; }
.tenant-percent { color: var(--navy); font: 700 1.45rem var(--font-en); }
.tenant-mini-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .7rem; padding: 0; margin: 0 0 1rem; list-style: none; color: var(--ink-soft); font-size: .82rem; }
.tenant-mini-checks li span { display: inline-block; width: 1.2rem; color: var(--amber); font-weight: 700; }
.tenant-mini-checks li.is-done span { color: var(--green); }
.tenant-card form { margin-top: auto; }

@media (max-width: 980px) {
  .setup-layout { grid-template-columns: 1fr; }
  .setup-side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .setup-checklist { grid-template-columns: 1fr; }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-details-grid { grid-template-columns: 1fr; }
  .import-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .setup-shell { margin-top: 1rem; }
  .page-heading { display: block; }
  .page-heading > .btn { margin-top: 1rem; }
  .setup-section { grid-template-columns: 1fr; }
  .setup-section-number { width: 2rem; height: 2rem; }
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .sticky-action-bar { position: static; display: block; padding: .9rem 1rem; }
  .sticky-action-bar .btn { width: 100%; margin: .4rem 0 0; }
  .setup-progress { padding: 1.15rem; }
  .setup-checklist li { grid-template-columns: 2rem minmax(0, 1fr); }
  .setup-checklist .status-pill { grid-column: 2; }
  .setup-side { display: block; }
  .master-summary-grid { grid-template-columns: 1fr; }
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-actions { align-items: stretch; flex-direction: column; }
  .import-actions form, .import-actions .btn { width: 100%; margin-right: 0; }
  .activation-form { grid-template-columns: 1fr; }
  .activation-form .btn { width: 100%; }
}

/* ============================================================
   Woven-thread WebGL background (Enshū Ribbon of Time)
   — bekito-bg.js paints its own cream, so content just needs
   to sit above the canvas via z-index. Canvas never takes
   pointer events (the module listens on window).
   ============================================================ */
/* HERO: canvas fills the hero section, behind the 2-col grid */
.hero-product { position: relative; isolation: isolate; }
.hero-product__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block; pointer-events: none;
}
.hero-product > .hero-grid { position: relative; z-index: 1; }

/* LOGIN / entrance: full-viewport fixed canvas; the card floats over it.
   z-index:-1 keeps it behind all page content (incl. footer) but above the
   body's cream background. .auth-main already has position:relative; z-index:1. */
.login-bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: -1; display: block; pointer-events: none;
  background: var(--cream);
}

/* ============================================================
   Solutions（業種別・状況別PRページ /solutions/）
   ============================================================ */
/* breadcrumb above the hero */
.crumbs {
  max-width: 1180px; margin: 1.1rem auto -0.4rem; padding: 0 clamp(1rem, 4vw, 2.4rem);
  font-size: .8rem; color: var(--ink-soft); position: relative; z-index: 2;
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .15rem; margin: 0; padding: 0; }
.crumbs li { display: flex; align-items: center; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--copper-dark); text-decoration: underline; }
.crumbs li + li::before { content: "›"; margin: 0 .5em; color: var(--line-strong); }
.crumbs [aria-current] { color: var(--navy); font-weight: 600; }

/* pain → solution rows: the heart of every solutions page */
.ps-list { display: grid; gap: 1.05rem; max-width: 1000px; margin: 0 auto; }
.ps-row { display: grid; grid-template-columns: 1fr 2.6rem 1fr; align-items: stretch; }
.ps-pain, .ps-fix { border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.ps-pain { background: var(--paper); border: 1px solid var(--line); }
.ps-fix { background: var(--navy); border: 1px solid var(--navy-deep); }
.ps-tag {
  display: inline-block; font-family: var(--font-en); font-size: .66rem; font-weight: 700;
  letter-spacing: .14em; margin-bottom: .45rem; padding: .14rem .55rem; border-radius: 999px;
}
.ps-pain .ps-tag { color: var(--red); background: var(--red-soft); }
.ps-fix .ps-tag { color: #f4c9a6; background: rgba(180, 95, 47, .28); }
.ps-pain h3, .ps-fix h3 { margin: 0 0 .35rem; font-size: .98rem; line-height: 1.5; }
.ps-fix h3 { color: #fff; }
.ps-pain p { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.7; }
.ps-fix p { margin: 0; font-size: .85rem; color: #b9c4cf; line-height: 1.7; }
.ps-fix .mono { color: #e8edf2; }
.ps-arrow { display: flex; align-items: center; justify-content: center; color: var(--copper); }
.ps-arrow svg { width: 1.35rem; height: 1.35rem; }
@media (max-width: 760px) {
  .ps-row { grid-template-columns: 1fr; }
  .ps-arrow { transform: rotate(90deg); padding: .35rem 0; }
}

/* audience router cards (landing band + /solutions/ hub) */
.aud-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.aud-card {
  display: flex; flex-direction: column; gap: .5rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.aud-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--copper); }
.aud-card:focus-visible { outline: 3px solid var(--copper-soft); outline-offset: 2px; }
.aud-card .aud-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 10px; background: var(--copper-soft);
  color: var(--copper-dark); display: grid; place-items: center; flex: none;
}
.aud-card .aud-icon svg { width: 1.35rem; height: 1.35rem; }
.aud-card h3 { margin: .2rem 0 0; font-size: 1.02rem; color: var(--navy); }
.aud-card .aud-pain { margin: 0; font-size: .82rem; color: var(--ink-soft); flex: 1; line-height: 1.7; }
.aud-card .aud-more { font-size: .85rem; font-weight: 700; color: var(--copper-dark); }
.aud-card:hover .aud-more { text-decoration: underline; }

/* language demo rows (foreign-workers hero) */
.lang-demo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.lang-demo .lang-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem;
  font-size: .88rem; color: var(--navy); font-weight: 600; background: var(--paper);
}
.lang-demo .lang-name {
  font-family: var(--font-en); font-size: .68rem; font-weight: 700;
  color: var(--ink-soft); letter-spacing: .08em; flex: none;
}

@media (max-width: 620px) {
  .lang-demo { grid-template-columns: 1fr; }
}

/* prose note under a solutions hero or section */
.sol-note { font-size: .84rem; color: var(--ink-soft); max-width: 46em; margin: 1rem auto 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .aud-card { transition: none; }
  .aud-card:hover { transform: none; }
}

/* ================= 創業キャンペーン banner (pricing) ================= */
.campaign-banner {
  display: flex; align-items: center; gap: 1rem; max-width: 860px;
  margin: 0 auto 1.8rem; padding: 1rem 1.3rem;
  background: linear-gradient(120deg, #fdf3ea, var(--copper-soft));
  border: 1.5px solid var(--copper); border-radius: var(--radius); box-shadow: var(--shadow);
}
.campaign-banner .campaign-tag {
  flex: none; background: var(--copper); color: #fff; font-weight: 700; font-size: .8rem;
  padding: .35rem .8rem; border-radius: 999px; letter-spacing: .04em;
}
.campaign-banner p { margin: 0; font-size: .9rem; color: var(--navy); line-height: 1.7; }
.price-card .campaign-free { color: var(--copper-dark); }
@media (max-width: 620px) {
  .campaign-banner { flex-direction: column; align-items: flex-start; gap: .6rem; }
}

/* ================= 公開ドキュメント (/docs/) ================= */
.docs-layout {
  max-width: 1180px; margin: 1.4rem auto 3rem; padding: 0 clamp(1rem, 4vw, 2rem);
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.4rem; align-items: start;
}
.docs-nav { position: sticky; top: 1.2rem; }
.docs-nav-title {
  font-family: var(--font-en); font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  color: var(--ink-soft); text-transform: uppercase; margin-bottom: .5rem;
}
.docs-nav ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.docs-nav li a {
  display: block; padding: .4rem .8rem; font-size: .85rem; color: var(--ink-soft);
  text-decoration: none; border-left: 2px solid transparent; margin-left: -2px; line-height: 1.5;
}
.docs-nav li a:hover { color: var(--copper-dark); }
.docs-nav li a.active { color: var(--navy); font-weight: 700; border-left-color: var(--copper); }
.doc-article { min-width: 0; }
.doc-article h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin: 0 0 .5rem; }
.doc-lede { color: var(--ink-soft); font-size: .95rem; margin: 0 0 1.8rem; max-width: 44em; }
.doc-prose { max-width: 46em; line-height: 1.95; font-size: .95rem; }
.doc-prose h2 {
  font-size: 1.2rem; margin: 2.2rem 0 .8rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--line);
}
.doc-prose h3 { font-size: 1.02rem; margin: 1.6rem 0 .6rem; }
.doc-prose p { margin: 0 0 1rem; }
.doc-prose ul, .doc-prose ol { margin: 0 0 1rem; padding-left: 1.5em; }
.doc-prose li { margin-bottom: .35rem; }
.doc-prose table {
  border-collapse: collapse; margin: 0 0 1.2rem; width: 100%; display: block; overflow-x: auto;
  font-size: .88rem; white-space: nowrap;
}
.doc-prose th, .doc-prose td { border: 1px solid var(--line); padding: .5rem .8rem; text-align: left; }
.doc-prose th { background: var(--paper); color: var(--navy); }
.doc-prose code {
  background: var(--paper); border: 1px solid var(--line); border-radius: 5px;
  padding: .1em .35em; font-size: .85em;
}
.doc-prose pre {
  background: var(--navy); color: #dbe4ec; border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; overflow-x: auto; font-size: .82rem; line-height: 1.7; margin: 0 0 1.2rem;
}
.doc-prose pre code { background: none; border: none; color: inherit; padding: 0; }
.doc-prose a { color: var(--copper-dark); }
.doc-prose strong { color: var(--navy); }
.doc-pager {
  display: flex; justify-content: space-between; gap: 1rem; margin: 2.6rem 0 0;
  padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .88rem;
}
.doc-pager-link { color: var(--navy); text-decoration: none; font-weight: 600; }
.doc-pager-link:hover { color: var(--copper-dark); }
.doc-contact {
  margin-top: 2.2rem; padding: 1.2rem 1.4rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.doc-contact p { margin: 0 0 .7rem; font-weight: 600; color: var(--navy); font-size: .92rem; }
.doc-contact .btn { margin: 0; }
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.4rem; }
  .docs-nav { position: static; }
  .docs-nav ol { display: flex; flex-wrap: wrap; gap: .3rem; border-left: none; }
  .docs-nav li a { border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; margin: 0; background: var(--paper); }
  .docs-nav li a.active { border-color: var(--copper); }
}

/* ================= Public docs chat widget (/ask/) ================= */
#public-chat { position: fixed; right: clamp(.8rem, 2.5vw, 1.6rem); bottom: clamp(.8rem, 2.5vw, 1.6rem); z-index: 90; }
/* the launcher must stand out on cream AND navy sections: copper fill,
   white separation ring, layered drop shadow. Transform is driven by the
   magnetic-pointer effect in public-chat.js. */
.pchat-launcher {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--copper); color: #fff;
  border: 2px solid rgba(255, 255, 255, .95); border-radius: 999px;
  padding: .72rem 1.2rem; font: inherit; font-weight: 700; font-size: .9rem;
  cursor: pointer; will-change: transform;
  box-shadow: 0 2px 6px rgba(43, 58, 74, .3), 0 12px 32px rgba(43, 58, 74, .38);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  /* no fill mode: a lingering animation fill would override the inline
     transform the magnetic-pointer effect sets */
  animation: pchat-pop .5s cubic-bezier(.3, 1.6, .5, 1);
}
.pchat-launcher:hover {
  background: var(--copper-dark);
  box-shadow: 0 4px 10px rgba(43, 58, 74, .32), 0 16px 40px rgba(43, 58, 74, .45);
}
.pchat-launcher:active { transform: scale(.94) !important; }
.pchat-launcher.pchat-launcher--active {
  background: var(--copper-dark);
  box-shadow: 0 2px 5px rgba(43, 58, 74, .28), 0 8px 22px rgba(43, 58, 74, .32);
}
.pchat-launcher svg { width: 1.15rem; height: 1.15rem; color: #fff; }
@keyframes pchat-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pchat-panel {
  position: absolute; right: 0; bottom: calc(100% + .8rem);
  width: min(380px, calc(100vw - 2rem)); height: min(560px, calc(100dvh - 6rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cream); border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: 0 8px 40px rgba(43, 58, 74, .25);
}
.pchat-panel--opening { animation: pchat-panel-open .18s ease-out; transform-origin: bottom right; }
@keyframes pchat-panel-open {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pchat-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: .7rem 1rem; flex: none;
}
.pchat-title { font-weight: 700; font-size: .92rem; }
.pchat-close {
  background: none; border: none; color: #cfd6dd; font-size: 1.3rem; line-height: 1;
  cursor: pointer; padding: .2rem .4rem; border-radius: 6px;
}
.pchat-close:hover { color: #fff; background: rgba(255,255,255,.1); }
.pchat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.pchat-msg {
  max-width: 88%; padding: .6rem .85rem; border-radius: 12px;
  font-size: .88rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
}
.pchat-user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.pchat-assistant {
  align-self: flex-start; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-bottom-left-radius: 4px;
}
.pchat-assistant a { color: var(--copper-dark); word-break: break-all; }
.pchat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; flex: none; }
.pchat-chip {
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: .35rem .8rem; font: inherit; font-size: .78rem; color: var(--navy);
  cursor: pointer;
}
.pchat-chip:hover { border-color: var(--copper); color: var(--copper-dark); }
/* composer: messaging-app style — auto-growing pill input (scrollbar hidden,
   grows to ~5 lines then scrolls internally) + circular icon send button */
.pchat-form { display: flex; gap: .55rem; align-items: flex-end; padding: .65rem .85rem .55rem; border-top: 1px solid var(--line); flex: none; }
.pchat-input {
  flex: 1; resize: none; border: 1.5px solid transparent; border-radius: 1.35rem;
  padding: .62rem 1rem; font: inherit; font-size: .9rem; line-height: 1.5;
  background: #f0eae1; color: var(--ink);
  min-height: 2.7rem; max-height: 7.6rem; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  transition: border-color .15s ease, background .15s ease;
}
.pchat-input::-webkit-scrollbar { display: none; }
.pchat-input:focus-visible { outline: none; border-color: var(--copper); background: var(--paper); }
.pchat-send {
  flex: none; width: 2.7rem; height: 2.7rem; border-radius: 50%; border: none;
  background: var(--copper); color: #fff; display: grid; place-items: center;
  cursor: pointer; transition: background .15s ease, transform .12s ease;
}
/* the right-pointing triangle's mass sits left of its bounding box —
   a 1px right nudge centers it optically */
.pchat-send svg { width: 1.2rem; height: 1.2rem; transform: translateX(1px); }
.pchat-send:hover { background: var(--copper-dark); transform: scale(1.06); }
.pchat-send:active { transform: scale(.94); }
.pchat-send:disabled { opacity: .45; cursor: default; transform: none; }
.pchat-send--busy svg { display: none; }
.pchat-send--busy::after {
  content: ""; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: btn-spin .7s linear infinite;
}
.pchat-note { padding: 0 1rem .7rem; font-size: .7rem; color: var(--ink-soft); flex: none; }
/* drag state + panel side-flip (JS toggles these) */
.pchat-launcher { touch-action: none; }  /* drag must not scroll the page */
.pchat-dragging .pchat-launcher { transition: none; cursor: grabbing; }
.pchat-panel--below { bottom: auto; top: calc(100% + .8rem); }
.pchat-panel--left { right: auto; left: 0; }

@media (max-width: 560px) {
  /* compact, icon-only launcher — it floats over content, so small wins */
  .pchat-launcher { padding: .78rem; }
  .pchat-launcher span { display: none; }
  .pchat-launcher svg { width: 1.3rem; height: 1.3rem; }
  /* full-screen messenger sheet */
  .pchat-panel { position: fixed; inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: none; }
  .pchat-head { padding-top: calc(.7rem + env(safe-area-inset-top)); }
  .pchat-input { font-size: 16px; }  /* <16px makes iOS zoom the viewport on focus */
  .pchat-note { padding-bottom: calc(.7rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .pchat-launcher { transition: none; animation: none; }
  .pchat-send { transition: none; }
  .pchat-send:hover, .pchat-send:active { transform: none; }
  .pchat-panel--opening { animation: none; }
  .page-progress::after { animation: none; width: 100%; }
  :is(a, button).is-pending::after, .pchat-send--busy::after { animation: none; }
}
@media print { #public-chat { display: none; } }
.pchat-panel[hidden], .pchat-chips[hidden] { display: none; }

/* ================= spacing/polish fixes (2026-07-10 review) ================= */
/* a submit button directly after a form grid was touching the fields above
   (onboarding Step 5 „36協定を保存" etc.) */
.form-grid + .btn { margin-top: 1.2rem; }
/* page-level action rows (compliance „モニターを今すぐ実行") sat flush against
   the following card */
main > .btn-row { margin: .2rem 0 1.3rem; }
main > .btn-row .muted { margin-left: .2rem; }
/* <summary> keeps focus after a mouse click in Chrome — round the ring so it
   doesn't draw a second box inside the details border */
.setup-details > summary { border-radius: 10px; }
.setup-details[open] > summary { border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); margin-bottom: .55rem; }
.setup-details > summary:focus:not(:focus-visible) { outline: none; }
/* links inside the details helper read as links */
.setup-details a { color: var(--copper-dark); }
.setup-details > ul { padding-left: 2.1rem; }

/* Bekito 案内係 rebrand bits */
.pchat-title { display: inline-flex; align-items: center; gap: .5rem; }
.pchat-beta {
  font-family: var(--font-en); font-size: .62rem; font-weight: 700; letter-spacing: .08em;
  color: #f4c9a6; background: rgba(180, 95, 47, .32); border-radius: 999px; padding: .12rem .5rem;
}
.pchat-head-actions { display: inline-flex; align-items: center; gap: .4rem; }
.pchat-clear {
  background: none; border: none; color: #9daebc; font: inherit; font-size: .72rem;
  cursor: pointer; padding: .25rem .45rem; border-radius: 6px;
}
.pchat-clear:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ============ logged-out topbar on phones: fit one tidy row ============ */
@media (max-width: 560px) {
  .topbar:has(.public-lang) { padding: .5rem .8rem; gap: .4rem .6rem; }
  .topbar:has(.public-lang) .brand { font-size: 1.02rem; }
  .public-lang select { max-width: 6.6rem; padding: .3rem .5rem; font-size: .8rem; }
  .topbar:has(.public-lang) .topbar-right { gap: .45rem; }
  .topbar:has(.public-lang) .topbar-guide { padding: .3rem .35rem; font-size: .84rem; }
  .topbar:has(.public-lang) .btn-sm { padding: .34rem .75rem; font-size: .84rem; }
}

/* ================= instant page feedback ================= */
.feedback-launcher {
  position: fixed;
  z-index: 95;
  right: max(clamp(.8rem, 2.5vw, 1.6rem), env(safe-area-inset-right));
  bottom: max(5.25rem, calc(4.5rem + env(safe-area-inset-bottom)));
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .68rem 1rem;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  color: #fff;
  background: var(--copper);
  box-shadow: 0 8px 28px rgba(43, 58, 74, .24);
  font: 700 .85rem/1 var(--font-ui);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.feedback-launcher:hover { background: var(--copper-dark); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.feedback-launcher:active { transform: translateY(0); }
.feedback-launcher svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feedback-sheet {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: end;
  padding: clamp(.7rem, 2vw, 1.4rem);
}
.feedback-sheet[hidden], .feedback-picker-help[hidden], .feedback-picker-outline[hidden] { display: none; }
.feedback-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(24, 34, 44, .54);
  cursor: default;
  backdrop-filter: blur(2px);
}
.feedback-panel {
  position: relative;
  z-index: 1;
  width: min(31rem, 100%);
  max-height: min(46rem, calc(100dvh - 2rem));
  overflow: auto;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(24, 34, 44, .3);
  animation: feedback-panel-in .18s ease-out;
}
@keyframes feedback-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.feedback-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.feedback-panel-head h2 { margin: .1rem 0 0; font-size: 1.2rem; line-height: 1.45; }
.feedback-eyebrow, .feedback-admin-heading .eyebrow {
  display: block;
  margin: 0;
  color: var(--copper-dark);
  font-family: var(--font-en);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}
.feedback-close {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  margin: -.3rem -.3rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  font: 400 1.75rem/1 var(--font-en);
  cursor: pointer;
}
.feedback-close:hover { color: var(--navy); background: var(--cream); }
.feedback-lead { margin: .45rem 0 1rem; color: var(--ink-soft); font-size: .86rem; line-height: 1.6; }
.feedback-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
}
.feedback-section-copy { min-width: 0; display: grid; line-height: 1.4; }
.feedback-section-copy span { color: var(--ink-soft); font-size: .72rem; }
.feedback-section-copy strong { overflow: hidden; color: var(--navy); font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.feedback-section-row .btn { flex: none; }
#feedback-message { width: 100%; max-width: none; min-height: 6.7rem; resize: vertical; font-size: 16px; }
#feedback-email { max-width: none; font-size: 16px; }
.feedback-capture-card {
  display: grid;
  grid-template-columns: 7.2rem 1fr auto;
  align-items: center;
  gap: .75rem;
  margin-top: .85rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfaf6;
}
.feedback-capture-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--cream);
}
.feedback-capture-preview img { width: 100%; height: 100%; object-fit: cover; }
.feedback-capture-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .35rem;
  color: var(--ink-soft);
  font-size: .63rem;
  line-height: 1.25;
  text-align: center;
}
.feedback-capture-placeholder.is-error { color: var(--red); }
.feedback-capture-placeholder.is-empty { color: var(--ink-soft); }
.feedback-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line-strong);
  border-right-color: var(--copper);
  border-radius: 50%;
  animation: btn-spin .75s linear infinite;
}
.feedback-capture-placeholder.is-error .feedback-spinner,
.feedback-capture-placeholder.is-empty .feedback-spinner { display: none; }
.feedback-capture-copy { min-width: 0; display: grid; line-height: 1.35; }
.feedback-capture-copy strong { color: var(--navy); font-size: .82rem; }
.feedback-capture-copy span { margin-top: .15rem; color: var(--ink-soft); font-size: .68rem; }
.feedback-remove-capture {
  border: 0;
  color: var(--copper-dark);
  background: transparent;
  font: 600 .72rem/1.3 var(--font-ui);
  cursor: pointer;
}
.feedback-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .7rem; }
.feedback-actions .btn { margin: 0; }
.feedback-form-status { min-height: 1.5rem; margin: .65rem 0 0; color: var(--ink-soft); font-size: .8rem; }
.feedback-form-status.is-success { color: var(--green); font-weight: 600; }
.feedback-form-status.is-error { color: var(--red); font-weight: 600; }
.feedback-picker-help {
  position: fixed;
  z-index: 321;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: .8rem;
  max-width: calc(100vw - 2rem);
  padding: .65rem .9rem;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow-lift);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  transform: translateX(-50%);
  pointer-events: none;
}
.feedback-picker-help kbd { padding: .15rem .4rem; border: 1px solid #718091; border-radius: 5px; color: #fff; font: 600 .68rem var(--font-en); }
.feedback-picker-outline {
  position: fixed;
  z-index: 320;
  border: 3px dashed var(--copper);
  border-radius: 8px;
  background: rgba(180, 95, 47, .1);
  box-shadow: 0 0 0 9999px rgba(24, 34, 44, .12);
  pointer-events: none;
  transition: inset .05s linear, width .05s linear, height .05s linear;
}
body.feedback-open { overflow: hidden; }
body.feedback-selecting, body.feedback-selecting * { cursor: crosshair !important; }
body.feedback-selecting .feedback-launcher { display: none; }
body.pchat-open .feedback-launcher {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
body.feedback-open #public-chat,
body.feedback-selecting #public-chat {
  visibility: hidden;
  pointer-events: none;
}

/* Feedback review workspace */
.feedback-admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.1rem; }
.feedback-admin-heading h1 { margin: .2rem 0 .15rem; }
.feedback-admin-heading p:last-child { margin: 0; }
.feedback-filter-tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .25rem 0 .75rem; }
.feedback-filter-tabs a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex: none;
  padding: .48rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}
.feedback-filter-tabs a span { color: var(--ink-soft); font-family: var(--font-en); font-size: .72rem; }
.feedback-filter-tabs a.active { border-color: var(--navy); color: #fff; background: var(--navy); }
.feedback-filter-tabs a.active span { color: #dce4eb; }
.feedback-admin-search { display: flex; align-items: center; gap: .55rem; max-width: 38rem; margin: .35rem 0 1rem; }
.feedback-admin-search input[type="search"] {
  width: 100%;
  padding: .55rem .75rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}
.feedback-admin-search input[type="search"]:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-soft); }
.feedback-admin-search .btn { flex: none; margin: 0; }
.feedback-table-card { padding: 0; overflow-x: auto; }
.feedback-table th:first-child, .feedback-table td:first-child { padding-left: 1rem; }
.feedback-table th:last-child, .feedback-table td:last-child { padding-right: 1rem; }
.feedback-table td { vertical-align: middle; }
.feedback-table small { display: block; max-width: 22rem; overflow: hidden; color: var(--ink-soft); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.feedback-message-link { color: var(--navy); font-weight: 600; text-decoration: none; }
.feedback-message-link:hover { color: var(--copper-dark); text-decoration: underline; }
.feedback-attachment-mark { margin-left: .35rem; color: var(--copper); }
.feedback-status, .feedback-priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .18rem .58rem;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.status-new { color: var(--copper-dark); background: var(--copper-soft); }
.status-reviewing { color: var(--amber); background: var(--amber-soft); }
.status-planned { color: #315f82; background: #e5eff7; }
.status-resolved { color: var(--green); background: var(--green-soft); }
.status-dismissed { color: var(--ink-soft); background: #eeeae4; }
.priority-low { color: var(--ink-soft); background: #eeeae4; }
.priority-normal { color: var(--navy); background: #e8edf2; }
.priority-high { color: var(--amber); background: var(--amber-soft); }
.priority-urgent { color: var(--red); background: var(--red-soft); }
.feedback-empty { padding: 2.8rem !important; color: var(--ink-soft); text-align: center; }
.feedback-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.feedback-pagination .btn { margin: 0; }
.feedback-back-link { color: var(--copper-dark); font-size: .86rem; font-weight: 600; text-decoration: none; }
.feedback-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.feedback-detail-head h1 { margin: .45rem 0 .15rem; }
.feedback-detail-head p { margin: 0; }
.feedback-detail-badges { display: flex; gap: .4rem; }
.feedback-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); gap: 1.4rem; align-items: start; }
.feedback-message-card { border-top: 3px solid var(--copper); }
.feedback-message-body { font-size: 1.03rem; line-height: 1.85; }
.feedback-card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.feedback-screenshot-card img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); }
.feedback-meta-list { margin: 0; }
.feedback-meta-list > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.feedback-meta-list > div:last-child { border-bottom: 0; }
.feedback-meta-list dt { color: var(--ink-soft); font-size: .78rem; font-weight: 600; }
.feedback-meta-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: .86rem; }
.feedback-client-context { margin-top: .9rem; }
.feedback-client-context summary { color: var(--copper-dark); cursor: pointer; font-size: .82rem; font-weight: 600; }
.feedback-client-context pre { max-height: 25rem; overflow: auto; padding: .8rem; border-radius: 8px; background: #f5f1eb; font-size: .7rem; line-height: 1.55; white-space: pre-wrap; }
.feedback-action-card { position: sticky; top: 5.2rem; }
.feedback-action-card select, .feedback-action-card textarea { max-width: none; }
.feedback-assignee { display: flex; justify-content: space-between; gap: .8rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .78rem; }
.feedback-assignee span { color: var(--ink-soft); }
.feedback-history-card ol { margin: 0; padding: 0; list-style: none; }
.feedback-history-card li { position: relative; display: grid; grid-template-columns: .8rem 1fr; gap: .55rem; padding: 0 0 1rem; }
.feedback-history-card li:not(:last-child)::before { content: ""; position: absolute; top: .65rem; bottom: -.15rem; left: .25rem; width: 1px; background: var(--line-strong); }
.feedback-history-dot { position: relative; z-index: 1; width: .55rem; height: .55rem; margin-top: .35rem; border-radius: 50%; background: var(--copper); }
.feedback-history-card strong { color: var(--navy); font-size: .82rem; }
.feedback-history-card p { margin: .25rem 0; font-size: .8rem; line-height: 1.55; }
.feedback-history-card small { color: var(--ink-soft); font-size: .68rem; }
.error-page-card { max-width: 42rem; margin: 7vh auto; padding: clamp(1.5rem, 5vw, 3.2rem); text-align: center; }
.error-code { color: var(--copper); font: 700 clamp(2.5rem, 8vw, 5rem)/1 var(--font-en); letter-spacing: -.04em; }
.error-page-card h1 { margin-top: .8rem; }

@media (max-width: 800px) {
  .feedback-detail-grid { grid-template-columns: 1fr; }
  .feedback-action-card { position: static; }
}
@media (max-width: 700px) {
  .feedback-table-card {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .feedback-table,
  .feedback-table tbody,
  .feedback-table tr,
  .feedback-table td { display: block; width: 100%; }
  .feedback-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .feedback-table tbody { display: grid; gap: .75rem; }
  .feedback-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
  }
  .feedback-table td,
  .feedback-table th:first-child,
  .feedback-table td:first-child,
  .feedback-table th:last-child,
  .feedback-table td:last-child {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    padding: .62rem .85rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }
  .feedback-table td:last-child { border-bottom: 0; }
  .feedback-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.5;
  }
  .feedback-table td > * { min-width: 0; }
  .feedback-table small { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .feedback-message-link { overflow-wrap: anywhere; }
  .feedback-empty {
    display: block !important;
    padding: 2rem 1rem !important;
    text-align: center;
  }
  .feedback-empty::before { content: none !important; }
}
@media (max-width: 560px) {
  .feedback-launcher { bottom: max(4.8rem, calc(4.1rem + env(safe-area-inset-bottom))); padding: .72rem; }
  .feedback-launcher span { display: none; }
  .feedback-launcher svg { width: 1.3rem; height: 1.3rem; }
  .feedback-sheet { align-items: end; padding: 0; }
  .feedback-panel {
    width: 100%;
    max-height: calc(94dvh - env(safe-area-inset-top));
    padding: 1.1rem 1rem max(1rem, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 18px 18px 0 0;
  }
  .feedback-capture-card { grid-template-columns: 5.5rem 1fr; }
  .feedback-remove-capture { grid-column: 2; justify-self: start; padding: 0; }
  .feedback-actions {
    position: sticky;
    z-index: 2;
    bottom: calc(-1rem - env(safe-area-inset-bottom));
    margin: .7rem -1rem calc(-1rem - env(safe-area-inset-bottom));
    padding: .75rem 1rem max(1rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    box-shadow: 0 -10px 24px rgba(250, 246, 240, .94);
  }
  .feedback-actions .btn { flex: 1; }
  .feedback-picker-help {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: calc(100vw - 2rem);
    border-radius: 12px;
  }
  .feedback-filter-tabs { flex-wrap: wrap; overflow: visible; }
  .feedback-meta-list > div { grid-template-columns: 1fr; gap: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .feedback-launcher, .feedback-panel { transition: none; animation: none; }
  .feedback-spinner { animation: none; }
}
@media print {
  .feedback-widget { display: none; }
}
