/*
 * K386 Apps 共通デザインシステム
 * すべてのページ（ポータル・各アプリ）がこの1枚を読み込む。
 * アプリごとの色は <html data-app="…"> で切り替わる。アプリ固有の追加CSSは最小限にする。
 */

/* ---------- トークン ---------- */
:root {
  color-scheme: light dark;

  --paper: #faf8f4;
  --paper-2: #f3eee5;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #1d1c1a;
  --ink-2: #45423d;
  --muted: #6b665d;
  --rule: #e6e0d5;
  --rule-strong: #d6cebf;

  --brand: #27365f;          /* K386 の紺（HANA の服に合わせた色） */
  --brand-ink: #ffffff;
  --brand-soft: rgba(39, 54, 95, 0.08);

  --ok: #18794e;
  --ok-soft: rgba(24, 121, 78, 0.1);
  --warn: #9a5b00;
  --warn-soft: rgba(210, 140, 0, 0.12);

  /* アプリのアクセント（data-app で上書き） */
  --accent: var(--brand);
  --accent-strong: #1b2748;
  --accent-soft: var(--brand-soft);
  --accent-ink: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.05), 0 6px 20px rgba(40, 30, 10, 0.06);
  --shadow-lg: 0 2px 4px rgba(40, 30, 10, 0.05), 0 16px 40px rgba(40, 30, 10, 0.1);

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(56px, 8vw, 96px);
}

:root[data-app="claudeck"]    { --accent: #d9540b; --accent-strong: #b3440a; --accent-soft: rgba(217, 84, 11, 0.1); }
:root[data-app="luminate"]    { --accent: #b7791f; --accent-strong: #946115; --accent-soft: rgba(183, 121, 31, 0.12); }
:root[data-app="maildeck"]    { --accent: #b42332; --accent-strong: #921b28; --accent-soft: rgba(180, 35, 50, 0.09); }
:root[data-app="quotadesk"]   { --accent: #0b7fc0; --accent-strong: #09679c; --accent-soft: rgba(11, 127, 192, 0.1); }
:root[data-app="refocus"]     { --accent: #0f7a64; --accent-strong: #0b6150; --accent-soft: rgba(15, 122, 100, 0.1); }
:root[data-app="soundswitch"] { --accent: #cf2e6e; --accent-strong: #ad2159; --accent-soft: rgba(207, 46, 110, 0.09); }
:root[data-app="icrec"]       { --accent: #7340c9; --accent-strong: #5d31a8; --accent-soft: rgba(115, 64, 201, 0.1); }
:root[data-app="whisper"]     { --accent: #2f45a8; --accent-strong: #24368a; --accent-soft: rgba(47, 69, 168, 0.09); }
:root[data-app="mousehalo"]   { --accent: #15803d; --accent-strong: #116632; --accent-soft: rgba(21, 128, 61, 0.1); }
:root[data-app="webbutton"]   { --accent: #0e7490; --accent-strong: #0b5d74; --accent-soft: rgba(14, 116, 144, 0.1); }
:root[data-app="honyaku"]     { --accent: #8b5a2b; --accent-strong: #6f4520; --accent-soft: rgba(139, 90, 43, 0.1); }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151517;
    --paper-2: #1c1c1f;
    --surface: #202024;
    --surface-2: #1a1a1d;
    --ink: #f1eee8;
    --ink-2: #cfcac1;
    --muted: #a39d93;
    --rule: #33322f;
    --rule-strong: #45433f;
    --brand: #a9b8e8;
    --brand-ink: #111525;
    --brand-soft: rgba(169, 184, 232, 0.12);
    --ok: #5fd39c;
    --ok-soft: rgba(95, 211, 156, 0.12);
    --warn: #f2b54a;
    --warn-soft: rgba(242, 181, 74, 0.12);
    --accent: var(--brand);
    --accent-strong: #c6d1f3;
    --accent-soft: var(--brand-soft);
    --accent-ink: #111525;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.35);
  }
  :root[data-app="claudeck"]    { --accent: #ff9a5c; --accent-strong: #ffb887; --accent-soft: rgba(255, 154, 92, 0.13); }
  :root[data-app="luminate"]    { --accent: #eab65a; --accent-strong: #f3cd87; --accent-soft: rgba(234, 182, 90, 0.13); }
  :root[data-app="maildeck"]    { --accent: #ff7d8a; --accent-strong: #ffa3ac; --accent-soft: rgba(255, 125, 138, 0.13); }
  :root[data-app="quotadesk"]   { --accent: #5cc0f5; --accent-strong: #8dd3f8; --accent-soft: rgba(92, 192, 245, 0.13); }
  :root[data-app="refocus"]     { --accent: #4fd1b0; --accent-strong: #80dfc7; --accent-soft: rgba(79, 209, 176, 0.13); }
  :root[data-app="soundswitch"] { --accent: #ff78ae; --accent-strong: #ffa1c7; --accent-soft: rgba(255, 120, 174, 0.13); }
  :root[data-app="icrec"]       { --accent: #b79bff; --accent-strong: #cfbcff; --accent-soft: rgba(183, 155, 255, 0.14); }
  :root[data-app="whisper"]     { --accent: #9aabff; --accent-strong: #bcc7ff; --accent-soft: rgba(154, 171, 255, 0.14); }
  :root[data-app="mousehalo"]   { --accent: #4ade80; --accent-strong: #86efac; --accent-soft: rgba(74, 222, 128, 0.13); }
  :root[data-app="webbutton"]   { --accent: #4fd0e6; --accent-strong: #86e0ef; --accent-soft: rgba(79, 208, 230, 0.13); }
  :root[data-app="honyaku"]     { --accent: #dcae7c; --accent-strong: #ebc9a2; --accent-soft: rgba(220, 174, 124, 0.13); }
}

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
  overflow-wrap: anywhere;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: 0.01em; margin: 0 0 0.6em; font-feature-settings: "palt" 1; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px; padding: 0.1em 0.4em; }
kbd { background: var(--surface); border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.45em; font-size: 0.85em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

.k-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.k-narrow { max-width: 780px; }
.k-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.k-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.k-skip:focus { top: 12px; color: var(--paper); }
.k-nowrap { white-space: nowrap; }
.k-muted { color: var(--muted); }
.k-small { font-size: 0.875rem; }

/* ---------- ボタン ---------- */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0.6em 1.3em;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.97rem; line-height: 1.3;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.k-btn svg { flex: none; }
.k-btn--primary { background: var(--accent); color: var(--accent-ink); }
.k-btn--primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.k-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.k-btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.k-btn--ghost { background: transparent; color: var(--accent); padding-left: 0.4em; padding-right: 0.4em; }
.k-btn--sm { min-height: 36px; padding: 0.35em 0.95em; font-size: 0.88rem; }
.k-btn[aria-disabled="true"] { background: var(--paper-2); color: var(--muted); border-color: var(--rule); cursor: not-allowed; }
.k-btn:active { transform: translateY(1px); }
.k-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- ヘッダー ---------- */
.k-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.k-header__inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.k-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.k-crumb a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; }
.k-crumb a:hover { color: var(--accent); }
.k-crumb__sep { color: var(--muted); font-weight: 400; }
.k-crumb__home { font-size: 0.9rem; color: var(--ink-2); }
.k-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; flex: none; }
.k-crumb__icon { width: 30px; height: 30px; border-radius: 7px; flex: none; }
.k-crumb__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-menu { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.k-menu__links { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.k-menu__links a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 0.92rem; white-space: nowrap; }
.k-menu__links a:hover, .k-menu__links a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.k-lang { display: inline-flex; flex: none; white-space: nowrap; border: 1px solid var(--rule-strong); border-radius: 999px; overflow: hidden; font-size: 0.8rem; margin: 0 6px; }
.k-lang a, .k-lang span { padding: 4px 10px; text-decoration: none; color: var(--muted); }
.k-lang [aria-current="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }
.k-menu__toggle { display: none; }
@media (max-width: 880px) {
  .k-menu__links { display: none; }
  .k-menu__toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
  .k-header[data-open="true"] .k-menu__links {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px var(--gutter) 16px;
    box-shadow: var(--shadow);
  }
  .k-header[data-open="true"] .k-menu__links a { padding: 12px; font-size: 1rem; }
  .k-header .k-btn--dl span { display: none; }
  .k-header .k-btn--dl { padding: 0 12px; min-height: 42px; }
}
@media (max-width: 1060px) {
  .k-crumb__home-text { display: none; }
}
@media (max-width: 400px) {
  .k-lang { display: none; }
}

/* ---------- ヒーロー ---------- */
.k-hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.k-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 85% 10%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 260px at 0% 100%, var(--brand-soft), transparent 70%);
}
.k-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .k-hero__grid { grid-template-columns: 1fr; } }
.k-app-id { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.k-app-id img { width: 64px; height: 64px; border-radius: 15px; box-shadow: var(--shadow); }
.k-app-id__name { font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.k-app-id__kind { color: var(--muted); font-size: 0.88rem; }
.k-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin: 0 0 16px; }
.k-title { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.22; font-weight: 800; letter-spacing: 0; margin-bottom: 18px; }
.k-title em { font-style: normal; color: var(--accent); }
.k-lede { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink-2); max-width: 40em; margin-bottom: 26px; }
.k-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--muted); }
.k-facts li { display: inline-flex; align-items: center; gap: 6px; }
.k-facts svg { color: var(--ok); }
.k-shot { margin: 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-lg); overflow: hidden; }
.k-shot img { width: 100%; }
.k-shot video { display: block; width: 100%; height: auto; background: #000; }
.k-shot figcaption, .k-figure figcaption { font-size: 0.82rem; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--rule); background: var(--surface-2); }
.k-figure { margin: 0; }
.k-hero__visual { position: relative; }
.k-hero__visual .k-say--hero { position: absolute; right: -8px; bottom: -28px; }
@media (max-width: 900px) { .k-hero__visual .k-say--hero { position: static; margin-top: 16px; } }

/* ---------- セクション ---------- */
.k-section { padding: var(--section) 0; }
.k-section--soft { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.k-section + .k-section--soft, .k-section--soft + .k-section { border-top: 0; }
.k-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 44px); }
.k-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.k-tag { display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.k-h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
.k-head p { color: var(--ink-2); font-size: 1.04rem; }
.k-head-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.k-head-row .k-head { margin-bottom: 0; }
@media (max-width: 760px) { .k-head-row { grid-template-columns: 1fr; } }
.k-h3 { font-size: 1.12rem; font-weight: 800; }
.k-prose { max-width: 760px; }
.k-prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.k-prose h3 { font-size: 1.15rem; margin-top: 1.8em; }
.k-prose li + li { margin-top: 0.3em; }

/* ---------- グリッド・カード ---------- */
.k-grid { display: grid; gap: clamp(14px, 2vw, 22px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.k-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.k-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.k-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(18px, 2.4vw, 26px); box-shadow: var(--shadow); }
.k-card > :last-child { margin-bottom: 0; }
.k-card h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.k-card p { color: var(--ink-2); font-size: 0.95rem; }
.k-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.k-icon svg { width: 22px; height: 22px; }

/* ---------- 確認カード（ダウンロード前に見る項目） ---------- */
.k-check { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.k-check__head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--rule); background: var(--surface-2); font-weight: 800; }
.k-check__head svg { color: var(--ok); }
.k-check dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.k-check__item { display: grid; grid-template-columns: 26px 1fr; gap: 2px 12px; padding: 16px 22px; border-bottom: 1px solid var(--rule); }
.k-check__item svg { grid-row: span 2; color: var(--accent); margin-top: 3px; }
.k-check dt { font-size: 0.8rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.k-check dd { margin: 0; font-weight: 600; line-height: 1.6; }
.k-check dd small { display: block; font-weight: 400; color: var(--muted); font-size: 0.84rem; }

/* ---------- チップ・バッジ ---------- */
.k-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.k-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 700; line-height: 1.4; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; }
.k-chip--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.k-chip--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.k-chip--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.k-chip svg { width: 13px; height: 13px; }

/* ---------- キャラクター（ナビゲーター） ----------
 * 本文の流れの中で「一言」を添える部品。内容は必ず本文にも書くこと（キャラだけの情報を作らない）。
 * .k-say          顔アイコン＋吹き出し（本文中に置く標準形）
 * .k-say--side    大きめの立ち絵＋吹き出し（見出しの横など、広い画面で横に並ぶ）
 * .k-say--hero    ヒーローの画面写真の端から顔を出す形
 */
.k-say { display: flex; align-items: flex-end; gap: 12px; margin: 22px 0; max-width: 620px; }
.k-say__who { flex: none; width: 64px; text-align: center; font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.k-say__who img { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--surface); box-shadow: var(--shadow); margin-bottom: 4px; }
.k-say__bubble {
  position: relative; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 18px 18px 18px 6px;
  padding: 12px 16px; font-size: 0.95rem; line-height: 1.7; color: var(--ink); box-shadow: var(--shadow);
}
.k-say__bubble::before {
  content: ""; position: absolute; left: -7px; bottom: 12px; width: 12px; height: 12px;
  background: var(--surface); border-left: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
  transform: rotate(45deg);
}
.k-say__bubble p { margin: 0; }
.k-say--right { flex-direction: row-reverse; margin-left: auto; }
.k-say--right .k-say__bubble { border-radius: 18px 18px 6px 18px; }
.k-say--right .k-say__bubble::before { left: auto; right: -7px; transform: rotate(-135deg); }

.k-say--side { flex-direction: column; align-items: center; gap: 0; margin: 0; max-width: 260px; }
.k-say--side .k-say__bubble { border-radius: 18px; margin-bottom: 10px; }
.k-say--side .k-say__bubble::before { left: 50%; bottom: -7px; transform: translateX(-50%) rotate(-45deg); }
.k-say--side .k-say__figure { width: 200px; }
.k-say--side .k-say__figure img { width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(40, 30, 10, 0.12)); }
.k-say__name { font-size: 0.74rem; color: var(--muted); margin-top: 4px; }

.k-say--hero { flex-direction: row; align-items: flex-end; gap: 0; max-width: 360px; margin: 0; }
.k-say--hero .k-say__figure { width: 150px; flex: none; margin-left: -18px; }
.k-say--hero .k-say__figure img { width: 100%; filter: drop-shadow(0 10px 18px rgba(40, 30, 10, 0.15)); }
.k-say--hero .k-say__bubble { margin-bottom: 70px; border-radius: 18px 18px 6px 18px; font-size: 0.9rem; }
.k-say--hero .k-say__bubble::before { left: auto; right: -7px; transform: rotate(-135deg); }

/* 見出し＋キャラを横並びにする枠 */
.k-with-say { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: clamp(20px, 4vw, 48px); align-items: start; }
.k-with-say--left { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 860px) {
  .k-with-say, .k-with-say--left { grid-template-columns: 1fr; }
  .k-with-say .k-say--side { flex-direction: row-reverse; max-width: none; align-items: flex-end; }
  .k-with-say .k-say--side .k-say__figure { width: 96px; flex: none; }
  .k-with-say .k-say--side .k-say__bubble { margin: 0 0 24px 0; border-radius: 18px 18px 6px 18px; }
  .k-with-say .k-say--side .k-say__bubble::before { left: auto; right: -7px; bottom: 12px; transform: rotate(-135deg); }
}

/* ---------- 手順 ---------- */
.k-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.k-steps > li { counter-increment: step; position: relative; padding: 18px 20px 18px 70px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.k-steps > li::before {
  content: counter(step); position: absolute; left: 20px; top: 18px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800;
}
.k-steps h3 { font-size: 1.02rem; margin: 3px 0 4px; }
.k-steps p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.k-steps p + p, .k-steps p + ul, .k-steps ul { margin-top: 8px; }

/* ---------- 表 ---------- */
.k-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.k-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.k-table th, .k-table td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.k-table thead th { background: var(--surface-2); font-size: 0.8rem; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.k-table tbody th { font-weight: 700; white-space: nowrap; }
.k-table tr:last-child > * { border-bottom: 0; }
.k-table code { word-break: break-all; }
.k-yes { color: var(--ok); font-weight: 700; }
.k-no { color: var(--muted); }

/* ---------- 注意・補足 ---------- */
.k-note { border-radius: var(--r); padding: 14px 18px; background: var(--brand-soft); border: 1px solid var(--rule); font-size: 0.94rem; margin: 18px 0; }
.k-note--warn { background: var(--warn-soft); border-color: transparent; }
.k-note--ok { background: var(--ok-soft); border-color: transparent; }
.k-note strong:first-child { display: block; margin-bottom: 2px; }
.k-note > :last-child { margin-bottom: 0; }

/* ---------- よくある質問 ---------- */
.k-faq { display: grid; gap: 10px; }
.k-faq details { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.k-faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 20px; font-weight: 700; position: relative; }
.k-faq summary::-webkit-details-marker { display: none; }
.k-faq summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.k-faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.k-faq details > div { padding: 0 20px 18px; color: var(--ink-2); }
.k-faq details > div > :last-child { margin-bottom: 0; }

/* ---------- ダウンロード ---------- */
.k-dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
@media (max-width: 860px) { .k-dl { grid-template-columns: 1fr; } }
.k-dl__main { padding: clamp(22px, 3vw, 34px); background: linear-gradient(160deg, var(--accent-soft), transparent 70%); }
.k-dl__main h2, .k-dl__main h3 { font-size: 1.4rem; }
.k-dl__meta { padding: clamp(18px, 3vw, 30px); border-left: 1px solid var(--rule); }
@media (max-width: 860px) { .k-dl__meta { border-left: 0; border-top: 1px solid var(--rule); } }
.k-dl__meta dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 0.92rem; }
.k-dl__meta dt { color: var(--muted); }
.k-dl__meta dd { margin: 0; font-weight: 600; }
.k-hash { display: flex; gap: 8px; align-items: flex-start; }
.k-hash code { font-size: 0.78rem; line-height: 1.5; word-break: break-all; background: var(--paper-2); flex: 1; }
.k-copy { flex: none; font: inherit; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.k-copy:hover { border-color: var(--accent); color: var(--accent); }
.k-copy[data-done] { color: var(--ok); border-color: var(--ok); }
.k-code { position: relative; background: #1c1d22; color: #e8e6e1; border-radius: var(--r); padding: 14px 16px; margin: 10px 0 16px; overflow-x: auto; font-size: 0.85rem; line-height: 1.6; }
.k-code pre { margin: 0; white-space: pre-wrap; word-break: break-all; }
.k-code .k-copy { position: absolute; top: 8px; right: 8px; background: #2a2b31; color: #cfcac1; border-color: #45454d; }

/* ---------- タブ風の比較（2アプリの違いなど） ---------- */
.k-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }

/* ---------- フッター ---------- */
.k-footer { margin-top: 0; background: var(--paper-2); border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--ink-2); }
.k-footer a { color: var(--ink-2); text-decoration: none; }
.k-footer a:hover { color: var(--accent); text-decoration: underline; }
.k-footer__trust { padding: 28px 0; border-bottom: 1px solid var(--rule); }
.k-footer__trust ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px 24px; margin: 0; padding: 0; list-style: none; }
.k-footer__trust li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; line-height: 1.6; }
.k-footer__trust svg { color: var(--ok); margin-top: 3px; }
.k-footer__trust strong { display: block; color: var(--ink); }
.k-footer__apps { padding: 30px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 28px; }
@media (max-width: 760px) { .k-footer__apps { grid-template-columns: 1fr; } }
.k-footer__apps h2 { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.k-footer__applist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.k-footer__applist a { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.k-footer__applist img { width: 24px; height: 24px; border-radius: 6px; }
.k-footer__bottom { padding: 20px 0 32px; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: space-between; font-size: 0.84rem; color: var(--muted); }
.k-footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }

/* ---------- ポータル専用 ---------- */
.k-portal-hero .k-hero__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
@media (max-width: 900px) { .k-portal-hero .k-hero__grid { grid-template-columns: 1fr; } }
.k-hana { position: relative; display: flex; flex-direction: column; align-items: center; }
.k-hana img { width: min(300px, 70vw); filter: drop-shadow(0 16px 26px rgba(40, 30, 10, 0.14)); }
.k-hana .k-say__bubble { max-width: 320px; margin-bottom: 8px; border-radius: 18px; }
.k-hana .k-say__bubble::before { left: 30%; bottom: -7px; transform: rotate(-45deg); }
/* ポータルのトップ：ハナの後ろに各アプリの案内役が集まった1枚（shared/img/nav/group.webp） */
@media (min-width: 901px) { .k-portal-hero:has(.k-hana--group) .k-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.k-hana--group img { width: min(620px, 112%); max-width: none; margin-right: -12%; filter: drop-shadow(0 16px 26px rgba(40, 30, 10, 0.12)); }
.k-hana--group .k-say__bubble::before { left: 46%; }
@media (max-width: 900px) {
  .k-hana { flex-direction: row-reverse; align-items: flex-end; gap: 6px; }
  .k-hana img { width: 120px; }
  .k-hana .k-say__bubble { margin-bottom: 30px; border-radius: 18px 18px 6px 18px; }
  .k-hana .k-say__bubble::before { left: auto; right: -7px; bottom: 12px; transform: rotate(-135deg); }
  /* 集合の1枚は小さくすると誰だかわからないので、吹き出しの下に大きく出す */
  .k-hana--group { flex-direction: column; align-items: center; gap: 0; }
  .k-hana--group img { width: min(460px, 100%); margin-right: 0; }
  .k-hana--group .k-say__bubble { margin-bottom: 8px; border-radius: 18px; }
  .k-hana--group .k-say__bubble::before { left: 46%; right: auto; bottom: -7px; transform: rotate(-45deg); }
}

.k-trust-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.k-trust-strip li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; font-size: 0.86rem; line-height: 1.55; color: var(--ink-2); }
.k-trust-strip strong { display: block; color: var(--ink); font-size: 0.92rem; }
.k-trust-strip svg { color: var(--ok); flex: none; margin-top: 2px; }

.k-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.k-filter button {
  font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2);
}
.k-filter button:hover { border-color: var(--ink-2); }
.k-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.k-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: clamp(16px, 2.2vw, 24px); }
.k-appcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.k-appcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--rule-strong); }
.k-appcard[hidden] { display: none; }
/* カード上部：アプリのアイコンと担当キャラ（吹き出しで一言） */
.k-appcard__shot {
  position: relative; height: 168px; overflow: hidden; border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(220px 160px at 78% 100%, var(--accent-soft), transparent 70%),
    linear-gradient(150deg, var(--accent-soft), var(--surface-2) 75%);
}
.k-appcard__icon { position: absolute; left: 20px; top: 20px; width: 64px; height: 64px; border-radius: 15px; box-shadow: var(--shadow); }
.k-appcard__line {
  position: absolute; left: 20px; top: 96px; right: 150px;
  font-size: 0.8rem; line-height: 1.5; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px 12px 12px 4px; padding: 6px 10px;
}
.k-appcard__guide { position: absolute; right: 4px; top: 10px; width: 138px; pointer-events: none; }
.k-appcard__guide img { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(40, 30, 10, 0.16)); }
.k-appcard__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.k-appcard__id { display: flex; align-items: center; gap: 12px; }
.k-appcard__id img { width: 48px; height: 48px; border-radius: 11px; flex: none; }
.k-appcard__name { font-size: 1.12rem; font-weight: 800; margin: 0; line-height: 1.3; }
.k-appcard__name a { color: var(--ink); text-decoration: none; }
.k-appcard__name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.k-appcard__kind { font-size: 0.8rem; color: var(--muted); }
.k-appcard__catch { font-weight: 700; margin: 0; }
.k-appcard__desc { font-size: 0.92rem; color: var(--ink-2); margin: 0; }
.k-appcard__for { font-size: 0.86rem; color: var(--ink-2); background: var(--paper-2); border-radius: var(--r-sm); padding: 8px 12px; margin: 0; }
.k-appcard__for b { color: var(--accent); }
.k-appcard .k-chips { margin-top: auto; padding-top: 6px; }
.k-appcard__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); font-size: 0.92rem; }
.k-appcard[data-status="soon"] .k-appcard__shot::after { content: "準備中"; position: absolute; left: 96px; top: 24px; background: var(--ink); color: var(--paper); font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
html[lang="en"] .k-appcard[data-status="soon"] .k-appcard__shot::after { content: "Coming soon"; }
/* カードごとの色（ポータルでは data-app をカードに付ける） */
.k-appcard[data-app="claudeck"]    { --accent: #d9540b; --accent-soft: rgba(217, 84, 11, 0.1); }
.k-appcard[data-app="luminate"]    { --accent: #b7791f; --accent-soft: rgba(183, 121, 31, 0.12); }
.k-appcard[data-app="maildeck"]    { --accent: #b42332; --accent-soft: rgba(180, 35, 50, 0.09); }
.k-appcard[data-app="quotadesk"]   { --accent: #0b7fc0; --accent-soft: rgba(11, 127, 192, 0.1); }
.k-appcard[data-app="refocus"]     { --accent: #0f7a64; --accent-soft: rgba(15, 122, 100, 0.1); }
.k-appcard[data-app="soundswitch"] { --accent: #cf2e6e; --accent-soft: rgba(207, 46, 110, 0.09); }
.k-appcard[data-app="icrec"]       { --accent: #7340c9; --accent-soft: rgba(115, 64, 201, 0.1); }
.k-appcard[data-app="whisper"]     { --accent: #2f45a8; --accent-soft: rgba(47, 69, 168, 0.09); }
.k-appcard[data-app="mousehalo"]   { --accent: #15803d; --accent-soft: rgba(21, 128, 61, 0.1); }
.k-appcard[data-app="webbutton"]   { --accent: #0e7490; --accent-soft: rgba(14, 116, 144, 0.1); }
.k-appcard[data-app="honyaku"]     { --accent: #8b5a2b; --accent-soft: rgba(139, 90, 43, 0.1); }
@media (prefers-color-scheme: dark) {
  .k-appcard[data-app="claudeck"]    { --accent: #ff9a5c; --accent-soft: rgba(255, 154, 92, 0.13); }
  .k-appcard[data-app="luminate"]    { --accent: #eab65a; --accent-soft: rgba(234, 182, 90, 0.13); }
  .k-appcard[data-app="maildeck"]    { --accent: #ff7d8a; --accent-soft: rgba(255, 125, 138, 0.13); }
  .k-appcard[data-app="quotadesk"]   { --accent: #5cc0f5; --accent-soft: rgba(92, 192, 245, 0.13); }
  .k-appcard[data-app="refocus"]     { --accent: #4fd1b0; --accent-soft: rgba(79, 209, 176, 0.13); }
  .k-appcard[data-app="soundswitch"] { --accent: #ff78ae; --accent-soft: rgba(255, 120, 174, 0.13); }
  .k-appcard[data-app="icrec"]       { --accent: #b79bff; --accent-soft: rgba(183, 155, 255, 0.14); }
  .k-appcard[data-app="whisper"]     { --accent: #9aabff; --accent-soft: rgba(154, 171, 255, 0.14); }
  .k-appcard[data-app="mousehalo"]   { --accent: #4ade80; --accent-soft: rgba(74, 222, 128, 0.13); }
  .k-appcard[data-app="webbutton"]   { --accent: #4fd0e6; --accent-soft: rgba(79, 208, 230, 0.13); }
  .k-appcard[data-app="honyaku"]     { --accent: #dcae7c; --accent-soft: rgba(220, 174, 124, 0.13); }
}

.k-finder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.k-finder a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none; color: var(--ink); transition: border-color 0.15s; }
.k-finder a:hover { border-color: var(--accent); color: var(--ink); }
.k-finder__q { font-weight: 800; line-height: 1.5; }
.k-finder__a { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--accent); font-weight: 700; margin-top: auto; }
.k-finder__a img { width: 22px; height: 22px; border-radius: 5px; }

.k-matrix th[scope="row"] a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.k-matrix th[scope="row"] img { width: 22px; height: 22px; border-radius: 5px; }
@media (max-width: 760px) {
  .k-matrix thead { display: none; }
  .k-matrix, .k-matrix tbody, .k-matrix tr, .k-matrix td, .k-matrix th { display: block; width: 100%; }
  .k-matrix tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .k-matrix tr:last-child { border-bottom: 0; }
  .k-matrix td, .k-matrix th { border: 0; padding: 4px 16px; }
  .k-matrix td::before { content: attr(data-label) "："; color: var(--muted); font-size: 0.8rem; }
}

/* ---------- 記事（note・Zenn） ---------- */
.k-platforms { margin-bottom: clamp(24px, 3vw, 36px); }
.k-platform h3 { margin-bottom: 0.3em; }
.k-platform a { font-weight: 700; color: var(--accent); text-decoration: none; }
.k-platform a:hover { text-decoration: underline; }
.k-articles__label { margin-bottom: 12px; }
.k-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.k-article { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.k-article img, .k-article .k-logo { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.k-article__title { font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.5; }
.k-article__title:hover { color: var(--accent); text-decoration: underline; }
.k-article__lead { margin: 4px 0 0; font-size: 0.9rem; color: var(--ink-2); }
.k-article__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 8px; font-size: 0.82rem; color: var(--muted); }
.k-chip--note { background: rgba(65, 201, 180, 0.16); color: #1c8676; border-color: transparent; }
.k-chip--zenn { background: rgba(62, 168, 255, 0.16); color: #1d6fba; border-color: transparent; }
.k-articles__card { margin-top: clamp(24px, 3vw, 36px); padding-top: clamp(20px, 3vw, 28px); border-top: 1px solid var(--rule); }
.k-articles__card > h3 { margin-bottom: 4px; }
.k-articles__card > p { margin-bottom: 12px; }
.k-footer__links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
@media (prefers-color-scheme: dark) {
  .k-chip--note { color: #6fdccb; }
  .k-chip--zenn { color: #86c5ff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .k-header, .k-footer, .k-say { display: none !important; }
}
