/* ==========================================================================
   Revenue OS — 和の帳簿
   生成りの紙 × 墨 × 朱印。金額は等幅、状態は印判。
   ========================================================================== */

:root {
  --paper: #f6f2e9;
  --paper-raised: #fffdf6;
  --paper-sunken: #efe9db;
  --ink: #26221b;
  --ink-soft: #5d5648;
  --ink-faint: #948b78;
  --hairline: #ded5c2;
  --hairline-soft: #e9e2d2;
  --shu: #bc3a1a;            /* 朱 */
  --shu-deep: #9c2f13;
  --shu-wash: #f6e3dc;
  --midori: #2f6e4e;         /* 深緑 = 入金・確定 */
  --midori-wash: #e2ece2;
  --kin: #9a6b1f;            /* 金茶 = 保留・注意 */
  --kin-wash: #f3e9d2;
  --grey-wash: #eae5d9;

  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;

  --shadow-card: 0 1px 2px rgba(48, 38, 20, 0.05), 0 8px 24px -12px rgba(48, 38, 20, 0.18);
  --radius: 4px;
}

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

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

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(188, 58, 26, 0.045), transparent 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 紙の粒子 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.30 0 0 0 0 0.26 0 0 0 0 0.18 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--shu-wash); color: var(--shu-deep); }

/* --------------------------------------------------------------------------
   ヘッダー
   -------------------------------------------------------------------------- */

.env-banner {
  background: #1a3a4a;
  color: #e8f4f8;
  text-align: center;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid #2a5568;
}

header {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand .seal {
  width: 34px;
  height: 34px;
  background: var(--shu);
  color: #fff8ee;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 1.5px rgba(255, 248, 238, 0.55), 0 2px 6px -2px rgba(156, 47, 19, 0.6);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .seal { transform: rotate(3deg) scale(1.06); }

.brand .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.9rem; }
nav a:hover { color: var(--shu-deep); }

#nav-auth { display: flex; align-items: center; gap: 1.25rem; }
#nav-auth span { color: var(--ink-faint); font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   レイアウト
   -------------------------------------------------------------------------- */

main {
  width: 100%;
  max-width: 1080px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
  flex: 1;
}

footer {
  border-top: 1px solid var(--hairline-soft);
  padding: 1.2rem 1.5rem 1.6rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

/* 登場アニメーション */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

main > * { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }
main > *:nth-child(5) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --------------------------------------------------------------------------
   見出し・ページヘッダー
   -------------------------------------------------------------------------- */

.page-head { margin-bottom: 2rem; }

.page-head .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--shu);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.page-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.page-head .sub { color: var(--ink-faint); font-size: 0.88rem; margin-top: 0.3rem; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}
.backlink:hover { color: var(--shu-deep); }

h3.rule {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

h3.rule::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--shu);
  border-radius: 2px;
  transform: rotate(-3deg);
  flex: none;
}

/* --------------------------------------------------------------------------
   カード
   -------------------------------------------------------------------------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.6rem 1.75rem;
  margin-bottom: 1.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

a.project-card {
  display: block;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.15rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

a.project-card::after {
  content: "→";
  position: absolute;
  right: 1.1rem;
  bottom: 0.8rem;
  color: var(--shu);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.18s ease;
}

a.project-card:hover { transform: translateY(-2px); border-color: var(--shu); }
a.project-card:hover::after { opacity: 1; transform: translateX(0); }

.project-card .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.project-card .desc {
  color: var(--ink-faint);
  font-size: 0.83rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.empty {
  border: 1.5px dashed var(--hairline);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9rem;
  background: transparent;
}

/* --------------------------------------------------------------------------
   テーブル = 台帳
   -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding: 0.45rem 0.75rem;
  border-bottom: 1.5px solid var(--ink);
  white-space: nowrap;
}

tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: middle;
}

tbody tr:hover td { background: color-mix(in srgb, var(--paper-sunken) 55%, transparent); }

td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); word-break: break-all; }
td.dt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }

.amount { font-weight: 600; }
.amount .yen { color: var(--ink-faint); font-weight: 400; margin-right: 1px; }

tfoot td {
  padding: 0.7rem 0.75rem;
  border-top: 1.5px solid var(--ink);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   印判（ステータス）
   -------------------------------------------------------------------------- */

.stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 0.34em 0.65em 0.42em;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  white-space: nowrap;
}

.stamp-ok   { color: var(--midori); background: var(--midori-wash); }
.stamp-warn { color: var(--kin); background: var(--kin-wash); }
.stamp-bad  { color: var(--shu-deep); background: var(--shu-wash); transform: rotate(-2deg); }
.stamp-mute { color: var(--ink-faint); background: var(--grey-wash); }

/* --------------------------------------------------------------------------
   ボタン・フォーム
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.btn-primary {
  background: var(--shu);
  color: #fff8ee;
  box-shadow: 0 2px 8px -2px rgba(156, 47, 19, 0.45);
}
.btn-primary:hover { background: var(--shu-deep); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--hairline);
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.btn-sm { font-size: 0.76rem; padding: 0.3rem 0.75rem; }

.btn-danger-ghost {
  background: transparent;
  color: var(--ink-faint);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.btn-danger-ghost:hover { color: var(--shu-deep); background: var(--shu-wash); }

.btn-danger {
  background: var(--shu);
  color: #fff8ee;
  border-color: var(--shu-deep);
}
.btn-danger:hover { background: var(--shu-deep); transform: translateY(-1px); }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.danger-confirm .danger-banner {
  background: var(--shu-wash);
  border: 1px solid rgba(156, 47, 19, 0.35);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin: 0.35rem 0 0.85rem;
  color: var(--shu-deep);
}
.danger-confirm .danger-banner strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}
.danger-confirm .danger-banner p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.danger-confirm .danger-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}
.danger-confirm .danger-list li { margin-bottom: 0.25rem; }

label.field { display: block; margin-bottom: 0.9rem; }

label.field .label,
.field-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

input[type="text"], input[type="number"], input[type="url"], input[type="email"],
input:not([type]), select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--shu);
  box-shadow: 0 0 0 3px rgba(188, 58, 26, 0.12);
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); }

textarea { resize: vertical; min-height: 5.5em; }

.form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.form-row label.field { margin-bottom: 0; flex: 1; min-width: 130px; }
.form-row .btn { flex: none; }

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0.9rem;
  cursor: pointer;
}
.checkbox-line input { width: auto; accent-color: var(--shu); }

.hint { font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.35rem; }

.login-error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--shu-wash);
  border: 1px solid color-mix(in srgb, var(--shu) 35%, transparent);
  border-radius: var(--radius);
  color: var(--shu-deep);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 28rem;
}

.tax-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.user-pick { min-width: 180px; vertical-align: middle; }
.user-pick .user-q { width: 100%; }
.suggest {
  position: fixed;
  z-index: 4000;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  max-height: 240px;
  overflow: auto;
}
.suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.suggest-item:hover { background: var(--paper-sunken); }
.suggest-name { font-weight: 600; font-size: 0.88rem; line-height: 1.2; }
.suggest-email {
  color: var(--ink-faint);
  font-size: 0.75rem;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* シークレット表示 */
.secret-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--paper-sunken);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   分配率メーター
   -------------------------------------------------------------------------- */

.share-meter { margin: 0.9rem 0 1.4rem; }

.share-meter .meter-track {
  height: 8px;
  background: var(--paper-sunken);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
}

.share-meter .meter-fill {
  height: 100%;
  background: var(--midori);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.share-meter.is-over .meter-fill { background: var(--shu); }

.share-meter .meter-caption {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
}

.share-meter .meter-caption .ok { color: var(--midori); font-weight: 600; }
.share-meter .meter-caption .ng { color: var(--shu-deep); font-weight: 600; }

/* --------------------------------------------------------------------------
   統計タイル
   -------------------------------------------------------------------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.stat {
  background: var(--paper-raised);
  padding: 0.9rem 1.1rem;
}

.stat .k {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  font-weight: 700;
}

.stat .v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

.stat .v.green { color: var(--midori); }

/* --------------------------------------------------------------------------
   タブ（プロジェクト内ナビ）
   -------------------------------------------------------------------------- */

.subnav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.subnav a {
  padding: 0.5rem 0.9rem 0.45rem;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius) var(--radius) 0 0;
}

.subnav a:hover { color: var(--ink); background: var(--paper-sunken); }

.subnav a.active {
  color: var(--shu-deep);
  font-weight: 700;
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--paper-raised);
  margin-bottom: -1.5px;
}

/* --------------------------------------------------------------------------
   決済カタログ（Product → Price → Link）
   -------------------------------------------------------------------------- */

.catalog-product {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper-raised);
  margin-bottom: 1rem;
  overflow: hidden;
}

.allocation-panel.catalog-product {
  overflow: visible;
}

.catalog-product > .head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--paper-sunken);
  border-bottom: 1px solid var(--hairline-soft);
}

.catalog-product > .head .name { font-weight: 700; font-size: 0.95rem; }
.catalog-product > .head .sid { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); margin-left: auto; }

.catalog-price {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem 0.7rem 1.75rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.catalog-price:last-child { border-bottom: none; }

.catalog-price .price-amount { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.catalog-price .cycle { font-size: 0.75rem; color: var(--ink-faint); }

.catalog-price .plan-tag {
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--midori);
  background: var(--midori-wash);
  border-radius: 99px;
  padding: 0.1rem 0.55rem;
}

.catalog-price .link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--midori-wash);
  color: var(--midori);
  border-radius: 99px;
  font-size: 0.74rem;
  padding: 0.2rem 0.7rem;
  text-decoration: none;
  font-weight: 600;
  max-width: 320px;
}
.catalog-price .link-pill .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-price .link-pill:hover { background: var(--midori); color: #fff; }

.catalog-price .spacer { margin-left: auto; }

.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }

/* コピー用ミニボタン */
.copy-btn {
  border: 1px solid var(--hairline);
  background: var(--paper-raised);
  border-radius: 3px;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--font-body);
}
.copy-btn:hover { border-color: var(--shu); color: var(--shu-deep); }

/* --------------------------------------------------------------------------
   ランディング
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3rem;
  padding: 4.5rem 1rem 3.5rem;
  min-height: 60vh;
}

.hero .lede { max-width: 30rem; }

.hero .seal-lg {
  width: 72px;
  height: 72px;
  background: var(--shu);
  color: #fff8ee;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 2.5px rgba(255, 248, 238, 0.55), 0 6px 18px -6px rgba(156, 47, 19, 0.55);
  margin-bottom: 1.75rem;
  animation: stamp-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-4deg) scale(1.6); }
  to   { opacity: 1; transform: rotate(-4deg) scale(1); }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.hero .desc { color: var(--ink-soft); margin-bottom: 2.25rem; font-size: 0.95rem; }

.hero .tate {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: 0.32em;
  line-height: 1.9;
  color: var(--ink);
  border-left: 1px solid var(--hairline);
  padding-left: 2rem;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.hero .tate .shu-char { color: var(--shu); }

.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.feature {
  background: var(--paper);
  padding: 1.5rem 1.4rem;
}

.feature .no {
  font-family: var(--font-mono);
  color: var(--shu);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
}

.feature .t { font-family: var(--font-display); font-weight: 600; margin-bottom: 0.3rem; }
.feature .d { font-size: 0.83rem; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   トースト
   -------------------------------------------------------------------------- */

#toast-root {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.toast {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px -8px rgba(38, 34, 27, 0.5);
  border-left: 3px solid var(--midori);
  animation: rise 0.25s ease both;
  max-width: min(480px, 90vw);
}

.toast.err { border-left-color: var(--shu); }

/* --------------------------------------------------------------------------
   モーダル
   -------------------------------------------------------------------------- */

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(640px, 94vw);
  width: 100%;
}
.modal::backdrop {
  background: rgba(38, 34, 27, 0.45);
}
.modal-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.2rem 1.25rem;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.modal-head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.price-pick-row {
  cursor: pointer;
}
.price-pick-row:hover {
  background: var(--paper-sunken);
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* --------------------------------------------------------------------------
   マイ精算（一括操作）
   -------------------------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-tab {
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.76rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.filter-tab.is-active {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-sunken);
  font-weight: 600;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--paper-sunken);
}

.bulk-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.bulk-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.summary-pre {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--paper-sunken);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   レスポンシブ
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; min-height: auto; }
  .hero .tate { display: none; }
  nav { gap: 1rem; }
  .card { padding: 1.2rem 1.1rem; }
  .bulk-actions { margin-left: 0; width: 100%; }
}
