:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-subtle: #f9fafb;
  --ink: #1d2327;
  --muted: #68727d;
  --line: #d7dde3;
  --line-strong: #b9c2cc;
  --blue: #2454d6;
  --blue-soft: #eef3ff;
  --green: #138557;
  --green-soft: #e8f7ef;
  --amber: #9c6b00;
  --amber-soft: #fff5d7;
  --red: #b42318;
  --red-soft: #fff1ef;
  --shadow: 0 18px 45px rgba(25, 35, 45, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  cursor: pointer;
}

button:hover {
  border-color: var(--blue);
}

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

.danger {
  border-color: #e1a29d;
  background: var(--red-soft);
  color: var(--red);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: 58px minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 250px minmax(360px, 1fr) minmax(520px, 0.9fr);
  gap: 14px;
  align-items: center;
  padding: 0 16px;
  background: #151a1f;
  color: #f5f7f9;
  border-bottom: 1px solid #2e363f;
}

.brand,
.session-tools,
.topnav,
.heading-actions,
.table-toolbar,
.segmented,
.row-actions,
.button-row,
.file-actions,
.mini-chrome {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 0;
}

.brand strong,
.brand span {
  display: block;
  white-space: nowrap;
}

.brand span {
  color: #aab4bf;
  font-size: 12px;
}

.wp-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #93a0ad;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.topnav {
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-button {
  flex: 0 0 auto;
  background: transparent;
  border-color: transparent;
  color: #c2cad3;
  border-radius: 5px;
}

.nav-button.is-active {
  background: #27313b;
  border-color: #3c4855;
  color: #fff;
}

.session-tools {
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.icon-button {
  background: #202831;
  border-color: #3c4855;
  color: #d9e0e7;
}

.path-field {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.path-field span,
.search-box span {
  position: absolute;
  left: 10px;
  top: -7px;
  padding: 0 5px;
  background: #151a1f;
  color: #aab4bf;
  font-size: 10px;
  line-height: 1;
}

.path-field input,
.search-box input,
.inline-form input,
.settings-grid select,
.start-list input,
.mini-chrome input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.path-field input {
  background: #29323b;
  color: #f7fafc;
  border-color: #45515e;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.status.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.workspace {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.content-panel {
  display: none;
}

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

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 14px;
}

.kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.25;
}

p,
small,
span {
  line-height: 1.4;
}

.heading-actions {
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-summary,
.transfer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.library-summary article,
.transfer-grid article,
.library-card,
.manager-index,
.mini-site,
.log-board article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.library-summary article,
.transfer-grid article {
  padding: 13px;
}

.library-summary span,
.transfer-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.library-summary strong,
.transfer-grid strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.library-summary small,
.transfer-grid small {
  color: var(--muted);
}

.library-card {
  overflow: hidden;
}

.table-toolbar {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-subtle);
}

.search-box {
  position: relative;
  flex: 1 1 280px;
}

.search-box span {
  background: var(--panel-subtle);
  color: var(--muted);
}

.segmented {
  gap: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf1f5;
  overflow-x: auto;
}

.segmented button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.segmented .is-selected {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 32, 42, 0.08);
}

.site-table {
  width: 100%;
}

.site-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) minmax(130px, 0.8fr) 100px minmax(130px, 0.8fr) minmax(125px, 0.8fr) minmax(170px, 0.8fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  text-align: left;
}

.site-row:hover {
  background: #f6f9fc;
}

.site-row.is-selected {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.table-head {
  min-height: 34px;
  background: #f0f3f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.site-name strong,
.site-name small {
  display: block;
}

.site-name small {
  color: var(--muted);
  margin-top: 2px;
}

.row-actions {
  gap: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  flex-wrap: wrap;
}

.context-drawer {
  grid-column: 2;
  grid-row: 2;
  overflow: auto;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 34px rgba(21, 26, 31, 0.05);
}

.drawer-view {
  display: none;
  padding: 18px;
}

.drawer-view.is-active {
  display: block;
}

.drawer-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 21px;
}

.drawer-actions,
.start-list,
.featured-list,
.settings-grid,
.log-stack {
  display: grid;
  gap: 9px;
}

.drawer-actions {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.property-list {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 14px;
}

.property-list div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.property-list div:last-child {
  border-bottom: 0;
}

.property-list span {
  color: var(--muted);
  font-size: 12px;
}

.property-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.inline-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.inline-form label,
.start-list label,
.settings-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.inline-form label strong,
.start-list strong {
  color: var(--ink);
}

.button-row {
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.compact-preview {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #f7f8fa;
}

.compact-preview img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: left top;
}

.drawer-note {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.radio-line,
.check-line {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--blue);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

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

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

.start-list button,
.start-list label,
.featured-list button,
.manager-list button {
  width: 100%;
  min-height: 50px;
  padding: 10px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.start-list span,
.manager-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.featured-list {
  margin-bottom: 14px;
}

.settings-grid {
  margin-bottom: 14px;
}

.notice {
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  padding: 12px;
  margin-bottom: 14px;
}

.notice p {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 13px;
}

.file-actions {
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.file-editor {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.file-editor ul {
  margin: 0;
  padding: 8px;
  list-style: none;
  border-right: 1px solid var(--line);
  background: #f6f7f8;
  font-size: 12px;
}

.file-editor li {
  padding: 6px;
  border-radius: 4px;
}

.file-editor .selected {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

pre,
.code-block {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  background: #10151b;
  color: #dfe8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  padding: 12px;
}

.log-stack article,
.log-board article {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.log-stack strong,
.log-board strong {
  display: block;
  padding: 9px 10px;
  background: #f1f4f7;
  border-bottom: 1px solid var(--line);
}

.blueprint-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.segmented.wide {
  justify-content: flex-start;
}

.compact-search span {
  background: var(--bg);
}

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

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

.blueprint-card.selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue), var(--shadow);
}

.blueprint-card img,
.thumb-placeholder {
  width: 100%;
  height: 155px;
  object-fit: cover;
  object-position: top left;
  background: #202832;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  font-weight: 800;
}

.blueprint-card h2,
.blueprint-card p,
.blueprint-card small {
  margin-left: 12px;
  margin-right: 12px;
}

.blueprint-card h2 {
  margin-top: 12px;
}

.blueprint-card p {
  color: var(--muted);
  font-size: 13px;
  min-height: 38px;
}

.blueprint-card small {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
}

.manager-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.manager-index {
  padding: 14px;
}

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

.mini-site {
  overflow: hidden;
}

.mini-chrome {
  gap: 7px;
  padding: 10px;
  background: #151a1f;
}

.mini-chrome input {
  flex: 1;
  background: #29323b;
  color: #fff;
  border-color: #45515e;
}

.wp-preview {
  min-height: 470px;
  background: #fff;
}

.admin-strip {
  padding: 7px 10px;
  background: #1d2327;
  color: #fff;
  font-size: 12px;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  font-size: 14px;
}

.welcome {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(190px, 1fr);
  gap: 20px;
  align-items: center;
  padding: 80px 36px;
}

.welcome h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1.25;
}

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

.welcome p {
  font-size: 18px;
  line-height: 1.45;
}

mark {
  background: #fff0a6;
}

.w-emblem {
  width: min(100%, 260px);
  aspect-ratio: 1;
  border: 18px solid #1d1d1d;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: center;
  color: #1d1d1d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 145px;
  font-weight: 700;
}

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

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

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .session-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workspace {
    grid-row: 2;
  }

  .context-drawer {
    grid-column: 1;
    grid-row: 3;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .site-row {
    grid-template-columns: minmax(230px, 1.5fr) minmax(120px, 0.7fr) 100px minmax(120px, 0.7fr);
  }

  .site-row span:nth-child(5),
  .site-row span:nth-child(6) {
    display: none;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 12px;
  }

  .page-heading,
  .table-toolbar,
  .blueprint-controls,
  .manager-layout,
  .welcome {
    display: block;
  }

  .heading-actions,
  .segmented {
    margin-top: 10px;
  }

  .library-summary,
  .transfer-grid,
  .blueprint-grid,
  .log-board {
    grid-template-columns: 1fr;
  }

  .site-table {
    display: grid;
    gap: 8px;
    background: var(--bg);
  }

  .site-row,
  .site-row.table-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .table-head {
    display: none !important;
  }

  .drawer-actions,
  .file-editor {
    grid-template-columns: 1fr;
  }

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

  .site-nav {
    display: grid;
    padding: 14px;
  }

  .welcome {
    padding: 28px 18px;
  }

  .welcome h2 {
    font-size: 32px;
  }

  .w-emblem {
    margin-top: 20px;
  }
}
