/* Scottie customer system: warm paper, cobalt actions, ink structure, and
   restrained offset depth derived from the supplied product reference. */

:root {
  --paper: #F7F4EC;
  --card: #FFFDF8;
  --ink: #111521;
  --sub: #626878;
  --line: #D7D4CB;
  --line-strong: #1B2130;
  --cobalt: #2948D7;
  --cobalt-dark: #1E38B4;
  --cobalt-soft: #E9EDFF;
  --signal: #2948D7;
  --danger: #B9382E;
  --shadow: 4px 5px 0 var(--line-strong);
  --soft-shadow: 0 12px 32px -20px rgba(17,21,33,.28);
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --serif: var(--sans);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  background-image: linear-gradient(rgba(17,21,33,.018) 1px, transparent 1px);
  background-size: 100% 28px;
}

.shell { max-width: 680px; margin: 0 auto; padding: 20px 20px 64px; }
.shell.narrow { max-width: 480px; }

/* masthead */
.masthead { display: flex; align-items: center; gap: 12px; padding: 14px 0 18px; }
.masthead img.logo { width: 44px; height: 44px; border-radius: 10px; }
.masthead .wordmark { font-weight: 700; font-size: 22px; letter-spacing: -.025em; }
.masthead .sub { font: 500 11px var(--mono); color: var(--sub); letter-spacing: .03em; }
.masthead .spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cobalt); color: #fff; font-weight: 600;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* type */
h1 { font-weight: 700; font-size: clamp(29px, 5vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
h1 em { font-style: italic; }
h2 { font-weight: 650; font-size: 20px; letter-spacing: -.02em; }
.lede { color: var(--sub); margin-top: 8px; }
.eyebrow, .step-kicker, .source-meta {
  font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--cobalt);
}
.hint { font-size: 12.5px; color: var(--sub); }
.field-label {
  display: block; font: 600 11px var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--sub); margin: 16px 0 6px;
}

/* cards */
.card {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow); padding: clamp(22px, 4vw, 34px);
}
.card + .card { margin-top: 16px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  border-radius: 9px; padding: 11px 18px; cursor: pointer; min-height: 44px;
  border: 1.5px solid transparent; transition: background .15s, transform .05s;
  width: 100%; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--cobalt); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--cobalt-dark); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { background: rgba(30,28,23,.04); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { background: transparent; color: var(--danger); border: 1px dashed var(--danger); }
.btn.slim { width: auto; padding: 8px 14px; font-size: 13.5px; min-height: 44px; }

/* inputs */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], textarea, select {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid #AEB2BC; border-radius: 8px;
  padding: 11px 12px; outline: none; min-height: 44px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft);
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #6F86F2; outline-offset: 3px;
}
textarea { resize: vertical; min-height: 96px; }
.field + .field { margin-top: 12px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid #AEB2BC; background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  min-height: 44px;
}
.chip[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

/* switch */
.switch-card { display: flex; align-items: flex-start; gap: 12px; }
.switch-card .grow { flex: 1; }
.switch-card b { font-size: 15px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line);
  transition: background .15s; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--cobalt); }
.switch input:checked + .track::after { left: 21px; }

/* tabs */
.tabbar {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px; margin: 4px 0 20px; box-shadow: var(--shadow);
}
.tab {
  flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 600; font-size: 14px; color: var(--sub);
  padding: 9px 0; border-radius: 999px; border: none; background: none; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--cobalt); color: #fff; }

/* source rows */
.group-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sub); margin: 18px 0 8px; }
.source-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px;
}
.source-row img { width: 18px; height: 18px; border-radius: 4px; }
.source-row .name { flex: 1 0 auto; max-width: 55%; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row .why { flex: 1 1 0; min-width: 0; font-size: 12px; color: var(--signal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border: none; background: none;
  color: var(--sub); cursor: pointer; font-size: 14px; padding: 6px;
}
.source-row button:hover { color: var(--ink); }
.preview-note { font-size: 12px; color: var(--sub); margin: -2px 0 8px 4px; }
.preview-note.bad { color: var(--danger); }

/* pills */
.pill { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--ink); }
.pill.ok { background: var(--cobalt-soft); color: var(--cobalt-dark); font-weight: 600; }
.pill.warn { background: #FCE8DC; color: var(--signal); font-weight: 600; }
.text-button {
  border: 0; background: transparent; color: var(--cobalt-dark);
  font: 600 13px var(--sans); text-decoration: underline; cursor: pointer;
  min-height: 44px; padding: 8px;
}
.notice {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 14px;
}

/* private newsletter inbox */
.inbox-claim { display: grid; gap: 10px; min-width: 0; }
.inbox-claim h3 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.02em; }
.inbox-claim .hint { margin: 0; }
.inbox-claim-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch; min-width: 0;
}
.inbox-claim-row input {
  min-width: 0; border-radius: 10px 0 0 10px;
}
.inbox-domain {
  display: flex; align-items: center; border: 1px solid var(--line);
  border-left: 0; border-radius: 0 10px 10px 0; background: #fff;
  padding: 0 12px; color: var(--sub); font: 600 12px "IBM Plex Mono", monospace;
  white-space: nowrap;
}
.inbox-availability { min-height: 20px; margin: 0; color: var(--sub); font-size: 13px; }
.inbox-availability.available { color: var(--ok); }
.inbox-availability.invalid,
.inbox-availability.reserved,
.inbox-availability.unavailable,
.inbox-availability.error { color: var(--danger); }
.inbox-suggestions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  color: var(--sub); font-size: 13px;
}
.inbox-claim-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inbox-permanent-note {
  margin: 0; max-width: 62ch; color: var(--ink); font-size: 13px; line-height: 1.45;
}
.inbox-existing { min-width: 0; margin-top: 18px; }
.inbox-address-row { display: flex; gap: 8px; align-items: stretch; }
.inbox-address {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 10px 12px; font: 500 12px "IBM Plex Mono", monospace;
}
.inbox-explanation { margin-top: 8px; max-width: 58ch; }
.inbox-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px;
}
.inbox-filter-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.inbox-filter {
  min-height: 44px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); padding: 8px 12px; cursor: pointer;
  font: 600 13px var(--sans);
}
.inbox-filter span { color: var(--sub); margin-left: 4px; }
.inbox-filter:hover,
.inbox-filter:focus-visible { border-color: var(--cobalt); }
.inbox-filter.selected {
  border-color: var(--cobalt); background: var(--cobalt); color: #fff;
}
.inbox-filter.selected span { color: inherit; }
.inbox-messages { border-top: 1px solid var(--line); margin-top: 8px; }
.inbox-message {
  display: flex; align-items: center; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.inbox-message .grow { flex: 1; min-width: 0; }
.inbox-message b {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inbox-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px;
}
.inbox-empty { color: var(--sub); font-size: 13px; padding: 14px 0 2px; }
.inbox-detail {
  max-height: 420px; overflow: auto; margin-top: 10px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 12px; font-size: 13px;
}
.inbox-detail-head {
  display: flex; align-items: flex-start; gap: 12px; min-width: 0;
}
.inbox-detail-head .grow { flex: 1; min-width: 0; }
.inbox-detail-head b {
  display: block; overflow-wrap: anywhere;
}
.inbox-detail-head p { margin: 4px 0 0; }
.inbox-detail-body {
  white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px;
  padding: 12px; border-radius: 8px; background: var(--paper);
}
.inbox-action-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.inbox-forward-status {
  min-height: 20px; margin: 4px 0 0; color: var(--sub);
}
.inbox-skeleton {
  height: 94px; border-radius: 12px;
  background: linear-gradient(90deg, var(--line), #fff, var(--line));
  background-size: 200% 100%; animation: inbox-shimmer 1.3s linear infinite;
}
@keyframes inbox-shimmer { to { background-position: -200% 0; } }

/* progress bar (wizard) */
.progress-track { height: 4px; background: var(--line); border-radius: 999px; margin: 10px 0 26px; }
.progress-fill {
  height: 100%; background: var(--cobalt); border-radius: 999px;
  transform: scaleX(var(--progress)); transform-origin: left center;
  transition: transform .3s;
}

/* spinner */
.proc-ring {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 16px;
  border: 3px solid var(--cobalt-soft); border-top-color: var(--cobalt);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* entrance */
.rise { animation: rise .35s cubic-bezier(.2,.7,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.divider { display: flex; align-items: center; gap: 12px; color: var(--sub); font-size: 12.5px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1em; }
.ok-text { color: var(--cobalt-dark); font-size: 13px; }
.footer-note { text-align: center; color: var(--sub); font-size: 12.5px; margin-top: 28px; }
.skip-to-content {
  position: fixed; left: 16px; top: -80px; z-index: 100; background: var(--ink);
  color: #fff; padding: 10px 14px; border-radius: 8px;
}
.skip-to-content:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .proc-ring { animation-duration: 2.5s; }
  .inbox-skeleton { animation: none; }
  * { transition: none !important; }
}

@media (max-width: 480px) {
  .inbox-address-row { flex-direction: column; }
  .inbox-message { align-items: flex-start; flex-wrap: wrap; }
  .inbox-message .grow { flex-basis: 100%; }
  .inbox-detail-head { flex-wrap: wrap; }
  .inbox-detail-head .grow { flex-basis: 100%; }
  .inbox-action-row .btn { width: 100%; }
  .inbox-claim-actions { flex-direction: column; align-items: stretch; }
  .inbox-claim-actions .btn { width: 100%; }
  .inbox-domain { padding-inline: 9px; font-size: 11px; }
}

/* pack browser (onboarding step 3 + dashboard Sources tab) */
.collection-card {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 14px; margin-bottom: 10px; cursor: pointer;
}
.collection-card:hover { border-color: var(--cobalt); }
.collection-card.selected { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.collection-card .col-head { display: flex; gap: 10px; align-items: flex-start; }
.collection-card .grow { flex: 1; }
.collection-card .col-members { font-size: 12px; color: var(--sub); margin-top: 8px; }
.pack-section-head { margin: 18px 0 10px; }
.pack-section-head:first-child { margin-top: 0; }
.pack-section-head b { font-size: 15px; }
.pack-section-head .hint { margin-top: 2px; }
