:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #333333;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #ff3232;
  --accent-hover: #e02a2a;
  --accent-soft: #ff4133;
  --danger: #b42318;
  --chip: #f3f4f6;
  --radius: 4px;
  font-family: "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html {
  max-width: 100%;
  scroll-padding-top: 3.25rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.brand {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-email {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}
.session-email:hover {
  color: var(--accent);
}
.session-email.is-active {
  color: var(--accent);
  font-weight: 600;
}

.account-users {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.usage-history {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.usage-history h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.usage-filters {
  margin-top: 20px;
}
.usage-filters select {
  width: 100%;
  height: 44px;
}

.site-footer {
  margin-top: auto;
  padding: 20px 16px 28px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.site-footer p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-card {
  width: min(420px, 100%);
}
.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}
.login-card .muted { margin: 0 0 24px; }
.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}
.login-card input {
  width: 100%;
  margin-bottom: 16px;
}
.login-card button { width: 100%; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 7.5rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 8px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}
.tab:not(:first-child)::before {
  content: "｜";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  pointer-events: none;
}
.tab:hover { background: #fafafa; color: var(--ink); }
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.layout {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  flex: 1;
}
.tab-panel h1 { margin: 0 0 8px; font-size: 24px; }
.tab-panel h2 { margin: 24px 0 8px; font-size: 18px; }
.tab-panel h3 { margin: 20px 0 8px; font-size: 15px; }
.tab-panel h4 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); }

#tab-help > .muted { margin: 0 0 8px; line-height: 1.65; max-width: 52rem; }
#tab-help h2 { margin-top: 32px; }
#tab-help h2:first-of-type { margin-top: 28px; }
#tab-help .steps,
#tab-help .bullets { max-width: 52rem; line-height: 1.65; }
#tab-help .steps > li { margin: 10px 0; }
#tab-help .steps .bullets { margin: 8px 0 4px; }
#tab-help .help-note {
  margin: 12px 0 0;
  max-width: 52rem;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="password"],
input[type="email"],
input[type="url"],
input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
select {
  min-height: 50px;
}
input[type="search"] {
  min-height: 50px;
  appearance: none;
}
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

button {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
}
button.ghost:hover { background: #fafafa; }
button.primary { margin-top: 12px; }

.eyebrow {
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 22px;
  margin-top: 16px;
  overflow-wrap: anywhere;
}

.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row input { flex: 1; min-width: 0; }
.row.tight { gap: 8px; flex-wrap: wrap; }
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
body.preview-modal-open {
  overflow: hidden;
}
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 17, 17, 0.45);
}
.preview-modal.hidden {
  display: none !important;
}
.preview-modal__panel {
  display: flex;
  flex-direction: column;
  width: min(960px, 96vw);
  height: min(92vh, 960px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.preview-modal__header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.preview-modal__panel iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fdfdfd;
}
.preview-revise {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}
.preview-revise__quotes-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.preview-revise__quotes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-height: 28px;
}
.preview-revise__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}
.preview-revise__chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.preview-revise__chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.preview-revise__chip-remove:hover {
  color: var(--ink);
}
.preview-revise__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}
.preview-revise__instruction {
  width: 100%;
  min-height: 56px;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.preview-revise__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.preview-revise__hint {
  margin: 0;
  flex: 1;
  font-size: 12px;
}
#preview-revise-error {
  margin: 0;
  font-size: 12px;
}
#preview-revise-error:empty {
  display: none;
}

.scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.scores-4 { grid-template-columns: repeat(4, 1fr); }
.scores-6 { grid-template-columns: repeat(3, 1fr); }
.scores-8 { grid-template-columns: repeat(2, 1fr); }
.scores-3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) {
  .scores-6 { grid-template-columns: repeat(6, 1fr); }
  .scores-8 { grid-template-columns: repeat(4, 1fr); }
}
.score-card {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.score-card span { display: block; color: var(--muted); font-size: 12px; }
.score-card strong { font-size: 28px; }
.score-card strong.sm { font-size: 18px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.split-col {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}
.split-col h2 { margin: 0; font-size: 15px; }
.stats-hero { margin: 8px 0 4px; gap: 32px; align-items: start; }
.stats-hero-image {
  display: block;
  width: 100%;
  height: auto;
}
.changelog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.changelog-heading h2 { margin: 0; font-size: 15px; }
.changelog-more {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.changelog-more:hover { text-decoration: underline; }
.changelog {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.changelog-page {
  max-height: none;
  overflow: visible;
  margin-bottom: 24px;
}
.changelog li.changelog-empty {
  font-size: 13px;
  color: var(--muted);
  border-top: 0;
  padding-top: 0;
}
.changelog li {
  display: grid;
  gap: 4px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.changelog li + li { margin-top: 12px; }
.changelog time {
  font-size: 12px;
  color: var(--muted);
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
}
th { color: var(--muted); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.articles-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: end;
  margin: 16px 0 8px;
}
.articles-search-field,
.articles-sort-field {
  min-width: 0;
}
.articles-search-field label,
.articles-sort-field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.articles-toolbar input[type="search"] {
  width: 100%;
}
.articles-toolbar input[type="search"]::-webkit-search-decoration,
.articles-toolbar input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
}
.articles-toolbar select {
  width: 100%;
}
#articles-count {
  margin: 0 0 10px;
  font-size: 13px;
}
#articles-meta {
  margin: 4px 0 0;
}
#articles-empty,
#articles-empty-search {
  margin: 12px 0;
}
.articles-site-switch {
  display: inline-flex;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.articles-site {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
}
.articles-site:hover {
  background: var(--chip);
  color: var(--ink);
}
.articles-site.is-active,
.articles-site.is-active:hover {
  background: var(--ink);
  color: #fff;
}
#articles-site-note {
  margin: 8px 0 0;
}
.articles-list {
  display: grid;
  gap: 10px;
}
.article-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--panel);
}
.article-card:hover {
  background: #fafafa;
}
.article-card__head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}
.tab-panel .article-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.article-card__id {
  margin: 0;
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.article-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 10px;
}
.article-metric__label {
  font-size: 12px;
  color: var(--muted);
}
.article-metric__value {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 6px;
}
.article-metric__sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.article-metric__bar {
  height: 6px;
  background: var(--chip);
  border-radius: 99px;
  overflow: hidden;
}
.article-metric__bar > span {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: inherit;
}
.article-metric.is-active .article-metric__label,
.article-metric.is-active .article-metric__value {
  color: var(--accent);
}
.article-metric.is-active .article-metric__bar > span {
  background: var(--accent);
}
.article-card__gsc {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.article-card__gsc summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
}
.article-gsc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 0;
}
.article-gsc-stats div {
  margin: 0;
}
.article-gsc-stats dt {
  font-size: 11px;
  color: var(--muted);
}
.article-gsc-stats dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.article-funnel-note {
  margin: 4px 0 12px;
  font-size: 13px;
}
.article-gsc-panel summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  list-style-position: outside;
}
.article-gsc-panel .scores {
  margin-top: 12px;
}
@media (max-width: 800px) {
  .article-card__metrics,
  .article-gsc-stats {
    grid-template-columns: 1fr 1fr;
  }
  .article-card__head {
    flex-direction: column;
    gap: 2px;
  }
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.meta-grid p { margin: 0; font-size: 14px; line-height: 1.5; }

.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin: 6px 0; font-size: 14px; }

.proposal-list { display: grid; gap: 10px; }
.proposal {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.proposal.high { border-color: #e8b4b8; background: #fff8f8; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent);
  margin-right: 6px;
  font-weight: 700;
}
.proposal .summary { font-weight: 700; margin: 0 0 4px; }
.proposal .rationale { margin: 0; color: var(--muted); font-size: 13px; }
.proposal .apply-note { margin: 6px 0 0; font-size: 12px; }
.proposal.manual { opacity: 0.92; border-style: dashed; }
.apply-legend { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.badge.apply-body { background: #fde8ea; color: var(--accent); }
.badge.apply-cms { background: #e8eef8; color: #2f5f9e; }
.badge.apply-manual { background: #f5efe6; color: #8a5a12; }

.steps { font-size: 14px; color: var(--muted); padding-left: 20px; }

code {
  background: var(--chip);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

a { color: var(--accent); }

.users-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}
.users-form button { height: 44px; }
.users-form select { height: 44px; width: 100%; }
.account-form {
  max-width: 420px;
  margin: 16px 0;
}
.account-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}
.account-form input {
  width: 100%;
  margin-bottom: 16px;
}
.account-form button { width: 100%; }
.create-form {
  max-width: 720px;
  margin-bottom: 24px;
}
.create-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 6px;
}
.create-form input,
.create-form select,
.create-form textarea {
  width: 100%;
}
.create-form button {
  margin-top: 16px;
}
.ec-result {
  margin-top: 28px;
}
.ec-warn {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.ec-result .row-actions {
  margin: 12px 0 4px;
}
.ec-result .row-actions .primary {
  margin-top: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.ec-result .row-actions .primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.ec-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  list-style: none;
  margin: 12px 0 8px;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
}
.ec-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ec-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  flex-shrink: 0;
}
.ec-swatch-new { background: #fff2cc; }
.ec-swatch-existing { background: #d9eaf7; }
.ec-swatch-heading { background: #e8e8e8; }
.ec-preview-wrap {
  margin: 8px 0 16px;
  overflow-x: auto;
}
.ec-preview-table {
  width: 100%;
  min-width: 960px;
  font-size: 12px;
  border-collapse: collapse;
}
.ec-preview-table th,
.ec-preview-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
  text-align: left;
}
.ec-preview-table th {
  background: #434343;
  color: #fff;
  white-space: nowrap;
}
.ec-preview-table th:nth-child(1),
.ec-preview-table td:nth-child(1),
.ec-preview-table th:nth-child(9),
.ec-preview-table td:nth-child(9) {
  white-space: nowrap;
}
.ec-preview-table td:nth-child(2),
.ec-preview-table td:nth-child(3),
.ec-preview-table td:nth-child(4) {
  min-width: 140px;
}
.ec-preview-table td:nth-child(8) {
  max-width: 220px;
  overflow-wrap: anywhere;
}
.ec-row-h2 td { background: #e8e8e8; }
.ec-row-h3 td { background: #f3f3f3; }
.ec-row-new td { background: #fff2cc; }
.ec-row-existing td { background: #d9eaf7; }
.ec-tsv-details {
  margin: 8px 0 0;
}
.ec-tsv-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.ec-tsv-details textarea {
  margin-top: 8px;
  width: 100%;
}
.create-products-block {
  margin-top: 4px;
}
.create-products-head {
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.create-products-head label {
  margin: 0;
  flex: 1;
}
.create-products-head button {
  margin-top: 0;
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 13px;
}
.create-suggest-hint {
  margin: 6px 0 8px;
  font-size: 12px;
}
.create-suggest-panel {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}
.create-suggest-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.create-suggest-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.create-suggest-item .meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.create-suggest-item .name {
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 13px;
}
.create-suggest-item .reason {
  margin: 6px 0 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  background: #fff7f7;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.create-suggest-item .reason-label {
  font-weight: 700;
  color: var(--accent);
}
.create-suggest-item a {
  font-size: 12px;
  word-break: break-all;
}
.create-suggest-actions {
  margin-top: 10px;
}
.create-suggest-actions button {
  margin-top: 0;
  padding: 8px 12px;
  font-size: 13px;
}
.create-suggest-revise {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.create-suggest-revise__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.create-suggest-revise__instruction {
  width: 100%;
  min-height: 52px;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.create-suggest-revise__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.create-suggest-revise__hint {
  margin: 0;
  flex: 1;
  font-size: 12px;
}
#create-suggest-revise-btn {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
}
.create-products-block #create-products {
  margin-top: 0;
}
.create-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.create-stepper > li {
  margin: 0;
}
.create-stepper-btn {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.create-stepper-btn.is-current {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff7f7;
}
.create-stepper-btn.is-done {
  color: var(--ink);
}
.create-stepper-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.create-step {
  max-width: 720px;
}
.create-step h2 {
  margin: 8px 0 6px;
  font-size: 18px;
}
.create-step h3 {
  margin: 18px 0 8px;
  font-size: 14px;
}
.create-step label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 6px;
}
.create-step textarea,
.create-step input {
  width: 100%;
}
.create-step-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.create-step-actions button {
  margin-top: 0;
}
.create-kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.create-kw-table th,
.create-kw-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.create-kw-table th:nth-child(1),
.create-kw-table td:nth-child(1) {
  width: 44px;
}
.create-qa-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.create-qa-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.create-qa-item .meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.create-copy-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.create-copy-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.create-copy-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.create-copy-card .meta {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}
.create-copy-card label {
  margin-top: 8px;
}
.create-copy-card textarea {
  width: 100%;
}
.create-copy-card .create-copy-regen {
  margin-top: 10px;
}
.users-table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.users-table-actions button { padding: 8px 12px; font-size: 12px; }

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.history-list.tall { max-height: none; }
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.history-item:hover { background: #fafafa; }
.history-item.active { border-color: var(--accent); }
.history-item .history-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.history-item .history-title { margin: 0; font-size: 14px; font-weight: 700; }
.history-item .history-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.history-item .stage-badge {
  justify-self: end;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent);
  white-space: nowrap;
}
.history-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.history-item .history-reanalyze,
.history-item .history-delete {
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.history-item .history-delete {
  color: var(--danger);
  border-color: #f0c9c5;
}
.work-header-actions { margin-top: 12px; }
.history-item .stage-badge.applied {
  background: var(--accent);
  color: #fff;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.4);
}
.progress-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 24px;
  text-align: center;
}
.progress-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-bar-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: var(--accent);
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.progress-phase { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.progress-elapsed { margin: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  html {
    scroll-padding-top: calc(2.75rem + env(safe-area-inset-top, 0px));
  }

  .site-header {
    padding: 12px 16px;
    gap: 8px;
    align-items: flex-start;
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .header-right {
    flex-shrink: 0;
    gap: 8px;
    max-width: 58%;
  }
  .session-email {
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .site-header .ghost {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .tabs {
    top: env(safe-area-inset-top, 0px);
    padding-left: 8px;
    padding-right: 8px;
    justify-content: stretch;
  }
  .tab {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 10px 4px;
    font-size: 12px;
  }
  .tab:not(:first-child)::before {
    content: none;
  }

  .layout { width: 100%; padding: 20px 16px 32px; }
  .scores, .meta-grid, .split, .scores-4, .scores-6, .scores-8 { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .articles-toolbar { grid-template-columns: 1fr; }
  .users-form { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 1fr; }
  .history-item .history-open { grid-template-columns: 1fr; }
  .history-item-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .preview-modal {
    padding: 0;
    align-items: stretch;
  }
  .preview-modal__panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }

  .site-footer {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}
