:root {
  color-scheme: light;
  --ink: #1e1f21;
  --muted: #646970;
  --soft: #f6f7f7;
  --panel: #ffffff;
  --line: #dcdcde;
  --line-strong: #c3c4c7;
  --chrome: #1d2327;
  --chrome-2: #2c3338;
  --blue: #2271b1;
  --blue-strong: #135e96;
  --green: #008a20;
  --yellow: #f0b849;
  --red: #b32d2e;
  --shadow: 0 18px 40px rgba(30, 31, 33, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.ide-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 58px 286px minmax(0, 1fr);
  background: var(--line);
}

.activity-rail {
  min-height: 100vh;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--chrome);
  color: #f0f0f1;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #f0f0f1;
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: 0;
}

.rail-button {
  min-height: 42px;
  padding: 6px 4px;
  border-radius: 4px;
  background: transparent;
  color: #c3c4c7;
  font-size: 11px;
  font-weight: 700;
}

.rail-button:hover,
.rail-button.is-active {
  background: var(--blue);
  color: #fff;
}

.rail-spacer {
  flex: 1;
}

.project-sidebar {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  border-right: 1px solid var(--line-strong);
}

.project-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.project-header h1 {
  max-width: 172px;
  font-size: 18px;
  line-height: 1.25;
}

.status {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.status.saved {
  color: var(--green);
}

.small-button,
.top-chrome button,
.toolbar-buttons button,
.sidebar-cta,
.compact-actions button,
.drawer button,
.gallery-filters button,
.search-field input,
.form-field input,
.path-field input,
select,
.destructive {
  border-radius: 3px;
}

.small-button {
  align-self: start;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--blue-strong);
  font-size: 12px;
}

.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-section h2 {
  margin-bottom: 10px;
  font-size: 12px;
  color: #2c3338;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-item {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  background: var(--soft);
  text-align: left;
  color: var(--ink);
}

.sidebar-item.is-current {
  border-left-color: var(--blue);
  background: #f0f6fc;
}

.item-name {
  font-weight: 700;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
}

.compact-actions {
  display: grid;
  gap: 6px;
}

.compact-actions h2 {
  margin-bottom: 4px;
}

.compact-actions button,
.sidebar-cta {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  color: var(--blue-strong);
}

.toggle-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 9px 0;
  font-size: 13px;
}

.sidebar-cta {
  width: 100%;
  margin-top: 8px;
  text-align: center;
}

.workspace-area {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 30px;
  background: #fff;
}

.top-chrome {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--chrome);
  color: #fff;
}

.top-chrome button {
  padding: 8px 10px;
  background: var(--chrome-2);
  color: #f0f0f1;
}

.top-chrome button.active {
  background: #fff;
  color: var(--ink);
}

.top-chrome .save-pill {
  background: #123f65;
}

.path-field {
  min-width: 220px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 4px;
  background: #3c434a;
}

.path-field span {
  color: #c3c4c7;
  font-size: 12px;
  white-space: nowrap;
}

.path-field input {
  width: 100%;
  min-width: 80px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #fff;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(460px, 1fr) minmax(360px, 43%);
  background: #f6f7f7;
}

.tool-panel {
  min-width: 0;
  min-height: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--line-strong);
  background: #fff;
}

.tool-panel.is-active {
  display: grid;
}

.panel-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-toolbar h2 {
  font-size: 18px;
  line-height: 1.25;
}

.toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.toolbar-buttons button {
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--blue-strong);
  font-size: 12px;
}

.toolbar-buttons .primary,
.drawer .primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.file-editor-grid,
.blueprint-editor {
  min-height: 0;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
}

.file-tree,
.single-file-list {
  min-width: 0;
  overflow: auto;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: #fbfbfc;
}

.file-tree button,
.single-file-list button {
  width: 100%;
  display: block;
  margin: 1px 0;
  padding: 8px 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-root {
  font-weight: 700;
}

.tree-child {
  padding-left: 22px !important;
  color: #2c3338 !important;
}

.file-tree .is-selected,
.single-file-list .is-selected {
  outline: 1px solid var(--blue);
  background: #eef6ff;
}

.code-card,
.code-view {
  min-width: 0;
  min-height: 0;
}

.code-card {
  display: grid;
  grid-template-rows: 39px minmax(0, 1fr);
}

.code-tabs {
  display: flex;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  background: #f6f7f7;
}

.code-tabs button {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.code-tabs .is-selected {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.code-view {
  margin: 0;
  overflow: auto;
  padding: 14px 0;
  background: #fff;
  color: #7a2700;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.code-view span {
  display: inline-block;
  width: 40px;
  margin-right: 12px;
  color: #8c8f94;
  text-align: right;
  user-select: none;
}

.code-view.json {
  color: #b32d2e;
}

.database-panel,
.logs-panel,
.settings-grid {
  overflow: auto;
  padding: 18px;
}

.notice-card,
.reset-note {
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  background: #f0f6fc;
}

.notice-card h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.notice-card p,
.drawer-copy {
  color: #3c434a;
  line-height: 1.55;
}

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

.metric-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.metric-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #f6f7f7;
  font-size: 12px;
  text-transform: uppercase;
}

.logs-panel {
  display: grid;
  gap: 16px;
}

.empty-log {
  display: grid;
  gap: 5px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  background: #fbfbfc;
}

.empty-log span {
  color: var(--muted);
}

.logs-panel pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  background: #1d2327;
  color: #dcdcde;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.settings-grid .reset-note {
  grid-column: 1 / -1;
}

.settings-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.settings-grid select {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.settings-grid .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.destructive {
  width: fit-content;
  padding: 10px 12px;
  border: 1px solid var(--red);
  background: #fff;
  color: var(--red);
}

.preview-panel {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #f0f0f1;
}

.preview-browser {
  min-width: 300px;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.preview-adminbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 10px;
  background: #1d2327;
  color: #dcdcde;
  font-size: 12px;
}

.preview-adminbar strong {
  margin-left: auto;
  color: #fff;
}

.preview-site-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  font-size: 15px;
}

.preview-site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  color: #2c3338;
}

.preview-content {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(160px, 1.05fr);
  align-items: center;
  gap: 20px;
  padding: 46px 24px;
  overflow: hidden;
}

.preview-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.24;
  font-weight: 400;
}

.preview-content h2 span {
  color: #3858e9;
}

.preview-content p {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.45;
}

mark {
  background: #fff2a8;
}

.preview-content button {
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 3px;
  background: #3858e9;
  color: #fff;
}

.wp-shape {
  width: min(34vw, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 20px solid #32e875;
  border-radius: 50%;
  color: #1e1f21;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(96px, 15vw, 180px);
  font-weight: 700;
  box-shadow: inset 0 0 0 17px #fff;
}

.status-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 5px 10px;
  background: var(--chrome-2);
  color: #dcdcde;
  font-size: 12px;
  overflow: auto;
  white-space: nowrap;
}

.status-bar button {
  padding: 2px 0;
  background: transparent;
  color: #b8d7f2;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(29, 35, 39, 0.42);
}

.drawer-backdrop.is-open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(520px, 100vw);
  height: 100vh;
  display: none;
  overflow: auto;
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.drawer.wide {
  width: min(900px, 100vw);
}

.drawer.is-open {
  display: block;
}

.drawer header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer header h2 {
  font-size: 24px;
}

.drawer header button {
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
}

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

.launcher-grid.single {
  grid-template-columns: 1fr;
}

.launcher-grid button {
  min-height: 98px;
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfbfc;
  color: var(--ink);
  text-align: left;
}

.launcher-grid button:hover,
.gallery-grid article:hover {
  border-color: var(--blue);
}

.launcher-grid span,
.saved-row span,
.progress-block span {
  color: var(--muted);
  font-size: 13px;
}

.drawer h3 {
  margin: 22px 0 10px;
  font-size: 15px;
}

.blueprint-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blueprint-strip button,
.wide-link {
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #f6f7f7;
  color: var(--blue-strong);
}

.drawer-copy {
  margin-bottom: 18px;
}

.form-field {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.form-field input,
.search-field input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.storage-choice {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.progress-block {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfbfc;
}

.progress-block > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcdcde;
}

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

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.drawer-actions button {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.saved-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.saved-row.current {
  border-left: 4px solid var(--yellow);
}

.saved-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.saved-row button {
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--blue-strong);
}

.wide-link {
  width: 100%;
  margin-top: 8px;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.gallery-filters button {
  padding: 8px 11px;
  background: #f0f0f1;
  color: #50575e;
}

.gallery-filters .is-active {
  background: var(--blue);
  color: #fff;
}

.search-field {
  display: block;
  margin-bottom: 18px;
}

.search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-grid article {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.thumb {
  height: 116px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #826721, #2f6f84 55%, #d9c9a5);
}

.thumb.coffee {
  background: linear-gradient(135deg, #4b266f, #a4532d 60%, #f0b849);
}

.thumb.feed {
  background: linear-gradient(135deg, #f5f7ff, #d7e3ff 60%, #3157d5);
}

.thumb.gaming {
  background: linear-gradient(135deg, #111, #b32d2e 54%, #f0b849);
}

.thumb.nonprofit {
  background: linear-gradient(135deg, #2f261d, #855d34 55%, #f4e9de);
}

.thumb.blog {
  background: linear-gradient(135deg, #6a1239, #8c2f59 54%, #e2d7dc);
}

.gallery-grid h3 {
  padding: 12px 12px 0;
  font-size: 15px;
}

.gallery-grid p {
  padding: 6px 12px 10px;
  color: var(--muted);
  line-height: 1.4;
}

.gallery-grid span {
  display: inline-block;
  margin: 0 0 12px 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f0f1;
  color: #50575e;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .ide-shell {
    grid-template-columns: 58px 250px minmax(0, 1fr);
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    min-height: 420px;
    border-top: 1px solid var(--line-strong);
  }
}

@media (max-width: 820px) {
  .ide-shell {
    grid-template-columns: 1fr;
  }

  .activity-rail {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 0;
    flex-direction: row;
    overflow: auto;
  }

  .mark {
    flex: 0 0 auto;
  }

  .rail-button {
    min-width: 54px;
    flex: 0 0 auto;
  }

  .rail-spacer {
    display: none;
  }

  .project-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .workspace-area {
    min-height: auto;
    grid-template-rows: auto auto auto;
  }

  .top-chrome,
  .panel-toolbar,
  .preview-site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .chrome-actions {
    flex-wrap: wrap;
  }

  .file-editor-grid,
  .blueprint-editor,
  .settings-grid,
  .metric-grid,
  .preview-content,
  .gallery-grid,
  .launcher-grid {
    grid-template-columns: 1fr;
  }

  .file-tree,
  .single-file-list {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-content {
    min-height: auto;
    padding: 30px 20px;
  }

  .wp-shape {
    width: min(70vw, 260px);
  }

  .status-bar {
    flex-wrap: wrap;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .project-header,
  .saved-row {
    flex-direction: column;
    align-items: stretch;
  }

  .project-header h1 {
    max-width: none;
  }

  .drawer {
    padding: 16px;
  }

  .toolbar-buttons {
    justify-content: flex-start;
  }
}
