:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --panel-strong: #111827;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --success: #065f46;
  --success-soft: #d1fae5;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.08), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

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

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.site-subtitle {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.site-subtitle-stack {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
}

.logout-form {
  margin: 0;
}

.logout-button {
  appearance: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1d4ed8;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.logout-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.dashboard-link {
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-link:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
  align-items: start;
}

.admin-shell {
  max-width: 1280px;
}

.admin-layout {
  display: grid;
  gap: 24px;
}

.admin-hero {
  padding: 32px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.9));
}

.admin-kicker {
  margin: 0 0 10px;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.admin-hero > p:last-of-type {
  margin: 0;
  max-width: 42rem;
  color: #374151;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.admin-articles-hero {
  padding-right: 28px;
}

.primary-link-button,
.secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
}

.primary-link-button {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.secondary-link-button {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #1d4ed8;
}

.secondary-link-button[aria-disabled="true"] {
  cursor: default;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.admin-card {
  padding: 24px;
}

.admin-card-label {
  margin: 0 0 10px;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.admin-card p {
  margin: 0 0 14px;
  color: #4b5563;
}

.text-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.inline-code-block,
.muted-caption {
  display: inline-block;
  font-size: 0.85rem;
}

.inline-code-block {
  padding: 8px 10px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.muted-caption {
  color: #6b7280;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 480px);
  padding: 32px;
}

.login-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.login-copy {
  margin: 0 0 20px;
  color: #4b5563;
}

.login-form {
  display: grid;
  gap: 14px;
}

.form-panel,
.output-panel {
  padding: 24px;
}

.form-panel {
  align-self: stretch;
}

.editor-shell {
  max-width: 980px;
}

.editor-layout {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.editor-form-panel {
  width: min(100%, 820px);
  padding: 28px 28px 24px;
}

.editor-form-panel .panel-heading {
  max-width: 40rem;
  margin-bottom: 18px;
}

.editor-form-panel .panel-heading p {
  font-size: 0.94rem;
  line-height: 1.55;
}

.editor-form-panel .editor-form {
  gap: 10px;
}

.editor-form-panel .field-row,
.editor-form-panel .field-stack {
  gap: 6px;
}

.editor-form-panel .field-row {
  grid-template-columns: 6.25rem minmax(0, 1fr);
  column-gap: 10px;
}

.editor-form-panel .field-control {
  padding: 9px 12px;
}

.editor-form-panel .category-options {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.editor-form-panel .category-option span {
  min-height: 40px;
  padding: 9px 10px;
  font-size: 0.84rem;
}

.editor-form-panel .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 180px;
  margin-top: 10px;
  justify-self: end;
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
}

.form-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  line-height: 1.4;
}

.section-heading-icon {
  width: 20px;
  height: 20px;
  color: #4f46e5;
  flex-shrink: 0;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.alert[hidden] {
  display: none;
}

.alert-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(185, 28, 28, 0.14);
}

.alert-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(6, 95, 70, 0.14);
}

.editor-form {
  display: grid;
  gap: 12px;
}

.field-row,
.field-stack {
  display: grid;
  gap: 8px;
}

.field-row {
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}

.category-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label,
.category-fieldset legend {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.category-fieldset legend {
  margin-bottom: 8px;
}

.field-label-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-label-icon {
  width: 14px;
  height: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.field-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.875rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field-stack textarea.field-control {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

.field-control:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.category-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category-option {
  position: relative;
  display: block;
}

.category-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.category-option input:focus-visible + span {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.category-option input:checked + span {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.12);
}

.category-option:hover span {
  transform: translateY(-1px);
}

.primary-button,
.ghost-button,
.danger-button {
  appearance: none;
  border: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.primary-button:hover:not(:disabled),
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.score-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
}

.score-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.score-card strong {
  font-size: 1.8rem;
  line-height: 1;
}

.score-card-total {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(37, 99, 235, 0.18);
}

.result-block {
  margin-bottom: 24px;
}

.result-block:last-child {
  margin-bottom: 0;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.ghost-button {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.danger-button {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.18);
}

.article-card,
.faq-item,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.article-card {
  padding: 24px;
}

.article-card h4 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  line-height: 1.2;
}

.summary-box {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 18px;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.summary-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-box p {
  margin: 0;
}

.article-card-optimized {
  border-radius: 12px;
  border-color: #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.article-card-optimized h4 {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
}

.summary-box-optimized {
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #eef2ff;
  border-color: #e0e7ff;
}

.summary-label-optimized {
  margin-bottom: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.summary-box-optimized p {
  color: #312e81;
  font-size: 0.95rem;
  line-height: 1.7;
}

.article-sections {
  display: grid;
  gap: 16px;
}

.article-section {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid rgba(229, 231, 235, 0.9);
}

.article-sections-optimized {
  gap: 24px;
}

.article-section-optimized {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.logic-tag,
.faq-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logic-tag-optimized {
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.75rem;
  font-weight: 700;
}

.faq-grid {
  display: grid;
  gap: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-item {
  padding: 20px;
}

.faq-question {
  margin: 0 0 8px;
  font-weight: 700;
}

.faq-answer {
  margin: 0;
  color: #374151;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.32), rgba(255, 255, 255, 0.96)),
    #fff;
}

.empty-state h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.5rem;
}

.empty-state p {
  margin: 0;
  max-width: 28rem;
}

.empty-state-loading {
  min-height: 320px;
}

.admin-company-panel,
.admin-user-panel {
  padding: 24px;
}

.admin-user-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-user-create,
.admin-user-list {
  display: grid;
  gap: 16px;
}

.admin-user-create h3,
.admin-user-list h3 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-user-create-form {
  display: grid;
  gap: 14px;
}

.radio-card-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.radio-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}

.radio-card:hover {
  border-color: rgba(37, 99, 235, 0.36);
  transform: translateY(-1px);
}

.radio-card:has(input:focus-visible) {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.radio-card:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.7);
  background: linear-gradient(180deg, #eff6ff, #f8fbff);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.radio-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.radio-card-title {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
}

.radio-card-copy {
  color: #64748b;
  font-size: 0.83rem;
  line-height: 1.5;
}

input.field-control-file {
  padding: 10px 12px;
}

.admin-user-help {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.admin-user-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-filter-field {
  min-width: 0;
}

.admin-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-user-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  .radio-card-group {
    grid-template-columns: 1fr;
  }
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.company-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.company-card-warning {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.06);
}

.company-card-link {
  display: grid;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.company-card-media {
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, #eff6ff, #f8fafc);
}

.company-card-image,
.company-hero-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f8fafc;
}

.company-card-image {
  aspect-ratio: 1 / 1;
  padding: 8px;
  box-sizing: border-box;
}

.company-card-placeholder,
.company-hero-placeholder {
  display: grid;
  place-items: center;
  color: #2563eb;
}

.company-card-placeholder {
  aspect-ratio: 16 / 11;
}

.company-card-placeholder svg,
.company-hero-placeholder svg {
  width: 38px;
  height: 38px;
}

.company-card-body h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.company-card-body p {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
}

.company-card-admin,
.company-card-warning-text {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.company-card-admin {
  color: #1d4ed8;
}

.company-card-warning-text {
  color: #b45309;
}

.company-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.company-card-actions .ghost-button,
.company-card-actions .compact-danger-button {
  width: 100%;
}

.user-table-shell {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.user-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.user-table tbody tr:last-child td {
  border-bottom: 0;
}

.user-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-table td {
  background: rgba(255, 255, 255, 0.96);
}

.user-table-id,
.user-table-date {
  white-space: nowrap;
}

.user-table-id {
  color: #1d4ed8;
  font-weight: 700;
}

.user-table-username {
  font-weight: 600;
}

.user-table-company {
  color: #334155;
  font-weight: 600;
}

.user-table-role {
  white-space: nowrap;
}

.user-table-date {
  color: #64748b;
  font-size: 0.85rem;
}

.user-table-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.article-table {
  min-width: 1120px;
}

.article-table-company {
  min-width: 160px;
  color: #0f172a;
  font-weight: 700;
}

.article-table-title-cell {
  min-width: 320px;
}

.article-table-title {
  display: block;
  margin-bottom: 6px;
  color: #111827;
  font-size: 0.98rem;
  line-height: 1.5;
}

.article-table-summary {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-table-category {
  white-space: nowrap;
}

.article-table-tag {
  margin-bottom: 0;
}

.article-table-author,
.article-table-brand {
  min-width: 150px;
}

.article-table-author strong,
.article-table-brand strong {
  display: block;
  color: #111827;
  font-size: 0.92rem;
}

.article-table-author span,
.article-table-brand span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.5;
}

.compact-danger-button {
  width: auto;
  min-height: 40px;
  margin-top: 0;
  padding: 0 14px;
  border-radius: 10px;
  box-shadow: none;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.role-pill-admin {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.role-pill-user {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.admin-user-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.user-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.user-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.user-card-label {
  margin: 0 0 6px;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.user-edit-form {
  display: grid;
  gap: 14px;
}

.user-meta {
  margin: 0;
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.6;
}

.user-card-actions,
.user-delete-form {
  margin: 0;
}

.admin-empty-state {
  min-height: 220px;
}

.company-shell {
  max-width: 1320px;
}

.company-home-layout {
  display: grid;
  gap: 24px;
}

.company-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.92));
}

.company-hero-media {
  width: 180px;
  height: 180px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 26%),
    linear-gradient(180deg, #eff6ff, #f8fafc);
  border: 1px solid #e0e7ff;
}

.company-hero-image,
.company-hero-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 16px;
  box-sizing: border-box;
}

.company-hero-copy {
  display: grid;
  align-content: center;
}

.company-hero-kicker {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-hero-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.company-hero-copy p {
  margin: 0;
  max-width: 44rem;
  color: #475569;
}

.company-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.company-drafts-panel {
  padding: 24px;
}

.company-drafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.company-draft-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.company-draft-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.company-draft-date {
  color: #64748b;
  font-size: 0.85rem;
  white-space: nowrap;
}

.company-draft-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.company-draft-summary {
  margin: 0;
  color: #1f2937;
  font-weight: 600;
}

.company-draft-preview {
  margin: 0;
  color: #475569;
  line-height: 1.7;
}

.company-draft-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.company-draft-details div {
  display: grid;
  gap: 4px;
}

.company-draft-details dt {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.company-draft-details dd {
  margin: 0;
  color: #111827;
  font-size: 0.92rem;
}

.company-empty-state {
  min-height: 240px;
}

.mypage-layout {
  display: grid;
  gap: 24px;
}

.mypage-profile-panel,
.mypage-password-panel,
.mypage-activity-panel {
  padding: 24px;
}

.mypage-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.mypage-stat-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.mypage-stat-card span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

.mypage-stat-card strong {
  font-size: 1rem;
}

.mypage-password-form {
  display: grid;
  gap: 16px;
}

.mypage-activity-list {
  display: grid;
  gap: 14px;
}

.mypage-activity-item {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.mypage-activity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mypage-activity-item h3 {
  margin: 0;
  font-size: 1rem;
}

.mypage-activity-copy {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
}

.modal-form {
  display: grid;
  gap: 16px;
}

.company-edit-preview {
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 26%),
    linear-gradient(180deg, #eff6ff, #f8fafc);
}

.company-edit-preview .company-card-image,
.company-edit-preview .company-card-placeholder {
  aspect-ratio: 4 / 3;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 500;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

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

.prose {
  color: #1f2937;
}

.prose-optimized {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #1f2937;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose h2,
.prose h3 {
  margin: 1.25em 0 0.6em;
  line-height: 1.3;
}

.prose p,
.prose ul,
.prose ol,
.prose table,
.prose pre {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid #dbe2ea;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: #eff6ff;
}

.prose code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.08);
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.92em;
}

.prose pre {
  padding: 14px;
  overflow-x: auto;
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
}

.copy-source {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.28);
}

.modal-dialog-danger {
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(254, 242, 242, 0.98));
}

.modal-dialog h3 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.modal-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal-close-button:hover {
  background: rgba(15, 23, 42, 0.12);
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 14px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.modal-badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.modal-copy {
  margin: 0;
  color: #475569;
  line-height: 1.7;
}

.modal-password-panel {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 18px;
  background: rgba(239, 246, 255, 0.78);
}

.modal-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.modal-password-input {
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions-split {
  justify-content: space-between;
}

.modal-primary-button,
.modal-danger-button,
.modal-secondary-button {
  width: auto;
  min-height: 44px;
  margin-top: 0;
  padding-inline: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(6, 95, 70, 0.18);
}

.toast[hidden] {
  display: none;
}

.toast[data-level="error"] {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: 0 12px 28px rgba(185, 28, 28, 0.18);
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-layout,
  .admin-user-list-grid {
    grid-template-columns: 1fr;
  }

  .company-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding-inline: 14px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-subtitle-stack {
    justify-items: start;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .site-subtitle {
    text-align: left;
  }

  .form-panel,
  .output-panel {
    padding: 18px;
  }

  .editor-form-panel {
    width: 100%;
    padding: 20px 18px;
  }

  .editor-form-panel .field-row {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .field-row {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .category-options {
    grid-template-columns: 1fr;
  }

  .editor-form-panel .category-options {
    grid-template-columns: 1fr;
  }

  .editor-form-panel .primary-button {
    width: 100%;
    justify-self: stretch;
  }

  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-user-filter-form {
    grid-template-columns: 1fr;
  }

  .company-card-actions,
  .company-draft-details {
    grid-template-columns: 1fr;
  }

  .company-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .modal-dialog {
    padding: 22px;
    border-radius: 24px;
  }

  .modal-password-row,
  .modal-actions,
  .modal-actions-split {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .modal-password-row,
  .modal-actions {
    display: grid;
  }

  .modal-primary-button,
  .modal-danger-button,
  .modal-secondary-button {
    width: 100%;
  }

  .toast {
    right: 14px;
    left: 14px;
    bottom: 14px;
    border-radius: 18px;
    text-align: center;
  }
}
