:root {
  --bg: #f6f1e8;
  --bg-strong: #efe4d1;
  --surface: rgba(255, 251, 245, 0.92);
  --surface-strong: #fffaf3;
  --ink: #23170f;
  --ink-soft: #5d4d42;
  --line: rgba(45, 25, 14, 0.12);
  --accent: #a63c1f;
  --accent-dark: #7f2d18;
  --lawyer: #173f5f;
  --general: #71611d;
  --shadow: 0 24px 60px rgba(58, 33, 18, 0.1);
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 32%),
    linear-gradient(180deg, #fbf7f0 0%, #f4ecdf 48%, #efe5d7 100%);
  font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

body {
  padding: 28px;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 245, 230, 0.95), rgba(255, 252, 247, 0.95)),
    var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker,
.panel-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.card-title,
.review-title,
.detail-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.05;
  max-width: 12ch;
}

.hero-text,
.feed-note,
.review-note,
.notice-box,
.field-hint,
.card-preview,
.review-preview,
.detail-body,
.empty-state {
  color: var(--ink-soft);
  line-height: 1.65;
}

.hero-text {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.metric-chip,
.attachment-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
}

.hero-panel,
.panel,
.feed-card,
.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 20px rgba(44, 27, 17, 0.05);
}

.hero-panel {
  padding: 22px;
}

.flow-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.ghost-button,
.nav-button,
.sort-button,
.detail-button,
.empathy-button,
.approve-button,
.reject-button,
.primary-button,
.close-button {
  border: none;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease,
    background 0.16s ease;
}

.ghost-button,
.nav-button,
.sort-button,
.detail-button,
.empathy-button,
.close-button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.primary-button,
.approve-button {
  padding: 12px 18px;
  background: var(--accent);
  color: #fff6ef;
}

.reject-button {
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.is-active,
.nav-button:hover,
.ghost-button:hover,
.sort-button:hover,
.detail-button:hover,
.empathy-button:hover,
.primary-button:hover,
.approve-button:hover,
.reject-button:hover,
.close-button:hover {
  transform: translateY(-1px);
}

.sort-button.is-active,
.nav-button.is-current,
.empathy-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff6ef;
}

.nav-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
}

.panel-copy {
  margin: 16px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.layout.single-column {
  grid-template-columns: 1fr;
}

.public-layout {
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.25fr);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.section-heading.compact {
  align-items: center;
}

.feed-controls,
.hero-metrics,
.feed-list,
.review-list,
.sidebar,
.conditional-fields,
.submission-form {
  display: grid;
  gap: 14px;
}

.feed-controls,
.hero-metrics {
  display: flex;
}

.feed-note,
.review-note {
  margin: 16px 0 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.panel {
  padding: 20px;
}

.notice-box {
  margin: 16px 0 18px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 247, 233, 0.92), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(166, 60, 31, 0.15);
}

.notice-box p {
  margin: 0 0 8px;
}

.notice-box p:last-child {
  margin-bottom: 0;
}

.warning-box {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(166, 60, 31, 0.18);
  background: linear-gradient(180deg, rgba(255, 244, 235, 0.95), rgba(255, 251, 246, 0.98));
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.6;
}

.submission-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.submission-form input,
.submission-form select,
.submission-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(35, 23, 15, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
}

.submission-form textarea {
  resize: vertical;
  min-height: 150px;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  font-weight: 500;
}

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

.is-hidden {
  display: none;
}

#approved-toggle-button {
  min-width: 84px;
}

#hold-toggle-button {
  min-width: 84px;
}

.form-status {
  min-height: 24px;
  margin: 0;
  font-size: 0.94rem;
  color: var(--accent-dark);
}

.submission-panel,
.feed-section {
  min-width: 0;
}

.attachment-editor-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(35, 23, 15, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.attachment-editor-title {
  margin: 0;
  font-weight: 700;
}

.attachment-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-preview {
  min-height: 140px;
}

.attachment-preview-card {
  display: grid;
  gap: 12px;
}

.google-login-shell {
  display: grid;
  justify-content: start;
}

.attachment-preview-copy {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
}

.feed-card,
.review-card {
  padding: 20px;
}

.card-topline,
.review-head,
.card-actions,
.review-actions,
.detail-actions,
.detail-meta,
.detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.review-attachment {
  margin-top: 14px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.type-pill[data-type="lawyer"] {
  background: rgba(23, 63, 95, 0.1);
  color: var(--lawyer);
}

.type-pill[data-type="general"] {
  background: rgba(113, 97, 29, 0.12);
  color: var(--general);
}

.card-date,
.review-date {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.card-title,
.review-title,
.detail-title {
  margin: 14px 0 10px;
  line-height: 1.22;
}

.card-title {
  font-size: 1.5rem;
}

.card-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.card-media,
.detail-media {
  margin-top: 16px;
}

.preview-image,
.detail-image {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  object-fit: cover;
}

.preview-image {
  max-height: 220px;
}

.detail-image {
  max-height: 480px;
}

.detail-document {
  width: 100%;
  min-height: 420px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.review-meta {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr;
  gap: 6px 12px;
  margin: 16px 0;
}

.review-meta dt {
  color: var(--ink-soft);
  font-weight: 700;
}

.review-meta dd {
  margin: 0;
}

.detail-dialog {
  width: min(760px, calc(100vw - 24px));
  border: none;
  padding: 0;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(22, 15, 10, 0.28);
}

.detail-dialog::backdrop {
  background: rgba(31, 19, 12, 0.5);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  position: relative;
  padding: 72px 28px 28px;
  background: var(--surface-strong);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(35, 23, 15, 0.08);
}

.inline-close-button {
  position: static;
}

.detail-header {
  align-items: start;
  padding-right: 88px;
}

.detail-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(166, 60, 31, 0.08);
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(35, 23, 15, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.editor-dialog {
  width: min(980px, calc(100vw - 24px));
  border: none;
  padding: 0;
  border-radius: 26px;
  box-shadow: 0 34px 90px rgba(22, 15, 10, 0.32);
}

.editor-dialog::backdrop {
  background: rgba(31, 19, 12, 0.54);
  backdrop-filter: blur(4px);
}

.editor-shell {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--surface-strong);
}

.editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.editor-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 245, 230, 0.8);
  color: var(--ink-soft);
  line-height: 1.6;
}

.editor-toolbar,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-actions {
  justify-content: flex-end;
}

.editor-canvas-shell {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(45deg, rgba(35, 23, 15, 0.03) 25%, transparent 25%, transparent 75%, rgba(35, 23, 15, 0.03) 75%),
    linear-gradient(45deg, rgba(35, 23, 15, 0.03) 25%, transparent 25%, transparent 75%, rgba(35, 23, 15, 0.03) 75%);
  background-position: 0 0, 14px 14px;
  background-size: 28px 28px;
  border: 1px solid rgba(35, 23, 15, 0.08);
}

.editor-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(44, 27, 17, 0.12);
  touch-action: none;
}

@media (max-width: 1080px) {
  body {
    padding: 18px;
  }

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

  .public-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero,
  .panel,
  .feed-card,
  .review-card,
  .dialog-shell {
    padding: 18px;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .dialog-shell {
    padding: 72px 18px 18px;
  }

  .editor-shell {
    padding: 18px;
  }

  .editor-head,
  .detail-header {
    padding-right: 0;
  }

  .editor-actions {
    justify-content: stretch;
  }
}
