:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #c7d2df;
  --line-soft: #d7e0ea;
  --ink: #020617;
  --muted: #334155;
  --brand: #0f766e;
  --brand-strong: #0b5d56;
  --brand-soft: #dff8f4;
  --danger: #dc2626;
  --warning: #a16207;
  --dark: #020617;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
}

body {
  min-width: 1180px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis-weight: none;
  letter-spacing: 0;
}

body.login-page {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
}

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

button,
.action-link,
.guide-link {
  cursor: pointer;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

button.primary:hover {
  background: var(--brand-strong);
}

.dark-button {
  width: 100%;
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
  font-weight: 700;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
  font-weight: 700;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

legend {
  padding: 0 7px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.brand {
  min-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.channel-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar .channel-shortcuts .channel-link {
  min-width: 92px;
  min-height: 36px;
  padding: 0 11px;
  border-color: #fecaca;
  background: #fff;
  color: #991b1b;
  font-size: 13px;
  white-space: nowrap;
}

.topbar .channel-shortcuts .channel-link:hover {
  border-color: #dc2626;
  background: #fff1f2;
  color: #7f1d1d;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar a {
  min-width: 112px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.topbar a:hover,
.topbar a.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.shell {
  width: min(1240px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 22px;
}

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

.publish-switch button {
  min-height: 40px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.publish-switch button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: inset 0 -3px 0 var(--brand);
}

.header-publish-switch {
  position: absolute;
  left: 50%;
  width: min(360px, 32vw);
  transform: translateX(-50%);
}

.post-form label:has(#publishProfileSelect) {
  display: none;
}

.post-form .form-grid.two:has(#publishProfileSelect) {
  grid-template-columns: 1fr;
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: center;
}

.hero-panel.narrow {
  grid-template-columns: 1fr 380px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.lead,
.hint {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.lead {
  margin-top: 8px;
  max-width: 720px;
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-strip > div,
.connect-status {
  min-height: 76px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 13px;
  background: var(--panel-soft);
  display: grid;
  align-content: center;
  gap: 5px;
}

.status-strip span,
.connect-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-strip strong,
.connect-status b {
  font-size: 17px;
  font-weight: 800;
}

.workspace {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.setup-layout {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.profile-panel {
  margin-top: 16px;
  box-shadow: none;
}

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

.profile-selector button {
  min-height: 48px;
  border-color: var(--line);
  background: #fff;
}

.profile-selector button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.compact-setup {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.compact-setup > .panel:nth-child(1),
.compact-setup > .panel:nth-child(2),
.compact-setup > .panel:nth-child(3),
.compact-setup > .panel:nth-child(4),
.compact-setup > .panel:nth-child(5),
.compact-setup > .source-connect-panel {
  grid-column: 1 / 2;
}

.compact-setup > .done-panel {
  grid-column: 2 / 3;
  grid-row: 1 / span 6;
  position: sticky;
  top: 86px;
}

.panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.create-panel {
  min-width: 0;
}

.side-stack {
  display: grid;
  gap: 16px;
}

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

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-head > span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.guide-link {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  display: grid;
  align-content: center;
  gap: 8px;
  text-decoration: none;
}

.guide-link:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.guide-link b {
  font-size: 16px;
  font-weight: 800;
}

.guide-link span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.copy-card {
  display: grid;
  gap: 8px;
}

.copy-card label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
}

.copy-row code {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
}

.optional-help {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.optional-help summary {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.optional-help .copy-row {
  margin-top: 10px;
}

#settingsFields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#settingsFields .field:first-child {
  grid-column: 1 / -1;
}

.stored-key-card {
  grid-column: 1 / -1;
  min-height: 58px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 12px;
  background: var(--brand-soft);
  display: grid;
  gap: 4px;
}

.stored-key-card b {
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 800;
}

.stored-key-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.need-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.need-list > div {
  min-height: 68px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  display: grid;
  align-content: center;
  gap: 5px;
}

.need-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.need-list strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.source-tabs label,
.check-grid label {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.source-tabs input,
.check-grid input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand);
}

.source-tabs label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

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

.source-app-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.source-app-card b {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.source-app-card span,
.source-app-card code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-app-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-app-actions button {
  min-width: 94px;
}

.source-box {
  display: grid;
  gap: 10px;
}

.drop-zone {
  min-height: 150px;
  border: 1px dashed #93a4b8;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
}

.drop-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone b {
  font-size: 17px;
  font-weight: 800;
}

.drop-zone span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-list {
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

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

.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.two,
.check-grid.two {
  grid-template-columns: 1fr 1fr;
}

.form-grid.three {
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
}

.check-grid {
  display: grid;
  gap: 8px;
}

.submit-row,
.setup-buttons {
  display: grid;
  grid-template-columns: 220px 140px;
  gap: 10px;
  justify-content: end;
}

.setup-buttons {
  grid-template-columns: 150px 220px;
  justify-content: start;
}

.job-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
}

.job-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.job-item.job-group {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.job-item b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.job-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.job-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.status-pill.queued {
  background: #fef3c7;
  color: var(--warning);
}

.status-pill.failed {
  background: #fee2e2;
  color: var(--danger);
}

.status-pill.success {
  background: #dcfce7;
  color: #166534;
}

.action-link {
  width: fit-content;
  min-height: 42px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.full-link {
  width: 100%;
}

.done-panel {
  align-content: start;
  gap: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #0f172a;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
  z-index: 30;
}

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

.login-panel {
  width: min(390px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.login-panel h1 {
  max-width: none;
  font-size: 20px;
}

.login-message {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
