:root {
  --bg: #fff8f6;
  --bg-alt: #fffefc;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.97);
  --surface-soft: #fff4ef;
  --line: rgba(90, 72, 81, 0.12);
  --line-strong: rgba(90, 72, 81, 0.2);
  --ink: #342a33;
  --ink-soft: #756774;
  --peach: #f5cfd0;
  --peach-strong: #e9aeb3;
  --mint: #caeadf;
  --mint-strong: #78b8a6;
  --sky: #dbe8ff;
  --sky-strong: #7b9cd3;
  --butter: #f8e8b5;
  --rose: #f5d8e6;
  --gold: #b58c5a;
  --danger: #d46262;
  --success: #2f8f74;
  --shadow-lg: 0 32px 90px rgba(182, 149, 163, 0.18);
  --shadow-md: 0 20px 48px rgba(164, 132, 148, 0.14);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans KR", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 207, 208, 0.75), transparent 22%),
    radial-gradient(circle at 88% 14%, rgba(202, 234, 223, 0.7), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(219, 232, 255, 0.66), transparent 32%),
    linear-gradient(180deg, #fffdfc 0%, #fff8f6 42%, #fff2ef 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(129, 104, 117, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 104, 117, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 84%);
}

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

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(155, 125, 139, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: rgba(123, 156, 211, 0.48);
  box-shadow: 0 0 0 4px rgba(123, 156, 211, 0.16);
}

.page-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.38;
  pointer-events: none;
}

.page-glow--a {
  top: 74px;
  left: -84px;
  background: rgba(245, 207, 208, 0.95);
}

.page-glow--b {
  right: -90px;
  bottom: 40px;
  background: rgba(202, 234, 223, 0.95);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px 18px 68px;
}

.hero {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 252, 249, 0.94)),
    linear-gradient(120deg, rgba(245, 207, 208, 0.18), rgba(202, 234, 223, 0.18));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.hero__copy {
  max-width: 760px;
}

.eyebrow,
.panel__kicker,
.formal-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9f7382;
}

.hero h1,
.metric strong,
.preview-amount,
.money {
  font-family: "Outfit", "IBM Plex Sans KR", sans-serif;
}

.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  line-height: 0.95;
}

.hero p {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero__actions,
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #7a6171;
  border: 1px solid rgba(155, 125, 139, 0.12);
  font-size: 0.92rem;
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.panel--meta,
.panel--participants,
.panel--expenses {
  grid-column: span 4;
  align-content: start;
}

.panel--results {
  grid-column: 1 / -1;
}

.panel__head {
  display: grid;
  gap: 8px;
}

.panel__head--spaced {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.panel__head h2,
.subpanel__head h3,
.formal-sheet h3,
.formal-card h4 {
  margin: 4px 0 0;
}

.panel__head p,
.subpanel__head p,
.helper,
.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

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

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
  color: #684f5d;
}

.field--wide {
  grid-column: 1 / -1;
}

.field--compact input[type="color"] {
  padding: 8px;
  min-height: 52px;
}

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

.stack-actions {
  display: flex;
  gap: 10px;
}

.stack-actions--inline {
  align-items: end;
}

.stack-actions--wrap {
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, #e9aeb3, #f0c6ba);
  color: #3f1f28;
  box-shadow: 0 14px 26px rgba(233, 174, 179, 0.3);
}

.button--soft {
  background: rgba(202, 234, 223, 0.86);
  color: #27594b;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(155, 125, 139, 0.14);
  color: #604b58;
}

.list-card,
.subpanel,
.formula-section,
.notice,
.metric,
.simple-summary,
.formal-card,
.chip {
  border: 1px solid rgba(155, 125, 139, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.list-card,
.subpanel,
.formula-section,
.simple-summary,
.formal-card {
  border-radius: 22px;
}

.list-card {
  min-height: 120px;
  overflow: hidden;
}

.participant-item,
.expense-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(155, 125, 139, 0.08);
}

.participant-item:last-child,
.expense-item:last-child {
  border-bottom: 0;
}

.person-row,
.expense-row,
.subtle-row,
.summary-columns,
.summary-highlight,
.formal-grid,
.formal-bank,
.formal-signoff {
  display: flex;
  gap: 12px;
}

.person-row,
.expense-row,
.summary-highlight,
.formal-bank,
.formal-signoff {
  align-items: center;
  justify-content: space-between;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.avatar-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.title-group {
  display: grid;
  gap: 4px;
}

.title-group strong {
  font-size: 1rem;
}

.title-group small,
.subtle {
  color: var(--ink-soft);
}

.mini-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(245, 244, 247, 0.92);
  color: #694f5d;
  font-size: 0.88rem;
  font-weight: 700;
}

.mini-button--danger {
  color: var(--danger);
}

.amount-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(219, 232, 255, 0.72);
  color: #4c6299;
  font-weight: 700;
}

.badge-row,
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  cursor: pointer;
}

.chip input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.chip.is-selected {
  background: rgba(202, 234, 223, 0.92);
  border-color: rgba(120, 184, 166, 0.4);
}

.chip__tone {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.subpanel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.subpanel__head {
  display: grid;
  gap: 6px;
}

.custom-share-grid {
  display: grid;
  gap: 12px;
}

.custom-share-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 180px);
  gap: 12px;
  align-items: center;
}

.custom-share-row__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.view-switch {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(155, 125, 139, 0.14);
}

.view-switch__button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  color: #715766;
}

.view-switch__button.is-active {
  background: linear-gradient(135deg, rgba(245, 207, 208, 0.82), rgba(202, 234, 223, 0.82));
  color: #3f2330;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
}

.metric span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.metric strong {
  font-size: 1.5rem;
  line-height: 1;
}

.notice-stack {
  display: grid;
  gap: 10px;
}

.notice {
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.6;
}

.notice--warn {
  background: rgba(248, 232, 181, 0.62);
  color: #6b5924;
}

.notice--info {
  background: rgba(219, 232, 255, 0.62);
  color: #3d5686;
}

.formula-board {
  display: grid;
  gap: 14px;
}

.receipt-status,
.transfer-section,
.share-links-panel {
  border: 1px solid rgba(125, 145, 169, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

.receipt-status {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #5b6878;
  line-height: 1.6;
}

.receipt-status--idle {
  background: rgba(247, 249, 251, 0.86);
}

.receipt-status--loading {
  background: rgba(229, 237, 246, 0.9);
  color: #415e82;
}

.receipt-status--success {
  background: rgba(226, 241, 233, 0.94);
  color: #2f725c;
}

.receipt-status--warn {
  background: rgba(255, 239, 225, 0.94);
  color: #946147;
}

.formula-section {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.formula-section__title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.formula-section__title h3,
.simple-summary h3 {
  margin: 0;
  font-size: 1.15rem;
}

.formula-list {
  display: grid;
  gap: 10px;
}

.formula-line {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 251, 248, 0.9);
  line-height: 1.65;
}

.preview-surface {
  display: grid;
}

.transfer-dashboard {
  display: grid;
}

.transfer-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
}

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

.transfer-section__head h3,
.share-links-panel__head h4 {
  margin: 0;
  font-family: "Gowun Batang", serif;
  font-size: 1.1rem;
}

.transfer-section__head p,
.share-links-panel__head p {
  margin: 6px 0 0;
  color: #667281;
  line-height: 1.6;
}

.transfer-summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(229, 237, 246, 0.92);
  color: #4a627a;
  font-weight: 700;
  white-space: nowrap;
}

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

.transfer-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(248, 251, 253, 0.92);
  border: 1px solid rgba(125, 145, 169, 0.14);
}

.transfer-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.transfer-card__head h4 {
  margin: 0;
}

.transfer-card__head span {
  color: #718194;
  font-size: 0.9rem;
  font-weight: 700;
}

.transfer-list {
  display: grid;
  gap: 10px;
}

.transfer-row {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(125, 145, 169, 0.12);
}

.transfer-row__copy,
.transfer-row__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.transfer-row__copy span {
  font-family: "Outfit", "IBM Plex Sans KR", sans-serif;
  font-weight: 700;
}

.transfer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.transfer-badge.is-confirmed {
  background: rgba(222, 239, 233, 0.96);
  color: #386b5d;
}

.transfer-badge.is-pending {
  background: rgba(255, 239, 225, 0.94);
  color: #8c5f47;
}

.simple-summary {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.simple-summary__hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.simple-summary__hero p,
.simple-summary__hero h3,
.chat-copy {
  margin: 0;
}

.simple-summary__hero p,
.simple-summary__bank,
.summary-card p {
  color: var(--ink-soft);
}

.preview-amount {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.92;
}

.simple-summary__bank {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 244, 0.95));
}

.summary-columns {
  flex-wrap: wrap;
}

.summary-card {
  flex: 1 1 260px;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(155, 125, 139, 0.12);
}

.summary-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.summary-highlight {
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(202, 234, 223, 0.9), rgba(219, 232, 255, 0.85));
}

.chat-copy {
  padding: 18px;
  border-radius: 20px;
  background: #fffdfb;
  border: 1px dashed rgba(155, 125, 139, 0.22);
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 0.95rem;
}

.formal-sheet {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 252, 246, 0.98)),
    linear-gradient(135deg, rgba(245, 207, 208, 0.14), rgba(202, 234, 223, 0.14));
  border: 1px solid rgba(181, 140, 90, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.formal-sheet::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 22px;
  border: 1px solid rgba(181, 140, 90, 0.12);
  pointer-events: none;
}

.formal-head {
  position: relative;
  display: grid;
  gap: 18px;
}

.formal-head h3 {
  font-family: "Gowun Batang", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.formal-head p {
  margin: 0;
  color: #7c6d63;
  line-height: 1.7;
}

.formal-head__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.formal-head__meta div,
.formal-mini {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(181, 140, 90, 0.14);
}

.formal-head__meta dt,
.formal-mini span {
  font-size: 0.82rem;
  color: #88796e;
}

.formal-head__meta dd {
  margin: 6px 0 0;
  font-weight: 700;
}

.formal-grid {
  flex-wrap: wrap;
}

.formal-card {
  flex: 1 1 280px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.formal-card h4 {
  font-family: "Gowun Batang", serif;
  font-size: 1.12rem;
}

.formal-mini strong,
.formal-bank strong {
  display: block;
  margin-top: 4px;
}

.formal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.formal-table th,
.formal-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(181, 140, 90, 0.16);
  text-align: left;
  vertical-align: top;
}

.formal-table th {
  color: #8b7769;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.formal-bank {
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245, 207, 208, 0.32), rgba(202, 234, 223, 0.36));
  border: 1px solid rgba(155, 125, 139, 0.12);
}

.formal-signoff {
  padding-top: 4px;
}

.formal-signoff__line {
  flex: 1 1 240px;
  padding-top: 24px;
  border-top: 1px solid rgba(181, 140, 90, 0.24);
  color: #7d6c61;
}

body.is-preview-open {
  overflow: hidden;
}

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

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

.preview-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(55, 40, 47, 0.34);
  backdrop-filter: blur(12px);
}

.preview-modal__dialog {
  position: relative;
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border-radius: 30px;
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 32px 90px rgba(39, 58, 74, 0.2);
}

.preview-toolbar,
.preview-toolbar__copy {
  display: grid;
  gap: 8px;
}

.preview-toolbar {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.preview-toolbar__copy h2 {
  margin: 0;
  font-family: "Gowun Batang", serif;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.preview-toolbar__copy p {
  margin: 0;
  color: #7a6a64;
}

.preview-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.preview-modal__body {
  overflow: auto;
  padding: 4px;
}

.share-hub {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  min-height: 0;
}

.share-pane {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(125, 145, 169, 0.16);
}

.share-pane--formal {
  padding-right: 14px;
}

.share-pane__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.share-pane__head h3 {
  margin: 6px 0 6px;
  font-family: "Gowun Batang", serif;
  font-size: 1.2rem;
}

.share-pane__head p {
  margin: 0;
  color: #667281;
  line-height: 1.6;
}

.share-pane__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.share-chat-card {
  margin: 0;
  min-height: 100%;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(246, 249, 251, 0.96), rgba(240, 245, 249, 0.92));
  border: 1px solid rgba(125, 145, 169, 0.16);
  color: #24303c;
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 0.95rem;
}

.share-links-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
}

.share-links-list {
  display: grid;
  gap: 10px;
}

.share-link-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248, 251, 253, 0.95);
  border: 1px solid rgba(125, 145, 169, 0.12);
}

.share-link-row div {
  display: grid;
  gap: 4px;
}

.share-link-row span {
  color: #6a7a8d;
  font-size: 0.9rem;
}

.formal-export-root {
  position: fixed;
  left: -300vw;
  top: 0;
  width: 1080px;
  pointer-events: none;
}

.formal-preview-shell,
.formal-page__body,
.formal-block,
.formal-section,
.formal-summary-list,
.formal-checks {
  display: grid;
}

.formal-preview-shell {
  gap: 14px;
}

.formal-preview-note {
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(155, 125, 139, 0.12);
  color: #6d5c67;
  line-height: 1.6;
}

.formal-preview-stack {
  display: grid;
  justify-items: center;
  gap: 22px;
}

.formal-page {
  width: min(100%, 860px);
  min-height: 1215px;
  display: flex;
  flex-direction: column;
  padding: 34px 34px 24px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(252, 253, 254, 0.99), rgba(245, 248, 251, 0.98)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(232, 239, 247, 0.48));
  border: 1px solid rgba(115, 136, 162, 0.22);
  box-shadow:
    0 24px 48px rgba(69, 92, 118, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.formal-preview-shell--inline .formal-page {
  width: min(100%, 760px);
  min-height: 1075px;
}

.formal-preview-shell--export .formal-page {
  width: 940px;
  min-height: 1329px;
}

.formal-page__body {
  flex: 1 1 auto;
  gap: 18px;
}

.formal-page__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(115, 136, 162, 0.2);
  color: #6a7b8d;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.formal-page__header {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.formal-page__header h3 {
  margin: 8px 0 10px;
  font-family: "Gowun Batang", serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.18;
}

.formal-page__header p {
  margin: 0;
  color: #5d6b79;
  line-height: 1.72;
}

.formal-docbox,
.formal-summary-list,
.formal-checks {
  gap: 12px;
  margin: 0;
}

.formal-docbox {
  padding: 18px;
  border-radius: 24px;
  background: rgba(248, 251, 253, 0.9);
  border: 1px solid rgba(115, 136, 162, 0.18);
}

.formal-docbox div,
.formal-summary-list div,
.formal-checks div {
  display: grid;
  gap: 4px;
}

.formal-docbox dt,
.formal-summary-list dt,
.formal-checks dt {
  font-size: 0.82rem;
  color: #708091;
}

.formal-docbox dd,
.formal-summary-list dd,
.formal-checks dd {
  margin: 0;
  font-weight: 700;
  color: #24303c;
}

.formal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.formal-kpi {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(248, 251, 253, 0.92);
  border: 1px solid rgba(115, 136, 162, 0.16);
}

.formal-kpi span {
  color: #708091;
  font-size: 0.82rem;
}

.formal-kpi strong {
  font-family: "Outfit", "IBM Plex Sans KR", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  color: #24303c;
}

.formal-section {
  gap: 14px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(115, 136, 162, 0.16);
}

.formal-section--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.formal-section__heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.formal-section__heading h4 {
  margin: 0;
  font-family: "Gowun Batang", serif;
  font-size: 1.12rem;
}

.formal-section__heading p {
  margin: 4px 0 0;
  color: #667584;
  line-height: 1.62;
}

.formal-section__meta,
.formal-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.formal-section__meta {
  background: rgba(229, 237, 246, 0.95);
  color: #536678;
}

.formal-transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.formal-transfer-box {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 251, 253, 0.96);
  border: 1px solid rgba(115, 136, 162, 0.14);
}

.formal-transfer-box__label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #67788a;
}

.formal-person-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.formal-person-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(115, 136, 162, 0.2);
}

.formal-person-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.formal-empty,
.formal-footnote {
  margin: 0;
  color: #677586;
  line-height: 1.64;
}

.formal-note-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #374453;
  line-height: 1.66;
}

.formal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.92rem;
}

.formal-table--tight {
  font-size: 0.88rem;
}

.formal-table th,
.formal-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(115, 136, 162, 0.16);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.formal-table th {
  color: #6d7e90;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.formal-table__sub {
  margin-top: 4px;
  color: #758598;
  font-size: 0.8rem;
}

.formal-table__money {
  font-weight: 700;
  color: #24303c;
}

.formal-status--pay {
  background: rgba(255, 232, 222, 0.96);
  color: #91573e;
}

.formal-status--refund {
  background: rgba(226, 236, 248, 0.96);
  color: #426281;
}

.formal-status--done {
  background: rgba(222, 239, 233, 0.96);
  color: #3b6f61;
}

.formal-approval {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: auto;
}

.formal-approval__line {
  display: grid;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(115, 136, 162, 0.24);
  color: #617284;
}

.personal-share-view {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 0;
}

.personal-share-card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(244, 248, 252, 0.98)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(225, 236, 247, 0.52));
  border: 1px solid rgba(125, 145, 169, 0.18);
  box-shadow: 0 24px 60px rgba(69, 92, 118, 0.18);
}

.personal-share-card__head,
.personal-share-card__hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.personal-share-card__head h2 {
  margin: 8px 0 8px;
  font-family: "Gowun Batang", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.personal-share-card__head p {
  margin: 0;
  color: #69798b;
}

.personal-share-card__label {
  display: inline-block;
  color: #6f7f92;
  font-size: 0.86rem;
  font-weight: 700;
}

.personal-share-card__hero strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.personal-share-card__amount {
  margin-top: 10px;
  font-family: "Outfit", "IBM Plex Sans KR", sans-serif;
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1;
  color: #24303c;
}

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

.personal-share-block {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(125, 145, 169, 0.16);
}

.personal-share-block h3 {
  margin: 0;
  font-family: "Gowun Batang", serif;
}

.personal-share-block p,
.personal-share-meta span {
  margin: 0;
  color: #667584;
  line-height: 1.65;
}

.personal-share-meta {
  display: grid;
  gap: 4px;
}

body.is-personal-share .shell {
  display: none;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 22px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state--compact {
  min-height: auto;
  padding: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .panel--meta,
  .panel--participants,
  .panel--expenses,
  .panel--results {
    grid-column: 1 / -1;
  }

  .summary-metrics,
  .formal-head__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formal-page__header,
  .formal-section--duo,
  .formal-transfer-grid,
  .transfer-columns,
  .personal-share-grid,
  .share-hub,
  .preview-toolbar {
    grid-template-columns: 1fr;
  }

  .preview-toolbar__actions {
    justify-content: flex-start;
  }

  .transfer-section__head,
  .personal-share-card__head,
  .personal-share-card__hero {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px 12px 46px;
  }

  .hero,
  .panel,
  .simple-summary,
  .formal-sheet {
    padding: 20px;
    border-radius: 24px;
  }

  .form-grid,
  .summary-metrics,
  .formal-head__meta {
    grid-template-columns: 1fr;
  }

  .panel__head--spaced,
  .simple-summary__hero,
  .summary-highlight,
  .person-row,
  .expense-row,
  .formal-bank,
  .formal-signoff {
    grid-template-columns: 1fr;
    display: grid;
  }

  .custom-share-row {
    grid-template-columns: 1fr;
  }

  .view-switch {
    width: 100%;
    justify-content: stretch;
  }

  .view-switch__button {
    flex: 1 1 0;
  }

  .stack-actions {
    flex-wrap: wrap;
  }

  .preview-modal {
    padding: 12px;
  }

  .preview-modal__dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 24px;
  }

  .preview-toolbar__actions {
    justify-content: stretch;
  }

  .preview-toolbar__actions .button {
    flex: 1 1 0;
  }

  .share-pane,
  .share-pane--formal {
    padding: 16px;
  }

  .share-pane__head {
    grid-template-columns: 1fr;
  }

  .share-pane__actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .share-pane__actions .button,
  .share-pane__head .button {
    width: 100%;
  }

  .formal-kpi-grid,
  .formal-approval {
    grid-template-columns: 1fr;
  }

  .formal-page,
  .formal-preview-shell--inline .formal-page {
    width: 100%;
    min-height: auto;
    padding: 24px 20px 18px;
    border-radius: 24px;
  }

  .formal-page__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .formal-section,
  .formal-docbox {
    padding: 16px;
  }

  .transfer-section,
  .personal-share-card {
    padding: 18px;
    border-radius: 24px;
  }

  .transfer-row__copy,
  .transfer-row__meta,
  .share-link-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .personal-share-view {
    padding: 16px 12px 0;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  .page-glow,
  .hero,
  .panel:not(.panel--results) .button,
  .stack-actions,
  .summary-metrics,
  .notice-stack,
  .formula-board {
    display: none !important;
  }

  .shell {
    max-width: none;
    padding: 0;
  }

  .workspace {
    display: block;
    margin: 0;
  }

  .panel--results {
    padding: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
  }

  .preview-surface {
    display: block;
  }
}
