@font-face {
  font-family: 'OCRAEXT';
  src: url('assets/OCRAEXT.TTF') format('truetype');
}

/* ── Text size scales ──────────────────────────────────────────────── */
/* Applied by JS via html.text-large / html.text-xl classes            */
:root {
  --fs-member-name:    13px;
  --fs-member-sub:     11px;
  --fs-cat-header:     12px;
  --fs-detail-name:    22px;
  --fs-detail-sub:     12px;
  --fs-fronter-name:   14px;
  --fs-history-name:   13px;
  --fs-topbar-title:   16px;
  --fs-section-title:  14px;
  --fs-section-label:  10px;
  --fs-field-label:    11px;
  --fs-pill:           11px;
}

html.text-large {
  --fs-member-name:    15px;
  --fs-member-sub:     13px;
  --fs-cat-header:     14px;
  --fs-detail-name:    25px;
  --fs-detail-sub:     14px;
  --fs-fronter-name:   16px;
  --fs-history-name:   15px;
  --fs-topbar-title:   18px;
  --fs-section-title:  16px;
  --fs-section-label:  12px;
  --fs-field-label:    12px;
  --fs-pill:           13px;
}

html.text-xl {
  --fs-member-name:    18px;
  --fs-member-sub:     15px;
  --fs-cat-header:     16px;
  --fs-detail-name:    28px;
  --fs-detail-sub:     16px;
  --fs-fronter-name:   18px;
  --fs-history-name:   17px;
  --fs-topbar-title:   21px;
  --fs-section-title:  18px;
  --fs-section-label:  13px;
  --fs-field-label:    13px;
  --fs-pill:           14px;
}

/* ── Ember theme (default) ─────────────────────────────────────────── */
:root {
  --t-bg-deep:       #1a1614;
  --t-sidebar:       #151210;
  --t-border:        #2e2926;
  --t-border-mid:    #3d3028;
  --t-hover:         #1e1a17;
  --t-active-bg:     #2a2118;
  --t-accent:        #e8a840;
  --t-accent-dim:    #8c6840;
  --t-accent-border: #6b4e20;
  --t-text-strong:   #e8d5c4;
  --t-text-mid:      #c4b0a0;
  --t-text-muted:    #8c7b6e;
  --t-text-dim:      #5a4e46;
  --t-av-bg:         #2e2620;
  --t-ok:            #5dc8a0;
  --t-danger:        #e07060;
}

/* ── Dusk (soft purple) ────────────────────────────────────────────── */
[data-theme="dusk"] {
  --t-bg-deep:       #141218;
  --t-sidebar:       #100e14;
  --t-border:        #2a2632;
  --t-border-mid:    #38323e;
  --t-hover:         #1c1920;
  --t-active-bg:     #261e30;
  --t-accent:        #c87ef0;
  --t-accent-dim:    #7c4e96;
  --t-accent-border: #5c3670;
  --t-text-strong:   #e4d8f0;
  --t-text-mid:      #c0aad8;
  --t-text-muted:    #857099;
  --t-text-dim:      #4e4460;
  --t-av-bg:         #2a2238;
  --t-ok:            #5dc8a0;
  --t-danger:        #e07060;
}

/* ── Moss (deep green) ─────────────────────────────────────────────── */
[data-theme="moss"] {
  --t-bg-deep:       #121614;
  --t-sidebar:       #0e1210;
  --t-border:        #243028;
  --t-border-mid:    #303e34;
  --t-hover:         #181e18;
  --t-active-bg:     #1e2c22;
  --t-accent:        #6ec88a;
  --t-accent-dim:    #3e7852;
  --t-accent-border: #2e5a3c;
  --t-text-strong:   #d0e8d8;
  --t-text-mid:      #a8c8b4;
  --t-text-muted:    #708878;
  --t-text-dim:      #405448;
  --t-av-bg:         #1e2e24;
  --t-ok:            #5dc8a0;
  --t-danger:        #e07060;
}

/* ── Rose (dusty pink) ─────────────────────────────────────────────── */
[data-theme="rose"] {
  --t-bg-deep:       #1a1416;
  --t-sidebar:       #151012;
  --t-border:        #2e242a;
  --t-border-mid:    #3a2e34;
  --t-hover:         #1e181c;
  --t-active-bg:     #2a1e24;
  --t-accent:        #e87090;
  --t-accent-dim:    #8c4060;
  --t-accent-border: #6b2e48;
  --t-text-strong:   #f0d4dc;
  --t-text-mid:      #d0b0b8;
  --t-text-muted:    #9c7880;
  --t-text-dim:      #5c4450;
  --t-av-bg:         #2e2028;
  --t-ok:            #5dc8a0;
  --t-danger:        #e07060;
}

/* ── Slate (cool blue-grey) ────────────────────────────────────────── */
[data-theme="slate"] {
  --t-bg-deep:       #131518;
  --t-sidebar:       #0f1114;
  --t-border:        #24292e;
  --t-border-mid:    #30383e;
  --t-hover:         #181d22;
  --t-active-bg:     #1e2830;
  --t-accent:        #70a8d0;
  --t-accent-dim:    #406880;
  --t-accent-border: #2e4e64;
  --t-text-strong:   #d0dce8;
  --t-text-mid:      #a8b8c8;
  --t-text-muted:    #6e7e90;
  --t-text-dim:      #3e4e5c;
  --t-av-bg:         #202c38;
  --t-ok:            #5dc8a0;
  --t-danger:        #e07060;
}

/* ── Sand (light mode) ─────────────────────────────────────────────── */
[data-theme="sand"] {
  --t-bg-deep:       #f0ece8;
  --t-sidebar:       #e8e0d8;
  --t-border:        #d0c8c0;
  --t-border-mid:    #b8b0a8;
  --t-hover:         #ece8e0;
  --t-active-bg:     #e0d4c4;
  --t-accent:        #8c5e20;
  --t-accent-dim:    #c89060;
  --t-accent-border: #d4a870;
  --t-text-strong:   #2a2018;
  --t-text-mid:      #5a4a38;
  --t-text-muted:    #887060;
  --t-text-dim:      #b8a898;
  --t-av-bg:         #ddd0c0;
  --t-ok:            #2c8050;
  --t-danger:        #c04040;
}

/* ── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--t-bg-deep);
  color: var(--t-text-mid);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

img { display: block; }

/* ── Layout ────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 200px;
  background: var(--t-sidebar);
  border-right: 1px solid var(--t-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

#main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--t-bg-deep);
}

#topbar {
  height: 48px;
  border-bottom: 1px solid var(--t-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  flex-shrink: 0;
}

#content {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--t-border);
  flex-shrink: 0;
}

.logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
}

.logo-name {
  font-family: 'OCRAEXT', monospace;
  font-size: 15px;
  color: var(--t-text-strong);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--t-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}

.nav-item:hover {
  background: var(--t-hover);
  color: var(--t-text-mid);
}

.nav-item.active {
  background: var(--t-active-bg);
  color: var(--t-accent);
  border-left: 2px solid var(--t-accent);
  padding-left: 12px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--t-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-system-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--t-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-status {
  font-size: 10px;
  color: var(--t-text-dim);
}

.sidebar-status.online { color: var(--t-ok); }

/* ── Top bar ───────────────────────────────────────────────────────── */
.topbar-title {
  font-family: 'Fraunces', serif;
  font-size: var(--fs-topbar-title);
  font-weight: 400;
  color: var(--t-text-strong);
  flex: 1;
}

.topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--t-text-muted);
  transition: background 0.1s, color 0.1s;
}

.icon-btn:hover {
  background: var(--t-hover);
  color: var(--t-text-mid);
}

.icon-btn svg { width: 16px; height: 16px; }

/* ── Member list panel ─────────────────────────────────────────────── */
.members-panel {
  width: 260px;
  border-right: 1px solid var(--t-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--t-bg-deep);
}

.panel-search {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--t-border);
}

.search-input {
  width: 100%;
  background: var(--t-active-bg);
  border: 1px solid var(--t-border-mid);
  border-radius: 6px;
  color: var(--t-text-mid);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--t-text-dim); }
.search-input:focus { border-color: var(--t-accent-border); }

.panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.member-row:hover { background: var(--t-hover); }
.member-row.selected { background: var(--t-active-bg); }

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--t-av-bg);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--t-accent);
  overflow: hidden;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-row-info {
  flex: 1;
  min-width: 0;
}

.member-row-name {
  font-size: var(--fs-member-name);
  font-weight: 600;
  color: var(--t-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-row-sub {
  font-size: var(--fs-member-sub);
  color: var(--t-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.front-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t-ok);
  flex-shrink: 0;
}

.panel-add-btn {
  margin: 6px 10px;
  padding: 5px 8px;
  background: var(--t-active-bg);
  border: 1px dashed var(--t-border-mid);
  border-radius: 6px;
  color: var(--t-text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.1s, color 0.1s;
}

.panel-add-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.panel-add-btn:hover {
  background: var(--t-hover);
  color: var(--t-accent);
}

/* ── Detail panel ──────────────────────────────────────────────────── */
.detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--t-text-dim);
}

.detail-empty-icon { font-size: 40px; opacity: 0.4; }
.detail-empty-text { font-size: 13px; }

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--t-av-bg);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  color: var(--t-accent);
  position: relative;
}

.detail-avatar img { width: 100%; height: 100%; object-fit: cover; }

.detail-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 12px;
  color: #fff;
}

.detail-avatar:hover .detail-avatar-overlay { opacity: 1; }

.detail-header-info { flex: 1; min-width: 0; }

.detail-name {
  font-family: 'Fraunces', serif;
  font-size: var(--fs-detail-name);
  font-weight: 400;
  color: var(--t-text-strong);
  margin-bottom: 4px;
}

.detail-pronouns {
  font-size: var(--fs-detail-sub);
  color: var(--t-text-muted);
}

.front-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--t-active-bg);
  border: 1px solid var(--t-ok);
  color: var(--t-ok);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.front-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--t-ok);
}

/* ── Form fields ───────────────────────────────────────────────────── */
.field-group {
  margin-bottom: 16px;
}

.field-label {
  font-size: var(--fs-field-label);
  font-weight: 600;
  color: var(--t-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.field-input {
  width: 100%;
  background: var(--t-active-bg);
  border: 1px solid var(--t-border-mid);
  border-radius: 6px;
  color: var(--t-text-strong);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.field-input:focus { border-color: var(--t-accent-border); }
.field-input::placeholder { color: var(--t-text-dim); }

textarea.field-input {
  resize: vertical;
  min-height: 72px;
}

.field-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.field-toggle-label {
  flex: 1;
  font-size: 13px;
  color: var(--t-text-mid);
}

.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--t-border-mid);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}

.toggle-switch.on { background: var(--t-accent); }

.toggle-knob {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.15s;
}

.toggle-switch.on .toggle-knob { left: 19px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, opacity 0.1s;
  border: none;
}

.btn-primary {
  background: var(--t-accent);
  color: var(--t-bg-deep);
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: var(--t-active-bg);
  color: var(--t-text-mid);
  border: 1px solid var(--t-border-mid);
}

.btn-secondary:hover { background: var(--t-hover); color: var(--t-text-strong); }

.btn-danger {
  background: transparent;
  color: var(--t-danger);
  border: 1px solid var(--t-danger);
}

.btn-danger:hover { background: var(--t-danger); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--t-text-muted);
}

.btn-ghost:hover { color: var(--t-text-mid); }

.btn-row {
  display: flex;
  gap: 8px;
  padding-top: 8px;
}

/* ── Category pills ────────────────────────────────────────────────── */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--t-active-bg);
  border: 1px solid var(--t-border-mid);
  color: var(--t-text-mid);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: var(--fs-pill);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.pill.selected {
  background: var(--t-accent-border);
  border-color: var(--t-accent);
  color: var(--t-accent);
}

.pill:hover { border-color: var(--t-accent-dim); }

/* ── Fronting screen ───────────────────────────────────────────────── */
.fronting-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fronting-section {
  padding: 16px 20px 8px;
}

.section-heading {
  font-size: var(--fs-section-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t-text-dim);
  margin-bottom: 10px;
}

.fronter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--t-active-bg);
  border: 1px solid var(--t-border-mid);
  border-radius: 8px;
  margin-bottom: 8px;
}

.fronter-card-info { flex: 1; min-width: 0; }

.fronter-card-name {
  font-size: var(--fs-fronter-name);
  font-weight: 600;
  color: var(--t-text-strong);
  font-family: 'Fraunces', serif;
}

.fronter-card-timer {
  font-size: 11px;
  color: var(--t-ok);
  margin-top: 2px;
}

.history-list {
  overflow-y: auto;
  flex: 1;
  padding: 0 20px 16px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--t-border);
}

.history-row:last-child { border-bottom: none; }

.history-name {
  font-size: var(--fs-history-name);
  font-weight: 600;
  color: var(--t-text-mid);
  flex: 1;
}

.history-time {
  font-size: 11px;
  color: var(--t-text-dim);
}

/* ── Friends screen ────────────────────────────────────────────────── */
.friends-screen {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--t-active-bg);
  border: 1px solid var(--t-border);
  border-radius: 8px;
}

.friend-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text-strong);
  flex: 1;
}

.request-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--t-hover);
  border: 1px solid var(--t-border);
  border-radius: 8px;
  margin-bottom: 6px;
}

.request-name {
  flex: 1;
  font-size: 13px;
  color: var(--t-text-mid);
}

.add-friend-row {
  display: flex;
  gap: 8px;
}

/* ── Settings screen ───────────────────────────────────────────────── */
.settings-screen {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-family: 'Fraunces', serif;
  font-size: var(--fs-section-title);
  font-weight: 400;
  color: var(--t-accent);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--t-border);
}

/* ── Theme picker ──────────────────────────────────────────────────── */
.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  font-size: 11px;
  font-weight: 600;
  min-width: 60px;
}

.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch.active { border-color: currentColor !important; }

.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* ── Text size picker ──────────────────────────────────────────────── */
.text-size-picker {
  display: flex;
  gap: 8px;
}

.text-size-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--t-border-mid);
  background: var(--t-active-bg);
  color: var(--t-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-align: center;
}

.text-size-btn:hover {
  border-color: var(--t-accent-dim);
  color: var(--t-text-mid);
}

.text-size-btn.active {
  border-color: var(--t-accent);
  color: var(--t-accent);
}

.text-size-sample {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  line-height: 1.2;
}

/* ── Welcome screen ────────────────────────────────────────────────── */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
}

.welcome-logo {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
}

.welcome-title {
  font-family: 'OCRAEXT', monospace;
  font-size: 28px;
  color: var(--t-text-strong);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.welcome-sub {
  font-size: 14px;
  color: var(--t-text-muted);
  margin-top: -8px;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
}

.welcome-actions .btn {
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
}

.welcome-status {
  font-size: 12px;
  color: var(--t-text-muted);
  text-align: center;
  min-height: 18px;
}

/* ── System icon ───────────────────────────────────────────────────── */
.system-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.system-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--t-av-bg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  position: relative;
}

.system-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Divider ───────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--t-border);
  margin: 12px 0;
}

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--t-text-dim);
  font-size: 13px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--t-border-mid);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--t-text-dim); }

/* ── Custom fields ─────────────────────────────────────────────────── */
.custom-field-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.custom-field-key {
  width: 120px;
  flex-shrink: 0;
}

.custom-field-val { flex: 1; }

/* ── Category group ────────────────────────────────────────────────── */
.category-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 4px;
  font-size: var(--fs-cat-header);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t-text-dim);
  cursor: pointer;
  user-select: none;
}

.category-group-header:hover { color: var(--t-text-muted); }

/* ── Mobile layout ─────────────────────────────────────────────────── */
/* JS adds class="mobile" to <html> when isMobile() is true.           */
/* This covers both the real Android build and the desktop preview mode. */

html.mobile #app { flex-direction: column; }

html.mobile #sidebar {
  width: 100%;
  height: 58px;
  border-right: none;
  border-top: 1px solid var(--t-border);
  flex-direction: row;
  order: 2;
  flex-shrink: 0;
  overflow: hidden;
}

html.mobile .logo-area,
html.mobile .sidebar-footer { display: none; }

html.mobile .sidebar-nav {
  display: flex;
  flex-direction: row;
  width: 100%;
  padding: 0;
  overflow: visible;
}

html.mobile .nav-item {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  font-size: 10px;
  font-weight: 600;
  border-left: none;
  padding-left: 0;
}

html.mobile .nav-item.active {
  border-left: none;
  padding-left: 0;
  background: transparent;
  color: var(--t-accent);
}

html.mobile .nav-icon { width: 22px; height: 22px; opacity: 1; }

html.mobile #main-area { order: 1; flex: 1; min-height: 0; }

html.mobile #topbar { height: 56px; padding: 0 14px; }

html.mobile .topbar-title {
  font-family: 'OCRAEXT', monospace;
  font-size: max(14px, var(--fs-topbar-title));
  letter-spacing: 0.04em;
}

html.mobile #content { position: relative; overflow: hidden; }

html.mobile .members-panel {
  width: 100%;
  border-right: none;
  position: absolute;
  inset: 0;
  transform: translateX(0);
  transition: transform 0.25s ease;
  z-index: 1;
}

html.mobile .members-panel.slide-out { transform: translateX(-100%); }

html.mobile .detail-panel {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 2;
  background: var(--t-bg-deep);
}

html.mobile .detail-panel.slide-in { transform: translateX(0); }

html.mobile .member-row::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--t-text-dim);
  border-top: 1.5px solid var(--t-text-dim);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-left: auto;
}

html.mobile .detail-scroll { padding: 14px 16px; }

html.mobile .detail-header { gap: 12px; margin-bottom: 14px; }

html.mobile .detail-avatar { width: 56px; height: 56px; font-size: 20px; }

html.mobile .detail-name { font-size: 19px; }

html.mobile .front-action-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 14px;
}

html.mobile .fronting-screen { padding: 0; }

html.mobile .fronting-section { padding: 12px 14px 6px; }

html.mobile .fronter-card { border-radius: 10px; }

html.mobile .history-list { padding: 0 14px 14px; }

html.mobile .friends-screen { padding: 12px 14px; gap: 14px; }

html.mobile .add-friend-row { flex-direction: column; }

html.mobile .add-friend-row .field-input,
html.mobile .add-friend-row .btn { width: 100%; }

html.mobile .settings-screen { padding: 14px 16px; }

html.mobile .theme-swatch { min-width: 50px; padding: 6px 8px; font-size: 10px; }

html.mobile .swatch-dot { width: 14px; height: 14px; }

html.mobile .welcome-screen { padding: 24px 20px; gap: 12px; }

html.mobile .welcome-logo { width: 80px; height: 80px; border-radius: 14px; }

html.mobile .welcome-title { font-size: 22px; }

html.mobile .welcome-actions { max-width: 100%; }

html.mobile .btn { min-height: 40px; }

html.mobile .icon-btn { width: 36px; height: 36px; }

html.mobile .field-input,
html.mobile .search-input { font-size: 16px; }

html.mobile .fronter-card,
html.mobile .friend-card,
html.mobile .request-card { border-radius: 10px; }

html.mobile .panel-search { padding: 8px 10px; }

html.mobile .panel-add-btn { margin: 6px 10px 10px; }
