:root {
  --navy: #0c2f54;
  --navy-2: #0f3d6e;
  --ink: #14181d;
  --muted: #66707c;
  --gold: #c4a35a;
  --paper: #f7f4ee;
  --line: #e4ddd0;
  --ok: #1f6b45;
  --warn: #9b3a12;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
button, input, select, textarea {
  font: inherit;
}
button { cursor: pointer; }
.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  background: var(--navy);
  padding: 32px 16px;
}
.gate-card {
  width: min(420px, 100%);
  background: #fff;
  padding: 40px 32px 32px;
  text-align: center;
}
.gate-card img { display: block; margin: 0 auto 18px; }
.gate-kicker {
  margin: 0;
  letter-spacing: .28em;
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
}
.gate-card h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 40px;
  margin: 8px 0 12px;
}
.gate-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}
.gate-card form { text-align: left; }
.gate-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.gate-card input, .gate-card button {
  width: 100%;
}
.gate-card input {
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.gate-card button, .actions button, .list-actions button, .row-actions .ghost, .btn-link {
  background: var(--navy);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  font-weight: 700;
}
.error { color: var(--warn); font-size: 13px; }
[hidden] { display: none !important; }
#app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100%;
}
aside {
  background: var(--navy);
  color: #e8eef5;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}
.aside-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}
.aside-brand img { border-radius: 4px; }
.aside-brand strong { display: block; font-size: 14px; }
.aside-brand span { font-size: 11px; letter-spacing: .12em; color: #9fb4cc; }
nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
nav button {
  background: transparent;
  color: #c5d4e4;
  border: 0;
  text-align: left;
  padding: 10px 12px;
  font-weight: 500;
}
nav button.active, nav button:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.aside-foot { font-size: 12px; color: #8ea3ba; }
.aside-foot .leave-site {
  display: block;
  margin: 0 0 12px;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.28);
  padding: 9px 12px;
  text-align: center;
  font-weight: 700;
}
.aside-foot .leave-site:hover { background: rgba(255,255,255,.08); }
.aside-foot button {
  margin-top: 8px;
  background: transparent;
  color: #ffd27a;
  border: 1px solid rgba(255,210,122,.35);
  padding: 8px 12px;
  width: 100%;
}
.gate-leave { margin: 18px 0 0; }
.gate-leave a {
  display: inline-block;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #d9d2c6;
  padding: 10px 14px;
}
.gate-leave a:hover { background: var(--paper); }
.top-meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.top-meta .leave-top {
  display: inline-block;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #d9d2c6;
  background: #fff;
  padding: 8px 12px;
}
.top-meta .leave-top:hover { background: var(--paper); }
main { padding: 28px 32px 48px; overflow: auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
}
.crumb { margin: 0; font-size: 12px; letter-spacing: .16em; color: var(--gold); font-weight: 700; }
.top h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 36px;
  margin: 4px 0 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px 16px;
}
.stat b { display: block; font-size: 28px; font-family: "Cormorant Garamond", serif; }
.stat span { color: var(--muted); font-size: 13px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px;
}
.card h3 { margin: 0 0 14px; font-size: 16px; }
.contact { display: grid; grid-template-columns: 72px 1fr; gap: 8px 12px; margin: 0; }
.contact dt { color: var(--muted); font-size: 13px; }
.contact dd { margin: 0; }
.search-box { margin-bottom: 16px; }
.search-box h3 { margin-bottom: 8px; }
.search-box textarea { min-height: 220px; line-height: 1.55; resize: vertical; }
.send-bar { margin-top: 18px; }
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.roster-card dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 10px;
  margin: 0 0 12px;
  font-size: 14px;
}
.roster-card dt { color: var(--muted); }
.roster-card dd { margin: 0; }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .form-grid input, .form-grid textarea, .form-grid select, .card input, .card textarea {
  border: 1px solid var(--line);
  padding: 10px 12px;
  width: 100%;
  background: #fff;
}
.toolbar input { max-width: 280px; }
.toolbar select { width: auto; }
.ghost {
  background: #fff !important;
  color: var(--navy) !important;
  border: 1px solid var(--navy) !important;
}
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); margin-bottom: 18px; }
.list-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.list-bar .hint { margin: 0; }
.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -10px 0 18px;
}
.chk-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.chk-all input,
th.chk input { width: 16px; height: 16px; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.chk { width: 88px; }
.company-name { font-weight: 700; }
.sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
}
.badge.ready { color: var(--navy); border-color: var(--navy); }
.badge.sent { color: var(--ok); border-color: var(--ok); }
.badge.client { color: var(--gold); border-color: var(--gold); }
.badge.progress { color: var(--orange, #e24a1b); border-color: var(--orange, #e24a1b); }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.send-progress { margin-top: 14px; }
.send-progress p { margin: 0 0 8px; font-weight: 700; }
.send-progress.is-done #send-progress-label {
  font-size: 28px;
  color: var(--ok);
}
.send-progress.is-done .send-track span { background: var(--ok); }
.send-track {
  height: 10px;
  background: #ece7dc;
  overflow: hidden;
}
.send-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--navy);
  transition: width .25s ease;
}
.mini {
  padding: 8px 12px !important;
  font-size: 13px !important;
}
.linkish {
  background: none;
  border: 0;
  color: var(--navy-2);
  padding: 0;
  font-weight: 600;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-top: 8px;
}
.form-grid h3, .full { grid-column: 1 / -1; }
.form-grid label, .card label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.form-grid label input, .form-grid label textarea, .form-grid label select, .card label input, .card label textarea {
  margin-top: 6px;
  font-weight: 400;
  color: var(--ink);
}
.actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.search-count {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.btn-link { display: inline-block; text-decoration: none; }
iframe {
  width: 100%;
  height: 720px;
  border: 1px solid var(--line);
  background: #d6e0ea;
}
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.preview-subject {
  font-weight: 700;
  font-size: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
pre {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.7;
  font-size: 14px;
}
.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.sample-card audio, .roster-card audio { width: 100%; margin: 12px 0; }
input[type="file"] { padding: 8px 0; }
.inline-mail {
  width: 100%;
  min-width: 160px;
  border: 1px solid var(--line);
  padding: 6px 8px;
}
.analyze-row td { background: #f4f1ea; padding: 10px 12px 14px; }
.analysis { font-size: 13px; line-height: 1.65; color: var(--ink); }
.analysis p { margin: 0 0 6px; }
.analysis.level-ok { border-left: 3px solid var(--ok); padding-left: 10px; }
.analysis.level-warn, .analysis.level-bad { border-left: 3px solid var(--warn); padding-left: 10px; }
.analysis.level-suggest, .analysis.level-missing, .analysis.level-unknown { border-left: 3px solid var(--gold); padding-left: 10px; }
.analysis.verdict-fail { border-left-color: var(--warn); background: #f8ece8; padding: 8px 10px; }
.hit-fail td { background: #fbf6f4; }
.verdict {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.verdict-pass { background: #e5f3eb; color: var(--ok); }
.verdict-fail { background: #f4e0d8; color: var(--warn); }
.analysis-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}
.analysis-head .verdict { margin-left: 0; }
input[type="file"] { padding: 8px 0; }
.warn { color: var(--warn); font-size: 12px; }
.log { font-size: 14px; line-height: 1.7; }
.log p { margin: 0 0 8px; }
.danger { background: #9b3a12 !important; }
.icon-del {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff !important;
  color: var(--warn);
  border: 1px solid #e2cfc8;
}
.icon-del svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-del:hover { background: #f8ece8 !important; }
dialog {
  border: 1px solid var(--line);
  padding: 0;
  width: min(640px, 94vw);
}
dialog::backdrop { background: rgba(12, 47, 84, .45); }
dialog form { padding: 24px; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  aside { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  nav { flex-direction: row; overflow: auto; flex: 1 1 100%; }
  .split, .form-grid { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}

.pwa-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #0c2f54;
  color: #f4f1ea;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 32px rgba(8, 24, 44, .35);
  font-size: 13px;
  line-height: 1.45;
}
.pwa-bar[hidden] { display: none !important; }
.pwa-bar p { margin: 0; flex: 1 1 180px; }
.pwa-bar strong { color: #ffb300; }
.pwa-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pwa-bar button {
  border: 0;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.pwa-install { background: #ffb300; color: #111; }
.pwa-dismiss { background: transparent; color: #d7e3f0; border: 1px solid rgba(215, 227, 240, .35) !important; }
@media (display-mode: standalone) {
  .pwa-bar { display: none !important; }
}
