@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Sans+KR:wght@400;500;600;700&display=swap");

:root {
  --ink: #132123;
  --ink-soft: #52696d;
  --white: #fffdfa;
  --panel: rgba(255, 250, 244, 0.82);
  --panel-dark: rgba(16, 42, 45, 0.96);
  --panel-dark-2: rgba(23, 52, 58, 0.96);
  --line: rgba(19, 33, 35, 0.1);
  --line-strong: rgba(255, 255, 255, 0.14);
  --teal: #2eb2a3;
  --teal-deep: #1f776d;
  --amber: #ffab48;
  --coral: #ef6b57;
  --lime: #88ba57;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 26px 60px rgba(14, 35, 37, 0.12);
  --shadow-soft: 0 18px 34px rgba(19, 33, 35, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 171, 72, 0.2), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(46, 178, 163, 0.18), transparent 24%),
    linear-gradient(180deg, #f7efe3 0%, #efe4d6 100%);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.backdrop {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.76;
  pointer-events: none;
}

.backdrop-a {
  top: -8rem;
  left: -3rem;
  width: 24rem;
  height: 24rem;
  background: rgba(255, 171, 72, 0.24);
}

.backdrop-b {
  right: -4rem;
  bottom: -6rem;
  width: 28rem;
  height: 28rem;
  background: rgba(46, 178, 163, 0.18);
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100vh;
}

.surface,
.surface-dark {
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
}

.surface {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.surface-dark {
  background:
    linear-gradient(180deg, var(--panel-dark-2) 0%, var(--panel-dark) 100%);
  border: 1px solid var(--line-strong);
  color: var(--white);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 34%, var(--amber) 0 0.62rem, transparent 0.7rem),
    radial-gradient(circle at 70% 34%, var(--teal) 0 0.62rem, transparent 0.7rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.16);
  position: relative;
  flex: 0 0 auto;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.85rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
}

.topbar h1,
.hero-copy h2,
.section-head h3,
.control-head h3,
.detail-hero h2,
.panel-card h3,
.modal-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.topbar h1 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.topbar-copy {
  margin: 0.3rem 0 0;
  max-width: 44ch;
  color: rgba(255, 253, 250, 0.64);
  line-height: 1.45;
  font-size: 0.93rem;
}

.eyebrow,
.search-field span,
.workflow-form span {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--ink-soft);
}

.topbar .eyebrow,
.control-bar .eyebrow {
  color: rgba(255, 253, 250, 0.68);
}

.topbar-actions,
.detail-header,
.detail-actions,
.hero-stats,
.workflow-card-top,
.workflow-card-meta,
.workflow-card-bottom,
.section-head,
.control-head,
.modal-actions,
.connection-actions,
.provider-switch,
.payload-head,
.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
  align-self: center;
}

.topbar .ghost-button,
.topbar .primary-button {
  padding: 0.72rem 0.92rem;
}

.ghost-button,
.primary-button,
.action-button,
.provider-button,
.back-button,
.icon-button {
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1rem;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    opacity 140ms ease;
}

.ghost-button,
.provider-button,
.back-button {
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.primary-button {
  background: linear-gradient(120deg, var(--ink) 0%, var(--teal-deep) 100%);
  color: var(--white);
}

.action-button {
  background: rgba(19, 33, 35, 0.08);
  color: var(--ink);
}

.icon-button {
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  background: rgba(19, 33, 35, 0.08);
  color: var(--ink);
}

.ghost-button:hover,
.primary-button:hover,
.action-button:hover,
.provider-button:hover,
.back-button:hover,
.icon-button:hover,
.workflow-card:hover,
.filter-chip:hover,
.preset-pill:hover {
  transform: translateY(-1px);
}

.clock-chip,
.count-chip,
.status-chip,
.provider-pill,
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  line-height: 1;
  font-size: 0.78rem;
}

.clock-chip,
.count-chip {
  background: rgba(19, 33, 35, 0.08);
  color: var(--ink-soft);
}

.topbar .clock-chip {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 253, 250, 0.84);
}

.count-chip-light {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 253, 250, 0.82);
}

.status-chip {
  font-weight: 700;
}

.status-live {
  background: rgba(136, 186, 87, 0.18);
  color: #517b24;
}

.status-draft {
  background: rgba(255, 171, 72, 0.18);
  color: #9b5b12;
}

.status-attention {
  background: rgba(239, 107, 87, 0.16);
  color: #ae3829;
}

.provider-pill {
  background: rgba(46, 178, 163, 0.14);
  color: var(--teal-deep);
}

.badge,
.tag {
  background: rgba(19, 33, 35, 0.06);
  color: var(--ink);
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.is-hidden {
  display: none !important;
}

.hero-board {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 250, 244, 0.52);
  border-color: rgba(19, 33, 35, 0.06);
  box-shadow: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
}

.hero-copy h2,
.detail-hero h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.hero-copy h2 {
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
}

.hero-note,
.workflow-card-note,
.modal-copy,
.payload-note,
.log-item p {
  margin: 0;
  line-height: 1.65;
  color: var(--ink-soft);
}

.hero-board .eyebrow {
  color: rgba(19, 33, 35, 0.42);
}

.hero-board .hero-note {
  max-width: 56ch;
  font-size: 0.93rem;
  line-height: 1.55;
  color: rgba(19, 33, 35, 0.62);
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  align-self: end;
}

.metric-card {
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(19, 33, 35, 0.06);
  box-shadow: none;
}

.metric-card strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.15rem;
  line-height: 1;
  font-family: "Space Grotesk", sans-serif;
}

.metric-card span {
  color: rgba(19, 33, 35, 0.56);
  font-size: 0.74rem;
}

.control-bar,
.registry-panel,
.panel-card,
.detail-hero,
.modal-card {
  padding: 1.3rem;
}

.control-bar {
  order: 3;
  background: rgba(255, 251, 246, 0.52);
  border-color: rgba(19, 33, 35, 0.06);
  box-shadow: none;
  color: var(--ink);
}

.control-bar .eyebrow {
  color: rgba(19, 33, 35, 0.42);
}

.control-head h3 {
  font-size: 1rem;
}

.control-bar .count-chip-light {
  background: rgba(19, 33, 35, 0.06);
  color: rgba(19, 33, 35, 0.56);
}

.search-field {
  display: grid;
  gap: 0.5rem;
}

.search-field input,
.workflow-form input,
.workflow-form select,
.workflow-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 0.88rem 0.95rem;
  outline: none;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

.search-field input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.search-field input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.control-bar .search-field input {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(19, 33, 35, 0.08);
  color: var(--ink);
}

.control-bar .search-field input::placeholder {
  color: rgba(19, 33, 35, 0.4);
}

.search-field input:focus,
.workflow-form input:focus,
.workflow-form select:focus,
.workflow-form textarea:focus {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition:
    background 140ms ease,
    transform 140ms ease,
    border-color 140ms ease;
}

.filter-chip.is-active {
  background: rgba(255, 171, 72, 0.2);
  border-color: rgba(255, 171, 72, 0.52);
}

.control-bar .filter-chip {
  background: rgba(19, 33, 35, 0.04);
  color: rgba(19, 33, 35, 0.62);
  border-color: rgba(19, 33, 35, 0.08);
}

.control-bar .filter-chip.is-active,
.control-bar .filter-chip:hover {
  background: rgba(255, 171, 72, 0.12);
  color: var(--ink);
  border-color: rgba(255, 171, 72, 0.3);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
}

.workflow-card {
  position: relative;
  width: 100%;
  border: 1px solid rgba(19, 33, 35, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 241, 231, 0.84));
  color: var(--ink);
  padding: 1.1rem;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.workflow-card::after {
  content: "";
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 0.9rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  opacity: 0.8;
}

.workflow-card[data-connected="false"]::after {
  background: rgba(19, 33, 35, 0.18);
}

.workflow-card:hover {
  border-color: rgba(255, 171, 72, 0.42);
  box-shadow: var(--shadow);
}

.registry-panel {
  order: 1;
  background:
    radial-gradient(circle at top right, rgba(255, 171, 72, 0.16), transparent 18%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 241, 231, 0.94));
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  padding: 1.45rem;
}

.registry-panel .section-head {
  margin-bottom: 1.15rem;
}

.registry-panel h3 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.workflow-card h4 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.workflow-card p {
  margin: 0;
}

.workflow-card-meta,
.workflow-card-bottom,
.workflow-card-subtitle {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.tag-row,
.badge-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.workflow-card-bottom {
  margin-top: 0.95rem;
  padding-bottom: 0.6rem;
}

.empty-state {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(19, 33, 35, 0.05);
  color: var(--ink-soft);
  line-height: 1.65;
}

.empty-state .primary-button {
  margin-top: 0.9rem;
}

.detail-header {
  justify-content: space-between;
}

.back-button {
  padding-left: 1.05rem;
  padding-right: 1.05rem;
}

.detail-hero {
  background:
    radial-gradient(circle at top right, rgba(46, 178, 163, 0.16), transparent 20%),
    linear-gradient(145deg, #ffffff 0%, #f8f1e7 100%);
}

.detail-hero-head,
.detail-meta,
.hero-stats,
.log-item-top,
.meta-grid {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-stats {
  margin-top: 1rem;
}

.stat-block,
.meta-item {
  min-width: 9rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(19, 33, 35, 0.08);
}

.stat-block strong,
.meta-item strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

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

.panel-card {
  min-height: 18rem;
}

.connection-stack,
.step-list,
.log-list,
.workflow-form {
  display: grid;
  gap: 0.9rem;
}

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

.provider-button.is-active {
  background: rgba(46, 178, 163, 0.16);
  color: var(--teal-deep);
}

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

.step-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(19, 33, 35, 0.08);
}

.step-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--amber), var(--teal));
}

.step-card h4 {
  margin: 0;
  font-size: 0.98rem;
}

.step-card p {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.payload-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #182d31 0%, #0e1f22 100%);
  color: #e9f7f5;
}

.payload-card pre {
  margin: 0;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.log-list {
  max-height: 24rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.log-item {
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(19, 33, 35, 0.05);
  border: 1px solid rgba(19, 33, 35, 0.07);
}

.log-item p {
  margin-top: 0.5rem;
  color: var(--ink);
}

.level-success {
  background: rgba(136, 186, 87, 0.18);
  color: #517b24;
}

.level-info {
  background: rgba(46, 178, 163, 0.16);
  color: var(--teal-deep);
}

.level-warn {
  background: rgba(239, 107, 87, 0.16);
  color: #ae3829;
}

.modal-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  z-index: 40;
}

.modal-root.is-open {
  display: flex;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 22, 0.54);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 2.4rem);
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(255, 171, 72, 0.18), transparent 20%),
    linear-gradient(140deg, #ffffff 0%, #f8f1e7 100%);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.modal-copy {
  margin-top: 0.8rem;
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.preset-pill {
  border: 1px solid rgba(19, 33, 35, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 0.72rem 0.95rem;
}

.workflow-form {
  margin-top: 1rem;
}

.workflow-form label {
  display: grid;
  gap: 0.45rem;
}

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

.workflow-form textarea {
  resize: vertical;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

.toggle-row input {
  width: 1.05rem;
  height: 1.05rem;
}

@media (max-width: 1100px) {
  .hero-board,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar-copy {
    display: none;
  }
}

@media (max-width: 820px) {
  .detail-header,
  .workflow-card-top,
  .workflow-card-meta,
  .workflow-card-bottom,
  .hero-stats,
  .detail-hero-head,
  .detail-meta,
  .connection-actions,
  .provider-switch,
  .payload-head,
  .activity-head,
  .modal-header,
  .modal-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .step-list,
  .meta-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .app-shell {
    padding: 0.9rem;
  }

  .topbar,
  .topbar-actions,
  .control-bar,
  .registry-panel,
  .panel-card,
  .detail-hero,
  .modal-card,
  .hero-board {
    padding: 1rem;
  }

  .topbar,
  .topbar-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }
}
