:root {
  color-scheme: light;
  --ink: #101517;
  --muted: #687178;
  --faint: #eef1f4;
  --line: #d8dee4;
  --panel: #ffffff;
  --panel-soft: #f8fafb;
  --chrome: #1f2529;
  --chrome-2: #30383e;
  --blue: #2f5bea;
  --blue-dark: #1740c3;
  --green: #1aa36f;
  --amber: #f3c144;
  --red: #c7382f;
  --shadow: 0 12px 38px rgba(23, 33, 43, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #dfe5eb;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(440px, 1fr) 380px;
  grid-template-rows: 58px minmax(0, 1fr);
  gap: 1px;
  background: #cbd3da;
}

.global-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--chrome);
  color: #fff;
}

.brand-mark,
.site-dot {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111;
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  color: #8f9aa3;
  font-size: 12px;
  line-height: 1.2;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.global-bar h1 {
  font-size: 18px;
  line-height: 1.15;
}

.mode-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding: 3px;
  border-radius: 7px;
  background: var(--chrome-2);
}

.mode-tab,
.icon-button,
.browser-link,
.save-button,
.manager-actions button,
.tool-row button,
.text-button,
.primary-wide,
.source-card,
.mini-blueprints button {
  border-radius: 6px;
}

.mode-tab {
  min-width: 78px;
  padding: 8px 10px;
  background: transparent;
  color: #cdd4da;
}

.mode-tab.is-active {
  background: #fff;
  color: var(--ink);
}

.icon-button {
  min-width: 38px;
  height: 34px;
  background: #2f363c;
  color: #fff;
}

.library-pane,
.operations-pane,
.site-stage {
  min-width: 0;
  min-height: 0;
}

.library-pane,
.operations-pane {
  overflow: auto;
  background: var(--panel);
}

.library-pane {
  padding: 14px;
}

.pane-section + .pane-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #2a3238;
  font-weight: 700;
}

.text-button {
  padding: 5px 7px;
  background: transparent;
  color: var(--blue-dark);
  font-size: 13px;
}

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

.source-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
}

.source-card:hover,
.source-card.is-primary {
  border-color: var(--blue);
  background: #f1f5ff;
}

.source-card span,
.saved-item span,
.progress-copy span {
  color: var(--muted);
  font-size: 12px;
}

.saved-list {
  display: grid;
  gap: 8px;
}

.saved-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.saved-item.is-current {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.saved-item strong,
.saved-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-dot {
  width: 30px;
  height: 30px;
  border-color: #d8dee4;
  background: #111;
}

.site-dot.saved {
  background: var(--blue);
}

.kebab {
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--muted);
}

.save-progress {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fff7dc;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.progress-track span {
  display: block;
  width: 81%;
  height: 100%;
  background: var(--amber);
}

.mini-blueprints {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-blueprints button {
  padding: 7px 8px;
  background: #edf2f6;
  color: #263038;
  font-size: 12px;
}

.site-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #f5f7f8;
}

.browser-bar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--chrome);
}

.url-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: #3a4249;
  color: #dbe1e6;
}

.url-field span {
  color: #9aa5ae;
  font-size: 12px;
}

.url-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.browser-link {
  height: 34px;
  padding: 0 11px;
  background: #2f363c;
  color: #fff;
}

.browser-link.is-selected,
.save-button {
  background: var(--amber);
  color: #101517;
}

.save-button {
  height: 34px;
  padding: 0 14px;
  font-weight: 700;
}

.site-frame {
  overflow: auto;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.wp-admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 34px;
  align-items: center;
  padding: 7px 12px;
  background: #1f2529;
  color: #e9edf0;
  font-size: 13px;
}

.wp-admin-bar strong {
  margin-left: auto;
}

.wp-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 34px;
}

.wp-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 20px;
  color: #333;
}

.wp-content {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(300px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 46px 34px 60px;
}

.welcome-copy {
  max-width: 460px;
  margin-inline: auto;
}

.welcome-copy h2 {
  font-family: Georgia, serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: 0;
}

.welcome-copy h2 span {
  color: #3858e9;
}

.welcome-copy p {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.42;
}

.welcome-copy mark {
  background: #f7e59b;
}

.welcome-copy button {
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  border-radius: 3px;
  background: #3858e9;
  color: #fff;
  font-weight: 700;
}

.playground-art {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}

.orb-ring {
  position: absolute;
  inset: 48px -120px 8px 20px;
  border: 56px solid #30e877;
  border-radius: 50%;
}

.orb-ring::after {
  content: "";
  position: absolute;
  inset: 130px 84px 26px;
  border: 52px solid #30e877;
  border-radius: 50%;
}

.wp-emblem {
  position: absolute;
  top: 10px;
  left: 27%;
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
  border: 16px solid #1f1f1f;
  border-radius: 50%;
  color: #1f1f1f;
  font-family: Georgia, serif;
  font-size: 172px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.4);
}

.operations-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.manager-header {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.manager-header h2 {
  font-size: 18px;
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.manager-actions button,
.tool-row button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #24313a;
}

.inspector-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.inspector-tabs button {
  flex: 1 0 auto;
  padding: 13px 9px;
  border-bottom: 3px solid transparent;
  background: #fff;
  color: #30383e;
}

.inspector-tabs button.is-active {
  border-color: var(--blue);
  color: var(--blue-dark);
  font-weight: 700;
}

.tab-panel {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.tab-panel.is-active {
  display: block;
}

.notice {
  margin-bottom: 14px;
  padding: 12px;
  border-left: 4px solid var(--blue);
  background: #f1f5ff;
  color: #31404b;
  font-size: 13px;
  line-height: 1.45;
}

.notice.strong {
  border-color: var(--amber);
  background: #fff8dd;
  font-weight: 700;
}

.field-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #2f3a40;
  font-size: 13px;
}

.field-row select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #b7c0c8;
  border-radius: 5px;
  background: #fff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: #2f3a40;
  font-size: 13px;
}

.primary-wide {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-row .accent {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.split-browser {
  min-height: 420px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-tree {
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #f4f6f8;
  border-right: 1px solid var(--line);
  font-size: 13px;
}

.file-tree li {
  padding: 8px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree .selected {
  background: #e2edff;
  color: var(--blue-dark);
  font-weight: 700;
}

.code-pane {
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #fff;
  color: #9b2b1c;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0 0 16px;
  font-size: 13px;
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  min-width: 0;
  margin: 0;
  color: #3a444c;
  overflow-wrap: anywhere;
}

.log-card {
  padding: 22px;
  border: 1px dashed #b8c2ca;
  border-radius: 8px;
  background: #fbfcfd;
}

.log-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.log-card p {
  color: var(--muted);
  line-height: 1.45;
}

.flow-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.flow-dialog::backdrop {
  background: rgba(15, 20, 24, 0.62);
}

.flow-dialog form {
  position: relative;
  padding: 22px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #edf1f4;
}

.dialog-title {
  margin: 0 40px 8px 0;
  font-size: 22px;
}

.dialog-copy {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.5;
}

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

.blueprint-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.thumb {
  height: 112px;
  background:
    linear-gradient(135deg, rgba(47, 91, 234, 0.72), transparent),
    linear-gradient(45deg, #f3c144, #1aa36f);
}

.thumb.coffee {
  background:
    linear-gradient(135deg, rgba(61, 29, 83, 0.86), transparent),
    linear-gradient(45deg, #f09b4f, #632c8e);
}

.thumb.news {
  background:
    linear-gradient(135deg, rgba(7, 9, 11, 0.92), transparent),
    linear-gradient(45deg, #b31327, #f8f8f8);
}

.thumb.org {
  background:
    linear-gradient(135deg, rgba(63, 28, 13, 0.88), transparent),
    linear-gradient(45deg, #c5683d, #111);
}

.blueprint-card div:last-child {
  padding: 12px;
}

.blueprint-card strong {
  display: block;
  margin-bottom: 5px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-row span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf1f4;
  color: #46535d;
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.dialog-actions button {
  padding: 10px 14px;
  border-radius: 6px;
  background: #edf1f4;
}

.dialog-actions .primary {
  background: var(--blue);
  color: #fff;
}

.dialog-field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.dialog-field input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #b7c0c8;
  border-radius: 6px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.filter-bar button {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf1f4;
}

.filter-bar button.is-active {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 270px minmax(380px, 1fr);
    grid-template-rows: 58px minmax(560px, auto) auto;
  }

  .operations-pane {
    grid-column: 1 / -1;
    max-height: none;
  }

  .tab-panel {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .global-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
  }

  .mode-tabs {
    width: 100%;
    order: 3;
  }

  .mode-tab {
    flex: 1;
  }

  .library-pane,
  .operations-pane {
    overflow: visible;
  }

  .browser-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .browser-link {
    display: none;
  }

  .site-frame {
    margin: 10px;
  }

  .wp-header,
  .wp-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .wp-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .playground-art {
    min-height: 260px;
  }

  .wp-emblem {
    width: 180px;
    height: 180px;
    font-size: 118px;
  }

  .orb-ring {
    border-width: 36px;
  }

  .split-browser,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .file-tree {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
