:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d7dbe0;
  --text: #171717;
  --muted: #737780;
  --faint: #a2a7af;
  --black: #111111;
  --green: #8ee53f;
  --green-text: #4a9d00;
  --violet: #8b5cf6;
  --blue: #3b82f6;
  --red: #d83b3b;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.auth-card {
  width: min(408px, 100%);
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: inline-block;
  margin-bottom: 28px;
}

.auth-card h1 {
  margin-bottom: 24px;
}

.auth-form {
  display: grid;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.google-button,
.dev-button,
.support-button {
  width: 100%;
  margin-top: 10px;
}

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

.support-card {
  width: min(680px, 100%);
}

.support-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.compact-button {
  min-height: 30px;
}

.support-copy {
  margin: -12px 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.app-shell {
  width: min(1880px, calc(100% - 48px));
  min-height: calc(100vh - 56px);
  margin: 28px auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.brand-area,
.top-actions,
.page-heading,
.toolbar-row,
.deployment-row,
.project-card-header,
.tiny-meta,
.runtime-line,
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
}

.brand-area {
  gap: 12px;
}

.brand-mark {
  color: var(--black);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.divider {
  color: var(--line-strong);
  font-size: 22px;
}

.workspace-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 6px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}

.workspace-switcher:hover {
  background: #f8fafc;
}

.workspace-icon,
.workspace-badge,
.project-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  font-weight: 700;
}

.workspace-icon {
  width: 18px;
  height: 18px;
  border: 1px solid #eadcff;
  color: var(--violet);
  background: #fbf7ff;
  font-size: 11px;
}

.workspace-badge {
  width: 38px;
  height: 38px;
  border: 1px solid #eadcff;
  color: var(--violet);
  background: #fbf7ff;
  font-size: 18px;
}

.chevron {
  color: var(--faint);
}

.top-actions {
  gap: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #2f3337;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.icon-button:hover {
  background: #f4f6f8;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(21, 128, 61, 0.22), rgba(59, 130, 246, 0.18)),
    #efe7da;
  border: 1px solid #d5d9de;
  color: #4d3d2b;
  font-size: 11px;
  font-weight: 800;
  padding: 0;
}

.tabs {
  display: flex;
  gap: 24px;
  height: 45px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
}

.tab.is-active {
  color: var(--text);
}

.tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--black);
  content: "";
}

.content {
  width: min(1460px, calc(100% - 220px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

.view {
  display: none;
}

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

.page-heading {
  gap: 16px;
  margin-bottom: 30px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.2;
  font-weight: 720;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 720;
}

.section-title {
  margin-top: 28px;
  margin-bottom: 14px;
}

.toolbar-row {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.primary-button,
.secondary-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  padding: 0 14px;
}

.mini-button {
  min-height: 29px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.mini-button:hover,
.secondary-button:hover {
  background: #f8fafc;
}

.mini-button.danger {
  color: var(--red);
}

.mini-button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.primary-button {
  color: #fff;
  background: var(--black);
  border: 1px solid var(--black);
}

.primary-button:hover {
  background: #2a2a2a;
}

.secondary-button {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.button-plus {
  margin-right: 8px;
  font-size: 16px;
  line-height: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
  gap: 16px;
}

.project-card,
.deployment-list,
.project-table,
.settings-panel,
.support-panel,
.metric-card,
.analytics-project-card,
.analytics-table,
.modal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.project-card {
  min-height: 138px;
  padding: 18px;
  box-shadow: 0 3px 8px rgba(16, 24, 40, 0.04);
}

.project-card-header {
  gap: 12px;
}

.project-icon {
  width: 31px;
  height: 31px;
  border: 1px solid #bff36b;
  color: var(--green-text);
  background: #f4ffe9;
  font-size: 17px;
}

.project-card h3 {
  max-width: 235px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.project-card .project-actions {
  margin-top: 16px;
}

.tiny-meta,
.runtime-line {
  min-width: 0;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.tiny-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  color: var(--faint);
  font-weight: 800;
}

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deployment-list {
  overflow: hidden;
}

.deployment-row {
  min-height: 47px;
  padding: 0 16px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.deployment-row:last-child {
  border-bottom: 0;
}

.status-dot {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #92e6b6;
  border-radius: 50%;
  color: #159a52;
  font-size: 10px;
  font-weight: 800;
}

.status-dot.failed {
  border-color: #f1a6a6;
  color: var(--red);
}

.hash {
  color: var(--text);
  font-weight: 720;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  background: #f4ffe9;
  color: var(--green-text);
  font-size: 12px;
  font-weight: 760;
}

.blue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.copy-link {
  margin-left: auto;
  color: var(--text);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.project-table {
  overflow: hidden;
}

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

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 16px;
}

.metric-card span,
.analytics-mini-grid span,
.analytics-project-header p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.metric-card strong {
  font-size: 23px;
  line-height: 1.1;
}

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

.analytics-project-card {
  padding: 18px;
}

.analytics-project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-project-header h3 {
  margin: 0 0 3px;
  font-size: 15px;
  line-height: 1.25;
}

.analytics-project-header > strong {
  font-size: 22px;
}

.analytics-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.analytics-mini-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.analytics-mini-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

.analytics-list {
  min-width: 0;
}

.analytics-list h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.analytics-list ul {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.analytics-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.analytics-list li strong {
  color: var(--text);
}

.analytics-table {
  overflow: hidden;
}

.analytics-row {
  display: grid;
  grid-template-columns: 18px minmax(130px, 1fr) minmax(190px, 1.3fr) 70px 86px 86px minmax(150px, 1.1fr) 92px;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.analytics-row:last-child {
  border-bottom: 0;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1.5fr) 100px minmax(245px, auto);
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-name {
  color: var(--text);
  font-weight: 740;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.settings-panel {
  padding: 20px;
}

.support-panel {
  width: min(820px, 100%);
  padding: 20px;
}

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

.support-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

dl {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
}

dl div {
  display: grid;
  gap: 4px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
}

.modal {
  width: min(620px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.28);
}

.modal-panel {
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
}

.field input,
.field select {
  height: 38px;
  padding: 0 11px;
}

.field textarea {
  min-height: 132px;
  padding: 10px 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #9aa4b2;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.segment-control {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.segment {
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.segment.is-active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.source-panel {
  display: none;
}

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

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 144px;
  padding: 18px;
  border: 1px dashed #cbd2da;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-zone strong {
  color: var(--text);
  font-size: 14px;
}

.drop-zone span {
  margin-top: 6px;
  font-size: 13px;
}

.modal-footer {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.status-text {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.status-text.error {
  color: var(--red);
}

.status-text.success {
  color: #16834c;
}

@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .content {
    width: calc(100% - 32px);
    padding-top: 28px;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 14px 16px;
  }

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

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

  .analytics-lists,
  .analytics-mini-grid {
    grid-template-columns: 1fr;
  }

  .analytics-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 14px 16px;
  }

  .support-panel {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar,
  .tabs {
    padding-right: 16px;
    padding-left: 16px;
  }

  .tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .tab {
    flex: 0 0 auto;
  }

  .top-actions .icon-button {
    display: none;
  }

  .toolbar-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .analytics-summary,
  .analytics-projects {
    grid-template-columns: 1fr;
  }

  .support-form-grid {
    grid-template-columns: 1fr;
  }

  .support-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .deployment-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 14px 16px;
  }

  .copy-link {
    margin-left: 0;
  }
}
