:root {
  --bg: #1d1d1f;
  --surface: #242427;
  --surface-2: #2b2b2f;
  --border: #333338;
  --border-strong: #4a4a51;
  --text: #ededed;
  --text-muted: #a8a8b0;
  --accent: #c9d4e0;
  --danger: #ff6b74;
  --ok: #00d5b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.bar-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.bar nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.bar nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--text);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 64px;
}

main.narrow {
  max-width: 720px;
}

h1 {
  margin: 8px 0 4px;
  font-size: 30px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lede {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
}

.btn.primary {
  background: #ededed;
  border-color: #ededed;
  color: #1d1d1f;
  font-weight: 600;
}

.btn.primary:hover {
  background: #ffffff;
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--surface-2);
}

.btn.small {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #ffbb00;
  border-radius: 8px;
  background: rgba(255, 187, 0, 0.1);
  font-size: 14px;
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.status.bad {
  color: var(--danger);
}

.status.good {
  color: var(--ok);
}

/* One preset */

.sheet {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.values {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 18px 0 0;
  font-size: 14px;
}

.values dt {
  color: var(--text-muted);
}

.values dd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  overflow-wrap: anywhere;
}

.chip {
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Catalog */

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.tools input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.owner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--danger);
  border-radius: 10px;
  font-size: 14px;
}

.sign-in {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.sign-in input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.card-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card-name a {
  color: var(--text);
  text-decoration: none;
}

.card-name a:hover {
  text-decoration: underline;
}

.card-font {
  font-size: 13px;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
}

.more {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 40px;
  font-size: 13px;
  color: var(--text-muted);
}

.foot a {
  color: var(--text-muted);
}

/* Mini chat: a small fake Pronto window. Sizes are in em, so font-size scales it. */

.mini {
  --m-bg: #ffffff;
  --m-side: #f3f4f5;
  --m-top: #f3f4f5;
  --m-line: #e7e7e8;
  --m-ink: #2c2d31;
  --m-muted: #8e8e8e;
  --m-soft: #dfe1e3;
  --m-accent: #00d5b2;
  --m-on-accent: #ffffff;
  --m-link: #49a4da;
  --m-ping: #ff3b30;
  --m-select: #e7e7e8;
  --m-wall: none;
  position: relative;
  display: grid;
  grid-template-columns: 30% 1fr;
  grid-template-rows: 2.6em 1fr;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--m-bg);
  color: var(--m-ink);
  font-size: 9px;
  line-height: 1.35;
  text-align: left;
  user-select: none;
}

.mini.big {
  font-size: 13px;
}

.mini * {
  min-width: 0;
}

.mini-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--m-top);
  border-bottom: 1px solid var(--m-line);
}

.mini-search {
  width: 36%;
  padding: 0.25em 0.8em;
  border: 1px solid var(--m-soft);
  border-radius: 0.4em;
  background: var(--m-bg);
  color: var(--m-muted);
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
}

.mini-side {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  padding: 0.7em 0.5em;
  overflow: hidden;
  background: var(--m-side);
  border-right: 1px solid var(--m-line);
}

.mini-me {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0 0.3em 0.6em;
  font-weight: 600;
}

.mini-cat {
  padding: 0.5em 0.4em 0.2em;
  color: var(--m-muted);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.35em 0.4em;
  border-radius: 0.5em;
  white-space: nowrap;
}

.mini-row span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-row.on {
  background: var(--m-select);
  font-weight: 600;
}

.mini-dot {
  flex: none;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--m-soft);
}

.mini-dot.sq {
  border-radius: 0.4em;
}

.mini-dot.acc {
  background: var(--m-accent);
}

.mini-badge {
  flex: none;
  min-width: 1.6em;
  padding: 0 0.4em;
  border-radius: 1em;
  background: var(--m-ping);
  color: #ffffff;
  font-size: 0.8em;
  font-weight: 700;
  text-align: center;
}

.mini-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.mini-head {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--m-line);
  font-size: 1.1em;
  font-weight: 700;
}

.mini-head span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-cam {
  flex: none;
  width: 1.5em;
  height: 1em;
  border-radius: 0.25em;
  background: var(--m-accent);
}

.mini-msgs {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75em;
  padding: 0.9em 1em;
  overflow: hidden;
  background: var(--m-wall);
}

.mini-msg {
  display: flex;
  gap: 0.7em;
}

.mini-msg .mini-dot {
  width: 2.2em;
  height: 2.2em;
}

.mini-name {
  font-weight: 700;
}

.mini-time {
  margin-left: 0.6em;
  color: var(--m-muted);
  font-size: 0.8em;
  font-weight: 400;
}

.mini-link {
  color: var(--m-link);
}

.mini-at {
  padding: 0 0.25em;
  border-radius: 0.3em;
  background: color-mix(in srgb, var(--m-accent) 22%, transparent);
  color: var(--m-ink);
  font-weight: 600;
}

.mini-react {
  display: inline-block;
  margin-top: 0.3em;
  padding: 0.05em 0.5em;
  border: 1px solid var(--m-accent);
  border-radius: 1em;
  font-size: 0.85em;
}

.mini-foot {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em 1em;
  border-top: 1px solid var(--m-line);
  color: var(--m-muted);
}

.mini-foot span:first-child {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.mini-send {
  flex: none;
  padding: 0.15em 0.9em;
  border-radius: 0.5em;
  background: var(--m-accent);
  color: var(--m-on-accent);
  font-weight: 700;
}

@media (max-width: 560px) {
  .mini.big {
    font-size: 9px;
  }
}

.mini:not(.big) .mini-msg:first-child {
  display: none;
}
