/* ===========================================================
   RuRu Lab Tools — design system
   iLovePDF風のツールハブ。シンプル & スタイリッシュ。
   =========================================================== */

:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --text: #141a24;
  --muted: #64707e;
  --line: #e4e9f0;
  --line-strong: #d3dae4;
  --brand: #e5322d;
  --brand-ink: #b71f1b;
  --ink: #141a24;
  --shadow-sm: 0 2px 8px rgba(20, 26, 36, .06);
  --shadow: 0 18px 48px rgba(20, 26, 36, .10);
  --shadow-lg: 0 30px 80px rgba(20, 26, 36, .16);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;

  /* category accents */
  --c-organize: #e5322d;
  --c-optimize: #7b3ff2;
  --c-toPdf:    #ff6a3d;
  --c-fromPdf:  #1f8fff;
  --c-edit:     #0fb5a5;
  --c-security: #3552e0;
  --c-ai:       #d6318c;

  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; }

.wrap { width: min(var(--maxw), calc(100% - 40px)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 22px;
  height: 66px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px; color: var(--text);
}
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #ff7a59);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.brand b { color: var(--brand); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 8px 12px; border-radius: 9px; font-size: 14px; font-weight: 600;
  color: var(--muted);
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a.active { color: var(--brand); }
.header-spacer { flex: 1; }
.header-cta {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border-radius: 10px; font-weight: 700; font-size: 14px;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-sm);
}
.header-cta:hover { background: var(--brand-ink); }
.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(48px, 8vw, 96px) 0 clamp(28px, 4vw, 44px);
}
.hero .eyebrow {
  display: inline-block; margin-bottom: 18px;
  padding: 6px 14px; border-radius: 999px;
  background: #fdeceb; color: var(--brand-ink);
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.hero h1 {
  margin: 0 auto; max-width: 900px;
  font-size: clamp(30px, 5.4vw, 56px); font-weight: 850;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), #ff7a59 60%, #ff9a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  margin: 20px auto 0; max-width: 640px; color: var(--muted); font-size: 17px;
}
.hero-actions { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 750; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: transform .06s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--muted); }

/* ---------- Product switcher tabs ---------- */
.switcher { display: flex; justify-content: center; gap: 8px; margin: 6px 0 8px; flex-wrap: wrap; }
.switcher a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.switcher a .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
.switcher a.active { color: #fff; border-color: transparent; }
.switcher a.active.pdf { background: var(--brand); }
.switcher a.active.word { background: #2b579a; }
.switcher a.active.ppt { background: #c43e1c; }
.switcher a.active.image { background: #0fb5a5; }
.switcher a.active.ocr { background: #7b3ff2; }
.switcher a.active.audio { background: #0f9f6e; }
.switcher a:not(.active):hover { border-color: var(--line-strong); color: var(--text); }

/* ---------- Section ---------- */
.section { padding: 34px 0 20px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 16px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head .count { color: var(--muted); font-size: 13px; font-weight: 600; }
.section-head .rule { flex: 1; height: 1px; background: var(--line); }
.seo-copy { max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.seo-copy p { margin: 0 0 14px; }
.seo-copy p:last-child { margin-bottom: 0; }
.seo-copy a { color: var(--brand); font-weight: 600; }

/* Language picker & switcher */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}
.lang-switch a {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--muted);
  border: 1px solid transparent;
}
.lang-switch a:hover { color: var(--text); background: var(--surface-2); }
.lang-switch a[aria-current="page"] {
  color: var(--brand);
  border-color: var(--line);
  background: var(--surface);
}
.lang-picker-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.lang-picker-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
}
.lang-picker-card .brand { justify-content: center; margin-bottom: 20px; }
.lang-picker-card h1 { margin: 0 0 8px; font-size: 24px; }
.lang-picker-card p { margin: 0 0 24px; color: var(--muted); }
.lang-picker-grid {
  display: grid;
  gap: 10px;
  text-align: left;
}
.lang-picker-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.lang-picker-grid a:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.lang-picker-grid a span { color: var(--muted); font-weight: 500; font-size: 13px; }
.locale-note {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

/* ---------- Tool grid & cards ---------- */
.tool-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.tool-card {
  position: relative; display: block;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
  min-height: 156px;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.tool-card .ticon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 16px;
}
.tool-card .ticon svg { width: 24px; height: 24px; }
.tool-card h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 750; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.tool-card .badges { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
.badge.free { background: #e7f7ee; color: #12874e; }
.badge.server { background: #eef1fb; color: #3552e0; }
.badge.paid { background: #fdeef6; color: #c02a7c; }
.badge.soon { background: #f2f4f7; color: #6a7684; }
.badge.new { background: var(--brand); color: #fff; }
.tool-card .corner {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 800; color: var(--muted);
}

/* category tint for icon tiles */
.ic-organize { background: #fdecec; color: var(--c-organize); }
.ic-optimize { background: #f0eafe; color: var(--c-optimize); }
.ic-toPdf    { background: #ffeee6; color: var(--c-toPdf); }
.ic-fromPdf  { background: #e7f2ff; color: var(--c-fromPdf); }
.ic-edit     { background: #e2f8f5; color: var(--c-edit); }
.ic-security { background: #e9edfd; color: var(--c-security); }
.ic-ai       { background: #fde9f4; color: var(--c-ai); }

/* ---------- Split hero (index) ---------- */
.hero-split {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
  padding: clamp(40px, 7vw, 88px) 0 clamp(30px, 5vw, 60px);
}
.hero-split .eyebrow {
  display: inline-block; margin-bottom: 18px; padding: 6px 14px; border-radius: 999px;
  background: #fdeceb; color: var(--brand-ink); font-size: 12px; font-weight: 800;
}
.hero-split h1 { margin: 0; font-size: clamp(32px, 4.6vw, 56px); font-weight: 850; }
.hero-split h1 .grad { background: linear-gradient(120deg, var(--brand), #ff7a59 60%, #ff9a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-split .lead { margin: 20px 0 0; max-width: 520px; color: var(--muted); font-size: 17px; }
.hero-split .hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-trust { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-weight: 700; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-visual {
  position: relative; border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, #fff, var(--surface-2));
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); border-radius: 22px; pointer-events: none; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; gap: 28px; text-align: center; } .hero-split .lead, .hero-split .hero-actions, .hero-trust { justify-content: center; margin-inline: auto; } .hero-visual { order: -1; } }

/* ---------- Product cards (index) ---------- */
.prod-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); margin-top: 8px; }
.prod-card {
  display: block; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
  padding: 26px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .2s ease;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.prod-card .pc-badge { position: absolute; top: 16px; right: 16px; font-size: 10.5px; font-weight: 800; color: var(--muted); background: var(--surface-2); padding: 4px 9px; border-radius: 999px; }
.prod-card .pc-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.prod-card.pdf .pc-ico { background: linear-gradient(135deg, var(--brand), #ff7a59); }
.prod-card.word .pc-ico { background: linear-gradient(135deg, #2b579a, #1f8fff); }
.prod-card.ppt .pc-ico { background: linear-gradient(135deg, #c43e1c, #ff6a3d); }
.prod-card.ocr .pc-ico { background: linear-gradient(135deg, #7b3ff2, #d6318c); }
.prod-card.audio .pc-ico { background: linear-gradient(135deg, #0f9f6e, #0fb5a5); }
.prod-card h3 { margin: 0 0 6px; font-size: 20px; }
.prod-card p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.prod-card .pc-go { font-weight: 800; font-size: 13.5px; color: var(--brand); }
.prod-card.word .pc-go { color: #2b579a; }
.prod-card.ppt .pc-go { color: #c43e1c; }
.prod-card.ocr .pc-go { color: #7b3ff2; }
.prod-card.audio .pc-go { color: #0f9f6e; }
@media (max-width: 820px) { .prod-grid { grid-template-columns: 1fr; } }

/* ---------- Feature strip ---------- */
.features {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 46px 0 8px;
}
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.feature .fico { font-size: 22px; margin-bottom: 10px; }
.feature h4 { margin: 0 0 6px; font-size: 15.5px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Tool page ---------- */
.tool-hero { text-align: center; padding: 48px 0 8px; }
.tool-hero .ticon { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 18px; display: grid; place-items: center; }
.tool-hero .ticon svg { width: 30px; height: 30px; }
.tool-hero h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); }
.tool-hero p { margin: 14px auto 0; max-width: 560px; color: var(--muted); font-size: 16px; }

.dropzone {
  margin: 34px auto 0; max-width: 720px;
  border: 2px dashed var(--line-strong); border-radius: 20px;
  background: var(--surface); padding: 48px 24px; text-align: center;
  transition: border-color .2s ease, background .2s ease;
}
.dropzone.drag { border-color: var(--brand); background: #fff7f6; }
.dropzone .dz-big { font-size: 44px; margin-bottom: 12px; }
.dropzone h3 { margin: 0 0 6px; font-size: 18px; }
.dropzone p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.picked-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 156px; min-height: 34px; margin: 0 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 13px; font-weight: 800;
}
.picked-count.has-files {
  border-color: #bfe8d0; background: #f2fcf6; color: #12874e;
}
.dropzone .hint { margin-top: 16px; font-size: 12px; color: var(--muted); }
.cloud-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.cloud-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text); cursor: pointer; }
.cloud-btn:hover { border-color: var(--muted); background: var(--surface-2); }
.cloud-btn span { font-size: 15px; }
.cloud-btn.gdrive span { color: #1f8fff; }
.cloud-btn.dropbox span { color: #0061ff; }
/* connect modal (login window) */
.cloud-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(20,26,36,.5); backdrop-filter: blur(3px); }
.cloud-card { position: relative; width: min(420px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px 26px 24px; text-align: center; }
.cloud-x { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.cloud-x:hover { color: var(--text); }
.cloud-logo { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; color: #fff; }
.cloud-logo.gdrive { background: linear-gradient(135deg, #1f8fff, #0fb5a5); }
.cloud-logo.dropbox { background: linear-gradient(135deg, #0061ff, #1f8fff); }
.cloud-card h3 { margin: 0 0 4px; font-size: 20px; }
.cloud-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.cloud-login { width: 100%; }
.cloud-err { min-height: 18px; margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.cloud-setup { margin-top: 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; background: var(--surface-2); }
.cloud-setup summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 0; }
.cloud-setup .fld { margin: 10px 0; }
.cloud-hint { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.5; }

.file-list { max-width: 720px; margin: 20px auto 0; display: grid; gap: 10px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.file-row .fi { width: 34px; height: 34px; border-radius: 8px; background: #fdecec; color: var(--brand); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.file-row .fname { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsize { color: var(--muted); font-size: 12px; margin-left: auto; flex: none; }
.file-row .fx { flex: none; cursor: pointer; color: var(--muted); border: none; background: none; font-size: 18px; line-height: 1; }
.file-row .fx:hover { color: var(--brand); }
.tool-actions { max-width: 720px; margin: 22px auto 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.result-box {
  max-width: 720px; margin: 22px auto 0; text-align: center;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 30px;
}
.result-box.ok { border-color: #bfe8d0; background: #f2fcf6; }
.status { max-width: 720px; margin: 14px auto 0; text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.notice-inline {
  max-width: 720px; margin: 16px auto 0; display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid #ffe0a3; background: #fff8ea; border-radius: 12px; padding: 12px 16px;
  font-size: 13px; color: #7a5a12;
}
.billing-preview {
  max-width: 720px; margin: 16px auto 0; display: grid; grid-template-columns: 1fr 180px; gap: 16px;
  border: 1px solid #d8d5ff; background: #f7f6ff; border-radius: 14px; padding: 16px;
  color: var(--text); font-size: 13px;
}
.billing-preview p { margin: 6px 0 0; color: var(--muted); }
.billing-meter {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 12px; display: grid; gap: 3px; align-content: center;
}
.billing-meter span, .billing-meter small { color: var(--muted); font-size: 11px; }
.billing-meter strong { font-size: 22px; }

/* ---------- File preview ---------- */
.preview-host { max-width: 720px; margin: 20px auto 0; }
.preview-head { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 12px; }
.preview-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.preview-cell {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px;
}
.preview-cell img, .preview-cell canvas {
  width: 100%; height: 150px; object-fit: contain;
  border-radius: 8px; background: var(--surface-2);
}
.pv-name { display: block; margin-top: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-loading, .pv-file { height: 150px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 13px; }
.pv-badge { position: absolute; top: 14px; right: 14px; background: rgba(20,26,36,.72); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.preview-cell.clickable { cursor: pointer; transition: transform .1s ease, box-shadow .2s ease, border-color .2s ease; }
.preview-cell.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pv-open { position: absolute; top: 14px; left: 14px; background: rgba(20,26,36,.72); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; opacity: 0; transition: opacity .15s ease; }
.preview-cell.clickable:hover .pv-open { opacity: 1; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); margin: 46px 0; }
.step { text-align: center; }
.step .n { width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step h4 { margin: 0 0 6px; font-size: 15.5px; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- App showcase ---------- */
.app-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 30px; }
.app-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .2s ease;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-card .app-top { display: flex; gap: 14px; align-items: center; padding: 20px; }
.app-card .app-icon { width: 62px; height: 62px; border-radius: 15px; flex: none; display: grid; place-items: center; }
.app-card .app-icon .logo { width: 62px; height: 62px; border-radius: 15px; font-size: 28px; }
.app-card h3 { margin: 0 0 3px; font-size: 17px; }
.app-card .app-cat { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.app-card .app-body { padding: 0 20px 18px; }
.app-card .app-body p { margin: 0; color: var(--muted); font-size: 13.5px; }
.app-card .app-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.app-card .app-foot a { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.app-card .app-foot a:hover { color: var(--text); border-color: var(--line-strong); }
.app-card .app-foot a.store { background: var(--text); color: #fff; border-color: var(--text); margin-left: auto; }

/* ---------- Ad slots (収益: 広告枠プレースホルダ) ---------- */
.ad-slot {
  margin: 34px auto;
  max-width: 728px;
  min-height: 90px;
  display: grid; place-items: center;
  border: 1px dashed var(--line-strong); border-radius: 12px;
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px);
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.ad-slot::before { content: "広告 / Sponsored"; opacity: .55; }
.ad-slot.rect { max-width: 336px; min-height: 280px; }

/* ---------- Forms (audio / ocr / signup) ---------- */
.tts-panel, .form-card {
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
  box-shadow: var(--shadow-sm); padding: 24px;
}
.fld { display: block; margin-bottom: 16px; }
.fld > span { display: block; font-size: 13px; font-weight: 750; margin-bottom: 7px; }
.fld textarea, .fld input, .fld select {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); resize: vertical;
}
.fld textarea:focus, .fld input:focus, .fld select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(229,50,45,.12); }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chk { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin: 4px 0 16px; cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--brand); }
.adv { margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; background: var(--surface-2); }
.adv summary { cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 0; color: var(--muted); }
.adv .hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
@media (max-width: 560px) { .fld-grid { grid-template-columns: 1fr; } }

/* ---------- PDF AI アシスタント（チャット） ---------- */
.pdf-ask-panel {
  max-width: 720px; margin: 20px auto 0;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.pdf-ask-meta {
  padding: 12px 16px; font-size: 13px; font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.pdf-ask-chat {
  min-height: 200px; max-height: 420px; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.pdf-ask-msg { font-size: 14px; line-height: 1.55; }
.pdf-ask-msg.user { align-self: flex-end; max-width: 88%; }
.pdf-ask-msg.user .pdf-ask-body {
  background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
}
.pdf-ask-msg.assistant { align-self: flex-start; max-width: 92%; }
.pdf-ask-msg.assistant .pdf-ask-body {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
}
.pdf-ask-msg.system .pdf-ask-body { color: var(--brand); font-size: 13px; }
.pdf-ask-role { font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.pdf-ask-form {
  display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line);
  background: var(--surface-2); align-items: flex-end;
}
.pdf-ask-form textarea {
  flex: 1; resize: vertical; min-height: 44px; max-height: 120px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px;
}
.pdf-ask-form .btn { flex-shrink: 0; }
.pdf-ask-adv { max-width: 720px; margin: 14px auto 0; }
@media (max-width: 560px) {
  .billing-preview { grid-template-columns: 1fr; }
  .pdf-ask-form { flex-direction: column; }
  .pdf-ask-form .btn { width: 100%; }
}

/* ---------- Auth (signup / login) ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 960px; margin: 40px auto; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--surface); }
.auth-aside { padding: 44px; color: #fff; background: linear-gradient(150deg, var(--brand), #ff7a59 65%, #ff9a3d); }
.auth-aside h2 { margin: 0 0 16px; font-size: 26px; }
.auth-aside ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.auth-aside li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.auth-aside li::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.25); flex: none; font-weight: 900; }
.auth-form { padding: 44px; }
.auth-form h1 { margin: 0 0 4px; font-size: 24px; }
.auth-form .sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; margin-bottom: 10px; }
.social-btn:hover { border-color: var(--muted); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form .btn { width: 100%; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.auth-alt a { color: var(--brand); font-weight: 700; }
.auth-msg { margin-top: 12px; font-size: 13px; text-align: center; min-height: 18px; }
@media (max-width: 760px) { .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- OCR ---------- */
.mode-tabs { display: flex; gap: 8px; justify-content: center; margin: 8px 0 22px; flex-wrap: wrap; }
.mode-tab { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.mode-tab.active { background: var(--brand); color: #fff; border-color: transparent; }
#m-canvas { max-width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; cursor: crosshair; background: var(--surface-2); }
.field-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.field-row .fi { width: 24px; height: 24px; border-radius: 6px; background: #fdecec; color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.field-row b { flex: 1; font-size: 14px; }
.field-row .fx, #m-fields .fx { border: none; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.field-row .fx:hover { color: var(--brand); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.ocr-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.ocr-table th, .ocr-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; white-space: nowrap; }
.ocr-table th { background: var(--surface-2); font-weight: 800; }
.step-block { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 18px; }
.step-block > h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.step-block .snum { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.step-block > p.hint { margin: 2px 0 14px 36px; color: var(--muted); font-size: 13px; }

/* ---------- Legal / prose ---------- */
.prose { max-width: 760px; margin: 0 auto; padding: 20px 0 60px; }
.prose h1 { font-size: clamp(26px, 4vw, 38px); }
.prose h2 { font-size: 20px; margin: 34px 0 10px; }
.prose p, .prose li { color: #3f4b57; }
.prose .updated { color: var(--muted); font-size: 13px; }
.breadcrumb { padding: 22px 0 0; font-size: 13px; color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 60px; }
.footer-inner { display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1fr 1fr; padding: 46px 0 30px; }
.footer-inner .fbrand p { color: var(--muted); font-size: 13.5px; max-width: 260px; }
.footer-col h5 { margin: 0 0 12px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.footer-col a { display: block; padding: 5px 0; font-size: 13.5px; color: var(--text); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legal-bottom-bar { border-top: 1px solid var(--line); padding: 16px 0 20px; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface-2); }
.legal-bottom-bar .btn { font-size: 13px; padding: 8px 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .main-nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
