/*
 * 書類リネームAI — site styles (LP, legal pages, server-rendered notices, forms).
 * Visual idea: the ledger (帳簿) — cool ruled paper, ink, ledger green; 朱 (vermilion) only for 「要確認」.
 * The filename segments carry one colour each: 取引年月日 = 藍, 取引先 = 帳簿の緑, 金額 = 黄土, 種類 = 鼠.
 */
:root {
  --paper: #f3f6f4;
  --sheet: #ffffff;
  --ink: #1d2a2c;
  --ink-2: #485759;
  --ink-3: #66767a;
  --rule: #cfe0d8;
  --rule-strong: #9dbcb0;
  --ledger: #24584a;
  --ledger-dark: #173f35;
  --ledger-tint: #e4efe9;
  --shu: #b0391f;
  --shu-tint: #fcebe6;
  --seg-date: #2f4c8f;
  --seg-party: #24584a;
  --seg-amount: #8a5b0a;
  --seg-type: #56636c;
  --focus: #2f4c8f;
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-serif: "Hiragino Mincho ProN", "BIZ UDPMincho", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --wrap: 1120px;
  --radius-sheet: 6px;
  --radius-control: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  line-break: strict;
  overflow-wrap: anywhere;
}

img,
svg {
  max-width: 100%;
}

/* Japanese headings break between phrases, not inside words (Chromium; elsewhere the default applies). */
h1,
h2,
h3 {
  word-break: auto-phrase;
  text-wrap: balance;
}

a {
  color: var(--ledger);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ledger-dark);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-control);
}

.skip-link:focus {
  top: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------- header / footer */

.site-header {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand__sheet {
  fill: var(--sheet);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.brand__fold {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.brand__seg {
  stroke-width: 2.6;
  stroke-linecap: round;
}

.brand__seg--date {
  stroke: var(--seg-date);
}

.brand__seg--party {
  stroke: var(--seg-party);
}

.brand__seg--amount {
  stroke: var(--seg-amount);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.site-nav a:not(.button) {
  color: var(--ink-2);
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer {
  margin-top: 72px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink-2);
  font-size: 14px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  color: var(--ink-2);
}

.site-footer__note {
  margin: 0;
  max-width: 46em;
  font-size: 13px;
}

/* ---------------------------------------------------------------- buttons, forms */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--ledger);
  border-radius: var(--radius-control);
  background: var(--ledger);
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--ledger-dark);
  border-color: var(--ledger-dark);
  color: #fff;
}

.button:disabled {
  background: #b9c9c2;
  border-color: #b9c9c2;
  cursor: not-allowed;
}

.button--quiet {
  background: var(--sheet);
  color: var(--ledger);
}

.button--quiet:hover {
  background: var(--ledger-tint);
  color: var(--ledger-dark);
}

.button--small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ledger);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.link-button--quiet {
  color: var(--ink-3);
}

label {
  cursor: pointer;
}

.field {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
}

.field__label {
  font-weight: 700;
}

.field__hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

input[type="email"],
input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-control);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
}

input[type="email"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--focus);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 15px;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin: 4px 0 0;
  flex: none;
  accent-color: var(--ledger);
}

.hp {
  position: absolute;
  left: -9999px;
}

/* Cloudflare Turnstile (shown only when the server has it configured) */
.turnstile {
  margin: 0 0 14px;
}

.turnstile[hidden] {
  display: none;
}

.turnstile #turnstile-widget {
  min-height: 65px;
  max-width: 100%;
}

.turnstile .field__hint:empty {
  display: none;
}

.field-error {
  margin: 0 0 14px;
  color: var(--shu);
  font-weight: 700;
}

/* ---------------------------------------------------------------- server-rendered notice pages */

.notice {
  display: grid;
  place-items: start center;
  padding: 56px 16px;
  min-height: 60vh;
}

.notice__panel {
  width: 100%;
  max-width: 560px;
  padding: 32px 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
}

.notice__title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.45;
}

.notice__lead {
  margin: 0 0 20px;
}

.notice__email {
  overflow-wrap: anywhere;
}

.notice__form {
  margin: 0 0 18px;
}

.notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.notice__small {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.consent {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--paper);
}

.consent__lead {
  margin: 0 0 8px;
  font-weight: 700;
}

.consent__list {
  margin: 0 0 14px;
  padding-left: 1.2em;
  font-size: 14px;
}

.consent .checkbox {
  margin: 0;
}

/* ---------------------------------------------------------------- LP */

.hero {
  padding: 56px 0 64px;
  background:
    linear-gradient(var(--sheet), var(--sheet)) top / 100% 0 no-repeat,
    var(--paper);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 48px;
  align-items: center;
}

.hero__title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(29px, 3.5vw, 43px);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0.01em;
}

.hero__title span {
  display: inline-block;
}

.hero__lead {
  margin: 0 0 28px;
  max-width: 30em;
  color: var(--ink-2);
  font-size: 17px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}

.hero__note {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}

/* The rename ledger: before → after, on ruled paper */
.ledger {
  margin: 0;
  padding: 18px 20px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sheet);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(to bottom, transparent 0 51px, var(--rule) 51px 52px);
  background-position: 0 44px;
  box-shadow: 0 1px 0 var(--rule), 0 14px 32px -24px rgba(29, 42, 44, 0.35);
}

.ledger__head {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) 28px minmax(0, 1.6fr);
  gap: 8px;
  margin: 0 0 6px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.ledger__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) 28px minmax(0, 1.6fr);
  gap: 8px;
  align-items: center;
  min-height: 52px;
  font-size: 13.5px;
  line-height: 1.5;
}

.ledger__old {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: rgba(176, 57, 31, 0.55);
  text-decoration-thickness: 1.5px;
  overflow-wrap: anywhere;
}

.ledger__arrow {
  color: var(--rule-strong);
  text-align: center;
}

.ledger__new {
  color: var(--ink);
  font-weight: 600;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.seg {
  padding-bottom: 1px;
  border-bottom: 2px solid currentColor;
}

.seg--date {
  color: var(--seg-date);
}

.seg--party {
  color: var(--seg-party);
}

.seg--amount {
  color: var(--seg-amount);
}

.seg--type {
  color: var(--seg-type);
}

.ledger__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 3px double var(--rule-strong);
  color: var(--ink-2);
  font-size: 12.5px;
}

.ledger__legend span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 0;
  margin-right: 6px;
  vertical-align: middle;
  border-bottom: 2px solid currentColor;
}

.ledger__legend .legend--date {
  color: var(--seg-date);
}

.ledger__legend .legend--party {
  color: var(--seg-party);
}

.ledger__legend .legend--amount {
  color: var(--seg-amount);
}

.ledger__legend .legend--type {
  color: var(--seg-type);
}

.ledger__caption {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

/* the one orchestrated moment: names are rewritten row by row */
@media (prefers-reduced-motion: no-preference) {
  .ledger__new {
    animation: rename 0.5s ease-out both;
  }

  .ledger__old {
    animation: strike 0.5s ease-out both;
  }

  .ledger__row:nth-child(1) .ledger__new,
  .ledger__row:nth-child(1) .ledger__old {
    animation-delay: 0.35s;
  }

  .ledger__row:nth-child(2) .ledger__new,
  .ledger__row:nth-child(2) .ledger__old {
    animation-delay: 0.6s;
  }

  .ledger__row:nth-child(3) .ledger__new,
  .ledger__row:nth-child(3) .ledger__old {
    animation-delay: 0.85s;
  }

  .ledger__row:nth-child(4) .ledger__new,
  .ledger__row:nth-child(4) .ledger__old {
    animation-delay: 1.1s;
  }

  @keyframes rename {
    from {
      opacity: 0;
      clip-path: inset(0 100% 0 0);
    }
    to {
      opacity: 1;
      clip-path: inset(0 0 0 0);
    }
  }

  @keyframes strike {
    from {
      text-decoration-color: transparent;
      color: var(--ink);
    }
  }
}

.section {
  padding: 64px 0;
}

.section--sheet {
  background: var(--sheet);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.section__title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 600;
  line-height: 1.45;
}

.section__lead {
  margin: 0 0 28px;
  max-width: 40em;
  color: var(--ink-2);
}

.prose {
  max-width: 42em;
}

.dencho {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 48px;
  align-items: start;
}

.dencho .section__title {
  grid-column: 1 / -1;
  max-width: 30em;
}

.dencho .callout:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 16px;
}

.callout {
  max-width: 46em;
  margin: 24px 0 0;
  padding: 18px 20px;
  border-left: 4px solid var(--rule-strong);
  background: var(--paper);
  font-size: 15px;
}

.callout--caution {
  border-left-color: var(--shu);
  background: var(--shu-tint);
}

.callout__title {
  margin: 0 0 6px;
  font-weight: 700;
}

.callout p {
  margin: 0 0 8px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.sources {
  margin: 20px 0 0;
  padding-left: 1.2em;
  color: var(--ink-2);
  font-size: 14px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 22px 22px 20px;
  border-top: 3px solid var(--ink);
  background: var(--sheet);
}

.step__no {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-3);
  font-family: var(--font-serif);
  font-size: 15px;
}

.step__title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.5;
}

.step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* sample table on the LP */
.sample {
  overflow-x: auto;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
}

.sample table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

.sample th,
.sample td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  word-break: auto-phrase;
}

.sample thead th {
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sample tbody th,
.sample .nowrap {
  white-space: nowrap;
}

.sample .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 取引先: wide enough for a typical company name on one line */
.sample th:nth-child(4),
.sample td:nth-child(4) {
  min-width: 14em;
}

.sample__evidence {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
}

.sample__flag {
  background: var(--shu-tint);
  box-shadow: inset 3px 0 0 var(--shu);
}

.flag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 2px;
  background: var(--shu);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
  vertical-align: 1px;
}

.csv-sample {
  margin: 20px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.facts strong {
  display: block;
  margin: 0 0 4px;
}

.facts span {
  color: var(--ink-2);
  font-size: 15px;
}

/* pricing */
.pricing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: start;
}

.prices {
  display: grid;
  gap: 14px;
}

.price {
  padding: 18px 20px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
}

.price--trial {
  border-style: dashed;
}

.price__name {
  margin: 0;
  font-weight: 700;
}

.price__amount {
  margin: 2px 0 0;
}

.price__yen {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.price__tax {
  color: var(--ink-3);
  font-size: 14px;
}

.price__unit {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.rules {
  margin: 0 0 20px;
  padding-left: 1.2em;
}

.rules li {
  margin: 0 0 8px;
}

.terms {
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sheet);
  background: var(--paper);
}

.terms__title {
  margin: 0 0 8px;
  font-size: 15px;
}

.terms-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 14px;
}

.terms-list li {
  margin: 0 0 6px;
}

/* FAQ */
.faq {
  max-width: 48em;
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  padding: 16px 32px 16px 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "＋";
  position: absolute;
  right: 4px;
  top: 16px;
  color: var(--ink-3);
}

.faq details[open] summary::after {
  content: "－";
}

.faq details > div {
  padding: 0 0 18px;
  color: var(--ink-2);
}

.faq details p {
  margin: 0 0 10px;
}

.cta-band {
  padding: 48px 0;
  text-align: left;
}

.cta-band__title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- legal pages */

.doc {
  max-width: 820px;
  margin: 40px auto 0;
  padding: 40px 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
}

.doc h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.4;
}

.doc h2 {
  margin: 32px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 19px;
}

.doc h3 {
  margin: 20px 0 8px;
  font-size: 16px;
}

.doc p,
.doc li {
  font-size: 15.5px;
}

.doc ol,
.doc ul {
  padding-left: 1.4em;
}

.doc__meta {
  margin: 0 0 24px;
  color: var(--ink-3);
  font-size: 14px;
}

.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.kv th,
.kv td {
  padding: 12px 14px;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.kv th {
  width: 30%;
  background: var(--paper);
  font-weight: 700;
}

.placeholder-warning {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-left: 4px solid var(--shu);
  background: var(--shu-tint);
  font-size: 14px;
}

/* ---------------------------------------------------------------- auth pages */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: start;
  padding-top: 48px;
}

.auth__panel {
  padding: 32px 30px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
}

.auth__title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
}

.auth__lead {
  margin: 0 0 24px;
  color: var(--ink-2);
}

.auth__aside {
  padding-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
}

.auth__aside h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 17px;
}

.auth__aside ul {
  margin: 0 0 20px;
  padding-left: 1.2em;
}

.signed-in {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 4px solid var(--ledger);
  background: var(--ledger-tint);
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 880px) {
  .hero__grid,
  .pricing,
  .auth,
  .dencho {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

  .site-header__inner {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .site-nav {
    flex-wrap: wrap;
    font-size: 14px;
  }

  .site-nav__hide-sm {
    display: none;
  }

  .hero {
    padding: 36px 0 44px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .ledger {
    padding: 14px 14px 12px;
    background-image: none;
  }

  .ledger__head {
    display: none;
  }

  .ledger__row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
  }

  .ledger__arrow {
    display: none;
  }

  .section {
    padding: 44px 0;
  }

  .doc {
    margin-top: 20px;
    padding: 24px 18px;
  }

  .kv th,
  .kv td {
    display: block;
    width: auto;
  }

  .kv td {
    border-top: 0;
  }

  .notice__panel,
  .auth__panel {
    padding: 24px 18px;
  }
}

.section__lead--after {
  margin-top: 20px;
}
