:root {
  --paper: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f4f4f7;
  --ink: #15161a;
  --ink-2: #5d6068;
  --line: #e7e7ec;
  --line-2: #d8d8e0;
  --violet: #8a2be2;
  --violet-soft: #f3ebfd;
  --grad: linear-gradient(95deg, #e0218a 0%, #8a2be2 38%, #3a6ff0 70%, #16c79a 100%);
  --ok: #16a34a;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  height: 4px;
  background: var(--grad);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.center {
  text-align: center;
  padding: 80px 20px;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 18px 0 4px;
  text-wrap: balance;
}

h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 17px;
  margin: 0;
}

.sub {
  margin-top: 0;
}

.muted {
  color: var(--ink-2);
}

code {
  font-family: "Space Mono", monospace;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

/* header */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand {
  display: flex;
  align-items: center;
}

.pill {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ok);
  background: #eafaf0;
  border: 1px solid #cdeeda;
  padding: 3px 9px;
  border-radius: 999px;
}
.pill.paused {
  color: #b45309;
  background: #fdf3e7;
  border-color: #f2ddc0;
}

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
}
.center-card {
  margin-top: 40px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hint {
  color: var(--ink-2);
  font-size: 13px;
  text-align: right;
}

textarea,
select,
input {
  width: 100%;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 11px 12px;
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
textarea:focus,
select:focus,
input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

/* buttons */
button {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  transition: filter 0.12s ease, background 0.12s ease;
}
.primary {
  background: var(--violet);
  color: #fff;
}
.primary:hover {
  filter: brightness(1.08);
}
.primary:disabled {
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: not-allowed;
}
.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.ghost:hover {
  background: var(--surface-2);
}

/* mcp */
.mcp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mcp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
}
.mcp-row .m-name {
  font-family: "Space Mono", monospace;
  font-size: 13px;
  font-weight: 700;
}
.mcp-row .m-url {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}
.mcp-row .m-del {
  color: #c02626;
  background: none;
  border: none;
  font-size: 13px;
  padding: 2px 6px;
}
.mcp-empty {
  color: var(--ink-2);
  font-size: 13px;
  font-style: italic;
}
.mcp-add {
  margin-top: 12px;
}
.mcp-add summary {
  cursor: pointer;
  color: var(--violet);
  font-weight: 600;
  font-size: 13px;
  list-style: none;
}
.mcp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.mcp-form input:nth-child(2) {
  grid-column: 1 / 3;
}
.mcp-form button {
  grid-column: 1 / 3;
}

/* drive */
.drive-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.drive-title {
  font-weight: 600;
}
.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--violet-soft);
  border: 1px solid #e6d6fb;
  border-radius: 10px;
  padding: 10px 12px;
}
.drive-state.connected .drive-title::after {
  content: " ✓";
  color: var(--ok);
}

/* save bar */
.save-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 20px;
  box-shadow: 0 6px 24px rgba(21, 22, 26, 0.06);
}

.foot {
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 32px;
}

@media (max-width: 520px) {
  .mcp-row .m-url {
    max-width: 140px;
  }
  .hint {
    display: none;
  }
}

.drive-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.drive-picker {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.drive-picker select {
  flex: 1;
}

/* drive browser */
.drive-browser {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.drive-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.crumb {
  background: none;
  border: none;
  color: var(--violet);
  font-weight: 600;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 6px;
}
.crumb:hover { background: var(--violet-soft); }
.crumb:last-of-type { color: var(--ink); }
.crumb-sep { color: var(--ink-2); }
.drive-folders {
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.folder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
}
.folder-row:hover { background: var(--surface-2); }
.folder-ico { font-size: 15px; }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-into { color: var(--ink-2); font-size: 18px; }
.drive-browser-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
