:root {
  --bg: #f4f7fb;
  --bg-2: #eef4fb;
  --surface: rgba(255, 255, 255, 0.9);
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: #fbfdff;
  --panel-muted: #f7faff;
  --text: #243243;
  --text-strong: #0f1f33;
  --muted: #627188;
  --line: #d6e0ec;
  --line-strong: #bfccdd;
  --brand: #1d5f9a;
  --brand-strong: #154e82;
  --brand-soft: #eaf4ff;
  --brand-soft-2: #f3f8ff;
  --accent: #f47b3c;
  --accent-soft: #fff4ea;
  --success: #1e8b62;
  --success-soft: #ecfbf4;
  --warning: #af7a1c;
  --warning-soft: #fff7e6;
  --danger: #c24263;
  --danger-soft: #fff2f6;
  --shadow-soft: none;
  --shadow-card: none;
  --shadow-hero: none;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Meiryo, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.mobile-menu-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: 48px;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid rgba(15, 31, 51, 0.06);
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0 10px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-mark svg,
.brand-mark img {
  display: block;
  width: 48px;
  height: 48px;
  filter: none;
}

.brand-mark img {
  border-radius: 12px;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.brand-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--brand);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
  max-width: min(44vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.mobile-menu-button {
  appearance: none;
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(29, 95, 154, 0.16);
  border-radius: 16px;
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 8px 22px rgba(15, 31, 51, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.mobile-menu-button:active {
  transform: scale(0.96);
}

.mobile-menu-button.is-open {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.mobile-menu-line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.mobile-menu-button.is-open .mobile-menu-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-button.is-open .mobile-menu-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-button.is-open .mobile-menu-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.mobile-menu-panel[hidden] {
  display: none;
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  border: 0;
  background: rgba(15, 31, 51, 0.28);
  backdrop-filter: blur(6px);
}

.mobile-menu-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-width: 100%;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 14px;
  margin: 64px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 -1px 0 rgba(15, 31, 51, 0.06), 0 12px 32px rgba(15, 31, 51, 0.08);
}

.mobile-menu-shell::before {
  content: none;
}

.mobile-menu-title,
.mobile-menu-section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mobile-menu-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.mobile-menu-link {
  appearance: none;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 54px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(29, 95, 154, 0.12);
  border-radius: 18px;
  background: var(--panel-muted);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  line-height: 1.35;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.mobile-menu-link:active {
  transform: scale(0.985);
}

.mobile-menu-link span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-menu-link-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 95, 154, 0.12);
  border-radius: 13px;
  background: #fff;
  color: var(--brand);
}

.mobile-menu-link-icon svg {
  width: 21px;
  height: 21px;
}

.mobile-menu-link.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.mobile-menu-link.is-active .mobile-menu-link-icon {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.mobile-menu-tools,
.mobile-menu-section,
.mobile-locale-picker {
  display: grid;
  gap: 8px;
}

.mobile-menu-tools {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 31, 51, 0.08);
}

.mobile-menu-section,
.mobile-locale-picker {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(29, 95, 154, 0.1);
  border-radius: 18px;
  background: #f8fbff;
}

.mobile-locale-picker .locale-select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-radius: 14px;
  background: #fff;
}

@media (min-width: 721px) {
  .mobile-menu-panel {
    display: none;
  }
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.auth-user-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-user-label.is-loading {
  color: var(--muted);
}

.auth-user-label.is-error {
  color: var(--danger);
}

.locale-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: none;
}

.locale-picker-label,
.kicker,
.section-badge,
.meta-label,
.meta-chip-label,
.preview-summary-label,
.trust-card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.locale-picker-label,
.kicker,
.meta-label,
.meta-chip-label,
.preview-summary-label,
.trust-card-title {
  color: var(--brand);
}

.locale-select,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
}

.locale-select {
  min-width: 164px;
  padding: 8px 12px;
  font-weight: 700;
}

.nav {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: none;
}

.nav-desktop {
  flex-shrink: 0;
}

.nav-link,
.bottom-nav-link,
.source-toggle,
.text-link-button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-link,
.bottom-nav-link {
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active,
.bottom-nav-link.is-active {
  background: #fff;
  color: var(--brand-strong);
  border-color: rgba(29, 95, 154, 0.12);
}

.main-shell {
  padding: 22px 0 0;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.screen[data-screen="home"].is-active {
  display: flex;
  flex-direction: column;
}

.main-grid-home {
  order: 1;
}

.hero-home {
  order: 2;
  margin-top: 18px;
}

.support-grid-home {
  order: 3;
}

.hero {
  display: grid;
  gap: 18px;
  margin: 10px 0 24px;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy-inner {
  display: grid;
  gap: 14px;
}

.hero h1,
.hero-subpage h1 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0;
  color: var(--text-strong);
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 600;
  line-height: 1.5;
  color: #334155;
}

.hero p,
.hero-micro,
.preview-step p,
.preview-summary p,
.muted,
.field-caption,
.plan-caption,
.list-card-sub,
.echo-inline-cta,
.footer-note {
  color: var(--muted);
}

.hero-micro,
.preview-step p,
.preview-summary p,
.support-note p,
.feature-list,
.list-card-sub,
.footer-note {
  font-size: 14px;
  line-height: 1.6;
}

.hero-action-row,
.hero-utility-row,
.hero-proof-strip,
.inline-buttons,
.doc-example-row,
.badge-group,
.button-row,
.list-card-meta,
.status-row,
.modal-actions,
.echo-inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-action-row {
  margin-top: 2px;
}

.hero-utility-row {
  gap: 6px;
}

.hero-proof-strip {
  gap: 8px;
}

.proof-pill,
.doc-example-pill,
.helper-pill,
.inline-code,
.meta-chip,
.preview-note,
.plan-highlight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(29, 95, 154, 0.1);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
}

.proof-pill {
  background: rgba(255, 255, 255, 0.82);
}

.proof-pill-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: var(--brand);
}

.proof-pill-icon svg {
  width: 18px;
  height: 18px;
}

.card,
.trust-card,
.list-card,
.plan-option,
.stat-card,
.support-note,
.info-card {
  border: 1px solid rgba(17, 33, 56, 0.06);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
}

.card {
  padding: 20px;
}

.card-hero {
  padding: clamp(22px, 3vw, 30px);
  background: var(--panel);
  box-shadow: none;
}

.card-preview {
  padding: 20px;
  background: var(--brand-soft-2);
}

.card-soft,
.info-card {
  background: var(--panel);
}

.card-subpage {
  padding: 22px;
  background: var(--panel);
}

.preview-topline,
.card-head,
.capture-preview-head,
.input-pane-head,
.list-card-head,
.subpage-hero-shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card-head h2,
.card-head h3,
.hero-subpage p,
.card-head p,
.preview-summary-label,
.support-note strong,
.list-card strong {
  margin: 0;
}

.card-head h2 {
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-strong);
}

.card-head h3 {
  font-size: 17px;
  line-height: 1.35;
  color: var(--text-strong);
}

.card-head.compact {
  margin-bottom: 12px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  white-space: nowrap;
  word-break: keep-all;
}

.section-badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.preview-stack,
.camera-stage,
.input-shell,
.input-pane,
.list-panel,
.inline-stack,
.details-stack,
.modal-body {
  display: grid;
  gap: 8px;
}

.preview-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(17, 33, 56, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.preview-step.is-accent {
  background: #ffffff;
  border-color: rgba(29, 95, 154, 0.14);
}

.preview-step-number {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.preview-step strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-strong);
}

.preview-summary {
  padding: 14px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(29, 95, 154, 0.08);
}

.main-grid,
.settings-grid,
.plan-card-grid,
.stat-grid,
.support-grid,
.summary-grid,
.details-meta-grid {
  display: grid;
  gap: 16px;
}

.main-grid {
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: start;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.plan-card-grid,
.support-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-card-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid,
.details-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.support-note {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.support-note-soft {
  background: var(--brand-soft-2);
}

.support-note-plain {
  background: #ffffff;
}

.input-shell {
  margin-top: 14px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.workflow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.workflow-item.is-current {
  background: var(--brand-soft-2);
  border-color: rgba(29, 95, 154, 0.18);
}

.workflow-number {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.workflow-copy {
  min-width: 0;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.source-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(29, 95, 154, 0.05);
  border: 1px solid var(--line);
}

.source-toggle {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--brand-strong);
}

.source-toggle.is-active {
  background: #fff;
  border-color: rgba(29, 95, 154, 0.12);
  box-shadow: none;
}

.input-pane {
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.input-pane.is-focused,
.input-pane.is-active {
  border-color: rgba(29, 95, 154, 0.18);
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.center {
  justify-content: center;
}

.two-up > * {
  flex: 1 1 200px;
}

.file-selection-name {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: #fff;
  color: var(--text-strong);
  font-weight: 700;
}

.file-selection-name.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.capture-preview {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(29, 95, 154, 0.14);
  background: #ffffff;
}

.capture-preview-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f6f9fc;
}

.button,
.button-secondary,
.button-primary {
  appearance: none;
  border-radius: 15px;
  min-height: 46px;
  padding: 11px 15px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover,
.button-secondary:hover,
.button-primary:hover {
  transform: none;
}

.button:disabled,
.button-secondary:disabled,
.button-primary:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.button-large {
  min-height: 50px;
  font-size: 14px;
}

.button,
.plan-caption,
.status-badge,
.meta-chip {
  word-break: keep-all;
  text-wrap: pretty;
}

.plan-caption {
  line-height: 1.45;
}

.button-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.button-secondary,
.text-link-button {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--brand-strong);
}

.button-fit-text {
  width: fit-content;
}

.button-compact {
  min-height: 40px;
  padding: 10px 14px;
}

.button-hero,
.button-hero-secondary {
  min-width: min(280px, 100%);
}

.text-link-button {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
}

textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.7;
}

textarea::placeholder {
  color: #95a1b3;
}

.text-meta-row,
.sticky-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sticky-action-row {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  padding: 8px;
  margin: 4px -4px 0;
  border-radius: 18px;
  border: 1px solid rgba(29, 95, 154, 0.12);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.sticky-action-row > * {
  flex: 1 1 0;
}

.sticky-action-row > .button-cancel {
  flex: 0 0 auto;
  min-width: 128px;
  padding-inline: 18px;
}

.status-row {
  align-items: center;
  justify-content: space-between;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  border: 1px solid transparent;
}

.status-neutral {
  background: #eff5fb;
  color: var(--brand-strong);
}

.status-processing {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-attention {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-empty-state,
.result-panel-empty,
.result-panel {
  display: grid;
  gap: 14px;
}

.empty-state-rich,
.empty-note {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px dashed rgba(29, 95, 154, 0.2);
}

.empty-note {
  text-align: center;
  color: var(--muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.action-spotlight {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: var(--brand-soft-2);
  border: 1px solid rgba(29, 95, 154, 0.12);
}

.action-spotlight-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--brand);
}

.action-spotlight-title {
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.22;
  font-weight: 900;
  color: var(--text-strong);
}

.action-spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.summary-card {
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(17, 33, 56, 0.06);
}

.summary-card-attention {
  background: #fff7e8;
  border-color: rgba(175, 122, 28, 0.18);
}

.summary-value,
.stat-value {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-strong);
}

.stat-value-small {
  font-size: clamp(18px, 2.4vw, 24px);
  overflow-wrap: anywhere;
}

.meta-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.summary-card-list,
.list,
.feature-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.details-compact {
  padding: 4px 0 0;
}

.details-summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand-strong);
  list-style: none;
}

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

.details-content {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.meta-item {
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 33, 56, 0.06);
}

.list-panel {
  margin-top: 14px;
}

.list-card {
  padding: 16px;
}

.list-card-head strong {
  color: var(--text-strong);
  line-height: 1.4;
}

.list-card-sub {
  margin-top: 4px;
  font-size: 13px;
}

.list-card-body {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.list-card-meta {
  gap: 8px;
}

.meta-chip {
  min-height: 36px;
  border-radius: 14px;
  padding: 8px 12px;
  background: var(--panel-muted);
}

.stat-card {
  padding: 16px;
}

.plan-option {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.plan-option-top {
  display: grid;
  gap: 8px;
}

.plan-option-free {
  background: #ffffff;
}

.plan-option-premium {
  background: var(--brand-soft-2);
  border-color: rgba(29, 95, 154, 0.16);
}

.top-gap {
  margin-top: 18px;
}

.echo-inline-cta {
  margin-top: 18px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(17, 33, 56, 0.08);
  border-radius: var(--radius-md);
  background: #f7fafc;
}

.echo-inline-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  max-width: 720px;
}

.echo-inline-copy strong {
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.35;
}

.echo-inline-copy span {
  line-height: 1.65;
}

.echo-inline-cta a {
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  white-space: nowrap;
}

.hero-subpage {
  margin-bottom: 18px;
}

.subpage-hero-shell {
  align-items: center;
}

.subpage-hero-shell p {
  margin: 8px 0 0;
  max-width: 760px;
  line-height: 1.7;
}

.global-footer {
  padding: 16px 0 36px;
}

.footer-note {
  text-align: center;
  font-weight: 600;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 20px));
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: none;
  z-index: 60;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 79;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
}

.modal-card {
  width: min(520px, 100%);
  padding: 22px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid rgba(17, 33, 56, 0.08);
  box-shadow: none;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-strong);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

/* Final release polish */
.topbar-inner {
  gap: 13px;
  padding: 11px 0 9px;
}

.topbar-left {
  gap: 14px;
}

.brand {
  gap: 7px;
}

.topbar-actions {
  gap: 6px;
}

.locale-picker {
  padding: 7px 10px;
  border-radius: 15px;
}

.nav {
  gap: 7px;
  padding: 5px;
}

.nav-link,
.bottom-nav-link {
  padding: 8px 13px;
}

.main-shell {
  padding: 20px 0 0;
}

.hero {
  gap: 16px;
  margin: 8px 0 22px;
}

.hero-shell {
  gap: 16px;
}

.hero-copy-inner {
  gap: 13px;
}

.hero h1,
.hero-subpage h1 {
  font-size: clamp(27px, 3.6vw, 40px);
  line-height: 1.08;
}

.hero-subtitle {
  font-size: clamp(15px, 1.45vw, 17px);
}

.hero-micro,
.preview-step p,
.preview-summary p,
.support-note p,
.feature-list,
.list-card-sub,
.footer-note {
  font-size: 13px;
  line-height: 1.58;
}

.hero-action-row,
.hero-utility-row,
.hero-proof-strip,
.inline-buttons,
.doc-example-row,
.badge-group,
.button-row,
.list-card-meta,
.status-row,
.modal-actions,
.echo-inline-cta {
  gap: 7px;
}

.hero-utility-row {
  gap: 5px;
}

.hero-proof-strip {
  gap: 7px;
}

.proof-pill,
.doc-example-pill,
.helper-pill,
.inline-code,
.meta-chip,
.preview-note,
.plan-highlight {
  min-height: 31px;
  padding: 6px 10px;
  font-size: 11px;
}

.card {
  padding: 19px;
}

.card-hero {
  padding: clamp(20px, 2.7vw, 28px);
}

.card-preview {
  padding: 19px;
}

.card-subpage {
  padding: 21px;
}

.card-head h2 {
  font-size: 21px;
}

.card-head h3 {
  font-size: 16px;
}

.section-badge {
  min-height: 27px;
  padding: 5px 8px;
}

.preview-stack,
.camera-stage,
.input-shell,
.input-pane,
.list-panel,
.inline-stack,
.details-stack,
.modal-body {
  gap: 7px;
}

.preview-step {
  grid-template-columns: 38px 1fr;
  gap: 11px;
  padding: 13px;
}

.preview-step-number {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  font-size: 11px;
}

.preview-summary {
  padding: 13px;
}

.main-grid,
.settings-grid,
.plan-card-grid,
.stat-grid,
.support-grid,
.summary-grid,
.details-meta-grid {
  gap: 15px;
}

.support-note {
  padding: 13px 15px;
}

.input-shell {
  margin-top: 12px;
}

.source-switch {
  gap: 5px;
  padding: 4px;
}

.source-toggle {
  min-height: 40px;
  padding: 9px 13px;
  font-size: 13px;
}

.file-selection-name {
  min-height: 52px;
  padding: 13px 15px;
}

.button,
.button-secondary,
.button-primary {
  min-height: 44px;
  padding: 10px 14px;
}

.button-large {
  min-height: 48px;
}

.text-link-button {
  min-height: 34px;
  padding: 7px 11px;
}

.sticky-action-row {
  padding-top: 2px;
}

.status-badge {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}

.result-empty-state,
.result-panel-empty,
.result-panel {
  gap: 12px;
}

.empty-state-rich,
.empty-note {
  gap: 12px;
  padding: 15px;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
}

.empty-state-icon svg {
  width: 22px;
  height: 22px;
}

.action-spotlight {
  gap: 7px;
  padding: 15px;
}

.action-spotlight-title {
  font-size: clamp(19px, 2.2vw, 24px);
}

.list-card {
  padding: 15px;
}

.plan-option {
  padding: 18px;
}

.global-footer {
  padding: 14px 0 34px;
}

.footer-note {
  font-size: 13px;
}

.modal-card {
  padding: 20px;
}

.modal-title {
  font-size: 21px;
}

.modal-actions {
  margin-top: 16px;
}

@media (max-width: 980px) {
  .hero-shell,
  .main-grid,
  .settings-grid,
  .plan-card-grid,
  .plan-card-grid-three,
  .support-grid,
  .summary-grid,
  .details-meta-grid,
  .stat-grid,
  .subpage-hero-shell {
    grid-template-columns: 1fr;
  }

  .subpage-hero-shell {
    display: grid;
  }

  .hero-copy,
  .hero-preview {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding-bottom: 32px;
  }

  .topbar-inner {
    gap: 10px;
  }

  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .topbar-left {
    display: flex;
    min-width: 0;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .topbar-actions > .auth-controls,
  .topbar-actions > .locale-picker {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .auth-controls-mobile {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    min-width: 0;
  }

  .auth-controls-mobile .auth-user-label {
    max-width: none;
    min-width: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .auth-controls-mobile .button {
    width: 100%;
  }

  .locale-select {
    min-width: 104px;
  }

  .workflow-strip {
    grid-template-columns: 1fr;
  }

  .sticky-action-row {
    bottom: 16px;
  }

  .nav {
    display: none;
  }

  .main-shell {
    padding-top: 16px;
  }

  .card,
  .card-hero,
  .card-preview,
  .card-subpage,
  .plan-option,
  .list-card,
  .stat-card {
    padding: 16px;
  }

  .hero h1,
  .hero-subpage h1 {
    font-size: clamp(26px, 8.2vw, 34px);
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-action-row,
  .status-row,
  .echo-inline-cta,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-action-row {
    flex-direction: row;
    align-items: center;
  }

  .button-hero,
  .button-hero-secondary,
  .two-up > * {
    width: 100%;
    min-width: 0;
  }

  .sticky-action-row > .button-primary {
    flex: 1 1 auto;
    min-width: 0;
  }

  .sticky-action-row > .button-cancel {
    flex: 0 0 112px;
    min-width: 0;
  }

  .preview-step {
    grid-template-columns: 34px 1fr;
    padding: 12px;
  }

  .preview-step-number {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .global-footer {
    padding-bottom: 10px;
  }
}

/* ============================================================================
   v6.1 polish — long-text resilience, Plus plan emphasis, and minor tweaks
   ============================================================================ */

/* Long-text resilience: protect cards/badges/lists from being blown out by
   long URLs, long English titles, or long addresses. */
.action-spotlight,
.action-spotlight-meta,
.summary-card,
.summary-grid,
.list-card,
.list-card-head,
.list-card-body,
.list-card-meta,
.meta-chip,
.stat-card,
.details-meta-grid,
.details-stack,
.meta-item {
  min-width: 0;
}

.action-spotlight-title,
.summary-value,
.list-card strong,
.list-card-sub,
.meta-chip span,
.meta-item,
.summary-card-list li,
.list li,
.stat-value,
.stat-value-small,
.auth-user-label,
.feedback-badge {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Action spotlight meta row: allow wrapping on narrow screens */
.action-spotlight-meta {
  flex-wrap: wrap;
  row-gap: 4px;
}

/* Plus plan: gentle emphasis as the recommended middle option.
   Free has plain white, Premium has --brand-soft-2; Plus needs its own
   identity so the three options read as a clear ladder. */
.plan-option-plus {
  background: var(--brand-soft);
  border: 1px solid rgba(29, 95, 154, 0.22);
  position: relative;
}

.plan-option-plus .status-badge {
  background: var(--brand);
  color: #fff;
}

/* Mobile: the auth label inside the menu is allowed to wrap; on narrow
   widths the email can be very long. */
@media (max-width: 720px) {
  .auth-controls-mobile .auth-user-label {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
  }

  /* Plan card buttons: ensure they don't get squeezed below readable size
     when "Premiumにする" or similar labels are translated to longer locales. */
  .plan-option .button-large {
    width: 100%;
    white-space: normal;
    line-height: 1.3;
  }

  /* Tighten plan card vertical rhythm on small screens */
  .plan-option {
    gap: 10px;
  }
}

/* Auth label on desktop: cap width but allow tooltip on hover */
.auth-user-label {
  max-width: min(220px, 30vw);
}

/* Google sign-in button: icon + label layout */
#auth-sign-in-button,
#mobile-auth-sign-in-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#auth-sign-in-button[hidden],
#mobile-auth-sign-in-button[hidden] {
  display: none;
}

.google-g-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}

/* On mobile menu, sign-in button is full width and visually a primary card-like CTA */
.auth-controls-mobile #mobile-auth-sign-in-button {
  width: 100%;
  justify-content: center;
}
