:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", Arial, sans-serif;
  color: #172033;
  background: #f4f6f8;
}

* { box-sizing: border-box; }

body.msg-page {
  min-height: 100vh;
  margin: 0;
  background: #f4f6f8;
  color: #172033;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.msg-site-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #dce1e7;
  background: #fff;
}

.msg-brand { display: flex; align-items: center; gap: 14px; color: #333b47; text-decoration: none; font-weight: 700; }
.msg-brand img { width: 48px; height: auto; display: block; }
.msg-header-login { border: 1px solid #c9d0d9; background: #fff; color: #273244; padding: 9px 15px; border-radius: 6px; cursor: pointer; }

.msg-preview-main { width: min(920px, calc(100% - 32px)); margin: 42px auto 80px; }
.msg-preview-main--wide { width: min(1240px, calc(100% - 28px)); }
.msg-tool-shell { padding: 28px; border: 1px solid #d9dfe6; border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(28, 39, 54, .08); }
.msg-tool-heading { display: flex; align-items: center; gap: 15px; padding-bottom: 22px; border-bottom: 1px solid #e6e9ed; }
.msg-tool-heading h1 { margin: 0 0 6px; font-size: 25px; line-height: 1.25; }
.msg-tool-heading p { margin: 0; color: #667085; font-size: 14px; }
.msg-tool-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #f04438; color: #fff; font-size: 19px; font-weight: 800; }
.msg-page--teal .msg-tool-icon { background: #0f8f83; }
.msg-field-label { display: block; margin: 22px 0 8px; color: #344054; font-size: 13px; font-weight: 700; }
.msg-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.msg-input-preview, .msg-textarea, .msg-select-preview, .msg-search-preview { border: 1px solid #cfd6df; border-radius: 6px; background: #fff; color: #98a2b3; }
.msg-input-preview { min-height: 44px; padding: 12px 14px; }
.msg-input-row button, .msg-document-toolbar button { border: 0; border-radius: 6px; background: #35445c; color: #fff; padding: 0 18px; cursor: pointer; }
.msg-textarea { min-height: 86px; padding: 14px; }
.msg-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-chip-row span { padding: 8px 12px; border: 1px solid #ccd3dc; border-radius: 5px; background: #fff; color: #4b5565; font-size: 13px; }
.msg-chip-row span.is-selected { border-color: #0f8f83; color: #08756c; background: #edf9f7; }
.msg-option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.msg-option-grid div { padding: 15px; border: 1px solid #d8dee6; border-radius: 6px; background: #f8fafb; }
.msg-option-grid strong, .msg-option-grid span { display: block; }
.msg-option-grid span { margin-top: 4px; color: #7a8493; font-size: 12px; }
.msg-primary-action { width: 100%; margin-top: 18px; border: 0; border-radius: 6px; background: #e63f32; color: #fff; padding: 13px 18px; font-weight: 700; cursor: pointer; }
.msg-page--teal .msg-primary-action { background: #0f8f83; }
.msg-history-preview { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e5e9ee; }
.msg-section-title { margin-bottom: 14px; font-size: 15px; font-weight: 800; }
.msg-placeholder-line { height: 12px; margin: 11px 0; border-radius: 3px; background: #e9edf1; }
.msg-placeholder-line--short { width: 62%; }

.msg-document-grid { min-height: 620px; display: grid; grid-template-columns: 280px minmax(0, 1fr); border: 1px solid #d8dee5; background: #fff; box-shadow: 0 10px 28px rgba(28, 39, 54, .08); }
.msg-document-sidebar { padding: 22px; border-right: 1px solid #d8dee5; background: #f8fafb; }
.msg-select-preview { padding: 11px 12px; color: #667085; }
.msg-search-preview { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 12px; }
.msg-search-preview span { color: #315f94; font-weight: 700; }
.msg-outline-item { padding: 10px 11px; margin-top: 7px; border-left: 3px solid transparent; color: #5b6574; font-size: 13px; }
.msg-outline-item.is-active { border-left-color: #315f94; background: #eaf1f8; color: #244b76; font-weight: 700; }
.msg-document-content { min-width: 0; padding: 24px; }
.msg-document-toolbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid #e2e7ec; }
.msg-document-toolbar strong, .msg-document-toolbar span { display: block; }
.msg-document-toolbar span { margin-top: 4px; color: #8a93a0; font-size: 12px; }
.msg-document-toolbar button { min-height: 38px; }
.msg-document-page { margin-top: 22px; padding: 26px; border: 1px solid #e0e5ea; min-height: 440px; }
.msg-document-title-line { width: 48%; height: 20px; margin-bottom: 28px; background: #cfd8e2; }
.msg-table-preview { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 34px; border-top: 1px solid #d7dee6; border-left: 1px solid #d7dee6; }
.msg-table-preview span { height: 46px; border-right: 1px solid #d7dee6; border-bottom: 1px solid #d7dee6; }

.msg-backdrop { position: fixed; inset: 0; z-index: 10000; background: rgba(24, 32, 45, .46); backdrop-filter: blur(1.5px); }
.msg-dialog { position: fixed; z-index: 10001; top: 50%; left: 50%; width: min(440px, calc(100% - 24px)); max-height: calc(100vh - 28px); overflow-y: auto; transform: translate(-50%, -50%); padding: 25px 28px 22px; border: 1px solid rgba(255,255,255,.7); border-radius: 8px; background: rgba(255,255,255,.97); box-shadow: 0 24px 70px rgba(8, 15, 27, .28); }
.msg-dialog[hidden], .msg-backdrop[hidden] { display: none; }
.msg-dialog-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; background: transparent; color: #697384; font-size: 25px; line-height: 1; cursor: pointer; }
.msg-dialog-brand img { width: 48px; height: auto; }
.msg-dialog-heading { margin-top: 14px; }
.msg-eyebrow { color: #d93b30; font-size: 12px; font-weight: 800; }
.msg-page--teal .msg-eyebrow { color: #08756c; }
.msg-page--blue .msg-eyebrow { color: #315f94; }
.msg-dialog-heading h2 { margin: 7px 0 7px; padding-right: 32px; font-size: 21px; line-height: 1.35; }
.msg-dialog-heading p { margin: 0 0 19px; color: #667085; font-size: 13px; line-height: 1.65; }
.msg-login-form label { display: block; margin: 11px 0 6px; color: #344054; font-size: 13px; font-weight: 700; }
.msg-login-form input { width: 100%; height: 43px; border: 1px solid #cbd2dc; border-radius: 6px; padding: 0 12px; color: #172033; background: #fff; outline: none; }
.msg-login-form input:focus { border-color: #667f9b; box-shadow: 0 0 0 3px rgba(61, 91, 125, .12); }
.msg-recaptcha-shell { min-height: 78px; margin-top: 14px; overflow: hidden; }
.msg-form-status { min-height: 20px; margin: 7px 0; color: #c52f28; font-size: 12px; }
.msg-login-submit { width: 100%; min-height: 44px; border: 0; border-radius: 6px; background: #df3e32; color: #fff; font-weight: 800; cursor: pointer; }
.msg-page--teal .msg-login-submit { background: #087f75; }
.msg-page--blue .msg-login-submit { background: #315f94; }
.msg-login-submit:disabled { opacity: .65; cursor: wait; }
.msg-account-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 15px; font-size: 12px; }
.msg-account-links a { color: #536174; text-decoration: none; }
.msg-preview-button { width: 100%; margin-top: 15px; border: 1px solid #cbd2dc; border-radius: 6px; background: #fff; color: #344054; padding: 10px 14px; cursor: pointer; }

@media (max-width: 760px) {
  .msg-site-header { height: 62px; padding: 0 16px; }
  .msg-brand img { width: 42px; }
  .msg-preview-main { margin-top: 22px; }
  .msg-tool-shell { padding: 20px; }
  .msg-tool-heading h1 { font-size: 20px; }
  .msg-option-grid { grid-template-columns: 1fr; }
  .msg-document-grid { grid-template-columns: 1fr; min-height: 660px; }
  .msg-document-sidebar { border-right: 0; border-bottom: 1px solid #d8dee5; }
  .msg-outline-item:nth-of-type(n+4) { display: none; }
  .msg-document-content { padding: 18px; }
  .msg-document-page { padding: 18px; }
}

@media (max-width: 370px) {
  .msg-dialog { padding-left: 20px; padding-right: 20px; }
  .msg-recaptcha-shell { height: 70px; }
  .msg-recaptcha-shell .g-recaptcha { transform: scale(.86); transform-origin: left top; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
