/* Web fonts: injected in production HTML head (build-pages.mjs). Noto + Montserrat only. */

/* SUGUDASU design tokens — docs/DESIGN_GUIDELINE.md §2–4, §7 */

:root {
  --sg-bg: #f1f5f9;
  --sg-surface: #ffffff;
  --sg-border: #e2e8f0;
  --sg-text: #1e293b;
  --sg-muted: #64748b;
  --sg-primary: #2563eb;
  --sg-primary-hover: #1d4ed8;
  --sg-header: #0f172a;
  --sg-brand-navy: #001f3f;
  --sg-brand-orange: #ff851b;
  /* Logo type — 案B（標準）を正本。A/C は .sg-logo--type-a / --type-c で切替 */
  --sg-logo-gap: 0.32rem;
  --sg-logo-mark-size: 1.9rem;
  --sg-logo-mark-size-lg: 2.15rem;
  --sg-logo-word-weight: 800;
  --sg-logo-word-tracking: 0.04em;
  --sg-logo-word-size: 1.74rem;
  --sg-logo-word-size-lg: 1.96rem;
  --sg-logo-word-size-sm: 1.48rem;
  --sg-logo-word-size-xs: 1.32rem;
  --sg-print-cta: #059669;
  --sg-warning: #d97706;
  --sg-error: #dc2626;
}

/* —— Base —— */
body.sg-body {
  font-family: 'Noto Sans JP', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--sg-bg);
  color: var(--sg-text);
}

.sg-mono,
.mono,
.mono-num {
  font-family: ui-monospace, 'Cascadia Code', 'Roboto Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* —— Components —— */
.sg-card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: 0.75rem;
  box-shadow: none;
}

.sg-input {
  width: 100%;
  border: 1px solid var(--sg-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: #fff;
}
.sg-input:focus {
  outline: none;
  border-color: var(--sg-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

/* EFO — 必須未入力（§3.4） */
.sg-input.sg-field--error,
textarea.sg-input.sg-field--error {
  border-color: #dc2626;
  background-color: #fef2f2;
  box-shadow: 0 0 0 3px rgb(220 38 38 / 0.12);
}
.sg-input.sg-field--error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgb(220 38 38 / 0.2);
}
.sg-field-error-msg {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  color: #dc2626;
}

.sg-btn-primary {
  background: var(--sg-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
}
.sg-btn-primary:hover { background: var(--sg-primary-hover); }
.sg-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
  transition: transform 100ms ease;
}

.sg-btn-print {
  background: #059669;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
}
.sg-btn-print:hover { background: #10b981; }

.sg-btn-secondary {
  background: #fff;
  border: 1px solid var(--sg-border);
  color: var(--sg-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.sg-btn-secondary:hover { background: #f8fafc; }
.sg-btn-secondary:active:not(:disabled) {
  transform: scale(0.98);
  transition: transform 100ms ease;
}

/* —— Mode segment (sg-segment) — DESIGN_GUIDELINE §3.3 —— */
.sg-segment {
  position: relative;
  display: grid;
  gap: 0;
  padding: 0.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--sg-border);
  background: #f8fafc;
  box-shadow: none;
}

.sg-segment--cols-2 { grid-template-columns: repeat(2, 1fr); }
.sg-segment--cols-3 { grid-template-columns: repeat(3, 1fr); }

.sg-segment__pill {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: 0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  border: 1px solid rgb(15 23 42 / 0.06);
  transition:
    transform 120ms cubic-bezier(0.2, 0, 0, 1),
    width 120ms cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
}

.sg-segment__btn {
  position: relative;
  z-index: 1;
  padding: 0.5rem 0.35rem;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  border-radius: 0.5rem;
  transition: color 120ms ease;
}

a.sg-segment__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.sg-segment__btn:hover { color: #1e293b; }

.sg-segment__btn[aria-selected='true'] {
  font-weight: 700;
}

.sg-segment__btn[aria-current='page'] {
  font-weight: 700;
}

.sg-segment--mode-estimate .sg-segment__btn[aria-selected='true'] { color: #0f172a; }
.sg-segment--mode-delivery .sg-segment__btn[aria-selected='true'] { color: #334155; }
.sg-segment--mode-invoice .sg-segment__btn[aria-selected='true'],
.sg-segment--mode-invoice .sg-segment__btn[aria-current='page'] { color: #1e40af; }
.sg-segment--mode-single .sg-segment__btn[aria-selected='true'] { color: #0f172a; }
.sg-segment--mode-multi .sg-segment__btn[aria-selected='true'] { color: #1e40af; }
.sg-segment--mode-coeff .sg-segment__btn[aria-selected='true'] { color: #0f172a; }
.sg-segment--mode-fixed .sg-segment__btn[aria-selected='true'] { color: #1e40af; }
.sg-segment--mode-local .sg-segment__btn[aria-selected='true'] { color: #0f172a; }
.sg-segment--mode-gemini .sg-segment__btn[aria-selected='true'] { color: #1e40af; }
.sg-segment--mode-ec .sg-segment__btn[aria-selected='true'] { color: #0f766e; }
.sg-segment--mode-csv .sg-segment__btn[aria-selected='true'] { color: #1e40af; }
.sg-segment--mode-fw .sg-segment__btn[aria-selected='true'] { color: #6d28d9; }
.sg-segment--mode-label .sg-segment__btn[aria-selected='true'] { color: #0f172a; }
.sg-segment--mode-card .sg-segment__btn[aria-selected='true'] { color: #1e40af; }

.sg-segment__btn[aria-selected='true']::after,
.sg-segment__btn[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.4;
}

.sg-segment__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(37 99 235 / 0.35);
}

.sg-segment-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 11px;
  line-height: 1.55;
  text-wrap: pretty;
  padding: 0.625rem 0.75rem 0.625rem 2rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  position: relative;
  transition: opacity 150ms ease;
}

.sg-segment-hint::before {
  content: 'ℹ';
  position: absolute;
  left: 0.625rem;
  top: 0.625rem;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.sg-segment-hint strong {
  color: #334155;
  font-weight: 600;
}

.sg-segment-hint.is-fading { opacity: 0; }

/* Notion Like PoC — DESIGN_NOTION_SUGUDASU_ADAPT.md §7 */
.sg-notion-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}

.sg-segment--notion-soft {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
}

.sg-segment--notion-soft .sg-segment__pill {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  transition-duration: 120ms;
}

.sg-segment--notion-soft .sg-segment__btn[aria-selected='true']::after {
  opacity: 0.55;
}

/* sg-notion-callout — alias; 正本は .sg-segment-hint */

.sg-notion-faq-section .sg-notion-faq-title,
.sg-notion-faq-section .sg-faq-title {
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
}

.sg-notion-faq-lead {
  text-align: left;
}

.sg-notion-faq-list {
  gap: 0;
  border-top: 1px solid #e2e8f0;
}

.sg-notion-toggle {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.875rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.sg-notion-toggle__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

details.sg-notion-toggle summary::-webkit-details-marker {
  display: none;
}

.sg-notion-toggle__summary::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent #94a3b8;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

details.sg-notion-toggle[open] .sg-notion-toggle__summary::before {
  transform: rotate(90deg);
}

.sg-notion-toggle__body {
  margin-top: 0.5rem;
  padding-left: 1rem;
  padding-bottom: 0.25rem;
}

.sg-notion-btn-press:active:not(:disabled) {
  transform: scale(0.98);
  transition: transform 100ms ease;
}

/* Hub（/）— Notion Like ツール目次 · DESIGN_NOTION_SUGUDASU_ADAPT §7-1 */
.sg-hub-hero {
  text-align: left;
}
.sg-hub-trust {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--sg-border);
  border-radius: 0.5rem;
  background: #f8fafc;
}
.sg-hub-callout--warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.sg-hub-card {
  display: block;
  text-decoration: none;
  transition: border-color 150ms ease;
}
.sg-hub-card:hover {
  border-color: #93c5fd;
}
.sg-hub-card__eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.sg-hub-card__title {
  font-weight: 700;
  color: #0f172a;
}
.sg-hub-card__meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 0.5rem;
}

.sg-tool-lead {
  max-width: 42rem;
  text-wrap: pretty;
}

/* —— Info pages: updates · statements · legal —— DESIGN_GUIDELINE_INFO_PAGES.md */
.sg-info-page {
  --sg-info-max-width: 48rem;
  flex: 1;
  width: 100%;
  max-width: var(--sg-info-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1rem;
}
@media (min-width: 640px) {
  .sg-info-page { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .sg-info-page { padding-left: 2rem; padding-right: 2rem; }
}

.sg-info-page__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.sg-info-page__subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
}
.sg-info-page__lead {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #475569;
}

.sg-info-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}
.sg-info-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}
.sg-info-caption {
  font-size: 0.6875rem;
  line-height: 1.5;
  color: #64748b;
}
.sg-info-callout {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: #334155;
}
.sg-info-callout > p:first-child {
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.sg-info-prose {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #334155;
}
.sg-info-prose h1.sg-info-page__title { margin: 0; }
.sg-info-prose h2.sg-info-section-title { margin: 0; }
.sg-info-prose h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}
.sg-info-prose h3.sg-info-subsection-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #5b21b6;
}
.sg-info-prose p { margin: 0; }
.sg-info-prose p + p { margin-top: 0.75rem; }
.sg-info-prose ul,
.sg-info-prose ol {
  margin: 0;
  padding-left: 1.25rem;
}
.sg-info-prose ul { list-style-type: disc; }
.sg-info-prose li + li { margin-top: 0.25rem; }
.sg-info-prose a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}
.sg-info-prose a:hover { text-decoration: underline; }
.sg-info-prose strong { font-weight: 700; color: #0f172a; }
.sg-info-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #475569;
}
.sg-info-prose table th {
  font-weight: 700;
  color: #1e293b;
  text-align: left;
}
.sg-info-prose table td,
.sg-info-prose table th { padding: 0.5rem 0.75rem 0.5rem 0; vertical-align: top; }
.sg-info-prose footer {
  font-size: 0.75rem;
  color: #475569;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* 書類クラスタ（印鑑 · 請求 · 領収）— ページ遷移用 sg-segment · DESIGN_GUIDELINE §3.3 */
.sg-doc-cluster {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.sg-sns-cluster {
  max-width: 28rem;
}

.sg-preview-fade {
  transition: opacity 200ms ease;
}

.sg-preview-fade.is-updating { opacity: 0.88; }

@media (prefers-reduced-motion: reduce) {
  .sg-segment__pill,
  .sg-segment-hint,
  .sg-preview-fade,
  .sg-segment--notion-soft .sg-segment__pill,
  .sg-notion-toggle__summary::before,
  details.sg-faq > summary::before,
  .sg-notion-btn-press:active,
  .sg-btn-primary:active,
  .sg-btn-secondary:active {
    transition: none;
  }
}

.sg-trust-badge {
  font-size: 11px;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
}

.ad-slot {
  border: 1px dashed var(--sg-border);
  border-radius: 0.75rem;
  background: #f8fafc;
  color: var(--sg-muted);
  font-size: 10px;
  text-align: center;
  padding: 1.5rem;
  margin-top: 1.5rem; /* CTA から最低 24px（AdSense 誤タップ防止） */
}

/* 結果表示の直下に置く広告枠（本番 AdSense 配置の正本） */
.ad-slot--result {
  margin-top: 1.5rem;
  min-height: 90px;
}

/* 入力フォーム内への配置は禁止（誤タップ対策・各 HTML で結果側に ad-slot--result を使う） */
.sg-input-zone .ad-slot {
  display: none;
}

/* Shell 注入前のレイアウトシフト抑止 */
#sg-chrome-top:empty {
  min-height: 6.5rem;
}

/* Brand logo — mark: logo-mark.png · type: Montserrat 800 */
.sg-site-header__brand {
  background: #fff;
  border-bottom: 1px solid var(--sg-border);
}
.sg-site-header__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.sg-site-header__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.sg-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sg-logo-gap);
  flex-shrink: 0;
  text-decoration: none;
  line-height: 1;
}
.sg-logo__mark {
  display: block;
  height: var(--sg-logo-mark-size);
  width: auto;
  max-width: var(--sg-logo-mark-size);
  object-fit: contain;
  flex-shrink: 0;
  transform: translateY(-0.05rem);
}
.sg-logo__word {
  color: var(--sg-brand-navy);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: var(--sg-logo-word-size);
  font-weight: var(--sg-logo-word-weight);
  letter-spacing: var(--sg-logo-word-tracking);
  line-height: 1;
  transform: translateY(0.03rem);
  text-rendering: geometricPrecision;
}
/* 案A — 軽快・ワイド（700 / 0.06em / やや小） */
.sg-logo--type-a {
  --sg-logo-gap: 0.4rem;
  --sg-logo-mark-size: 1.85rem;
  --sg-logo-mark-size-lg: 2.05rem;
  --sg-logo-word-weight: 700;
  --sg-logo-word-tracking: 0.06em;
  --sg-logo-word-size: 1.62rem;
  --sg-logo-word-size-lg: 1.82rem;
  --sg-logo-word-size-sm: 1.42rem;
  --sg-logo-word-size-xs: 1.26rem;
}
/* 案C — コンパクト（800 / タイト / ヘッダー省幅） */
.sg-logo--type-c {
  --sg-logo-gap: 0.28rem;
  --sg-logo-mark-size: 1.78rem;
  --sg-logo-mark-size-lg: 1.98rem;
  --sg-logo-word-weight: 800;
  --sg-logo-word-tracking: 0.015em;
  --sg-logo-word-size: 1.56rem;
  --sg-logo-word-size-lg: 1.74rem;
  --sg-logo-word-size-sm: 1.36rem;
  --sg-logo-word-size-xs: 1.22rem;
}
@media (min-width: 640px) {
  .sg-logo__mark {
    height: var(--sg-logo-mark-size-lg);
    max-width: var(--sg-logo-mark-size-lg);
  }
  .sg-logo__word { font-size: var(--sg-logo-word-size-lg); }
}
@media (max-width: 430px) {
  .sg-logo__word { font-size: var(--sg-logo-word-size-sm); }
}
@media (max-width: 360px) {
  .sg-logo__word { font-size: var(--sg-logo-word-size-xs); }
}
.sg-site-header__pagetitle-wrap {
  min-width: 0;
}
.sg-site-header__pagetitle {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-site-header__pagesub {
  margin: 0.1rem 0 0;
  font-size: 0.625rem;
  line-height: 1.35;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 479px) {
  .sg-site-header__pagetitle-wrap {
    display: none;
  }
}

/* ヘッダーナビ（アイコン + 短ラベル） */
.sg-nav-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
}
.sg-nav-item {
  min-width: 0;
}
.sg-nav-link {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.15rem;
}
.sg-nav-icon {
  font-size: 11px;
  line-height: 1;
}
.sg-nav-label {
  font-size: 10px;
}
@media (min-width: 640px) {
  .sg-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .sg-nav-link {
    width: auto;
    min-height: 0;
    justify-content: flex-start;
  }
  .sg-nav-icon { font-size: 12px; }
  .sg-nav-label { font-size: 11px; }
}

/* FAQ（ツール共通 · Notion toggle — DESIGN_NOTION_SUGUDASU_ADAPT §7） */
.sg-faq-section {
  margin-top: 2rem;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--sg-border);
  background: #fff;
}
.sg-faq-inner {
  max-width: 42rem;
  margin: 0 auto;
}
.sg-faq-title {
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  color: #0f172a;
  margin-bottom: 1.5rem;
}
.sg-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid #e2e8f0;
}
details.sg-faq {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.875rem 0;
  border-bottom: 1px solid #e2e8f0;
}
details.sg-faq summary::-webkit-details-marker { display: none; }
details.sg-faq > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-start;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  list-style: none;
  width: 100%;
}
details.sg-faq > summary::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent #94a3b8;
  flex-shrink: 0;
  transition: transform 200ms ease;
}
details.sg-faq[open] > summary::before {
  transform: rotate(90deg);
}
details.sg-faq[open] summary svg { transform: none; }
details.sg-faq > summary svg { display: none; }
.sg-faq-lead,
.sg-notion-faq-lead {
  text-align: left;
}

body.sg-chrome-focus main {
  padding-bottom: max(5rem, env(safe-area-inset-bottom, 0px));
}

.sync-s1-delete-muted {
  opacity: 0.45;
}

.sync-s1-room-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.sync-s1-room-select {
  flex: 1;
  min-width: 0;
}

.sync-s1-room-del {
  flex-shrink: 0;
  align-self: stretch;
  padding: 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
}

.sync-s1-room-del:hover {
  background: #fef2f2;
}

/* Growth: bookmark banner (§2-5 A4) */
.sg-bookmark-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0.75rem;
  pointer-events: none;
}
.sg-bookmark-banner__inner {
  pointer-events: auto;
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
  border: 1px solid #334155;
}
.sg-bookmark-banner__title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}
.sg-bookmark-banner__body {
  font-size: 0.6875rem;
  line-height: 1.5;
  color: #cbd5e1;
}
.sg-bookmark-banner__hint {
  font-size: 0.625rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}
.sg-bookmark-banner__close {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: #334155;
  color: #f8fafc;
  border: none;
  cursor: pointer;
}
.sg-bookmark-banner__close:hover { background: #475569; }

.sg-btn-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid #1d9bf0;
  background: #fff;
  color: #0f1419;
  cursor: pointer;
  transition: background 0.15s;
}
.sg-btn-x:hover { background: #eff9ff; }

/* —— Changelog (updates.html) —— */
.sg-changelog {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--sg-border);
  margin-left: 0.5rem;
  padding-left: 1.25rem;
}

.sg-changelog-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.sg-changelog-item:last-child {
  padding-bottom: 0;
}

.sg-changelog-item::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 5px);
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sg-primary);
  box-shadow: 0 0 0 3px #fff;
}

.sg-changelog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.sg-changelog-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--sg-muted);
  font-family: ui-monospace, 'Cascadia Code', monospace;
}

.sg-changelog-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.sg-changelog-badge--feature {
  background: #ecfdf5;
  color: #047857;
}

.sg-changelog-badge--fix {
  background: #fef2f2;
  color: #b91c1c;
}

.sg-changelog-badge--improve {
  background: #eff6ff;
  color: #1d4ed8;
}

.sg-changelog-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.sg-changelog-body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--sg-muted);
  margin: 0;
}

.sg-changelog-tools {
  font-size: 11px;
  margin-top: 0.5rem;
  color: var(--sg-muted);
}

.sg-changelog-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  margin-right: 0.35rem;
}

.sg-changelog-when,
.sg-changelog-highlight {
  font-size: 12px;
  line-height: 1.55;
  margin: 0.5rem 0 0;
  color: #334155;
}

.sg-changelog-highlight {
  color: #0f766e;
}

/* —— Receipt (receipt.html) —— */
.rcpt-desc-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--sg-border);
  background: #fff;
  color: var(--sg-text);
  cursor: pointer;
}
.rcpt-desc-chip:hover { background: #f8fafc; border-color: #cbd5e1; }

.rcpt-chat-btn {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}
.rcpt-chat-btn:hover { background: #f8fafc; }

.rcpt-paper {
  padding: 18mm;
}

.rcpt-card {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.6;
}

.rcpt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.rcpt-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  margin: 0;
}

.rcpt-date {
  font-size: 11px;
  color: #475569;
  margin: 0;
}

.rcpt-to {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 0.35rem;
}

.rcpt-sama { font-size: 0.85em; font-weight: 600; }

.rcpt-amount-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.rcpt-amount-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.rcpt-amount {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rcpt-desc,
.rcpt-paid {
  margin: 0.35rem 0;
  font-size: 12px;
}

.rcpt-breakdown {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 11px;
}

.rcpt-breakdown th,
.rcpt-breakdown td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.6rem;
}

.rcpt-breakdown th {
  background: #f8fafc;
  font-weight: 600;
  text-align: left;
  width: 55%;
}

.rcpt-breakdown td { text-align: right; }

.rcpt-breakdown-total th,
.rcpt-breakdown-total td {
  font-weight: 700;
  background: #f1f5f9;
}

.rcpt-footer {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.rcpt-issuer-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rcpt-issuer {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  min-width: 8rem;
  border-bottom: 1px solid #94a3b8;
  padding-bottom: 0.25rem;
}

.rcpt-stamp {
  width: 52px;
  height: 52px;
  border: 3px solid #dc2626;
  border-radius: 50%;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  transform: rotate(-12deg);
  flex-shrink: 0;
  opacity: 0.92;
}

.rcpt-stamp-note {
  font-size: 9px;
  color: #94a3b8;
  margin: 0;
  text-align: right;
}

.rcpt-multi-sheet {
  padding: 10mm 12mm !important;
}

.rcpt-multi-sheet .rcpt-card {
  font-size: 10px;
  padding-bottom: 0;
}

.rcpt-multi-sheet .rcpt-title { font-size: 1.1rem; letter-spacing: 0.25em; }
.rcpt-multi-sheet .rcpt-amount { font-size: 1.25rem; }
.rcpt-multi-sheet .rcpt-card-head { margin-bottom: 0.65rem; }
.rcpt-multi-sheet .rcpt-footer { margin-top: 0.75rem; }
.rcpt-multi-sheet .rcpt-breakdown { margin: 0.65rem 0; }
.rcpt-multi-sheet .rcpt-stamp { width: 40px; height: 40px; font-size: 9px; }

.rcpt-cut {
  border-bottom: 1px dashed #94a3b8;
  margin: 6mm 0;
  height: 0;
}

@media print {
  .rcpt-multi-sheet {
    padding: 8mm 10mm !important;
    min-height: auto !important;
  }

  .rcpt-multi-sheet .rcpt-card {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .rcpt-cut {
    margin: 4mm 0;
  }
}

/* —— A4 paper (screen) —— */
.sg-a4-portrait,
.a4-page {
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
}

.sg-a4-landscape {
  width: 297mm;
  min-height: 210mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
}

/* Invoice (index.html) */
.a4-page {
  padding: 20mm;
}

.preview-container {
  transform-origin: top left;
}

/* Invoice — 明細は縦伸び・プレビューは PC で sticky（入力照合） */
@media (min-width: 1024px) {
  .invoice-preview-section {
    position: sticky;
    top: 7.5rem; /* sg-chrome（白ヘッダー + ナビ）高さ */
    align-self: start;
    overflow: visible;
    z-index: 10;
  }
}

.stamp-box { position: relative; }
.stamp-img {
  mix-blend-mode: multiply;
  pointer-events: none;
}

.sortable-row {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sortable-row.dragging {
  opacity: 0.5;
  background-color: #e2e8f0;
  border-style: dashed;
  border-color: #cbd5e1;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.invoice-detail-spacer-row {
  background-color: #f8fafc;
}

@media print {
  tr.invoice-preview-empty {
    display: none !important;
  }

  .invoice-print-omit {
    display: none !important;
  }

  tr.invoice-preview-empty-placeholder {
    display: none !important;
  }

  tr.invoice-preview-spacer td {
    color: transparent !important;
    border-color: #e2e8f0 !important;
    height: 1.6rem;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
  }

  tr.invoice-preview-spacer .no-print {
    display: none !important;
  }
}

/* Label (label.html) */
.a4-sheet {
  width: 210mm;
  height: 297mm;
  background: #fff;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
  box-sizing: border-box;
  display: grid;
  page-break-after: always;
  break-after: page;
}

.label-cell {
  box-sizing: border-box;
  border: 1px dashed #cbd5e1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#label-spec-select option.spec-highlight {
  background-color: #dbeafe;
  font-weight: bold;
}

.spec-search-hit {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.25);
}

.tooltip-box {
  display: none;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}
.tooltip-box.active { display: block; }

/* Shift (shift.html) */
.watermark-active::before {
  content: "下書き / 調整中";
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 5.5rem;
  font-weight: 900;
  color: rgb(226 232 240 / 0.45);
  z-index: 0;
  pointer-events: none;
  white-space: nowrap;
}

/* SNS (sns.html) */
.deco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.65rem;
}
.deco-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  min-height: 5.5rem;
}
.deco-card--muted { background: #f8fafc; border-color: #e2e8f0; }
.deco-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.deco-card__label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.3;
}
.deco-card__copy {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
}
.deco-card__copy:hover { background: #dbeafe; }
.deco-card__copy--disabled {
  color: #cbd5e1;
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: not-allowed;
}
.deco-card__meta {
  font-size: 9px;
  font-family: ui-monospace, monospace;
  color: #94a3b8;
  margin: 0;
}
.deco-unsupported { min-height: 2rem; font-size: 11px; line-height: 1.4; color: #64748b; }
.deco-hint { line-height: 1.35; }
.deco-sample { word-break: break-all; line-height: 1.45; font-size: 13px; }

/* Unicode 装飾英字 — Noto Sans JP だと Mathematical 記号がハングル誤表示になる */
@font-face {
  font-family: 'SG Unicode Deco';
  src: local('Cambria Math'), local('Segoe UI Symbol'), local('Segoe UI'), local('Arial Unicode MS');
  unicode-range: U+1D400-1D7FF, U+2100-214F;
}
.sg-deco-text,
.deco-result,
.deco-sample,
.fc-font-card__preview,
.sns-preview__display-name,
.sns-preview__x-name,
.sns-preview__bio,
.sns-gallery-card__bio,
.sns-part-chip__text {
  font-family: 'SG Unicode Deco', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  font-variant-ligatures: none;
  font-synthesis: none;
}

/* SNS hub nav — フォント変換 / プロフィール作成 */
.sns-tool-nav {
  display: flex;
  width: 100%;
  max-width: 32rem;
}
.sns-tool-nav .sns-pv-tab--link {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 10px;
  font-weight: 700;
}
.sns-tool-nav .sns-pv-tab--link:hover { color: #0f172a; }
.sns-tool-nav .sns-pv-tab--link.sns-pv-tab--active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.stamp-preview-wrap {
  background-color: #f8fafc;
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.stamp-canvas { max-width: 100%; height: auto; }
.stamp-toast {
  font-size: 0.6875rem;
  line-height: 1.45;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.stamp-toast--ok {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}
.stamp-toast--warn {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.deco-vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.15em;
  min-height: 8rem;
  margin: 0 auto;
}

/* SNS preview mock */
.sns-pv-tab {
  font-size: 10px;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  color: #64748b;
}
.sns-pv-tab--active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.sns-preview {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
}
.sns-preview--insta { padding: 1rem; }
.sns-preview__insta-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.sns-preview__avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f472b6, #fb923c, #a78bfa);
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.sns-preview__insta-meta { min-width: 0; }
.sns-preview__handle {
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, monospace;
}
.sns-preview__display-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}
.sns-preview__bio {
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0;
  background: transparent;
  border: 0;
}
.sns-preview--x { background: #000; color: #e7e9ea; }
.sns-preview__x-banner {
  height: 4.5rem;
  background: linear-gradient(90deg, #1e293b, #334155);
}
.sns-preview__x-body {
  padding: 0 1rem 1rem;
  margin-top: -1.75rem;
  position: relative;
}
.sns-preview__avatar--x {
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.5rem;
  border: 4px solid #000;
}
.sns-preview__x-name {
  font-size: 15px;
  font-weight: 800;
  word-break: break-all;
}
.sns-preview--x .sns-preview__handle { color: #71767b; }
.sns-preview__bio--x { color: #e7e9ea; margin-top: 0.5rem; }

/* SNS sections (gallery / parts) */
.sns-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.sns-section__head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}
.sns-section__title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem;
}
.sns-section__lead {
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
  margin: 0;
}

/* Profile template gallery */
.sns-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.sns-gallery-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 42%);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.sns-gallery-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.sns-gallery-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.5rem;
}
.sns-gallery-card__identity {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}
.sns-gallery-card__icon {
  font-size: 1.15rem;
  line-height: 1;
  margin-top: 0.1rem;
}
.sns-gallery-card__titles { min-width: 0; }
.sns-gallery-card__title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.35;
}
.sns-gallery-card__tag {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 9px;
  font-weight: 600;
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid #ede9fe;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}
.sns-gallery-card__status {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  font-family: ui-monospace, monospace;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.2rem 0.45rem;
  margin: 0;
  white-space: nowrap;
}
.sns-gallery-card__status--warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.sns-gallery-card__status--over { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.sns-gallery-card__bio-frame {
  margin: 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  min-height: 5.5rem;
}
.sns-gallery-card__bio {
  font-size: 11px;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: inherit;
}
.sns-gallery-card__foot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem 0.75rem;
  margin-top: auto;
}
.sns-copy-btn {
  font-size: 11px;
  font-weight: 700;
  border-radius: 0.5rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease;
}
.sns-copy-btn--primary {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}
.sns-copy-btn--primary:hover { background: #1d4ed8; }
.sns-copy-btn--ghost {
  color: #64748b;
  background: transparent;
  border-color: #e2e8f0;
}
.sns-copy-btn--ghost:hover { background: #f8fafc; color: #334155; }

/* Decoration parts — chip layout */
.sns-parts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sns-parts-group__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 0.45rem;
}
.sns-parts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.sns-part-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  max-width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}
.sns-part-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.sns-part-chip--copied {
  border-color: #86efac;
  background: #ecfdf5;
}
.sns-part-chip__label {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
}
.sns-part-chip__text {
  font-size: 11px;
  line-height: 1.35;
  color: #0f172a;
  word-break: break-all;
}

.sns-char-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.sns-char-bar--compact { font-size: 10px; }
.sns-cc {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.15rem 0.5rem;
}
.sns-cc--warn { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.sns-cc--over { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.sns-char-remainder {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}
.sns-char-remainder--over { color: #b91c1c; }

/* font-converter (font-converter.html) */
.fc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 1024px) {
  .fc-layout {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    align-items: start;
  }
  .fc-sticky-panel {
    position: sticky;
    top: 1rem;
  }
}
.fc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.fc-filter-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.fc-filter-btn--active {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.fc-mini-symbols {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.fc-mini-symbol {
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.fc-sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.fc-sample-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fc-sample-chip:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.fc-mini-symbol:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.fc-font-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}
.fc-font-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #fff;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.fc-font-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.fc-font-card--featured {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 55%);
}
.fc-font-card__info {
  min-width: 0;
  flex: 1;
}
.fc-font-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.fc-font-card__label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  line-height: 1.35;
}
.fc-font-card__pill {
  font-size: 9px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}
.fc-font-card__preview {
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
  word-break: break-all;
}
.fc-font-card__copy {
  flex-shrink: 0;
  align-self: center;
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.fc-font-card__copy:hover { background: #dbeafe; }
.fc-symbol-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
}
.fc-symbol-section summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}
.fc-symbol-section summary::-webkit-details-marker { display: none; }
.fc-symbol-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}
.fc-symbol-chip {
  min-width: 2rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 0.25rem 0.4rem;
  border-radius: 0.45rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
}
.fc-symbol-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.fc-symbol-chip--copied {
  border-color: #86efac;
  background: #ecfdf5;
}
.fc-hiragana-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.fc-hiragana-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.fc-hiragana-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 3.25rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.fc-hiragana-cell:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.fc-hiragana-cell--copied {
  border-color: #86efac;
  background: #ecfdf5;
}
.fc-hiragana-cell__kana {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.fc-hiragana-cell__decor {
  font-size: 14px;
  line-height: 1.2;
  color: #0f172a;
  word-break: break-all;
}

/* —— Print (shared) —— */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  @page landscape {
    size: A4 landscape;
    margin: 5mm;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    min-height: 0 !important;
    height: auto !important;
  }

  body.sg-body,
  main {
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .print-target,
  .preview-section {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .preview-scaler,
  .preview-wrapper {
    transform: none !important;
    scale: 1 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-container {
    transform: scale(1) !important;
    transform-origin: top left !important;
  }

  .print-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .sg-a4-portrait,
  .sg-a4-landscape,
  .a4-page {
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: avoid;
    break-after: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* ラベル複数枚のみ枚間改ページ */
  .a4-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: always;
    break-after: page;
  }

  .a4-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .a4-page {
    padding: 15mm !important;
    width: 210mm !important;
    min-height: auto !important;
    max-height: 297mm;
  }

  #pdf-paper.a4-page,
  #receipt-paper.a4-page {
    min-height: 297mm !important;
  }

  .label-cell {
    border: none !important;
  }

  /* Shift landscape */
  body.sg-print-landscape {
    font-size: 9px;
  }

  body.sg-print-landscape .sg-shift-sheet {
    page: landscape;
  }

  body.sg-print-landscape .print-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.sg-print-landscape .page-break {
    page-break-before: always;
    break-before: page;
    margin-top: 20px;
  }

  body.sg-print-landscape .card-shadow-none {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* --- Tool dev stage badges (alpha / beta / gamma) --- */
.sg-dev-stage {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  vertical-align: middle;
}
.sg-dev-stage--alpha {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}
.sg-dev-stage--beta {
  color: #5b21b6;
  background: #ede9fe;
  border-color: #c4b5fd;
}
.sg-dev-stage--gamma {
  color: #0f766e;
  background: #ccfbf1;
  border-color: #5eead4;
}
.sg-dev-stage--stable {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.sg-dev-badge-bar {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.35rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.sg-dev-badge-note {
  font-size: 10px;
  line-height: 1.4;
  color: #64748b;
}

/* —— normalize · copy feedback (T03) → 全ツール sg-copy 契約 —— */
.sg-line-match--ok,
.norm-line-match--ok {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
}
.sg-line-match--warn,
.norm-line-match--bad {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}
.sg-copy-gate {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #78350f;
}
.sg-copy-toast:empty {
  display: none;
}
.norm-preview:empty::before {
  content: '（未変換）';
  color: #94a3b8;
}
body.sg-copy-flash {
  animation: sg-copy-flash 320ms ease-out;
}
@keyframes sg-copy-flash {
  0% { background-color: #ecfdf5; }
  100% { background-color: transparent; }
}
.sg-copy-btn--done {
  background: #059669 !important;
  border-color: #059669 !important;
}

/* —— Copy-first 免責 · TSV/JSON（statements #copy-first-tech と同期）—— */
.sg-copy-disclosure {
  border: 1px solid var(--sg-border, #e2e8f0);
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.65rem 0.85rem;
}
.sg-copy-disclosure summary:hover {
  color: #0f172a;
}

/* —— statements · 通信レイヤ · DevTools 手順 —— */
.sg-layer-table tbody th[scope='row'] {
  white-space: nowrap;
}
.sg-steps li::marker {
  font-weight: 700;
  color: #334155;
}
.sg-kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
}
.sg-note {
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

/* —— statements · サマリー · 目次 · 図解キット —— */
.sg-statements-summary {
  border: 1px solid var(--sg-border);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  padding: 1rem 1.1rem;
}
.sg-statements-summary__lead {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #334155;
}
.sg-statements-summary__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}
.sg-statements-pill {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid transparent;
}
.sg-statements-pill--local {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.sg-statements-pill--neutral {
  color: #334155;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.sg-statements-toc {
  border: 1px solid var(--sg-border);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.85rem 1rem;
}
.sg-statements-toc__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
  margin-bottom: 0.5rem;
}
.sg-statements-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}
@media (min-width: 480px) {
  .sg-statements-toc ul {
    grid-template-columns: 1fr 1fr;
  }
}
.sg-statements-toc a {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sg-primary);
  text-decoration: none;
  padding: 0.15rem 0;
}
.sg-statements-toc a:hover {
  text-decoration: underline;
  color: var(--sg-primary-hover);
}
.sg-diagram-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 28rem;
  margin: 0 auto;
}
.sg-diagram-stack__layer {
  border: 1px solid var(--sg-border);
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.45rem 0.65rem;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--sg-muted);
}
.sg-diagram-stack__layer strong {
  color: #334155;
  font-weight: 700;
}
.sg-diagram-stack__layer--remote {
  background: #fff;
}
.sg-diagram-stack__device {
  border: 2px solid var(--sg-primary);
  border-radius: 0.65rem;
  background: #eff6ff;
  padding: 0.55rem 0.65rem 0.65rem;
}
.sg-diagram-stack__device-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.35rem;
}
.sg-diagram-stack__layer--local {
  border-color: #93c5fd;
  background: #fff;
  color: #1e3a8a;
}
.sg-diagram-stack__layer--local strong {
  color: #1e40af;
}
.sg-diagram-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  max-width: 36rem;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .sg-diagram-flow {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }
}
.sg-diagram-flow__step {
  flex: 1 1 0;
  border: 1px solid var(--sg-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.55rem 0.65rem;
  text-align: center;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--sg-text);
}
.sg-diagram-flow__step strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}
.sg-diagram-flow__step--core {
  border-color: #93c5fd;
  background: #eff6ff;
}
.sg-diagram-flow__arrow {
  flex: 0 0 auto;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
}
@media (min-width: 640px) {
  .sg-diagram-flow__arrow {
    padding: 0 0.15rem;
  }
}

/* —— fair-draw · テスト/本番モード —— */
.fd-mode-banner {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid transparent;
}
.fd-mode-banner--idle {
  color: #475569;
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}
.fd-mode-banner--test {
  color: #475569;
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}
/* —— fair-draw · 当選ヒーロー —— */
.fd-winner-hero--solo {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.fd-winner-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}
.fd-winner-chip--large {
  padding: 0.875rem 1.25rem;
}
.fd-winner-rank {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
}
.fd-winner-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.3;
}
.fd-winner-chip--large .fd-winner-name {
  font-size: 1.375rem;
}

/* fair-draw · 賞帯行（sg-input width:100% が flex で潰れるのを防ぐ） */
.band-row .sg-input--band {
  width: 100%;
  min-width: 5.5rem;
}
.band-row .band-count {
  width: 100%;
  min-width: 0;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.fd-ops-preview {
  tab-size: 4;
  white-space: pre;
  overflow-x: auto;
}

.fd-mode-banner--live {
  color: #475569;
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

/* group-split — M02 Resilience · タップ除外チップ */
.gs-member-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.gs-member-chip:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.gs-member-chip:active {
  transform: scale(0.98);
}
@media (max-width: 640px) {
  .gs-member-chip {
    min-height: 2.75rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
  }
}
