/* ---------------------------------------------------------------------------
   Box and Assistant
   A quiet dark grey theme. One accent colour, generous spacing, no clutter.
--------------------------------------------------------------------------- */

:root {
  --bg: #191919;
  --bg-soft: #1f1f20;
  --surface: #242426;
  --surface-2: #2c2c2f;
  --surface-3: #343438;
  --line: #38383d;
  --line-soft: #2e2e32;
  --text: #ececee;
  --text-dim: #a2a2aa;
  --text-faint: #75757e;
  --accent: #f0c069;
  --accent-dim: #a8823c;
  --good: #74c99a;
  --warn: #e0b473;
  --bad: #e08b8b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.02rem;
}
p {
  margin: 0 0 1em;
}
.muted {
  color: var(--text-dim);
}
.faint {
  color: var(--text-faint);
  font-size: 0.86rem;
}
.center {
  text-align: center;
}
.hidden {
  display: none !important;
}

/* --------------------------------------------------------------- layout */

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px;
}
.wrap-narrow {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 26px;
  height: 26px;
  display: block;
  flex-shrink: 0;
}

/* --------------------------------------------------------------- buttons */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn:hover:not(:disabled) {
  background: var(--surface-3);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--text);
  color: #17171a;
  border-color: var(--text);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: #ffffff;
  border-color: #ffffff;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.btn-danger {
  border-color: #5c3535;
  color: var(--bad);
  background: transparent;
}
.btn-danger:hover:not(:disabled) {
  background: #3a2525;
}
.btn-sm {
  padding: 5px 11px;
  font-size: 0.84rem;
}
.btn-wide {
  width: 100%;
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- forms */

label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-dim);
}
textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.55;
}
.field {
  margin-bottom: 16px;
}
.hint {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 6px;
}

/* --------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2,
.card-head h3 {
  margin: 0;
}

.notice {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.9rem;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.notice-good {
  border-color: #35543f;
  background: #22301f;
  color: #bfe3cc;
}
.notice-bad {
  border-color: #5c3535;
  background: #2f2020;
  color: #f0c4c4;
}
.notice-info {
  border-color: #37455c;
  background: #1f2530;
  color: #c8d6ef;
}

/* --------------------------------------------------------------- landing */

.hero {
  padding: 76px 0 56px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin-bottom: 16px;
}
.hero p.lead {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 28px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 48px 0;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 24px 0 60px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.plan.current {
  border-color: var(--accent-dim);
}
.plan h3 {
  margin-bottom: 4px;
}
.plan .price {
  font-size: 1.7rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.plan .per {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  flex: 1;
}
.plan li {
  padding: 5px 0 5px 20px;
  position: relative;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.plan li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
}

/* --------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line-soft);
  margin: 26px 0 24px;
  overflow-x: auto;
}
.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

/* --------------------------------------------------------------- box */

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--text-dim);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  margin-bottom: 18px;
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--accent-dim);
  background: var(--surface);
}

.meter {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.meter-fill {
  height: 100%;
  width: var(--fill, 0%);
  background: var(--accent-dim);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.meter-fill.high {
  background: var(--warn);
}
.meter-fill.full {
  background: var(--bad);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.file-row:last-child {
  border-bottom: none;
}
.file-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.file-main {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 0.93rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  font-size: 0.79rem;
  color: var(--text-faint);
}
.file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--surface-2);
  vertical-align: 1px;
}
.tag-made {
  border-color: #35543f;
  color: var(--good);
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faint);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

/* --------------------------------------------------------------- assistant */

.avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.trait-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trait {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.trait:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}
.trait.on {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #12161f;
  font-weight: 500;
}

/* --------------------------------------------------------------- connect */

.code-box {
  font-family: var(--mono);
  font-size: 1.9rem;
  letter-spacing: 0.14em;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  user-select: all;
}

.link-steps {
  counter-reset: s;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.link-steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 14px 34px;
  color: var(--text-dim);
}
.link-steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-right: 7px;
}
.status-dot.on {
  background: var(--good);
}

/* --------------------------------------------------------------- misc */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 600;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.preview {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
  margin-top: 12px;
  color: var(--text-dim);
}

footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 60px;
  padding: 24px 0 40px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--text-dim);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 620px) {
  .hero {
    padding: 48px 0 36px;
  }
  .card {
    padding: 18px;
  }
  .file-actions .btn-sm {
    padding: 5px 8px;
  }
}
