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

:root {
  --bg: #f0eee8;
  --panel: #ffffff;
  --border: #dbe1ec;
  --text: #1a1a1a;
  --muted: #888;
  --accent: #4895ef;
  --accent2: #2a9d8f;
  --red: #e63946;
  --yellow: #f4a261;
  --purple: #7b2d8b;
  --green: #52b788;
  --floating-footer-h: 66px;
  --readonly-feedback-h: 140px;
}

body {
  font-family: 'DM Mono', monospace;
  background: #f8f9fc;
  min-height: 100vh;
  color: var(--text);
  max-width: 100vw;
  overflow-x: hidden;
  padding-bottom: calc(var(--floating-footer-h) + 12px);
}

body.readonly-note-view {
  padding-bottom: calc(var(--readonly-feedback-h) + 12px);
}

/* ── APP SHELL ── */
.app-header {
  background: #1a1a2e;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg,#e63946,#f4a261,#2a9d8f,#4895ef,#7b2d8b) 1;
}

.app-logo {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-user-chip {
  display: inline-flex;
}

.app-logo span {
  background: linear-gradient(135deg,#f4a261,#e63946);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(72,149,239,0.2);
  color: #7ec8fd;
  border: 1px solid rgba(72,149,239,0.3);
  letter-spacing: 0.5px;
}

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

@media (max-width: 860px) {
  .app-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-actions {
    gap: 5px;
    flex-wrap: wrap;
  }
  .auth-user-chip {
    font-size: 10px;
    padding: 3px 8px;
    min-width: 0;
  }
  .logout-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
}

@media (max-width: 600px) {
  .btn-label { display: none; }
  .logout-btn, .settings-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    border-radius: 50%;
    min-width: 0;
  }
  .header-actions { gap: 4px; }
  .auth-user-chip { display: none; }
  .logo-user-chip {
    display: none;
  }

  .floating-footer {
    width: calc(100vw - 12px);
    bottom: 6px;
    border-radius: 14px;
    gap: 4px;
    padding: 6px;
  }

  .floating-footer-btn {
    font-size: 10px;
    gap: 5px;
  }

  .floating-footer-btn .icon {
    font-size: 14px;
  }
}

/* ── MAIN LAYOUT ── */
.main {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  height: calc(100vh - 57px - var(--floating-footer-h));
}

.floating-footer {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 20px));
  height: var(--floating-footer-h);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.3);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  z-index: 1200;
}

.floating-footer.reader-footer {
  grid-template-columns: repeat(3, 1fr);
}

.floating-footer-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #e2e8f0;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transform: translateY(0) scale(1);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.floating-footer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.floating-footer-btn.active {
  background: rgba(72, 149, 239, 0.22);
  border-color: rgba(125, 211, 252, 0.55);
  color: #dbeafe;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
}

.floating-footer-btn .icon {
  font-size: 15px;
  transition: transform 0.24s ease;
}

.floating-footer-btn.active .icon {
  transform: scale(1.08);
}

/* ── LEFT PANEL ── */
.left-panel {
  background: #fafaf8;
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px 14px;
  background: #f8f9fc;
}

.panel-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.panel-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.input-area {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: #f8f9fc;
}

#generator-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.edit-inspector-panel {
  display: none;
  flex: 1;
  border: 1px solid #d9e1ef;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  overflow-y: auto;
  font-family: 'DM Mono', monospace;
}

.edit-inspector-panel.active {
  display: block;
}

.edit-inspector-title {
  font-size: 12px;
  color: #1f2937;
  margin-bottom: 8px;
  font-weight: 700;
}

.edit-inspector-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.edit-inspector-title-row .edit-inspector-title {
  margin-bottom: 0;
}

.edit-page-btn {
  border: 1px solid #d5e3f4;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
}

.edit-page-btn:hover {
  background: #f4f8ff;
  border-color: #bfd3f2;
}

.edit-inspector-section {
  margin-bottom: 14px;
}

.edit-inspector-section:last-child {
  margin-bottom: 0;
}

.edit-inspector-empty {
  border: 1px dashed #c8d4e8;
  border-radius: 8px;
  padding: 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.edit-inspector-grid {
  display: grid;
  gap: 8px;
}

.edit-block-summary {
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
  padding: 12px;
}

.edit-block-summary-title {
  font-size: 14px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 4px;
}

.edit-block-summary-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}

.edit-mode-tabs {
  display: flex;
  gap: 6px;
  border: 1px solid #bfd3f2;
  background: linear-gradient(180deg, #eef5ff 0%, #e7f1ff 100%);
  border-radius: 8px;
  padding: 3px;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.edit-mode-tab {
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  cursor: pointer;
  flex: 1 1 50%;
  text-align: center;
}

.edit-mode-tab.active {
  background: #fff;
  color: #0b3b8f;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), inset 0 0 0 1px #c9daf8;
}

.edit-block-toolbar,
.edit-item-actions,
.edit-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edit-block-toolbar {
  margin-top: 6px;
}

.edit-block-summary .edit-block-toolbar {
  margin-top: 10px;
}

.edit-block-btn {
  border: 1px solid #d5e3f4;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 8px 10px;
  cursor: pointer;
}

.edit-block-btn.icon-only {
  width: 34px;
  min-width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.edit-inspector-panel .edit-block-toolbar .edit-block-btn,
.edit-inspector-panel .edit-item-actions .edit-block-btn,
.edit-inspector-panel .edit-subeditor-head .edit-block-btn {
  width: 34px;
  min-width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.edit-inspector-panel .edit-block-toolbar .edit-block-btn.fit-content {
  width: auto;
  min-width: 0;
  padding: 0 10px;
  font-size: 11px;
}

.edit-inspector-panel .edit-subeditor-head .edit-block-btn.fit-content {
  width: auto;
  min-width: 0;
  padding: 0 10px;
  font-size: 11px;
}

.edit-block-btn:hover {
  background: #f4f8ff;
  border-color: #bfd3f2;
}

.edit-block-btn.danger {
  border-color: #f3c4c4;
  color: #991b1b;
  background: #fff7f7;
}

.edit-block-btn.danger:hover {
  background: #ffe9e9;
}

.edit-block-field,
.edit-subeditor,
.edit-item-card {
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.edit-subeditor {
  display: grid;
  gap: 10px;
}

.edit-subeditor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.edit-subeditor-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #475569;
}

.edit-item-card {
  display: grid;
  gap: 8px;
  border: none;
  padding: 0;
  background: transparent;
}

.edit-item-card.active {
  background: transparent;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.edit-item-card .edit-block-field {
  border: none;
  padding: 0;
  background: transparent;
}

.edit-item-card .edit-field-label {
  display: none;
}

.edit-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.edit-item-title {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.edit-inline-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.edit-inline-grid.one {
  grid-template-columns: minmax(0, 1fr);
}

.edit-field-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.edit-input,
.edit-textarea,
.edit-select {
  width: 100%;
  border: 1px solid #d9e3f1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 9px 10px;
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

.edit-input,
.edit-select {
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
}

.edit-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}

.edit-item-card .edit-input {
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
}

.edit-list-stack {
  display: grid;
  gap: 8px;
}

.edit-muted-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}

.edit-inspector-row {
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbff;
}

.edit-inspector-key {
  display: block;
  font-size: 10px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.edit-inspector-value {
  display: block;
  font-size: 12px;
  color: #111827;
  line-height: 1.5;
  word-break: break-word;
}

.edit-inspector-row.full {
  background: #f6f8fc;
}

.edit-inspector-pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.55;
  color: #1f2937;
}

textarea#input-text {
  flex: 1;
  min-height: 280px;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

#json-output {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

textarea#input-text:focus { border-color: var(--accent); }
textarea#input-text::placeholder { color: #bbb; }

/* token estimate */
.token-hint {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f7ff;
  border: 1px solid #bdd8f5;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  color: #1d4ed8;
}

.token-badge.good { background:#f0fdf4; border-color:#86efac; color:#15803d; }
.token-badge.warn { background:#fefce8; border-color:#fde047; color:#854d0e; }

/* convert button */
.convert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #1a1a2e, #2d3561);
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.convert-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,26,46,0.3); }
.convert-btn:active { transform: scale(0.98); }
.convert-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.convert-btn .btn-icon { font-size: 18px; }

.assist-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: #1a1a2e;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}

.assist-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f8fbff;
}

.assist-panel {
  display: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  gap: 12px;
}

.assist-panel.open {
  display: grid;
}

.assist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.assist-title {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #1a1a2e;
}

.assist-subtitle {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
  margin-top: 4px;
}

.assist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.assist-field {
  display: grid;
  gap: 6px;
}

.assist-field.full {
  grid-column: 1 / -1;
}

.assist-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #475569;
}

.assist-input,
.assist-select,
.assist-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: #fff;
  color: #1f2937;
  outline: none;
}

.assist-input:focus,
.assist-select:focus,
.assist-textarea:focus {
  border-color: var(--accent);
}

.assist-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

.assist-actions {
  display: flex;
  gap: 8px;
}

.assist-actions .note-settings-btn,
.assist-actions .note-settings-btn.secondary {
  flex: 1;
}

.assist-status {
  min-height: 18px;
  font-size: 12px;
  color: #64748b;
}

.assist-extra-blocks {
  display: grid;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fcfdff;
}

.assist-extra-blocks-head {
  display: grid;
  gap: 4px;
}

.assist-extra-blocks-hint {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.assist-extra-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #1f2937;
  font-family: 'DM Mono', monospace;
}

.assist-extra-toggle input {
  accent-color: var(--accent);
}

.assist-extra-block-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── RIGHT PANEL ── */
.right-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.composer-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e6eaf2;
  background: #f8f9fc;
}

.composer-mobile-switch-btn {
  display: none;
  border: 1px solid #dbe1ec;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  padding: 7px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
}

/* tabs */
.tabs {
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid #e6eaf2;
  background: #f8f9fc;
  padding: 0 16px;
  gap: 0;
  height: 46px;
}

.tab-btn {
  height: 100%;
  padding: 0 18px;
  background: none;
  border: none;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0; right: 0;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.tab-btn.active { color: var(--accent); }
.tab-btn.active::after { opacity: 1; }

@media (max-width: 600px) {
  .tab-label { display: none; }
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  display: none;
}

.tab-content.active { display: block; }
#tab-json.active { display: flex; flex-direction: column; }

/* rendered note wrapper */
#note-output {
  padding: 15px;
}

#note-output,
#note-output * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

#note-output .note-element-selected {
  outline: 1px solid rgba(37, 99, 235, 0.9) !important;
  outline-offset: 2px;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.24),
    0 12px 28px -18px rgba(37, 99, 235, 0.65);
  border-radius: 10px;
  transition: box-shadow 0.18s ease, outline-color 0.18s ease;
}

#note-output [data-selectable-element="true"] {
  cursor: pointer;
}

/* JSON editor */
#json-output {
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  line-height: 1.8;
  color: #2d2d2d;
  background: #fafaf8;
  border: none;
  outline: none;
  resize: none;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}

#json-output:focus { background: #fff; }

.json-status {
  padding: 6px 20px;
  font-size: 11px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.json-status.ok   { color: #15803d; }
.json-status.err  { color: #b91c1c; }
.json-status.idle { color: #888; }



/* toolbar icon buttons */
.print-btn, .save-btn, .split-btn, .skeleton-btn, .capture-btn {
  margin-left: auto;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.save-btn { margin-left: 4px; }
.split-btn { margin-left: 4px; }
.skeleton-btn { margin-left: 4px; }
.capture-btn { margin-left: 4px; }
.print-btn:active, .save-btn:active, .split-btn:active, .skeleton-btn:active, .capture-btn:active { transform: scale(0.97); }
.print-btn:disabled, .save-btn:disabled, .split-btn:disabled, .skeleton-btn:disabled, .capture-btn:disabled { opacity: 0.3; cursor: not-allowed; }
/* tooltip */
.print-btn::after, .save-btn::after, .split-btn::after, .skeleton-btn::after, .capture-btn::after, .fullscreen-btn::after {
  content: attr(title);
  position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e; color: #fff;
  font-family: 'DM Mono', monospace; font-size: 10px;
  padding: 4px 8px; border-radius: 5px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.15s;
}
.print-btn:hover::after, .save-btn:hover::after, .split-btn:hover::after, .skeleton-btn:hover::after, .capture-btn:hover::after, .fullscreen-btn:hover::after { opacity: 1; }

.skeleton-reveal {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 1.4em;
  padding: 0 4px;
  border: 1px dashed rgba(42,157,143,0.45);
  border-radius: 6px;
  background: rgba(42,157,143,0.08);
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  vertical-align: baseline;
}

.skeleton-reveal:hover {
  border-color: rgba(42,157,143,0.85);
  background: rgba(42,157,143,0.16);
}

.skeleton-reveal.revealed {
  border-color: transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

/* placeholder state */
.placeholder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  gap: 12px;
  color: var(--muted);
  padding: 40px;
  text-align: center;
}

.placeholder-icon {
  font-size: 56px;
  opacity: 0.4;
}

.placeholder-state h3 {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: #aaa;
}

.placeholder-state p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 300px;
}

/* error state */
.error-box {
  background: #fff5f5;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px;
  font-size: 13px;
  color: #b91c1c;
  line-height: 1.6;
}

/* ════════════════════════════════════════
   DOODLE NOTE RENDERER STYLES
   ════════════════════════════════════════ */
.mc-choice-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 12px 0;
}

.mc-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mc-block-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.mc-choice-row {
  --mc-accent: #4895ef;
  --mc-ink: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 12px 9px 10px;
  border: 2px solid rgba(26,26,46,0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.68)),
    repeating-linear-gradient(180deg, transparent 0, transparent 13px, rgba(72,149,239,0.055) 13px, rgba(72,149,239,0.055) 15px);
  color: var(--mc-ink);
  cursor: pointer;
  position: relative;
  box-shadow: 2px 3px 0 rgba(26,26,46,0.08);
  transform: rotate(-0.12deg);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mc-choice-row:hover {
  transform: translateY(-1px) rotate(0.1deg);
  border-color: color-mix(in srgb, var(--mc-accent) 62%, #1a1a2e 12%);
  box-shadow: 3px 5px 0 rgba(26,26,46,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.76)),
    repeating-linear-gradient(180deg, transparent 0, transparent 13px, rgba(72,149,239,0.08) 13px, rgba(72,149,239,0.08) 15px);
}

.mc-choice-row.selected {
  border-color: var(--mc-accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mc-accent) 14%, #fff 86%), rgba(255,255,255,0.76)),
    repeating-linear-gradient(180deg, transparent 0, transparent 13px, color-mix(in srgb, var(--mc-accent) 12%, transparent) 13px, color-mix(in srgb, var(--mc-accent) 12%, transparent) 15px);
  box-shadow: 3px 5px 0 color-mix(in srgb, var(--mc-accent) 24%, transparent);
}

.mc-choice-row.disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.mc-choice-input {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid color-mix(in srgb, var(--mc-accent) 72%, #1a1a2e 18%);
  border-radius: 7px 6px 8px 5px;
  background: rgba(255,255,255,0.86);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  box-shadow: 1px 2px 0 rgba(26,26,46,0.08);
}

.mc-choice-input::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px 5px 4px 6px;
  background: var(--mc-accent);
  transform: scale(0) rotate(-8deg);
  transition: transform 120ms ease;
}

.mc-choice-input:checked::before {
  transform: scale(1) rotate(-8deg);
}

.mc-choice-text {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  line-height: 1.45;
}

.tf-block .mc-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.tf-block .mc-choice-row {
  justify-content: center;
  min-width: 0;
}

.tf-block .mc-choice-true {
  --mc-accent: #52b788;
  border-color: rgba(82,183,136,0.58);
  box-shadow: 2px 3px 0 rgba(82,183,136,0.18);
}

.tf-block .mc-choice-false {
  --mc-accent: #e63946;
  border-color: rgba(230,57,70,0.54);
  box-shadow: 2px 3px 0 rgba(230,57,70,0.16);
}

.tf-block .mc-choice-true:hover,
.tf-block .mc-choice-true.selected {
  border-color: #52b788;
  box-shadow: 3px 5px 0 rgba(82,183,136,0.24);
}

.tf-block .mc-choice-false:hover,
.tf-block .mc-choice-false.selected {
  border-color: #e63946;
  box-shadow: 3px 5px 0 rgba(230,57,70,0.22);
}

.tf-block .mc-choice-true.selected {
  background:
    linear-gradient(180deg, rgba(220,252,231,0.92), rgba(255,255,255,0.76)),
    repeating-linear-gradient(180deg, transparent 0, transparent 13px, rgba(82,183,136,0.12) 13px, rgba(82,183,136,0.12) 15px);
}

.tf-block .mc-choice-false.selected {
  background:
    linear-gradient(180deg, rgba(254,226,226,0.92), rgba(255,255,255,0.76)),
    repeating-linear-gradient(180deg, transparent 0, transparent 13px, rgba(230,57,70,0.12) 13px, rgba(230,57,70,0.12) 15px);
}

.tf-block .mc-choice-text {
  flex: 0 1 auto;
  text-align: center;
}

@media (max-width: 420px) {
  .tf-block .mc-choice-list {
    grid-template-columns: 1fr;
  }
}

.mc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
}

.mc-reset-btn {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.mc-reset-btn:hover {
  background: rgba(148,163,184,0.16);
}

.mc-check-btn {
  --mc-action-accent: var(--mc-accent, #4895ef);
  border: 2px solid rgba(26,26,46,0.18);
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 40px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.72)),
    repeating-linear-gradient(180deg, transparent 0, transparent 12px, rgba(244,162,97,0.10) 12px, rgba(244,162,97,0.10) 14px);
  color: #1a1a2e;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 2px 3px 0 rgba(26,26,46,0.10);
  transform: rotate(-0.2deg);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mc-check-btn:hover:not(:disabled) {
  transform: translateY(-1px) rotate(0.15deg);
  border-color: var(--mc-action-accent);
  box-shadow: 3px 5px 0 color-mix(in srgb, var(--mc-action-accent) 24%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mc-action-accent) 13%, #fff 87%), rgba(255,255,255,0.78)),
    repeating-linear-gradient(180deg, transparent 0, transparent 12px, color-mix(in srgb, var(--mc-action-accent) 11%, transparent) 12px, color-mix(in srgb, var(--mc-action-accent) 11%, transparent) 14px);
}

.mc-check-btn:active:not(:disabled) {
  transform: translateY(1px) rotate(0deg);
  box-shadow: 1px 2px 0 rgba(26,26,46,0.12);
}

.mc-check-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 1px 2px 0 rgba(26,26,46,0.06);
}

.cl-page .mc-check-btn {
  border-width: 1px;
  background: #fff;
  box-shadow: none;
  transform: none;
}

.cl-page .mc-check-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.chalk-page .mc-check-btn {
  background: rgba(255,255,255,0.035);
  border-color: color-mix(in srgb, var(--mc-action-accent) 52%, #d4cfc8 18%);
  color: #f5f0e8;
  box-shadow: none;
}

.chalk-page .mc-check-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--mc-action-accent) 15%, transparent);
  box-shadow: none;
}

.term-page .mc-check-btn {
  border-width: 1px;
  border-radius: 0;
  background: rgba(88,166,255,0.06);
  color: #c9d1d9;
  box-shadow: none;
  transform: none;
}

.term-page .mc-check-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--mc-action-accent) 16%, transparent);
  transform: none;
  box-shadow: none;
}

.kids-page .mc-check-btn {
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(26,26,46,0.10);
  transform: rotate(-0.2deg);
}

.mc-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
}

.mc-feedback.correct {
  background: rgba(220,252,231,0.8);
  border-color: rgba(22,163,74,0.35);
}

.mc-feedback.wrong {
  background: rgba(254,242,242,0.84);
  border-color: rgba(220,38,38,0.28);
}

.mc-feedback-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.mc-feedback-answer {
  font-weight: 700;
  margin-bottom: 4px;
}

.mc-feedback-explanation {
  opacity: 0.9;
  line-height: 1.5;
}

.dn-c-blue .mc-choice-row,
.cl-c-blue .mc-choice-row,
.chalk-c-blue .mc-choice-row,
.term-c-blue .mc-choice-row,
.ps-c-blue .mc-choice-row,
.mg-c-blue .mc-choice-row,
.kids-c-blue .mc-choice-row { --mc-accent: #4895ef; }

.dn-c-red .mc-choice-row,
.cl-c-red .mc-choice-row,
.chalk-c-red .mc-choice-row,
.term-c-red .mc-choice-row,
.ps-c-red .mc-choice-row,
.mg-c-red .mc-choice-row,
.kids-c-red .mc-choice-row { --mc-accent: #e63946; }

.dn-c-green .mc-choice-row,
.cl-c-green .mc-choice-row,
.chalk-c-green .mc-choice-row,
.term-c-green .mc-choice-row,
.ps-c-green .mc-choice-row,
.mg-c-green .mc-choice-row,
.kids-c-green .mc-choice-row { --mc-accent: #52b788; }

.dn-c-teal .mc-choice-row,
.cl-c-teal .mc-choice-row,
.chalk-c-teal .mc-choice-row,
.term-c-teal .mc-choice-row,
.ps-c-teal .mc-choice-row,
.mg-c-teal .mc-choice-row,
.kids-c-teal .mc-choice-row { --mc-accent: #2a9d8f; }

.dn-c-yellow .mc-choice-row,
.cl-c-yellow .mc-choice-row,
.chalk-c-yellow .mc-choice-row,
.term-c-yellow .mc-choice-row,
.ps-c-yellow .mc-choice-row,
.mg-c-yellow .mc-choice-row,
.kids-c-yellow .mc-choice-row,
.dn-c-orange .mc-choice-row,
.cl-c-orange .mc-choice-row,
.chalk-c-orange .mc-choice-row,
.term-c-orange .mc-choice-row,
.ps-c-orange .mc-choice-row,
.mg-c-orange .mc-choice-row,
.kids-c-orange .mc-choice-row { --mc-accent: #f4a261; }

.dn-c-purple .mc-choice-row,
.cl-c-purple .mc-choice-row,
.chalk-c-purple .mc-choice-row,
.term-c-purple .mc-choice-row,
.ps-c-purple .mc-choice-row,
.mg-c-purple .mc-choice-row,
.kids-c-purple .mc-choice-row { --mc-accent: #7b2d8b; }

.dn-c-pink .mc-choice-row,
.cl-c-pink .mc-choice-row,
.chalk-c-pink .mc-choice-row,
.term-c-pink .mc-choice-row,
.ps-c-pink .mc-choice-row,
.mg-c-pink .mc-choice-row,
.kids-c-pink .mc-choice-row { --mc-accent: #f778ba; }

.cl-page .mc-choice-row {
  border-width: 1px;
  background: #fff;
  box-shadow: none;
  transform: none;
}

.cl-page .mc-choice-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.chalk-page .mc-choice-row {
  background: rgba(255,255,255,0.035);
  border-color: color-mix(in srgb, var(--mc-accent) 52%, #d4cfc8 18%);
  color: #f5f0e8;
  box-shadow: none;
}

.chalk-page .mc-choice-row:hover,
.chalk-page .mc-choice-row.selected {
  background: color-mix(in srgb, var(--mc-accent) 15%, transparent);
}

.chalk-page .mc-choice-input {
  background: rgba(18,18,18,0.5);
  box-shadow: none;
}

.term-page .mc-choice-row {
  border-width: 1px;
  border-radius: 0;
  background: rgba(88,166,255,0.06);
  color: #c9d1d9;
  box-shadow: none;
  transform: none;
}

.term-page .mc-choice-row:hover,
.term-page .mc-choice-row.selected {
  background: color-mix(in srgb, var(--mc-accent) 16%, transparent);
  transform: none;
}

.term-page .mc-choice-input {
  border-radius: 0;
  background: #0d1117;
  box-shadow: none;
}

.kids-page .mc-choice-row {
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(26,26,46,0.10);
  transform: rotate(-0.2deg);
}

.dn-page {
  max-width: 950px;
  margin: 0 auto;
  background: #fffef7;
  border-radius: 6px;
  padding: 44px 10px 56px;
  position: relative;
  box-shadow: 4px 5px 0 #e0c8a0, 8px 10px 0 #c8b080;
  border: 2px solid #e0d5c0;
}

.dn-content { position: relative; z-index: 1; }

/* Title */
.dn-title {
  font-family: 'Caveat', cursive;
  font-size: 40px;
  font-weight: 700;
  background: linear-gradient(135deg, #e63946, #f4a261, #2a9d8f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  display: block;
  margin-bottom: 4px;
}

.dn-title-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.dn-title-bar span { height: 4px; border-radius: 4px; display: block; }

/* Divider */
.dn-divider {
  height: 3px;
  background: repeating-linear-gradient(90deg,
    #e63946 0,#e63946 20px, #f4a261 20px,#f4a261 40px,
    #2a9d8f 40px,#2a9d8f 60px, #4895ef 60px,#4895ef 80px,
    #7b2d8b 80px,#7b2d8b 100px);
  border-radius: 4px;
  margin: 26px 0;
  opacity: 0.5;
}

/* Section header */
.dn-section-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 14px;
}

.dn-section-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-family: 'Caveat', cursive;
}

.dn-section-title {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 700;
}

/* Box */
.dn-box {
  border: 3px solid;
  border-radius: 14px 6px 16px 8px;
  padding: 16px 18px;
  margin: 10px 0;
  position: relative;
}

.dn-box-label {
  position: absolute;
  top: -13px;
  left: 16px;
  background: #fffef7;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Caveat', cursive;
}

/* Two-col */
.dn-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
}

/* Bullets */
.dn-bullets { list-style: none; padding: 0; margin: 8px 0; }
.dn-bullets li {
  padding: 3px 0 3px 26px;
  position: relative;
  font-size: 17px;
  font-family: 'Patrick Hand', cursive;
  color: #333;
  line-height: 1.5;
}
.dn-bullets li::before { position: absolute; left: 4px; font-size: 15px; }
.dn-bullets.arrow li::before  { content: '→'; color: #4895ef; }
.dn-bullets.check li::before  { content: '✓'; color: #52b788; font-weight: 700; }
.dn-bullets.warn  li::before  { content: '!'; color: #e63946; font-weight: 900; }
.dn-bullets.star  li::before  { content: '★'; color: #f4a261; font-size: 13px; top:6px; }
.dn-bullets.dot   li::before  { content: '●'; color: #7b2d8b; font-size: 10px; top:7px; }

/* Note text */
.dn-text {
  font-family: 'Patrick Hand', cursive;
  font-size: 17px;
  color: #333;
  line-height: 1.7;
  margin: 6px 0;
}

/* Stats */
.dn-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.dn-stat {
  flex: 1;
  min-width: 110px;
  border: 3px dashed;
  border-radius: 12px 8px 14px 10px;
  padding: 10px 12px;
  text-align: center;
}
.dn-stat .n { font-family:'Caveat',cursive; font-size:28px; font-weight:700; display:block; }
.dn-stat .l { font-family:'Patrick Hand',cursive; font-size:13px; color:#555; line-height:1.3; margin-top:3px; }

/* Table */
.dn-table { width:100%; border-collapse:separate; border-spacing:0; margin:10px 0; font-family:'Patrick Hand',cursive; font-size:15px; border-radius:10px; overflow:hidden; }
.dn-table th { padding:9px 12px; font-family:'Caveat',cursive; font-size:17px; font-weight:700; color:#fff; border:1.5px solid rgba(255,255,255,0.3); }
.dn-table td { padding:8px 12px; border:1.5px solid rgba(0,0,0,0.08); color:#333; vertical-align:middle; }
.dn-table tr:nth-child(even) td { background:rgba(0,0,0,0.02); }

/* Sticky */
.dn-sticky {
  padding: 14px 18px 14px 20px;
  margin: 12px 0;
  font-family: 'Caveat', cursive;
  font-size: 19px;
  position: relative;
  border-radius: 4px 16px 14px 6px;
  border-left: 6px solid;
}
.dn-sticky .dn-pin { position:absolute; top:-14px; right:12px; font-size:22px; }

/* Pills */
.dn-pills { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
.dn-pill {
  padding: 8px 16px;
  border-radius: 30px;
  font-family: 'Caveat', cursive;
  font-size: 17px;
  font-weight: 700;
  border: 2.5px solid;
}

/* Tags */
.dn-tags { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.dn-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-family: 'Caveat', cursive;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid;
}

/* Score tiers */
.dn-tiers { display:flex; gap:14px; margin:12px 0; }
.dn-tier {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-radius: 14px 10px 12px 8px;
  border: 3px solid;
}
.dn-tier .tn { font-family:'Caveat',cursive; font-size:26px; font-weight:700; display:block; }
.dn-tier .tl { font-family:'Patrick Hand',cursive; font-size:14px; font-weight:700; }
.dn-tier .ta { font-family:'Caveat',cursive; font-size:18px; font-weight:700; margin:4px 0; display:block; }
.dn-tier .ts { font-family:'Patrick Hand',cursive; font-size:12px; padding:3px 8px; border-radius:10px; display:inline-block; margin-top:4px; }

/* Color themes */
.dn-c-blue   { border-color:#4895ef; background:linear-gradient(135deg,rgba(72,149,239,.08),rgba(72,149,239,.16)); }
.dn-c-red    { border-color:#e63946; background:linear-gradient(135deg,rgba(230,57,70,.08),rgba(230,57,70,.16)); }
.dn-c-teal   { border-color:#2a9d8f; background:linear-gradient(135deg,rgba(42,157,143,.08),rgba(42,157,143,.16)); }
.dn-c-green  { border-color:#52b788; background:linear-gradient(135deg,rgba(82,183,136,.08),rgba(82,183,136,.16)); }
.dn-c-yellow { border-color:#f4a261; background:linear-gradient(135deg,rgba(244,162,97,.1),rgba(244,162,97,.2)); }
.dn-c-orange { border-color:#e76f51; background:linear-gradient(135deg,rgba(231,111,81,.08),rgba(231,111,81,.16)); }
.dn-c-purple { border-color:#7b2d8b; background:linear-gradient(135deg,rgba(123,45,139,.08),rgba(123,45,139,.16)); }
.dn-c-gray   { border-color:#888;    background:linear-gradient(135deg,rgba(100,100,100,.06),rgba(100,100,100,.12)); }
.dn-c-pink   { border-color:#e07ab1; background:linear-gradient(135deg,rgba(224,122,177,.08),rgba(224,122,177,.16)); }

.dn-label-blue   { color:#1d4ed8; }
.dn-label-red    { color:#b91c1c; }
.dn-label-teal   { color:#0f766e; }
.dn-label-green  { color:#166534; }
.dn-label-yellow { color:#b45309; }
.dn-label-orange { color:#c2410c; }
.dn-label-purple { color:#6b21a8; }
.dn-label-gray   { color:#555; }
.dn-label-pink   { color:#9d174d; }

.dn-icon-blue   { background:#4895ef; }
.dn-icon-red    { background:#e63946; }
.dn-icon-teal   { background:#2a9d8f; }
.dn-icon-green  { background:#52b788; }
.dn-icon-yellow { background:#f4a261; }
.dn-icon-orange { background:#e76f51; }
.dn-icon-purple { background:#7b2d8b; }
.dn-icon-gray   { background:#888; }
.dn-icon-pink   { background:#e07ab1; }

/* Tag/stat color variants */
.dn-tag.blue   { background:#dbeafe; color:#1e40af; border-color:#93c5fd; }
.dn-tag.red    { background:#fee2e2; color:#991b1b; border-color:#fca5a5; }
.dn-tag.green  { background:#dcfce7; color:#166534; border-color:#86efac; }
.dn-tag.teal   { background:#ccfbf1; color:#134e4a; border-color:#5eead4; }
.dn-tag.yellow { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.dn-tag.purple { background:#f3e8ff; color:#6b21a8; border-color:#d8b4fe; }
.dn-tag.orange { background:#ffedd5; color:#9a3412; border-color:#fdba74; }
.dn-tag.pink   { background:#fce7f3; color:#9d174d; border-color:#f9a8d4; }
.dn-tag.gray   { background:#f3f4f6; color:#374151; border-color:#d1d5db; }

.dn-pill.blue   { background:#dbeafe; border-color:#4895ef; color:#1e40af; }
.dn-pill.red    { background:#fee2e2; border-color:#e63946; color:#991b1b; }
.dn-pill.green  { background:#dcfce7; border-color:#52b788; color:#166534; }
.dn-pill.teal   { background:#ccfbf1; border-color:#2a9d8f; color:#134e4a; }
.dn-pill.yellow { background:#fef3c7; border-color:#f4a261; color:#92400e; }
.dn-pill.purple { background:#f3e8ff; border-color:#7b2d8b; color:#6b21a8; }
.dn-pill.orange { background:#ffedd5; border-color:#e76f51; color:#9a3412; }
.dn-pill.pink   { background:#fce7f3; border-color:#e07ab1; color:#9d174d; }
.dn-pill.gray   { background:#f3f4f6; border-color:#888; color:#374151; }

/* Sticky color variants */
.dn-sticky.yellow { background:linear-gradient(135deg,#fffde7,#fff9c4); border-color:#f9a825; color:#4e3800; }
.dn-sticky.blue   { background:linear-gradient(135deg,#e3f2fd,#bbdefb); border-color:#1e88e5; color:#0d2a5e; }
.dn-sticky.green  { background:linear-gradient(135deg,#e8f5e9,#c8e6c9); border-color:#43a047; color:#1b4a20; }
.dn-sticky.pink   { background:linear-gradient(135deg,#fce4ec,#f8bbd0); border-color:#e91e8c; color:#4a0020; }
.dn-sticky.red    { background:linear-gradient(135deg,#fee2e2,#fecaca); border-color:#dc2626; color:#7f1d1d; }
.dn-sticky.teal   { background:linear-gradient(135deg,#ccfbf1,#99f6e4); border-color:#0f766e; color:#134e4a; }
.dn-sticky.orange { background:linear-gradient(135deg,#ffedd5,#fed7aa); border-color:#ea580c; color:#7c2d12; }
.dn-sticky.purple { background:linear-gradient(135deg,#f3e8ff,#e9d5ff); border-color:#7c3aed; color:#4c1d95; }
.dn-sticky.gray   { background:linear-gradient(135deg,#f3f4f6,#e5e7eb); border-color:#6b7280; color:#1f2937; }

/* Stat color variants */
.dn-stat.blue   { border-color:#4895ef; background:linear-gradient(160deg,#dbeafe,#eff6ff); }
.dn-stat.blue .n { color:#1d4ed8; }
.dn-stat.red    { border-color:#e63946; background:linear-gradient(160deg,#fee2e2,#fff5f5); }
.dn-stat.red .n  { color:#b91c1c; }
.dn-stat.green  { border-color:#52b788; background:linear-gradient(160deg,#dcfce7,#f0fdf4); }
.dn-stat.green .n { color:#15803d; }
.dn-stat.teal   { border-color:#2a9d8f; background:linear-gradient(160deg,#ccfbf1,#f0fdf4); }
.dn-stat.teal .n  { color:#0f766e; }
.dn-stat.yellow { border-color:#f4a261; background:linear-gradient(160deg,#fef3c7,#fffbeb); }
.dn-stat.yellow .n { color:#b45309; }

/* Tier colors */
.dn-tier.green  { border-color:#52b788; background:linear-gradient(160deg,#dcfce7,#bbf7d0); }
.dn-tier.green .tn { color:#15803d; } .dn-tier.green .tl { color:#14532d; }
.dn-tier.green .ta { color:#15803d; } .dn-tier.green .ts { background:#bbf7d0; color:#14532d; }
.dn-tier.yellow { border-color:#f4a261; background:linear-gradient(160deg,#fef9c3,#fde68a); }
.dn-tier.yellow .tn { color:#b45309; } .dn-tier.yellow .tl { color:#78350f; }
.dn-tier.yellow .ta { color:#b45309; } .dn-tier.yellow .ts { background:#fde68a; color:#78350f; }
.dn-tier.red    { border-color:#e63946; background:linear-gradient(160deg,#fee2e2,#fecaca); }
.dn-tier.red .tn { color:#b91c1c; } .dn-tier.red .tl { color:#7f1d1d; }
.dn-tier.red .ta { color:#b91c1c; } .dn-tier.red .ts { background:#fecaca; color:#7f1d1d; }

/* Th header colors */
.dn-th-blue   { background:linear-gradient(135deg,#4895ef,#2563eb); }
.dn-th-red    { background:linear-gradient(135deg,#e63946,#b91c1c); }
.dn-th-teal   { background:linear-gradient(135deg,#2a9d8f,#0f766e); }
.dn-th-green  { background:linear-gradient(135deg,#52b788,#15803d); }
.dn-th-yellow { background:linear-gradient(135deg,#f4a261,#b45309); }
.dn-th-orange { background:linear-gradient(135deg,#e76f51,#c2410c); }
.dn-th-purple { background:linear-gradient(135deg,#7b2d8b,#6b21a8); }
.dn-th-gray   { background:linear-gradient(135deg,#888,#555); }
.dn-th-pink   { background:linear-gradient(135deg,#e07ab1,#9d174d); }

.dn-footer {
  text-align: center;
  margin-top: 36px;
  font-family: 'Caveat', cursive;
  font-size: 16px;
  color: #aaa;
  border-top: 1.5px dashed #ddd;
  padding-top: 14px;
}

.readonly-feedback-thread {
  margin-top: 8px;
}

.note-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.note-table-scroll > table {
  width: max-content !important;
  min-width: 100%;
}

@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; height: auto; }
  .left-panel { height: auto; border-right: none; border-bottom: 1.5px solid var(--border); }
  .right-panel { height: 600px; }
  .main.mobile-composer-input .left-panel {
    display: flex;
    min-height: calc(100dvh - 57px - var(--floating-footer-h));
    border-bottom: none;
  }
  .main.mobile-composer-input .left-panel .panel-header {
    padding: 0;
  }
  .main.mobile-composer-input .left-panel .composer-mobile-topbar {
    display: flex;
  }
  .main.mobile-composer-input .left-panel .panel-desc {
    padding: 12px 12px 14px;
  }
  .main.mobile-composer-input .right-panel {
    display: none;
  }
  .main.mobile-composer-preview .left-panel {
    display: none;
  }
  .main.mobile-composer-preview .right-panel {
    display: flex;
    height: calc(100dvh - 57px - var(--floating-footer-h));
  }
  .main.mobile-composer-preview .composer-mobile-topbar {
    display: flex;
  }
  .composer-mobile-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .dn-twocol, .dn-tiers { grid-template-columns: 1fr; flex-direction: column; }
}

/* ── FULLSCREEN BUTTON ── */
.fullscreen-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: 4px;
  line-height: 1; position: relative;
}
.fullscreen-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── FULLSCREEN OVERLAY ── */
.fs-overlay {
  display: none;
  position: fixed; inset: 0;
  background: #f0eee8;
  z-index: 2000;
  flex-direction: column;
  animation: fsFadeIn 0.22s ease;
}
.fs-overlay.open { display: flex; }
@keyframes fsFadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.fs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #1a1a2e;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg,#e63946,#f4a261,#2a9d8f,#4895ef,#7b2d8b) 1;
  flex-shrink: 0;
  gap: 12px;
}

.fs-logo {
  font-family: 'Caveat', cursive;
  font-size: 22px; font-weight: 700;
  color: #fff;
}
.fs-logo span {
  background: linear-gradient(135deg,#f4a261,#e63946);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fs-toolbar-left { display: flex; align-items: center; gap: 12px; }
.fs-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.fs-style-pills {
  display: flex; gap: 5px;
  background: rgba(255,255,255,0.06);
  padding: 4px 8px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}

.fs-style-chip {
  padding: 4px 12px; border-radius: 14px;
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: rgba(255,255,255,0.55);
  background: transparent; border: none;
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.fs-style-chip:hover { color: #fff; background: rgba(255,255,255,0.1); }
.fs-style-chip.active { background: rgba(255,255,255,0.18); color: #fff; }

.fs-print-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25); background: transparent;
  color: rgba(255,255,255,0.7); font-family: 'DM Mono', monospace;
  font-size: 16px; cursor: pointer; transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fs-capture-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25); background: transparent;
  color: rgba(255,255,255,0.7); font-family: 'DM Mono', monospace;
  font-size: 16px; cursor: pointer; transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fs-capture-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.fs-split-btn,
.fs-skeleton-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fs-close-btn {
  padding: 6px 14px; border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: transparent; color: rgba(255,255,255,0.7);
  font-family: 'DM Mono', monospace; font-size: 12px;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.fs-close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.5); }

@media (max-width: 860px) {
  body.readonly-note-view .fs-overlay.open .fs-close-btn {
    padding: 6px 10px;
  }

  body.readonly-note-view .fs-overlay.open .fs-close-btn .fs-close-label {
    display: none;
  }
}

.fs-content {
  flex: 1; overflow-y: auto;
  padding: 40px 32px;
}

.split-note-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  position: relative;
}

.split-note-sidebar {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.split-note-nav-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
}

.split-note-nav-tab {
  flex: none;
  padding: 14px 16px;
  border: 2px solid #7b8fb4;
  border-radius: 24px 18px 22px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 33px,
      rgba(59, 130, 246, 0.09) 33px,
      rgba(59, 130, 246, 0.09) 35px
    ),
    #eef5ff;
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.1),
    5px 6px 0 rgba(123, 143, 180, 0.22);
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.split-note-nav-tab:nth-child(odd) {
  transform: rotate(-0.55deg);
}

.split-note-nav-tab:nth-child(even) {
  transform: rotate(0.45deg);
}

.split-note-nav-tab::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(59, 130, 246, 0.18);
  border-radius: 18px 14px 16px 12px;
  pointer-events: none;
}

.split-note-nav-tab:hover {
  transform: translateY(-2px) rotate(0deg);
  box-shadow:
    0 12px 28px rgba(20, 29, 49, 0.14),
    6px 7px 0 rgba(123, 143, 180, 0.22);
}

.split-note-nav-tab.active {
  border-color: #24406f;
  box-shadow:
    0 12px 28px rgba(20, 29, 49, 0.14),
    6px 7px 0 rgba(36, 64, 111, 0.18);
}

.split-note-nav-num {
  font-size: 24px;
  line-height: 1;
}

.split-note-nav-title {
  font-size: 17px;
  line-height: 1.05;
}

.split-note-pages {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.split-note-page-frame {
  position: relative;
}

.split-note-section {
  scroll-margin-top: 18px;
  display: none;
}

.split-note-section.active {
  display: block;
}

.split-note-mobile-toggle {
  display: none;
}

.split-note-mobile-backdrop,
.split-note-mobile-sheet {
  display: none;
}

/* Keyboard hint */
.fs-kbd-hint {
  position: fixed; bottom: 20px; right: 24px;
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: rgba(0,0,0,0.3); pointer-events: none;
  z-index: 2001;
  background: rgba(255,255,255,0.7);
  padding: 5px 10px; border-radius: 6px;
  backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
  .fs-style-pills { display: none; }
  .fs-content { padding: 20px 16px; }
  .fs-logo { font-size: 18px; }
}

@media (max-width: 768px) {
  .split-note-shell {
    display: block;
  }

  .split-note-sidebar {
    display: none;
  }

  .split-note-mobile-toggle {
    display: inline-flex;
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    border: 2px solid #24406f;
    border-radius: 14px 10px 13px 9px;
    background: #eef5ff;
    color: #24406f;
    box-shadow: 3px 3px 0 rgba(123, 143, 180, 0.2);
    font-family: 'DM Mono', monospace;
    font-size: 17px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 18;
  }

  .split-note-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    z-index: 20;
  }

  .split-note-mobile-sheet {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-height: 100dvh;
    padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
    background: #f8fbff;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.22);
    overflow-y: auto;
    z-index: 21;
  }

  .split-note-mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
  }

  .split-note-mobile-sheet-title {
    font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
    font-size: 28px;
    line-height: 1;
    color: #0f172a;
  }

  .split-note-mobile-close {
    width: 44px;
    height: 44px;
    border: 2px solid #24406f;
    border-radius: 14px 10px 13px 9px;
    background: #fff;
    color: #24406f;
    box-shadow: 3px 3px 0 rgba(123, 143, 180, 0.2);
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .split-note-mobile-sheet .split-note-nav-list {
    gap: 16px;
    padding-right: 0;
  }

  .split-note-mobile-sheet .split-note-nav-tab {
    width: 100%;
  }

  .split-note-shell.nav-open .split-note-mobile-backdrop,
  .split-note-shell.nav-open .split-note-mobile-sheet {
    display: block;
  }
}

@media print {
  .split-note-mobile-toggle {
    display: none !important;
  }
}

/* ═══════════════════════════════════════
   STYLE: KIDS
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800&display=swap');

.kids-page {
  max-width: 950px; margin: 0 auto;
  background: #fffef0;
  font-family: 'Baloo 2', cursive;
  padding: 36px 10px 56px;
  border-radius: 32px;
  border: 4px solid #1a1a1a;
  box-shadow: 6px 6px 0 #1a1a1a;
  position: relative;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255,220,100,0.25) 0%, transparent 40%),
    radial-gradient(circle at 92% 85%, rgba(160,220,255,0.25) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255,180,210,0.12) 0%, transparent 60%);
}
.kids-page::before {
  content: '\2B50 \1F308 \2B50';
  position: absolute; top: 14px; right: 20px;
  font-size: 18px; letter-spacing: 4px; opacity: 0.55;
  pointer-events: none;
}
.kids-title {
  font-size: 40px; font-weight: 800; text-align: center;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #c77dff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 4px;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.08));
}
.kids-title-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.kids-star { font-size: 20px; animation: kidsSpin 4s linear infinite; display: inline-block; }
.kids-star:nth-child(2) { animation-delay: -1.3s; }
.kids-star:nth-child(3) { animation-delay: -2.6s; }
@keyframes kidsSpin { 0%,100%{transform:rotate(-15deg) scale(1)} 50%{transform:rotate(15deg) scale(1.15)} }
.kids-divider { display: flex; align-items: center; gap: 8px; margin: 22px 0; }
.kids-divider::before,.kids-divider::after { content:''; flex:1; height:3px; border-radius:3px;
  background: repeating-linear-gradient(90deg,#ff6b6b 0,#ff6b6b 12px,#ffd93d 12px,#ffd93d 24px,#6bcb77 24px,#6bcb77 36px,#4d96ff 36px,#4d96ff 48px,#c77dff 48px,#c77dff 60px); }
.kids-divider span { font-size: 20px; flex-shrink: 0; }
.kids-section-hdr { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; }
.kids-section-num { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #1a1a1a; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0; box-shadow: 3px 3px 0 #1a1a1a; }
.kids-section-title { font-size: 22px; font-weight: 800; color: #1a1a1a; border-bottom: 3px dashed; padding-bottom: 4px; flex: 1; }
.kids-box { border: 3px solid #1a1a1a; border-radius: 20px; padding: 16px 20px; margin: 10px 0; position: relative; box-shadow: 4px 4px 0 #1a1a1a; }
.kids-box-label { position: absolute; top: -14px; left: 16px; padding: 2px 14px; font-size: 14px; font-weight: 800; border: 2.5px solid #1a1a1a; border-radius: 20px; box-shadow: 2px 2px 0 #1a1a1a; }
.kids-text { font-size: 17px; color: #1a1a1a; line-height: 1.7; margin: 4px 0; }
.kids-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.kids-bullets { list-style: none; padding: 0; margin: 6px 0; }
.kids-bullets li { padding: 4px 0 4px 30px; font-size: 17px; color: #1a1a1a; line-height: 1.5; position: relative; }
.kids-bullets li::before { position: absolute; left: 2px; font-size: 16px; }
.kids-bullets.arrow li::before { content: '\1F449'; }
.kids-bullets.check li::before { content: '\2705'; }
.kids-bullets.warn  li::before { content: '\26A0\FE0F'; }
.kids-bullets.star  li::before { content: '\2B50'; }
.kids-bullets.dot   li::before { content: '\1F535'; font-size: 12px; top: 6px; }
.kids-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.kids-stat { flex: 1; min-width: 100px; border: 3px solid #1a1a1a; border-radius: 20px; padding: 14px 10px; text-align: center; box-shadow: 4px 4px 0 #1a1a1a; }
.kids-stat .n { font-size: 32px; font-weight: 800; display: block; }
.kids-stat .l { font-size: 13px; color: #444; line-height: 1.3; margin-top: 4px; font-weight: 600; }
.kids-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 10px 0; font-size: 15px; overflow: hidden; border-radius: 16px; border: 3px solid #1a1a1a; box-shadow: 4px 4px 0 #1a1a1a; }
.kids-table th { padding: 10px 14px; font-size: 15px; font-weight: 800; color: #fff; border: 1.5px solid rgba(255,255,255,0.3); }
.kids-table td { padding: 9px 14px; border: 1.5px solid rgba(0,0,0,0.07); color: #1a1a1a; vertical-align: middle; font-weight: 600; }
.kids-table tr:nth-child(even) td { background: rgba(0,0,0,0.025); }
.kids-sticky { border: 3px solid #1a1a1a; border-radius: 20px; padding: 14px 20px 14px 52px; margin: 12px 0; font-size: 17px; font-weight: 700; position: relative; box-shadow: 4px 4px 0 #1a1a1a; }
.kids-sticky::before { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 24px; }
.kids-sticky.yellow { background: #fff9c4; border-color: #f9a825; box-shadow: 4px 4px 0 #f9a825; } .kids-sticky.yellow::before { content: '\1F4A1'; }
.kids-sticky.blue   { background: #e3f2fd; border-color: #1e88e5; box-shadow: 4px 4px 0 #1e88e5; } .kids-sticky.blue::before   { content: '\1F499'; }
.kids-sticky.green  { background: #e8f5e9; border-color: #43a047; box-shadow: 4px 4px 0 #43a047; } .kids-sticky.green::before  { content: '\1F31F'; }
.kids-sticky.pink   { background: #fce4ec; border-color: #e91e63; box-shadow: 4px 4px 0 #e91e63; } .kids-sticky.pink::before   { content: '\1F389'; }
.kids-sticky.red    { background: #fee2e2; border-color: #dc2626; box-shadow: 4px 4px 0 #dc2626; } .kids-sticky.red::before    { content: '\2764'; }
.kids-sticky.teal   { background: #ccfbf1; border-color: #0f766e; box-shadow: 4px 4px 0 #0f766e; } .kids-sticky.teal::before   { content: '\1F30A'; }
.kids-sticky.orange { background: #ffedd5; border-color: #ea580c; box-shadow: 4px 4px 0 #ea580c; } .kids-sticky.orange::before { content: '\1F525'; }
.kids-sticky.purple { background: #f3e8ff; border-color: #7c3aed; box-shadow: 4px 4px 0 #7c3aed; } .kids-sticky.purple::before { content: '\1F48E'; }
.kids-sticky.gray   { background: #f3f4f6; border-color: #6b7280; box-shadow: 4px 4px 0 #6b7280; } .kids-sticky.gray::before   { content: '\1F9E0'; }
.kids-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.kids-pill { padding: 6px 16px; border: 2.5px solid #1a1a1a; border-radius: 20px; font-size: 15px; font-weight: 800; box-shadow: 3px 3px 0 #1a1a1a; }
.kids-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.kids-tag { padding: 3px 12px; border: 2px solid #1a1a1a; border-radius: 12px; font-size: 13px; font-weight: 800; box-shadow: 2px 2px 0 #1a1a1a; }
.kids-tiers { display: flex; gap: 10px; margin: 10px 0; }
.kids-tier { flex: 1; padding: 16px 8px; text-align: center; border: 3px solid #1a1a1a; border-radius: 20px; box-shadow: 4px 4px 0 #1a1a1a; }
.kids-tier .tn { font-size: 28px; font-weight: 800; display: block; }
.kids-tier .tl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin: 2px 0; }
.kids-tier .ta { font-size: 15px; font-weight: 800; display: block; margin: 4px 0 2px; }
.kids-tier .ts { font-size: 12px; font-weight: 600; opacity: 0.7; }
.kids-footer { text-align: center; margin-top: 32px; font-size: 22px; letter-spacing: 6px; opacity: 0.5; border-top: 3px dashed rgba(0,0,0,0.12); padding-top: 14px; }
.kids-c-blue  {border-color:#4d96ff;background:rgba(77,150,255,0.1)}   .kids-c-blue  .kids-box-label{background:#4d96ff;color:#fff;border-color:#1a6ed8}
.kids-c-red   {border-color:#ff6b6b;background:rgba(255,107,107,0.1)}  .kids-c-red   .kids-box-label{background:#ff6b6b;color:#fff;border-color:#cc3333}
.kids-c-teal  {border-color:#06d6a0;background:rgba(6,214,160,0.1)}    .kids-c-teal  .kids-box-label{background:#06d6a0;color:#fff;border-color:#029e76}
.kids-c-green {border-color:#6bcb77;background:rgba(107,203,119,0.1)}  .kids-c-green .kids-box-label{background:#6bcb77;color:#fff;border-color:#3a9944}
.kids-c-yellow{border-color:#ffd93d;background:rgba(255,217,61,0.12)}  .kids-c-yellow .kids-box-label{background:#ffd93d;color:#1a1a1a;border-color:#c8a800}
.kids-c-orange{border-color:#ff9f1c;background:rgba(255,159,28,0.1)}   .kids-c-orange .kids-box-label{background:#ff9f1c;color:#fff;border-color:#c07300}
.kids-c-purple{border-color:#c77dff;background:rgba(199,125,255,0.1)}  .kids-c-purple .kids-box-label{background:#c77dff;color:#fff;border-color:#8e44cc}
.kids-c-gray  {border-color:#adb5bd;background:rgba(173,181,189,0.1)}  .kids-c-gray  .kids-box-label{background:#adb5bd;color:#fff;border-color:#6c757d}
.kids-c-pink  {border-color:#ff79c6;background:rgba(255,121,198,0.1)}  .kids-c-pink  .kids-box-label{background:#ff79c6;color:#fff;border-color:#cc3399}
.kids-num-blue{background:#4d96ff}  .kids-num-red{background:#ff6b6b}  .kids-num-teal{background:#06d6a0}
.kids-num-green{background:#6bcb77} .kids-num-yellow{background:#ffd93d;color:#1a1a1a!important}
.kids-num-orange{background:#ff9f1c} .kids-num-purple{background:#c77dff} .kids-num-gray{background:#adb5bd} .kids-num-pink{background:#ff79c6}
.kids-tb-blue{border-color:#4d96ff}  .kids-tb-red{border-color:#ff6b6b}   .kids-tb-teal{border-color:#06d6a0}
.kids-tb-green{border-color:#6bcb77} .kids-tb-yellow{border-color:#ffd93d} .kids-tb-orange{border-color:#ff9f1c}
.kids-tb-purple{border-color:#c77dff} .kids-tb-gray{border-color:#adb5bd}  .kids-tb-pink{border-color:#ff79c6}
.kids-sn-blue{background:rgba(77,150,255,0.1);border-color:#4d96ff}    .kids-sn-blue .n{color:#1a6ed8}
.kids-sn-red{background:rgba(255,107,107,0.1);border-color:#ff6b6b}    .kids-sn-red .n{color:#cc3333}
.kids-sn-teal{background:rgba(6,214,160,0.1);border-color:#06d6a0}     .kids-sn-teal .n{color:#029e76}
.kids-sn-green{background:rgba(107,203,119,0.1);border-color:#6bcb77}  .kids-sn-green .n{color:#3a9944}
.kids-sn-yellow{background:rgba(255,217,61,0.12);border-color:#ffd93d} .kids-sn-yellow .n{color:#c8a800}
.kids-sn-orange{background:rgba(255,159,28,0.1);border-color:#ff9f1c}  .kids-sn-orange .n{color:#c07300}
.kids-sn-purple{background:rgba(199,125,255,0.1);border-color:#c77dff} .kids-sn-purple .n{color:#8e44cc}
.kids-sn-gray{background:rgba(173,181,189,0.1);border-color:#adb5bd}   .kids-sn-gray .n{color:#6c757d}
.kids-sn-pink{background:rgba(255,121,198,0.1);border-color:#ff79c6}   .kids-sn-pink .n{color:#cc3399}
.kids-th-blue{background:#4d96ff}   .kids-th-red{background:#ff6b6b}   .kids-th-teal{background:#06d6a0}
.kids-th-green{background:#6bcb77}  .kids-th-yellow{background:#ffd93d;color:#1a1a1a!important}
.kids-th-orange{background:#ff9f1c} .kids-th-purple{background:#c77dff} .kids-th-gray{background:#adb5bd} .kids-th-pink{background:#ff79c6}
.kids-pill-blue{background:rgba(77,150,255,0.12);border-color:#4d96ff;color:#1a6ed8}
.kids-pill-red{background:rgba(255,107,107,0.12);border-color:#ff6b6b;color:#cc3333}
.kids-pill-teal{background:rgba(6,214,160,0.12);border-color:#06d6a0;color:#029e76}
.kids-pill-green{background:rgba(107,203,119,0.12);border-color:#6bcb77;color:#3a9944}
.kids-pill-yellow{background:rgba(255,217,61,0.15);border-color:#ffd93d;color:#b8960a}
.kids-pill-orange{background:rgba(255,159,28,0.12);border-color:#ff9f1c;color:#c07300}
.kids-pill-purple{background:rgba(199,125,255,0.12);border-color:#c77dff;color:#8e44cc}
.kids-pill-gray{background:rgba(173,181,189,0.12);border-color:#adb5bd;color:#495057}
.kids-pill-pink{background:rgba(255,121,198,0.12);border-color:#ff79c6;color:#cc3399}
.kids-tag-blue{background:rgba(77,150,255,0.12);color:#1a6ed8}   .kids-tag-red{background:rgba(255,107,107,0.12);color:#cc3333}
.kids-tag-teal{background:rgba(6,214,160,0.12);color:#029e76}    .kids-tag-green{background:rgba(107,203,119,0.12);color:#3a9944}
.kids-tag-yellow{background:rgba(255,217,61,0.15);color:#b8960a} .kids-tag-orange{background:rgba(255,159,28,0.12);color:#c07300}
.kids-tag-purple{background:rgba(199,125,255,0.12);color:#8e44cc} .kids-tag-gray{background:rgba(173,181,189,0.12);color:#495057}
.kids-tag-pink{background:rgba(255,121,198,0.12);color:#cc3399}
.kids-tier-green{background:rgba(107,203,119,0.12);border-color:#6bcb77} .kids-tier-green .tn,.kids-tier-green .ta{color:#3a9944}
.kids-tier-yellow{background:rgba(255,217,61,0.15);border-color:#ffd93d} .kids-tier-yellow .tn,.kids-tier-yellow .ta{color:#b8960a}
.kids-tier-red{background:rgba(255,107,107,0.12);border-color:#ff6b6b}   .kids-tier-red .tn,.kids-tier-red .ta{color:#cc3333}
@media (max-width:600px){
  .kids-twocol,.kids-tiers{grid-template-columns:1fr;flex-direction:column}
  .kids-title{font-size:28px}
}

.style-picker {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: #f8f9fc;
  border-bottom: 1.5px solid #e6eaf2;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.style-picker::-webkit-scrollbar { display: none; }

.style-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fafaf8;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.style-chip:hover { border-color: var(--accent); color: var(--accent); }
.style-chip.active { background: #1a1a2e; border-color: #1a1a2e; color: #fff; }

/* ═══════════════════════════════════════
   STYLE: CLEAN / MINIMAL
═══════════════════════════════════════ */
.cl-page {
  max-width: 950px;
  margin: 0 auto;
  background: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  padding: 40px 10px 56px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
.cl-title { font-size: 32px; font-weight: 700; color: #111; margin-bottom: 4px; }
.cl-title-sub { font-size: 14px; color: #9ca3af; margin-bottom: 28px; font-weight: 400; }
.cl-divider { height: 1px; background: #f3f4f6; margin: 28px 0; }
.cl-section-hdr { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; }
.cl-section-num { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cl-section-title { font-size: 18px; font-weight: 600; }
.cl-box { border-left: 4px solid; border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 8px 0; background: #fafafa; }
.cl-box-label { font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 6px; }
.cl-text { font-size: 14px; color: #374151; line-height: 1.7; margin: 4px 0; }
.cl-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.cl-bullets { list-style: none; padding: 0; margin: 6px 0; }
.cl-bullets li { padding: 3px 0 3px 20px; font-size: 14px; color: #374151; line-height: 1.5; position: relative; }
.cl-bullets li::before { position: absolute; left: 2px; font-size: 13px; }
.cl-bullets.arrow li::before { content: '→'; color: #6b7280; }
.cl-bullets.check li::before { content: '✓'; color: #16a34a; }
.cl-bullets.warn  li::before { content: '!'; color: #dc2626; font-weight: 700; }
.cl-bullets.star  li::before { content: '★'; color: #d97706; font-size: 11px; top: 5px; }
.cl-bullets.dot   li::before { content: '●'; color: #7c3aed; font-size: 9px; top: 7px; }
.cl-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cl-stat { flex: 1; min-width: 100px; padding: 12px; border-radius: 8px; border: 1px solid #e5e7eb; text-align: center; background: #f9fafb; }
.cl-stat .n { font-size: 24px; font-weight: 700; display: block; }
.cl-stat .l { font-size: 12px; color: #6b7280; line-height: 1.3; margin-top: 2px; }
.cl-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.cl-table th { padding: 8px 12px; font-weight: 600; font-size: 12px; text-align: left; border-bottom: 2px solid; }
.cl-table td { padding: 8px 12px; border-bottom: 1px solid #f3f4f6; color: #374151; vertical-align: middle; }
.cl-table tr:last-child td { border-bottom: none; }
.cl-sticky { border-radius: 8px; padding: 12px 16px; margin: 8px 0; font-size: 14px; font-weight: 500; border-left: 4px solid; }
.cl-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cl-pill { padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid; }
.cl-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.cl-tag { padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.cl-tiers { display: flex; gap: 8px; margin: 8px 0; }
.cl-tier { flex: 1; padding: 14px 10px; border-radius: 8px; text-align: center; border: 1px solid; }
.cl-tier .tn { font-size: 24px; font-weight: 700; display: block; }
.cl-tier .tl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.cl-tier .ta { font-size: 13px; font-weight: 600; display: block; margin: 4px 0 2px; }
.cl-tier .ts { font-size: 11px; }
.cl-footer { text-align: center; margin-top: 28px; font-size: 12px; color: #d1d5db; border-top: 1px solid #f3f4f6; padding-top: 14px; }

/* Clean color map */
.cl-c-blue   { border-color: #2563eb; } .cl-c-blue   .cl-box-label { color: #2563eb; } .cl-c-blue   .n { color: #2563eb; }
.cl-c-red    { border-color: #dc2626; } .cl-c-red    .cl-box-label { color: #dc2626; } .cl-c-red    .n { color: #dc2626; }
.cl-c-teal   { border-color: #0d9488; } .cl-c-teal   .cl-box-label { color: #0d9488; } .cl-c-teal   .n { color: #0d9488; }
.cl-c-green  { border-color: #16a34a; } .cl-c-green  .cl-box-label { color: #16a34a; } .cl-c-green  .n { color: #16a34a; }
.cl-c-yellow { border-color: #d97706; } .cl-c-yellow .cl-box-label { color: #d97706; } .cl-c-yellow .n { color: #d97706; }
.cl-c-orange { border-color: #ea580c; } .cl-c-orange .cl-box-label { color: #ea580c; } .cl-c-orange .n { color: #ea580c; }
.cl-c-purple { border-color: #7c3aed; } .cl-c-purple .cl-box-label { color: #7c3aed; } .cl-c-purple .n { color: #7c3aed; }
.cl-c-gray   { border-color: #6b7280; } .cl-c-gray   .cl-box-label { color: #6b7280; } .cl-c-gray   .n { color: #6b7280; }
.cl-c-pink   { border-color: #db2777; } .cl-c-pink   .cl-box-label { color: #db2777; } .cl-c-pink   .n { color: #db2777; }

.cl-num-blue   { background: #eff6ff; color: #1d4ed8; }
.cl-num-red    { background: #fef2f2; color: #b91c1c; }
.cl-num-teal   { background: #f0fdfa; color: #0f766e; }
.cl-num-green  { background: #f0fdf4; color: #15803d; }
.cl-num-yellow { background: #fffbeb; color: #b45309; }
.cl-num-orange { background: #fff7ed; color: #c2410c; }
.cl-num-purple { background: #faf5ff; color: #6b21a8; }
.cl-num-gray   { background: #f9fafb; color: #374151; }
.cl-num-pink   { background: #fdf2f8; color: #9d174d; }
.cl-sticky-yellow { background: #fffbeb; border-color: #d97706; color: #78350f; }
.cl-sticky-blue   { background: #eff6ff; border-color: #2563eb; color: #1e3a8a; }
.cl-sticky-green  { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.cl-sticky-pink   { background: #fdf2f8; border-color: #db2777; color: #831843; }
.cl-sticky-red    { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
.cl-sticky-teal   { background: #f0fdfa; border-color: #0d9488; color: #134e4a; }
.cl-sticky-orange { background: #fff7ed; border-color: #ea580c; color: #7c2d12; }
.cl-sticky-purple { background: #faf5ff; border-color: #7c3aed; color: #4c1d95; }
.cl-sticky-gray   { background: #f9fafb; border-color: #6b7280; color: #1f2937; }
.cl-tier-green  { background: #f0fdf4; border-color: #86efac; } .cl-tier-green  .tn,.cl-tier-green  .ta { color: #15803d; } .cl-tier-green  .tl,.cl-tier-green  .ts { color: #166534; }
.cl-tier-yellow { background: #fffbeb; border-color: #fde68a; } .cl-tier-yellow .tn,.cl-tier-yellow .ta { color: #b45309; } .cl-tier-yellow .tl,.cl-tier-yellow .ts { color: #92400e; }
.cl-tier-red    { background: #fef2f2; border-color: #fca5a5; } .cl-tier-red    .tn,.cl-tier-red    .ta { color: #b91c1c; } .cl-tier-red    .tl,.cl-tier-red    .ts { color: #991b1b; }
.cl-pill-blue   { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.cl-pill-red    { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cl-pill-teal   { background: #f0fdfa; border-color: #99f6e4; color: #0f766e; }
.cl-pill-green  { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.cl-pill-yellow { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.cl-pill-orange { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.cl-pill-purple { background: #faf5ff; border-color: #e9d5ff; color: #6b21a8; }
.cl-pill-gray   { background: #f9fafb; border-color: #e5e7eb; color: #374151; }
.cl-pill-pink   { background: #fdf2f8; border-color: #fbcfe8; color: #9d174d; }
.cl-tag-blue   { background: #dbeafe; color: #1e40af; }
.cl-tag-red    { background: #fee2e2; color: #991b1b; }
.cl-tag-teal   { background: #ccfbf1; color: #134e4a; }
.cl-tag-green  { background: #dcfce7; color: #166534; }
.cl-tag-yellow { background: #fef3c7; color: #92400e; }
.cl-tag-orange { background: #ffedd5; color: #9a3412; }
.cl-tag-purple { background: #f3e8ff; color: #6b21a8; }
.cl-tag-gray   { background: #f3f4f6; color: #374151; }
.cl-tag-pink   { background: #fce7f3; color: #9d174d; }
.cl-th-blue   { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.cl-th-red    { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.cl-th-teal   { border-color: #0d9488; color: #0d9488; background: #f0fdfa; }
.cl-th-green  { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }
.cl-th-yellow { border-color: #d97706; color: #d97706; background: #fffbeb; }
.cl-th-orange { border-color: #ea580c; color: #ea580c; background: #fff7ed; }
.cl-th-purple { border-color: #7c3aed; color: #7c3aed; background: #faf5ff; }
.cl-th-gray   { border-color: #6b7280; color: #6b7280; background: #f9fafb; }
.cl-th-pink   { border-color: #db2777; color: #db2777; background: #fdf2f8; }
.cl-sn-blue   { background: #dbeafe; color: #1e40af; } .cl-st-blue   { color: #1d4ed8; }
.cl-sn-red    { background: #fee2e2; color: #991b1b; } .cl-st-red    { color: #b91c1c; }
.cl-sn-teal   { background: #ccfbf1; color: #134e4a; } .cl-st-teal   { color: #0f766e; }
.cl-sn-green  { background: #dcfce7; color: #166534; } .cl-st-green  { color: #15803d; }
.cl-sn-yellow { background: #fef3c7; color: #92400e; } .cl-st-yellow { color: #b45309; }
.cl-sn-orange { background: #ffedd5; color: #9a3412; } .cl-st-orange { color: #c2410c; }
.cl-sn-purple { background: #f3e8ff; color: #6b21a8; } .cl-st-purple { color: #7c3aed; }
.cl-sn-gray   { background: #f3f4f6; color: #374151; } .cl-st-gray   { color: #6b7280; }
.cl-sn-pink   { background: #fce7f3; color: #9d174d; } .cl-st-pink   { color: #db2777; }

/* ═══════════════════════════════════════
   STYLE: CHALKBOARD
═══════════════════════════════════════ */
.chalk-page {
  max-width:950px;
  margin: 0 auto;
  background: #1a2744;
  font-family: 'Caveat', cursive;
  padding: 44px 10px 56px;
  border-radius: 8px;
  border: 6px solid #2a3d5c;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
}
.chalk-page::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: repeating-linear-gradient(transparent,transparent 35px,rgba(255,255,255,0.03) 35px,rgba(255,255,255,0.03) 36px);
  pointer-events: none;
}
.chalk-title { font-size: 38px; font-weight: 700; color: #f5f0e8; text-align: center; margin-bottom: 4px; text-shadow: 2px 2px 0 rgba(0,0,0,0.3); }
.chalk-title-bar { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.chalk-title-bar span { height: 3px; border-radius: 2px; display: block; opacity: 0.7; }
.chalk-divider { border: none; border-top: 2px dashed rgba(255,255,255,0.15); margin: 24px 0; }
.chalk-section-hdr { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.chalk-section-num { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.chalk-section-title { font-size: 26px; font-weight: 700; }
.chalk-box { border: 2px dashed; border-radius: 10px 4px 12px 6px; padding: 14px 16px; margin: 8px 0; position: relative; }
.chalk-box-label { position: absolute; top: -12px; left: 14px; padding: 0 8px; font-size: 15px; font-weight: 700; background: #1a2744; }
.chalk-text { font-size: 18px; color: #e8e0d0; line-height: 1.6; margin: 4px 0; }
.chalk-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.chalk-bullets { list-style: none; padding: 0; margin: 6px 0; }
.chalk-bullets li { padding: 3px 0 3px 24px; font-size: 17px; color: #d4cfc8; line-height: 1.5; position: relative; }
.chalk-bullets li::before { position: absolute; left: 4px; font-size: 14px; }
.chalk-bullets.arrow li::before { content: '→'; color: #7ec8fd; }
.chalk-bullets.check li::before { content: '✓'; color: #86efac; }
.chalk-bullets.warn  li::before { content: '!'; color: #fca5a5; font-weight: 700; }
.chalk-bullets.star  li::before { content: '★'; color: #fde68a; font-size: 12px; top: 6px; }
.chalk-bullets.dot   li::before { content: '●'; color: #d8b4fe; font-size: 9px; top: 7px; }
.chalk-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chalk-stat { flex: 1; min-width: 100px; border: 2px dashed rgba(255,255,255,0.25); border-radius: 10px; padding: 12px; text-align: center; }
.chalk-stat .n { font-size: 28px; font-weight: 700; display: block; color: #fde68a; }
.chalk-stat .l { font-size: 13px; color: #9ca3af; line-height: 1.3; margin-top: 2px; }
.chalk-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 16px; }
.chalk-table th { padding: 8px 12px; font-size: 16px; font-weight: 700; text-align: left; border-bottom: 2px solid rgba(255,255,255,0.3); color: #fde68a; }
.chalk-table td { padding: 8px 12px; border-bottom: 1px dashed rgba(255,255,255,0.1); color: #d4cfc8; vertical-align: middle; }
.chalk-sticky { border-radius: 6px 14px 12px 8px; padding: 12px 16px; margin: 10px 0; font-size: 18px; border-left: 4px solid; }
.chalk-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chalk-pill { padding: 6px 14px; border-radius: 20px; font-size: 17px; font-weight: 700; border: 2px solid; }
.chalk-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.chalk-tag { padding: 3px 10px; border-radius: 14px; font-size: 15px; font-weight: 700; border: 1.5px solid; }
.chalk-tiers { display: flex; gap: 8px; margin: 8px 0; }
.chalk-tier { flex: 1; padding: 12px 8px; border-radius: 10px; text-align: center; border: 2px dashed; }
.chalk-tier .tn { font-size: 26px; font-weight: 700; display: block; }
.chalk-tier .tl { font-size: 14px; font-weight: 700; }
.chalk-tier .ta { font-size: 17px; display: block; margin: 3px 0; }
.chalk-tier .ts { font-size: 13px; opacity: 0.8; }
.chalk-footer { text-align: center; margin-top: 28px; font-size: 16px; color: rgba(255,255,255,0.25); border-top: 1px dashed rgba(255,255,255,0.1); padding-top: 12px; }

.chalk-c-blue   { border-color: #7ec8fd; } .chalk-c-blue   .chalk-box-label { color: #7ec8fd; }
.chalk-c-red    { border-color: #fca5a5; } .chalk-c-red    .chalk-box-label { color: #fca5a5; }
.chalk-c-teal   { border-color: #5eead4; } .chalk-c-teal   .chalk-box-label { color: #5eead4; }
.chalk-c-green  { border-color: #86efac; } .chalk-c-green  .chalk-box-label { color: #86efac; }
.chalk-c-yellow { border-color: #fde68a; } .chalk-c-yellow .chalk-box-label { color: #fde68a; }
.chalk-c-orange { border-color: #fdba74; } .chalk-c-orange .chalk-box-label { color: #fdba74; }
.chalk-c-purple { border-color: #d8b4fe; } .chalk-c-purple .chalk-box-label { color: #d8b4fe; }
.chalk-c-gray   { border-color: rgba(255,255,255,0.3); } .chalk-c-gray .chalk-box-label { color: #9ca3af; }
.chalk-c-pink   { border-color: #f9a8d4; } .chalk-c-pink   .chalk-box-label { color: #f9a8d4; }
.chalk-sn-blue{background:rgba(126,200,253,0.12);border-color:#7ec8fd;color:#7ec8fd}
.chalk-sn-red{background:rgba(252,165,165,0.12);border-color:#fca5a5;color:#fca5a5}
.chalk-sn-green{background:rgba(134,239,172,0.12);border-color:#86efac;color:#86efac}
.chalk-sn-yellow{background:rgba(253,230,138,0.15);border-color:#fde68a;color:#fde68a}
.chalk-sn-teal{background:rgba(94,234,212,0.12);border-color:#5eead4;color:#5eead4}
.chalk-sn-orange{background:rgba(253,186,116,0.12);border-color:#fdba74;color:#fdba74}
.chalk-sn-purple{background:rgba(216,180,254,0.12);border-color:#d8b4fe;color:#d8b4fe}
.chalk-sn-gray{background:rgba(156,163,175,0.12);border-color:#9ca3af;color:#9ca3af}
.chalk-sn-pink{background:rgba(249,168,212,0.12);border-color:#f9a8d4;color:#f9a8d4}
.chalk-tier-green{border-color:#86efac}.chalk-tier-green .tn,.chalk-tier-green .ta{color:#86efac}
.chalk-tier-yellow{border-color:#fde68a}.chalk-tier-yellow .tn,.chalk-tier-yellow .ta{color:#fde68a}
.chalk-tier-red{border-color:#fca5a5}.chalk-tier-red .tn,.chalk-tier-red .ta{color:#fca5a5}

/* ═══════════════════════════════════════
   STYLE: TERMINAL
═══════════════════════════════════════ */
.term-page {
  max-width: 950px;
  margin: 0 auto;
  background: #0d1117;
  font-family: 'DM Mono', 'Courier New', monospace;
  padding: 36px 10px 48px;
  border-radius: 8px;
  border: 1px solid #30363d;
  box-shadow: 0 0 0 1px #21262d, 0 4px 20px rgba(0,0,0,0.5);
}
.term-titlebar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-title { font-size: 22px; font-weight: 500; color: #58a6ff; letter-spacing: 0.3px; margin-left: 6px; }
.term-prompt { color: #3fb950; font-size: 13px; margin-bottom: 20px; }
.term-divider { border: none; border-top: 1px solid #21262d; margin: 20px 0; }
.term-section-hdr { margin: 20px 0 10px; }
.term-section-num-line { color: #3fb950; font-size: 13px; margin-bottom: 2px; }
.term-section-title { font-size: 16px; font-weight: 500; color: #f0f6fc; border-bottom: 1px solid #21262d; padding-bottom: 6px; margin-bottom: 10px; }
.term-box { border: 1px solid #30363d; border-radius: 4px; padding: 12px 16px; margin: 8px 0; background: #161b22; }
.term-box-label { font-size: 11px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed #30363d; }
.term-text { font-size: 13px; color: #8b949e; line-height: 1.7; margin: 4px 0; }
.term-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.term-bullets { list-style: none; padding: 0; margin: 6px 0; }
.term-bullets li { padding: 2px 0 2px 20px; font-size: 13px; color: #8b949e; line-height: 1.6; position: relative; }
.term-bullets li::before { position: absolute; left: 2px; font-size: 12px; }
.term-bullets.arrow li::before { content: '→'; color: #58a6ff; }
.term-bullets.check li::before { content: '+'; color: #3fb950; font-weight: 700; }
.term-bullets.warn  li::before { content: '!'; color: #f85149; font-weight: 700; }
.term-bullets.star  li::before { content: '*'; color: #e3b341; }
.term-bullets.dot   li::before { content: '·'; color: #bc8cff; font-size: 16px; top: -1px; }
.term-stats { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.term-stat { flex: 1; min-width: 90px; border: 1px solid #30363d; border-radius: 4px; padding: 10px; text-align: center; background: #161b22; }
.term-stat .n { font-size: 22px; font-weight: 500; display: block; color: #58a6ff; }
.term-stat .l { font-size: 11px; color: #8b949e; line-height: 1.3; margin-top: 2px; }
.term-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.term-table th { padding: 6px 10px; font-size: 11px; text-align: left; border: 1px solid #30363d; background: #161b22; color: #58a6ff; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
.term-table td { padding: 6px 10px; border: 1px solid #21262d; color: #8b949e; vertical-align: middle; }
.term-table tr:hover td { background: #161b22; }
.term-sticky { border: 1px solid; border-radius: 4px; padding: 10px 14px; margin: 8px 0; font-size: 13px; background: #161b22; }
.term-sticky::before { content: '# NOTE: '; font-weight: 700; }
.term-pills { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.term-pill { padding: 3px 10px; border-radius: 2px; font-size: 12px; font-weight: 500; border: 1px solid; }
.term-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.term-tag { padding: 1px 8px; border-radius: 2px; font-size: 11px; font-weight: 500; }
.term-tiers { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 8px 0; }
.term-tier { padding: 12px; border: 1px solid; border-radius: 4px; background: #161b22; }
.term-tier .tn { font-size: 20px; font-weight: 500; display: block; }
.term-tier .tl { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; margin: 2px 0; }
.term-tier .ta { font-size: 13px; display: block; margin: 4px 0 2px; }
.term-tier .ts { font-size: 11px; opacity: 0.7; }
.term-footer { text-align: right; margin-top: 24px; font-size: 11px; color: #30363d; border-top: 1px solid #21262d; padding-top: 10px; }

.term-c-blue   { border-color: #1f6feb; } .term-c-blue   .term-box-label { color: #58a6ff; }
.term-c-red    { border-color: #da3633; } .term-c-red    .term-box-label { color: #f85149; }
.term-c-teal   { border-color: #388bfd; } .term-c-teal   .term-box-label { color: #79c0ff; }
.term-c-green  { border-color: #238636; } .term-c-green  .term-box-label { color: #3fb950; }
.term-c-yellow { border-color: #9e6a03; } .term-c-yellow .term-box-label { color: #e3b341; }
.term-c-orange { border-color: #bd5b00; } .term-c-orange .term-box-label { color: #ffa657; }
.term-c-purple { border-color: #6e40c9; } .term-c-purple .term-box-label { color: #bc8cff; }
.term-c-gray   { border-color: #30363d; } .term-c-gray   .term-box-label { color: #8b949e; }
.term-c-pink   { border-color: #ad4061; } .term-c-pink   .term-box-label { color: #f778ba; }
.term-sn-yellow { border-color: #9e6a03; color: #e3b341; }
.term-sn-blue   { border-color: #1f6feb; color: #58a6ff; }
.term-sn-green  { border-color: #238636; color: #3fb950; }
.term-sn-pink   { border-color: #ad4061; color: #f778ba; }
.term-sn-red    { border-color: #da3633; color: #f85149; }
.term-sn-teal   { border-color: #388bfd; color: #79c0ff; }
.term-sn-orange { border-color: #bd5b00; color: #ffa657; }
.term-sn-purple { border-color: #6e40c9; color: #bc8cff; }
.term-sn-gray   { border-color: #30363d; color: #8b949e; }
.term-tier-green  { border-color: #238636; } .term-tier-green  .tn,.term-tier-green  .ta { color: #3fb950; } .term-tier-green  .tl,.term-tier-green  .ts { color: #3fb950; }
.term-tier-yellow { border-color: #9e6a03; } .term-tier-yellow .tn,.term-tier-yellow .ta { color: #e3b341; } .term-tier-yellow .tl,.term-tier-yellow .ts { color: #e3b341; }
.term-tier-red    { border-color: #da3633; } .term-tier-red    .tn,.term-tier-red    .ta { color: #f85149; } .term-tier-red    .tl,.term-tier-red    .ts { color: #f85149; }
.term-pill-blue{background:#1f2d3f;border-color:#1f6feb;color:#58a6ff}
.term-pill-red{background:#2a1519;border-color:#da3633;color:#f85149}
.term-pill-teal{background:#1a2d3a;border-color:#388bfd;color:#79c0ff}
.term-pill-green{background:#1a2b1a;border-color:#238636;color:#3fb950}
.term-pill-yellow{background:#2a2010;border-color:#9e6a03;color:#e3b341}
.term-pill-orange{background:#2a1e0f;border-color:#bd5b00;color:#ffa657}
.term-pill-purple{background:#1e1a2e;border-color:#6e40c9;color:#bc8cff}
.term-pill-gray{background:#161b22;border-color:#30363d;color:#8b949e}
.term-pill-pink{background:#271520;border-color:#ad4061;color:#f778ba}
.term-tag-blue{background:#1f2d3f;color:#58a6ff}
.term-tag-red{background:#2a1519;color:#f85149}
.term-tag-teal{background:#1a2d3a;color:#79c0ff}
.term-tag-green{background:#1a2b1a;color:#3fb950}
.term-tag-yellow{background:#2a2010;color:#e3b341}
.term-tag-orange{background:#2a1e0f;color:#ffa657}
.term-tag-purple{background:#1e1a2e;color:#bc8cff}
.term-tag-gray{background:#161b22;color:#8b949e}
.term-tag-pink{background:#271520;color:#f778ba}

@media (max-width: 600px) {
  .cl-twocol, .cl-tiers, .chalk-twocol, .chalk-tiers, .term-twocol, .term-tiers { grid-template-columns: 1fr; }
  .style-chip { font-size: 10px; padding: 4px 10px; }
}

/* ── SETTINGS TRIGGER ── */
.settings-trigger {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #ccc;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s;
}
.settings-trigger:hover { background: rgba(255,255,255,0.16); color: #fff; border-color: rgba(255,255,255,0.35); }

/* ── SETTINGS OVERLAY ── */
.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 57px 0 0 0;
}
.settings-overlay.open { display: flex; }

.settings-page-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
  background: #f8f9fc;
}

.settings-page-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  background: #f8f9fc;
}

.profile-page-content {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #f8f9fc;
}

.profile-page-panel {
  height: 100%;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 28px 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.profile-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.profile-hero-card,
.profile-info-card {
  border: 1px solid #dbe1ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(20, 29, 49, 0.08);
}

.profile-hero-card {
  position: relative;
  overflow: visible;
  padding: 28px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 33px,
      rgba(59, 130, 246, 0.09) 33px,
      rgba(59, 130, 246, 0.09) 35px
    ),
    #eef5ff;
  border: 2px solid #7b8fb4;
  border-radius: 28px 22px 26px 20px;
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.1),
    5px 6px 0 rgba(123, 143, 180, 0.22);
  transform: rotate(-0.7deg);
}

.profile-hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.profile-hero-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(59, 130, 246, 0.18);
  border-radius: 22px 18px 24px 16px;
  pointer-events: none;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 26px 20px 24px 18px;
  display: grid;
  place-items: center;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,0.7), transparent 22%),
    linear-gradient(145deg, #9bd8ff 0%, #7cc8ff 45%, #a7f3d0 100%);
  border: 2px solid rgba(15, 23, 42, 0.7);
  box-shadow:
    0 10px 22px rgba(37, 99, 235, 0.14),
    inset 0 2px 0 rgba(255,255,255,0.65);
  transform: rotate(-4deg);
  flex: 0 0 auto;
  position: relative;
}

.profile-avatar::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(15, 23, 42, 0.22);
  border-radius: 22px 16px 20px 14px;
  pointer-events: none;
}

.profile-hero-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.profile-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1e3a8a;
  background: #fff8b8;
  border: 2px solid rgba(30, 58, 138, 0.25);
  border-radius: 18px 12px 20px 14px;
  padding: 4px 12px 3px;
  box-shadow: 3px 3px 0 rgba(30, 58, 138, 0.12);
  transform: rotate(-2deg);
}

.profile-hero-name {
  margin-top: 8px;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 6px;
  border-radius: 16px 12px 15px 11px;
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 13px;
  color: #1e293b;
  background: #ffffff;
  border: 2px solid rgba(71, 85, 105, 0.32);
  box-shadow: 3px 3px 0 rgba(148, 163, 184, 0.16);
}

.profile-badge:nth-child(1) {
  transform: rotate(-2deg);
}

.profile-badge:nth-child(2) {
  transform: rotate(1.2deg);
}

.profile-badge:nth-child(3) {
  transform: rotate(-1deg);
}

.profile-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.profile-mini-stat {
  border-radius: 16px 12px 15px 11px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(148, 163, 184, 0.34);
  box-shadow: 3px 3px 0 rgba(199, 206, 219, 0.32);
}

.profile-mini-stat-label {
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.profile-mini-stat-value {
  margin-top: 8px;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.profile-mini-stat-help {
  margin-top: 5px;
  font-size: 12px;
  color: #94a3b8;
}

.profile-info-card {
  position: relative;
  overflow: visible;
  padding: 24px 22px 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0.78)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 35px,
      rgba(148, 163, 184, 0.08) 35px,
      rgba(148, 163, 184, 0.08) 37px
    ),
    #ffffff;
  border: 2px solid #c7cedb;
  border-radius: 24px 18px 22px 20px;
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.08),
    5px 6px 0 rgba(199, 206, 219, 0.32);
  transform: rotate(0.35deg);
}

.profile-info-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(148, 163, 184, 0.18);
  border-radius: 18px 14px 16px 15px;
  pointer-events: none;
}

.profile-info-title {
  position: relative;
  z-index: 1;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.profile-info-subtitle {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.profile-detail-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.profile-detail-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-detail-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #555;
}

.profile-detail-value {
  max-width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px 10px 13px 9px;
  background: #fff;
  border: 2px solid rgba(123, 143, 180, 0.42);
  box-shadow: 3px 3px 0 rgba(190, 215, 255, 0.95);
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 18px;
  line-height: 1.5;
  color: #0f172a;
  word-break: break-word;
}

.profile-stat-card {
  width: 100%;
  border: 1px solid #dbe1ec;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.profile-stat-card:hover {
  border-color: #c9d4e7;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.profile-stat-value {
  margin-top: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  line-height: 1.35;
  color: #0f172a;
}

.profile-stat-value.compact {
  font-size: 14px;
}

.profile-stat-value.wrap {
  word-break: break-word;
}

.profile-messages-list {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.profile-message-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.profile-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  color: #64748b;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-message-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-message-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.profile-message-badge.unread {
  color: #9f1239;
  background: #fff1f2;
  border-color: #fecdd3;
}

.profile-message-badge.read {
  color: #155e75;
  background: #ecfeff;
  border-color: #bae6fd;
}

.profile-message-title {
  font-size: 12px;
  color: #0f172a;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-message-thread {
  position: relative;
  padding: 18px 18px 16px;
  border: 2px solid #7b8fb4;
  border-radius: 28px 22px 26px 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 33px,
      rgba(59, 130, 246, 0.09) 33px,
      rgba(59, 130, 246, 0.09) 35px
    ),
    #eef5ff;
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.1),
    5px 6px 0 rgba(123, 143, 180, 0.22);
}

.profile-message-thread::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(59, 130, 246, 0.18);
  border-radius: 22px 18px 24px 16px;
  pointer-events: none;
}

.profile-message-thread-header {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-message-thread-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
}

.profile-message-thread-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px 9px 14px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #8b5cf6;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.18);
}

.profile-message-thread-title {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  line-height: 1;
  color: #7c3aed;
  font-weight: 700;
}

.profile-message-thread-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 12px;
  color: #475569;
}

.profile-message-thread-note {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #334155;
}

.profile-message-thread-boxes {
  position: relative;
  z-index: 1;
}

.profile-message-text {
  font-size: 13px;
  color: #1f2937;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-message-original {
  margin-top: 0;
}

.profile-message-original-label {
  display: none;
}

.profile-message-reply {
  margin-top: 12px;
}

.profile-message-reply-label {
  margin-bottom: 0;
}

.profile-message-reply-box {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
}

.profile-message-reply-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ai-reply-btn {
  width: 120px;
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #6366f1;
  background: #eef2ff;
  color: #4338ca;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-reply-btn:hover {
  background: #e0e7ff;
}

.ai-reply-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-message-reply-input {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 2px solid #d8dee9;
  border-radius: 14px;
  padding: 10px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: #fffefb;
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.profile-message-reply-input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.16);
}

@media (max-width: 700px) {
  .profile-message-thread {
    padding: 16px 14px 14px;
    border-radius: 18px;
  }

  .profile-message-thread::before {
    inset: 10px;
    border-radius: 14px;
  }

  .profile-message-thread-title {
    font-size: 24px;
  }

  .profile-message-thread-icon {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

.readonly-feedback-bar {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 20px));
  min-height: var(--floating-footer-h);
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.3);
  z-index: 1200;
  display: none;
}

body:not(.readonly-note-view) .readonly-feedback-bar {
  display: none !important;
}

.readonly-feedback-title {
  display: none;
}

.readonly-feedback-history {
  display: none;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 2px;
}

.readonly-feedback-history-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.58);
  padding: 10px 12px;
}

.readonly-feedback-history-card + .readonly-feedback-history-card {
  margin-top: 8px;
}

.readonly-feedback-history-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.readonly-feedback-history-text {
  white-space: pre-wrap;
  line-height: 1.5;
  color: #f8fafc;
  font-size: 12px;
}

.readonly-feedback-history-reply {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.readonly-feedback-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.readonly-feedback-input {
  width: 100%;
  height: calc(var(--floating-footer-h) - 14px);
  min-height: 0;
  max-height: none;
  resize: none;
  border: 1px solid rgba(203, 213, 225, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.55);
}

.readonly-feedback-input::placeholder {
  color: #94a3b8;
}

.readonly-feedback-row .setting-action-btn {
  height: calc(var(--floating-footer-h) - 14px);
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.readonly-feedback-status {
  display: none;
}

@media (max-width: 700px) {
  .readonly-feedback-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .readonly-feedback-bar {
    width: calc(100vw - 12px);
    bottom: 6px;
    border-radius: 14px;
    padding: 6px;
  }
}

/* ── SETTINGS PANEL ── */
.settings-panel {
  width: 420px;
  height: calc(100vh - 57px);
  background: #fff;
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  animation: slideIn 0.22s ease;
}

@keyframes slideIn { from { transform: translateX(100%); opacity:0; } to { transform: translateX(0); opacity:1; } }

.settings-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafaf8;
  flex-shrink: 0;
}

.settings-title {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  letter-spacing: 0.3px;
}

.settings-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #888;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.settings-close:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

.settings-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── SETTING GROUPS ── */
.setting-group { display: flex; flex-direction: column; gap: 6px; }

.setting-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}

.setting-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.18s;
  appearance: none;
}
.setting-input:focus { border-color: var(--accent); }
select.setting-input { cursor: pointer; }

.setting-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.setting-hint {
  font-size: 11px;
  color: #aaa;
  line-height: 1.5;
  font-family: 'DM Mono', monospace;
}

.setting-hint-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
  font-family: 'DM Mono', monospace;
  margin-top: -2px;
}

.setting-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #333;
  background: #fff;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.18s;
}
.setting-textarea:focus { border-color: var(--accent); }

.setting-action-btn {
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #fafaf8;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}
.setting-action-btn:hover { border-color: var(--accent); color: var(--accent); background: #f0f7ff; }

.compose-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.compose-form {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.compose-form.is-open {
  display: flex;
}

.compose-panel {
  margin-top: 16px;
}

.eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.5;
  padding: 0;
  line-height: 1;
}
.eye-btn:hover { opacity: 1; }

/* ── SETTINGS FOOTER ── */
.settings-footer {
  padding: 16px 0px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.settings-save-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #1a1a2e, #2d3561);
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
}
.settings-save-btn:hover { opacity: 0.88; }

.settings-reset-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-reset-btn:hover { border-color: #e63946; color: #e63946; }

/* toggle switch */
.toggle-row { display:flex; align-items:center; gap:10px; }
.toggle-switch { position:relative; width:40px; height:22px; flex-shrink:0; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-track {
  position:absolute; inset:0; border-radius:11px;
  background:#ddd; cursor:pointer; transition:background 0.2s;
}
.toggle-track::before {
  content:''; position:absolute;
  width:16px; height:16px; left:3px; top:3px;
  border-radius:50%; background:#fff;
  transition:transform 0.2s; box-shadow:0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track { background:var(--accent2); }
.toggle-switch input:checked + .toggle-track::before { transform:translateX(18px); }
.toggle-label { font-family:'DM Mono',monospace; font-size:12px; color:#444; }

/* ── CONTACTS ── */
.settings-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 230px;
  padding: 20px 14px;
  flex-shrink: 0;
  align-self: flex-start;
}

.settings-nav-tab {
  flex: none;
  padding: 14px 16px;
  border: 2px solid #7b8fb4;
  border-radius: 24px 18px 22px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 33px,
      rgba(59, 130, 246, 0.09) 33px,
      rgba(59, 130, 246, 0.09) 35px
    ),
    #eef5ff;
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.1),
    5px 6px 0 rgba(123, 143, 180, 0.22);
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  line-height: 1.1;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  position: relative;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.settings-nav-tab:nth-child(odd) {
  transform: rotate(-0.55deg);
}

.settings-nav-tab:nth-child(even) {
  transform: rotate(0.45deg);
}

.settings-nav-tab::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(59, 130, 246, 0.18);
  border-radius: 18px 14px 16px 12px;
  pointer-events: none;
}

.settings-nav-tab:hover {
  transform: translateY(-2px) rotate(0deg);
  box-shadow:
    0 12px 28px rgba(20, 29, 49, 0.14),
    6px 7px 0 rgba(123, 143, 180, 0.22);
}

.settings-nav-tab.active {
  color: #0f172a;
  border-color: #24406f;
  box-shadow:
    0 12px 28px rgba(20, 29, 49, 0.14),
    6px 7px 0 rgba(36, 64, 111, 0.18);
}
.mobile-page-header,
.mobile-panel-topbar,
.mobile-section-picker {
  display: none;
}

.mobile-page-header {
  align-items: center;
  gap: 10px;
  padding: 18px 16px 8px;
}

.mobile-back-btn {
  width: 38px;
  height: 38px;
  border: 2px solid #7b8fb4;
  border-radius: 14px 10px 13px 9px;
  background: #eef5ff;
  color: #24406f;
  box-shadow: 3px 3px 0 rgba(123, 143, 180, 0.2);
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  cursor: pointer;
}

.notes-back-btn {
  height: 38px;
  padding: 0 12px;
  border: 2px solid #7b8fb4;
  border-radius: 14px 10px 13px 9px;
  background: #eef5ff;
  color: #24406f;
  box-shadow: 3px 3px 0 rgba(123, 143, 180, 0.2);
  font-family: 'DM Mono', monospace;
  font-size: 16px;
}

.notes-back-btn:hover {
  background: #e2edff;
  border-color: #6f86ae;
}

.notes-back-btn .btn-label {
  font-size: 12px;
}

.mobile-page-title,
.mobile-panel-title {
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
}

.mobile-section-picker {
  padding: 8px 16px 18px;
}

.mobile-section-list {
  display: grid;
  gap: 14px;
}

.mobile-section-card {
  width: 100%;
  text-align: left;
  padding: 18px 16px;
  border: 2px solid #7b8fb4;
  border-radius: 24px 18px 22px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 33px,
      rgba(59, 130, 246, 0.09) 33px,
      rgba(59, 130, 246, 0.09) 35px
    ),
    #eef5ff;
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.1),
    5px 6px 0 rgba(123, 143, 180, 0.22);
  cursor: pointer;
  position: relative;
}

.mobile-section-card:nth-child(odd) {
  transform: rotate(-0.55deg);
}

.mobile-section-card:nth-child(even) {
  transform: rotate(0.45deg);
}

.mobile-section-card.active {
  border-color: #24406f;
  box-shadow:
    0 12px 28px rgba(20, 29, 49, 0.14),
    6px 7px 0 rgba(36, 64, 111, 0.18);
}

.mobile-section-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(59, 130, 246, 0.18);
  border-radius: 18px 14px 16px 12px;
  pointer-events: none;
}

.mobile-section-card-icon,
.mobile-section-card-title,
.mobile-section-card-subtitle {
  position: relative;
  z-index: 1;
}

.mobile-section-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 14px 10px 13px 9px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(123, 143, 180, 0.45);
  font-size: 20px;
}

.mobile-section-card-title {
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  color: #0f172a;
}

.mobile-section-card-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.mobile-panel-topbar {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.mobile-panel-topbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-panel-topbar .notes-new-btn {
  flex-shrink: 0;
}

.mobile-page-label {
  font-size: 11px;
  color: #64748b;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Contacts */
.contacts-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: #f8f9fc;
  border-radius: 8px;
  border: 1px solid #e6eaf2;
}

.contacts-create-panel { margin-top: 16px; }
.contacts-create-form-title { color: #0f172a; font-size: 15px; font-weight: 700; }
.contacts-create-form-subtitle { color: #64748b; font-size: 12px; line-height: 1.5; }

.picker-dropdown { position: relative; }

.picker-trigger {
  width: 100%;
  border: 1px solid #dbe2ee;
  background: #fff;
  color: #334155;
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 10px;
  text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
}

.picker-trigger:hover { border-color: var(--accent); }

.picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dbe2ee;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
  display: none;
  padding: 6px;
}

.picker-menu.open { display: block; }

.picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #334155;
}

.picker-option:hover { background: #f0f7ff; }
.picker-empty { font-family: 'DM Mono', monospace; font-size: 11px; color: #94a3b8; padding: 8px; }
.contacts-form-actions { display: flex; gap: 8px; align-self: flex-start; margin-top: 0; }
.contacts-form-actions .setting-action-btn,
.contacts-form-actions .settings-reset-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.contacts-list { display: flex; flex-direction: column; gap: 10px; overflow: visible; }
.contact-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fafaf8; border: 1px solid #e6eaf2; border-radius: 6px; gap: 10px; }
.contact-item:hover { background: #f0f7ff; border-color: var(--accent); }
.contacts-list.notes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contacts-pagination {
  display:flex;
  justify-content:center;
  margin-top:14px;
}
.contact-card.note-item {
  background:#bed7ff;
  border-color:#9cbaf0;
  min-height:210px;
  height:210px;
  cursor:pointer;
}
.contact-card .note-item-desc {
  visibility:visible;
}
.contact-card-actions {
  display:flex;
  gap:6px;
}
.contact-email, .contact-name { font-family:'DM Mono',monospace; font-size:12px; color:#333; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.contact-name { font-size:13px; font-weight:500; color:#1a1a1a; }
.contact-email { font-size:11px; color:#888; margin-top:2px; }
.contact-action-btn { padding:4px 8px; border-radius:4px; border:1px solid #ddd; background:#fff; font-size:11px; cursor:pointer; transition:all 0.15s; color:#666; }
.contact-action-btn:hover { border-color:var(--accent); color:var(--accent); background:#f0f7ff; }
.contact-delete-btn { color:#e63946; border-color:#fca5a5; }
.contact-delete-btn:hover { background:#fee2e2; border-color:#e63946; }
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:2000; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal-content { background:#fff; border-radius:12px; box-shadow:0 10px 40px rgba(0,0,0,0.15); max-width:500px; width:90%; max-height:80vh; overflow-y:auto; display:flex; flex-direction:column; }
.modal-header { padding:20px; border-bottom:1px solid #e6eaf2; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.modal-header-title { font-family:'DM Mono',monospace; font-size:14px; font-weight:500; color:#1a1a1a; }
.modal-close { width:28px; height:28px; border-radius:6px; border:1px solid #e6eaf2; background:#fff; cursor:pointer; font-size:16px; color:#888; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
.modal-close:hover { background:#fee2e2; border-color:#fca5a5; color:#b91c1c; }
.modal-body { flex:1; padding:20px; display:flex; flex-direction:column; gap:12px; }
.modal-footer { padding:16px 20px; border-top:1px solid #e6eaf2; display:flex; gap:10px; flex-shrink:0; }
.modal-btn { flex:1; padding:10px; border-radius:6px; border:1.5px solid var(--border); background:#fff; font-family:'DM Mono',monospace; font-size:12px; color:#666; cursor:pointer; transition:all 0.15s; }
.modal-btn:hover { border-color:var(--accent); color:var(--accent); }
.modal-btn.primary { background:linear-gradient(135deg,#1a1a2e,#2d3561); color:#fff; border-color:transparent; }
.modal-btn.primary:hover { opacity:0.88; }

@media (max-width: 768px) {
  .settings-nav-tabs {
    display: none;
  }

  .settings-page-wrapper {
    display: block;
  }

  .profile-page-panel {
    border-radius: 0;
    padding: 20px 14px 24px;
  }

  .mobile-page-header,
  .mobile-panel-topbar,
  .mobile-section-picker {
    display: flex;
  }

  .mobile-section-picker {
    display: block;
  }

  .profile-page-panel > .notes-header {
    display: none;
  }
}

/* saved toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: min(92vw, 560px);
  background: #eff6ff;
  color: #1e3a8a;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.16);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 3000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
}
.toast-message {
  overflow-wrap: anywhere;
}
.toast.info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.24);
}
.toast.info .toast-icon {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}
.toast.success {
  background: #f0fdf4;
  color: #166534;
  border-color: rgba(34, 197, 94, 0.24);
}
.toast.success .toast-icon {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}
.toast.warning {
  background: #fffbeb;
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}
.toast.warning .toast-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
.toast.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}
.toast.danger .toast-icon {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}
/* ═══════════════════════════════════════
   STYLE: PASTEL / KAWAII
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
.ps-page {
  max-width:950px; margin: 0 auto;
  background: linear-gradient(160deg, #fff0f6 0%, #f0f4ff 50%, #f0fff8 100%);
  font-family: 'Nunito', system-ui, sans-serif;
  padding: 44px 10px 56px;
  border-radius: 24px;
  border: 3px solid #fbc8e0;
  box-shadow: 0 4px 0 #fbc8e0, 0 8px 32px rgba(255,182,219,0.2);
  position: relative; overflow: hidden;
}
.ps-page::before {
  content:''; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(circle at 10% 10%, rgba(255,182,219,0.18) 0%, transparent 50%),
              radial-gradient(circle at 90% 90%, rgba(182,219,255,0.18) 0%, transparent 50%);
}
.ps-title { font-size: 36px; font-weight: 800; text-align: center; margin-bottom: 4px;
  background: linear-gradient(135deg, #f472b6, #a78bfa, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ps-title-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.ps-title-dots span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.ps-divider { height: 2px; background: linear-gradient(90deg,#fbc8e0,#c8d8fb,#c8fbea,#fbc8e0); border-radius: 2px; margin: 24px 0; opacity: 0.6; }
.ps-section-hdr { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; }
.ps-section-num { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.ps-section-title { font-size: 20px; font-weight: 800; }
.ps-box { border: 2.5px solid; border-radius: 18px; padding: 14px 18px; margin: 8px 0; position: relative; }
.ps-box-label { position: absolute; top: -12px; left: 16px; padding: 0 8px; font-size: 13px; font-weight: 800; border-radius: 20px; }
.ps-text { font-size: 15px; line-height: 1.7; margin: 4px 0; color: #4a4a6a; }
.ps-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.ps-bullets { list-style: none; padding: 0; margin: 6px 0; }
.ps-bullets li { padding: 3px 0 3px 24px; font-size: 15px; color: #4a4a6a; line-height: 1.5; position: relative; }
.ps-bullets li::before { position: absolute; left: 2px; font-size: 14px; }
.ps-bullets.arrow li::before { content: '🌸'; font-size: 12px; top: 4px; }
.ps-bullets.check li::before { content: '✿'; color: #f472b6; }
.ps-bullets.warn  li::before { content: '⚠'; font-size: 12px; top: 4px; }
.ps-bullets.star  li::before { content: '⭐'; font-size: 11px; top: 4px; }
.ps-bullets.dot   li::before { content: '💜'; font-size: 11px; top: 4px; }
.ps-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.ps-stat { flex: 1; min-width: 100px; border: 2.5px solid; border-radius: 16px; padding: 12px; text-align: center; }
.ps-stat .n { font-size: 26px; font-weight: 800; display: block; }
.ps-stat .l { font-size: 12px; color: #7a7a9a; line-height: 1.3; margin-top: 2px; }
.ps-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0; font-size: 14px; border-radius: 14px; overflow: hidden; }
.ps-table th { padding: 9px 12px; font-size: 14px; font-weight: 800; color: #fff; }
.ps-table td { padding: 8px 12px; color: #4a4a6a; border-bottom: 1.5px solid rgba(200,180,230,0.2); }
.ps-sticky { border-radius: 16px; padding: 12px 18px; margin: 10px 0; font-size: 16px; font-weight: 700; border: 2px solid; position: relative; }
.ps-sticky::before { font-size: 20px; margin-right: 6px; }
.ps-sticky.yellow::before { content: '🍋'; } .ps-sticky.blue::before { content: '💙'; }
.ps-sticky.green::before  { content: '🍀'; } .ps-sticky.pink::before  { content: '🌷'; }
.ps-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ps-pill { padding: 5px 14px; border-radius: 20px; font-size: 14px; font-weight: 700; border: 2px solid; }
.ps-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.ps-tag { padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.ps-tiers { display: flex; gap: 8px; margin: 8px 0; }
.ps-tier { flex: 1; padding: 14px 8px; border-radius: 16px; text-align: center; border: 2.5px solid; }
.ps-tier .tn { font-size: 26px; font-weight: 800; display: block; }
.ps-tier .tl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.ps-tier .ta { font-size: 14px; font-weight: 700; display: block; margin: 3px 0; }
.ps-tier .ts { font-size: 12px; }
.ps-footer { text-align: center; margin-top: 28px; font-size: 13px; color: #c8aad8; padding-top: 12px; border-top: 2px dashed #f0c8e8; }

/* pastel color map */
.ps-c-blue   { border-color:#bfdbfe; background:rgba(219,234,254,0.4); } .ps-c-blue   .ps-box-label { background:#dbeafe; color:#3b82f6; }
.ps-c-red    { border-color:#fecdd3; background:rgba(254,205,211,0.4); } .ps-c-red    .ps-box-label { background:#ffe4e6; color:#f43f5e; }
.ps-c-teal   { border-color:#99f6e4; background:rgba(153,246,228,0.3); } .ps-c-teal   .ps-box-label { background:#ccfbf1; color:#14b8a6; }
.ps-c-green  { border-color:#bbf7d0; background:rgba(187,247,208,0.3); } .ps-c-green  .ps-box-label { background:#dcfce7; color:#22c55e; }
.ps-c-yellow { border-color:#fef08a; background:rgba(254,240,138,0.3); } .ps-c-yellow .ps-box-label { background:#fef9c3; color:#eab308; }
.ps-c-orange { border-color:#fed7aa; background:rgba(254,215,170,0.3); } .ps-c-orange .ps-box-label { background:#ffedd5; color:#f97316; }
.ps-c-purple { border-color:#e9d5ff; background:rgba(233,213,255,0.4); } .ps-c-purple .ps-box-label { background:#f3e8ff; color:#a855f7; }
.ps-c-gray   { border-color:#e2e8f0; background:rgba(226,232,240,0.4); } .ps-c-gray   .ps-box-label { background:#f1f5f9; color:#64748b; }
.ps-c-pink   { border-color:#fbcfe8; background:rgba(251,207,232,0.4); } .ps-c-pink   .ps-box-label { background:#fce7f3; color:#ec4899; }
/* pastel stats nums */
.ps-sn-blue{background:#dbeafe;border-color:#bfdbfe}.ps-sn-blue .n{color:#3b82f6}
.ps-sn-red{background:#ffe4e6;border-color:#fecdd3}.ps-sn-red .n{color:#f43f5e}
.ps-sn-teal{background:#ccfbf1;border-color:#99f6e4}.ps-sn-teal .n{color:#14b8a6}
.ps-sn-green{background:#dcfce7;border-color:#bbf7d0}.ps-sn-green .n{color:#22c55e}
.ps-sn-yellow{background:#fef9c3;border-color:#fef08a}.ps-sn-yellow .n{color:#eab308}
.ps-sn-orange{background:#ffedd5;border-color:#fed7aa}.ps-sn-orange .n{color:#f97316}
.ps-sn-purple{background:#f3e8ff;border-color:#e9d5ff}.ps-sn-purple .n{color:#a855f7}
.ps-sn-gray{background:#f1f5f9;border-color:#e2e8f0}.ps-sn-gray .n{color:#64748b}
.ps-sn-pink{background:#fce7f3;border-color:#fbcfe8}.ps-sn-pink .n{color:#ec4899}
/* pastel section nums */
.ps-num-blue{background:#dbeafe;color:#3b82f6} .ps-num-red{background:#ffe4e6;color:#f43f5e}
.ps-num-teal{background:#ccfbf1;color:#14b8a6} .ps-num-green{background:#dcfce7;color:#22c55e}
.ps-num-yellow{background:#fef9c3;color:#eab308} .ps-num-orange{background:#ffedd5;color:#f97316}
.ps-num-purple{background:#f3e8ff;color:#a855f7} .ps-num-gray{background:#f1f5f9;color:#64748b}
.ps-num-pink{background:#fce7f3;color:#ec4899}
/* pastel sticky */
.ps-sticky.yellow{background:#fef9c3;border-color:#fef08a;color:#713f12}
.ps-sticky.blue  {background:#dbeafe;border-color:#bfdbfe;color:#1e3a8a}
.ps-sticky.green {background:#dcfce7;border-color:#bbf7d0;color:#14532d}
.ps-sticky.pink  {background:#fce7f3;border-color:#fbcfe8;color:#831843}
.ps-sticky.red   {background:#ffe4e6;border-color:#fecdd3;color:#9f1239}
.ps-sticky.teal  {background:#ccfbf1;border-color:#99f6e4;color:#134e4a}
.ps-sticky.orange{background:#ffedd5;border-color:#fed7aa;color:#7c2d12}
.ps-sticky.purple{background:#f3e8ff;border-color:#e9d5ff;color:#581c87}
.ps-sticky.gray  {background:#f1f5f9;border-color:#e2e8f0;color:#334155}
/* pastel tier */
.ps-tier-green{background:#dcfce7;border-color:#bbf7d0}.ps-tier-green .tn,.ps-tier-green .ta{color:#22c55e}.ps-tier-green .tl,.ps-tier-green .ts{color:#15803d}
.ps-tier-yellow{background:#fef9c3;border-color:#fef08a}.ps-tier-yellow .tn,.ps-tier-yellow .ta{color:#eab308}.ps-tier-yellow .tl,.ps-tier-yellow .ts{color:#92400e}
.ps-tier-red{background:#ffe4e6;border-color:#fecdd3}.ps-tier-red .tn,.ps-tier-red .ta{color:#f43f5e}.ps-tier-red .tl,.ps-tier-red .ts{color:#9f1239}
/* pastel pill */
.ps-pill-blue{background:#dbeafe;border-color:#bfdbfe;color:#3b82f6}.ps-pill-red{background:#ffe4e6;border-color:#fecdd3;color:#f43f5e}
.ps-pill-teal{background:#ccfbf1;border-color:#99f6e4;color:#14b8a6}.ps-pill-green{background:#dcfce7;border-color:#bbf7d0;color:#22c55e}
.ps-pill-yellow{background:#fef9c3;border-color:#fef08a;color:#eab308}.ps-pill-orange{background:#ffedd5;border-color:#fed7aa;color:#f97316}
.ps-pill-purple{background:#f3e8ff;border-color:#e9d5ff;color:#a855f7}.ps-pill-gray{background:#f1f5f9;border-color:#e2e8f0;color:#64748b}
.ps-pill-pink{background:#fce7f3;border-color:#fbcfe8;color:#ec4899}
/* pastel tag */
.ps-tag-blue{background:#dbeafe;color:#3b82f6}.ps-tag-red{background:#ffe4e6;color:#f43f5e}
.ps-tag-teal{background:#ccfbf1;color:#14b8a6}.ps-tag-green{background:#dcfce7;color:#22c55e}
.ps-tag-yellow{background:#fef9c3;color:#eab308}.ps-tag-orange{background:#ffedd5;color:#f97316}
.ps-tag-purple{background:#f3e8ff;color:#a855f7}.ps-tag-gray{background:#f1f5f9;color:#64748b}
.ps-tag-pink{background:#fce7f3;color:#ec4899}
/* pastel table th */
.ps-th-blue{background:#bfdbfe;color:#1e40af}.ps-th-red{background:#fecdd3;color:#9f1239}
.ps-th-teal{background:#99f6e4;color:#134e4a}.ps-th-green{background:#bbf7d0;color:#14532d}
.ps-th-yellow{background:#fef08a;color:#713f12}.ps-th-orange{background:#fed7aa;color:#7c2d12}
.ps-th-purple{background:#e9d5ff;color:#581c87}.ps-th-gray{background:#e2e8f0;color:#334155}
.ps-th-pink{background:#fbcfe8;color:#831843}

/* ═══════════════════════════════════════
   STYLE: JAPANESE MANGA / ANIME
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Zen+Dots&family=Noto+Sans+JP:wght@400;700;900&display=swap');

.fx-page {
  max-width: 950px; margin: 0 auto;
  background: #fff;
  background-image:
    radial-gradient(circle, #e8e8f0 1px, transparent 1px);
  background-size: 18px 18px;
  font-family: 'Noto Sans JP', sans-serif;
  padding: 0 10px 48px 10px;
  border: 3px solid #1a1a1a;
  box-shadow: 6px 6px 0 #1a1a1a;
  position: relative; overflow: hidden;
}
/* Speed lines top banner */
.fx-page::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg,
    #e63946 0, #e63946 20px, #fff 20px, #fff 22px,
    #4895ef 22px, #4895ef 42px, #fff 42px, #fff 44px,
    #f4a261 44px, #f4a261 64px, #fff 64px, #fff 66px,
    #2a9d8f 66px, #2a9d8f 86px, #fff 86px, #fff 88px,
    #7b2d8b 88px, #7b2d8b 108px, #fff 108px, #fff 110px
  );
  pointer-events: none; z-index: 2;
}
.fx-masthead {
  background: #1a1a1a;
  padding: 28px 40px 22px;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
/* halftone dots on masthead */
.fx-masthead::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
}
.fx-title {
  font-family: 'Zen Dots', sans-serif;
  font-size: 32px; font-weight: 400;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative; z-index: 1;
  text-shadow: 3px 3px 0 #e63946, 6px 6px 0 rgba(230,57,70,0.3);
  margin-bottom: 0;
}
.fx-title-ornament {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px; letter-spacing: 6px;
  color: #f4a261; margin-top: 6px;
  position: relative; z-index: 1;
  text-transform: uppercase;
}
.fx-content { padding: 0 36px; }
.fx-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0;
}
.fx-divider::before,.fx-divider::after {
  content:''; flex:1; height: 3px;
  background: repeating-linear-gradient(90deg, #1a1a1a 0, #1a1a1a 8px, transparent 8px, transparent 12px);
}
.fx-divider-icon {
  width: 28px; height: 28px; background: #1a1a1a; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; flex-shrink: 0;
}
/* Section header — manga chapter style */
.fx-section-hdr {
  display: flex; align-items: stretch; gap: 0;
  margin: 24px 0 14px; border: 2.5px solid #1a1a1a;
  overflow: hidden;
}
.fx-section-num {
  font-family: 'Zen Dots', sans-serif;
  font-size: 20px; font-weight: 400;
  color: #fff; background: #1a1a1a;
  padding: 8px 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: 1px;
}
.fx-section-title {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px; font-weight: 900;
  color: #1a1a1a; padding: 8px 14px;
  display: flex; align-items: center;
  letter-spacing: 1px; text-transform: uppercase;
  flex: 1;
}
/* manga panel box */
.fx-box {
  border: 2.5px solid #1a1a1a;
  border-radius: 0;
  padding: 14px 16px 14px 18px;
  margin: 8px 0;
  position: relative;
  background: #fff;
  box-shadow: 3px 3px 0 #1a1a1a;
}
.fx-box-label {
  position: absolute; top: -13px; left: 12px;
  padding: 2px 10px;
  font-family: 'Zen Dots', sans-serif;
  font-size: 11px; font-weight: 400;
  background: #1a1a1a; color: #fff;
  letter-spacing: 1px; text-transform: uppercase;
}
.fx-text { font-size: 15px; color: #1a1a1a; line-height: 1.8; margin: 4px 0; }
.fx-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
/* speech bubble bullets */
.fx-bullets { list-style: none; padding: 0; margin: 6px 0; }
.fx-bullets li { padding: 3px 0 3px 24px; font-size: 15px; color: #1a1a1a; line-height: 1.6; position: relative; }
.fx-bullets li::before { position: absolute; left: 2px; font-size: 13px; }
.fx-bullets.arrow li::before { content: '▶'; color: #e63946; }
.fx-bullets.check li::before { content: '✓'; color: #2a9d8f; font-weight: 900; font-size: 15px; top: 2px; }
.fx-bullets.warn  li::before { content: '!!'; color: #e63946; font-size: 11px; font-weight: 900; top: 4px; font-family: 'Zen Dots', sans-serif; }
.fx-bullets.star  li::before { content: '★'; color: #f4a261; }
.fx-bullets.dot   li::before { content: '◆'; color: #7b2d8b; font-size: 9px; top: 7px; }
/* stat cards — manga stat panel */
.fx-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.fx-stat {
  flex: 1; min-width: 90px;
  border: 2.5px solid #1a1a1a;
  padding: 10px 12px; text-align: center;
  background: #fff; box-shadow: 3px 3px 0 #1a1a1a;
  position: relative;
}
.fx-stat::before {
  content: ''; position: absolute; inset: 3px;
  border: 1px dashed rgba(0,0,0,0.12); pointer-events: none;
}
.fx-stat .n { font-family: 'Zen Dots', sans-serif; font-size: 26px; display: block; color: #e63946; text-shadow: 2px 2px 0 rgba(230,57,70,0.2); }
.fx-stat .l { font-size: 11px; color: #555; line-height: 1.3; margin-top: 4px; letter-spacing: 0.5px; }
/* table — manga data panel */
.fx-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; border: 2px solid #1a1a1a; }
.fx-table th { padding: 8px 12px; text-align: left; border: 1.5px solid #1a1a1a; background: #1a1a1a; color: #fff; font-family: 'Zen Dots', sans-serif; font-size: 11px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; }
.fx-table td { padding: 8px 12px; border: 1px solid #ddd; color: #1a1a1a; vertical-align: middle; }
.fx-table tr:nth-child(even) td { background: #f9f9f9; }
/* speech bubble sticky */
.fx-sticky {
  position: relative;
  background: #fff;
  border: 2.5px solid #1a1a1a;
  border-radius: 12px;
  padding: 12px 18px 12px 44px;
  margin: 12px 0 12px 16px;
  font-size: 15px; color: #1a1a1a;
  box-shadow: 3px 3px 0 #1a1a1a;
  font-weight: 700;
}
.fx-sticky::after {
  content: '';
  position: absolute; left: -14px; top: 16px;
  border: 8px solid transparent;
  border-right-color: #1a1a1a;
}
.fx-sticky::before { font-size: 20px; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.fx-sticky.yellow::before { content: '💭'; } .fx-sticky.blue::before   { content: '💬'; }
.fx-sticky.green::before  { content: '✅'; } .fx-sticky.pink::before   { content: '❗'; }
.fx-sticky.red::before    { content: '❌'; } .fx-sticky.teal::before   { content: '🌀'; }
.fx-sticky.orange::before { content: '🔥'; } .fx-sticky.purple::before { content: '✨'; }
.fx-sticky.gray::before   { content: '⚙'; }
.fx-sticky.yellow{background:#fffbeb;border-color:#d97706;color:#713f12}
.fx-sticky.blue  {background:#eff6ff;border-color:#2563eb;color:#1e3a8a}
.fx-sticky.green {background:#f0fdf4;border-color:#16a34a;color:#14532d}
.fx-sticky.pink  {background:#fdf2f8;border-color:#db2777;color:#831843}
.fx-sticky.red   {background:#fff1f2;border-color:#e63946;color:#7f1d1d}
.fx-sticky.teal  {background:#f0fdfa;border-color:#2a9d8f;color:#134e4a}
.fx-sticky.orange{background:#fff7ed;border-color:#ea580c;color:#7c2d12}
.fx-sticky.purple{background:#faf5ff;border-color:#7c3aed;color:#4c1d95}
.fx-sticky.gray  {background:#f9fafb;border-color:#374151;color:#1f2937}
/* pills — manga badge style */
.fx-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fx-pill {
  padding: 4px 12px; border: 2px solid #1a1a1a;
  font-size: 12px; font-weight: 700; font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.5px; text-transform: uppercase;
  box-shadow: 2px 2px 0 #1a1a1a;
}
.fx-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.fx-tag {
  padding: 2px 8px; border: 1.5px solid #1a1a1a;
  font-size: 11px; font-weight: 700;
  font-family: 'Zen Dots', sans-serif; letter-spacing: 0.5px;
}
/* score tiers — manga power level */
.fx-tiers { display: flex; gap: 8px; margin: 8px 0; }
.fx-tier {
  flex: 1; padding: 14px 8px; text-align: center;
  border: 2.5px solid #1a1a1a;
  box-shadow: 3px 3px 0 #1a1a1a;
  position: relative; overflow: hidden;
}
.fx-tier::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, transparent, transparent 4px, rgba(0,0,0,0.03) 4px, rgba(0,0,0,0.03) 5px);
  pointer-events: none;
}
.fx-tier .tn { font-family: 'Zen Dots', sans-serif; font-size: 24px; display: block; text-shadow: 2px 2px 0 currentColor; }
.fx-tier .tl { font-size: 10px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; margin: 2px 0; font-family: 'Noto Sans JP', sans-serif; }
.fx-tier .ta { font-size: 13px; font-weight: 900; display: block; margin: 4px 0 2px; }
.fx-tier .ts { font-size: 11px; opacity: 0.7; }
.fx-footer {
  text-align: center; margin-top: 24px;
  font-family: 'Zen Dots', sans-serif;
  font-size: 12px; color: #1a1a1a;
  letter-spacing: 4px; opacity: 0.35;
  border-top: 3px solid #1a1a1a; padding-top: 12px;
  text-transform: uppercase;
}
/* manga color tokens — vivid anime palette */
.fx-c-blue  {border-color:#2563eb} .fx-c-blue  .fx-box-label{background:#2563eb}
.fx-c-red   {border-color:#e63946} .fx-c-red   .fx-box-label{background:#e63946}
.fx-c-teal  {border-color:#2a9d8f} .fx-c-teal  .fx-box-label{background:#2a9d8f}
.fx-c-green {border-color:#16a34a} .fx-c-green .fx-box-label{background:#16a34a}
.fx-c-yellow{border-color:#d97706} .fx-c-yellow .fx-box-label{background:#d97706}
.fx-c-orange{border-color:#ea580c} .fx-c-orange .fx-box-label{background:#ea580c}
.fx-c-purple{border-color:#7c3aed} .fx-c-purple .fx-box-label{background:#7c3aed}
.fx-c-gray  {border-color:#374151} .fx-c-gray  .fx-box-label{background:#374151}
.fx-c-pink  {border-color:#db2777} .fx-c-pink  .fx-box-label{background:#db2777}
.fx-c-blue  .fx-box{background:#eff6ff} .fx-c-red   .fx-box{background:#fff1f2}
.fx-c-teal  .fx-box{background:#f0fdfa} .fx-c-green .fx-box{background:#f0fdf4}
.fx-c-yellow .fx-box{background:#fffbeb} .fx-c-orange .fx-box{background:#fff7ed}
.fx-c-purple .fx-box{background:#faf5ff} .fx-c-gray .fx-box{background:#f9fafb}
.fx-c-pink  .fx-box{background:#fdf2f8}
.fx-pill-blue{background:#eff6ff;border-color:#2563eb;color:#2563eb}
.fx-pill-red{background:#fff1f2;border-color:#e63946;color:#e63946}
.fx-pill-teal{background:#f0fdfa;border-color:#2a9d8f;color:#2a9d8f}
.fx-pill-green{background:#f0fdf4;border-color:#16a34a;color:#16a34a}
.fx-pill-yellow{background:#fffbeb;border-color:#d97706;color:#d97706}
.fx-pill-orange{background:#fff7ed;border-color:#ea580c;color:#ea580c}
.fx-pill-purple{background:#faf5ff;border-color:#7c3aed;color:#7c3aed}
.fx-pill-gray{background:#f9fafb;border-color:#374151;color:#374151}
.fx-pill-pink{background:#fdf2f8;border-color:#db2777;color:#db2777}
.fx-tag-blue{background:#dbeafe;color:#1d4ed8} .fx-tag-red{background:#fee2e2;color:#b91c1c}
.fx-tag-teal{background:#ccfbf1;color:#0f766e} .fx-tag-green{background:#dcfce7;color:#15803d}
.fx-tag-yellow{background:#fef3c7;color:#b45309} .fx-tag-orange{background:#ffedd5;color:#c2410c}
.fx-tag-purple{background:#f3e8ff;color:#6b21a8} .fx-tag-gray{background:#f3f4f6;color:#374151}
.fx-tag-pink{background:#fce7f3;color:#9d174d}
.fx-tier-green{background:#f0fdf4;border-color:#16a34a} .fx-tier-green .tn,.fx-tier-green .ta{color:#15803d}
.fx-tier-yellow{background:#fffbeb;border-color:#d97706} .fx-tier-yellow .tn,.fx-tier-yellow .ta{color:#b45309}
.fx-tier-red{background:#fff1f2;border-color:#e63946} .fx-tier-red .tn,.fx-tier-red .ta{color:#b91c1c}

/* ═══════════════════════════════════════
   STYLE: MAGAZINE / EDITORIAL
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Serif+4:wght@400;600&display=swap');
.mg-page {
  max-width: 950px; margin: 0 auto;
  background: #fff; font-family: 'Source Serif 4', Georgia, serif;
  padding: 0 10px 48px 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.06);
}
.mg-masthead {
  background: #111; padding: 28px 48px 22px; margin-bottom: 0;
  border-bottom: 4px solid #e63946;
}
.mg-title { font-family: 'Playfair Display', serif; font-size: 38px; font-weight: 900; color: #fff; line-height: 1.1; margin-bottom: 6px; }
.mg-kicker { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #e63946; font-family: 'DM Mono', monospace; font-weight: 500; }
.mg-content { padding: 0 48px; }
.mg-divider { height: 3px; background: #111; margin: 28px 0 0; }
.mg-divider.thin { height: 1px; background: #e5e7eb; margin: 20px 0; }
.mg-section-hdr { display: flex; align-items: baseline; gap: 14px; margin: 28px 0 16px; padding-bottom: 10px; border-bottom: 3px solid; }
.mg-section-num { font-family: 'Playfair Display', serif; font-size: 42px; font-weight: 900; line-height: 1; flex-shrink: 0; }
.mg-section-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: #111; }
.mg-box { padding: 14px 18px; margin: 8px 0; border-left: 4px solid; }
.mg-box-label { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.mg-text { font-size: 16px; line-height: 1.8; color: #1a1a1a; margin: 4px 0; }
.mg-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 12px 0; }
.mg-bullets { list-style: none; padding: 0; margin: 8px 0; }
.mg-bullets li { padding: 4px 0 4px 20px; font-size: 16px; color: #1a1a1a; line-height: 1.6; position: relative; }
.mg-bullets li::before { position: absolute; left: 0; }
.mg-bullets.arrow li::before { content: '→'; color: #e63946; font-family: 'DM Mono', monospace; font-size: 13px; top: 6px; }
.mg-bullets.check li::before { content: '✓'; color: #2a9d8f; font-weight: 700; }
.mg-bullets.warn  li::before { content: '■'; color: #e63946; font-size: 10px; top: 7px; }
.mg-bullets.star  li::before { content: '◆'; color: #f4a261; font-size: 10px; top: 7px; }
.mg-bullets.dot   li::before { content: '●'; color: #7b2d8b; font-size: 8px; top: 9px; }
.mg-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 1px; margin: 12px 0; background: #e5e7eb; border: 1px solid #e5e7eb; }
.mg-stat { padding: 16px 12px; background: #fff; text-align: center; }
.mg-stat .n { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 900; display: block; color: #111; }
.mg-stat .l { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #6b7280; margin-top: 4px; }
.mg-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.mg-table th { padding: 10px 14px; text-align: left; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; border-bottom: 2px solid; }
.mg-table td { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; color: #1a1a1a; vertical-align: middle; }
.mg-pull-quote { border-left: 6px solid; padding: 16px 22px; margin: 14px 0; }
.mg-pull-quote p { font-family: 'Playfair Display', serif; font-size: 20px; font-style: italic; font-weight: 700; line-height: 1.4; color: #111; margin: 0; }
.mg-pull-quote cite { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; display: block; margin-top: 8px; }
.mg-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.mg-pill { padding: 4px 14px; font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; border: 1.5px solid; }
.mg-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.mg-tag { padding: 2px 8px; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; }
.mg-tiers { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 12px 0; background: #111; border: 1px solid #111; }
.mg-tier { padding: 16px 10px; background: #fff; text-align: center; }
.mg-tier .tn { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; display: block; color: #111; }
.mg-tier .tl { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: #6b7280; margin: 2px 0; }
.mg-tier .ta { font-size: 14px; font-weight: 700; display: block; margin: 4px 0 2px; color: #111; }
.mg-tier .ts { font-family: 'DM Mono', monospace; font-size: 11px; color: #6b7280; }
.mg-footer { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #9ca3af; text-align: center; padding-top: 24px; border-top: 1px solid #f3f4f6; margin-top: 8px; }

/* magazine color tokens */
.mg-c-blue{border-color:#2563eb} .mg-c-blue .mg-box-label{color:#2563eb}
.mg-c-red{border-color:#e63946}   .mg-c-red .mg-box-label{color:#e63946}
.mg-c-teal{border-color:#2a9d8f}  .mg-c-teal .mg-box-label{color:#2a9d8f}
.mg-c-green{border-color:#16a34a} .mg-c-green .mg-box-label{color:#16a34a}
.mg-c-yellow{border-color:#d97706} .mg-c-yellow .mg-box-label{color:#d97706}
.mg-c-orange{border-color:#f4a261} .mg-c-orange .mg-box-label{color:#f4a261}
.mg-c-purple{border-color:#7b2d8b} .mg-c-purple .mg-box-label{color:#7b2d8b}
.mg-c-gray{border-color:#6b7280}   .mg-c-gray .mg-box-label{color:#6b7280}
.mg-c-pink{border-color:#db2777}   .mg-c-pink .mg-box-label{color:#db2777}
.mg-sn-blue{color:#2563eb} .mg-sn-red{color:#e63946} .mg-sn-teal{color:#2a9d8f}
.mg-sn-green{color:#16a34a} .mg-sn-yellow{color:#d97706} .mg-sn-orange{color:#f4a261}
.mg-sn-purple{color:#7b2d8b} .mg-sn-gray{color:#6b7280} .mg-sn-pink{color:#db2777}
.mg-th-blue{border-color:#2563eb;color:#2563eb} .mg-th-red{border-color:#e63946;color:#e63946}
.mg-th-teal{border-color:#2a9d8f;color:#2a9d8f} .mg-th-green{border-color:#16a34a;color:#16a34a}
.mg-th-yellow{border-color:#d97706;color:#d97706} .mg-th-orange{border-color:#f4a261;color:#f4a261}
.mg-th-purple{border-color:#7b2d8b;color:#7b2d8b} .mg-th-gray{border-color:#6b7280;color:#6b7280}
.mg-th-pink{border-color:#db2777;color:#db2777}
.mg-pill-blue{background:#eff6ff;border-color:#2563eb;color:#2563eb}
.mg-pill-red{background:#fff1f2;border-color:#e63946;color:#e63946}
.mg-pill-teal{background:#f0fdfa;border-color:#2a9d8f;color:#2a9d8f}
.mg-pill-green{background:#f0fdf4;border-color:#16a34a;color:#16a34a}
.mg-pill-yellow{background:#fffbeb;border-color:#d97706;color:#d97706}
.mg-pill-orange{background:#fff7ed;border-color:#f4a261;color:#f4a261}
.mg-pill-purple{background:#fdf4ff;border-color:#7b2d8b;color:#7b2d8b}
.mg-pill-gray{background:#f9fafb;border-color:#6b7280;color:#6b7280}
.mg-pill-pink{background:#fdf2f8;border-color:#db2777;color:#db2777}
.mg-tag-blue{background:#eff6ff;color:#2563eb} .mg-tag-red{background:#fff1f2;color:#e63946}
.mg-tag-teal{background:#f0fdfa;color:#2a9d8f} .mg-tag-green{background:#f0fdf4;color:#16a34a}
.mg-tag-yellow{background:#fffbeb;color:#d97706} .mg-tag-orange{background:#fff7ed;color:#f4a261}
.mg-tag-purple{background:#fdf4ff;color:#7b2d8b} .mg-tag-gray{background:#f9fafb;color:#6b7280}
.mg-tag-pink{background:#fdf2f8;color:#db2777}
.mg-tier-green{border-right:3px solid #16a34a} .mg-tier-green .tn{color:#16a34a}
.mg-tier-yellow .tn{color:#d97706}
.mg-tier-red{border-left:3px solid #e63946} .mg-tier-red .tn{color:#e63946}
.mg-pq-blue{border-color:#2563eb} .mg-pq-blue cite{color:#2563eb}
.mg-pq-red{border-color:#e63946} .mg-pq-red cite{color:#e63946}
.mg-pq-green{border-color:#16a34a} .mg-pq-green cite{color:#16a34a}
.mg-pq-yellow{border-color:#d97706} .mg-pq-yellow cite{color:#d97706}
.mg-pq-purple{border-color:#7b2d8b} .mg-pq-purple cite{color:#7b2d8b}
.mg-pq-pink{border-color:#db2777} .mg-pq-pink cite{color:#db2777}
.mg-pq-teal{border-color:#2a9d8f} .mg-pq-teal cite{color:#2a9d8f}
.mg-pq-orange{border-color:#f4a261} .mg-pq-orange cite{color:#f4a261}
.mg-pq-gray{border-color:#6b7280} .mg-pq-gray cite{color:#6b7280}

@media (max-width: 600px) {
  .ps-twocol,.fx-twocol,.mg-twocol { grid-template-columns: 1fr; }
  .ps-tiers,.fx-tiers,.mg-tiers { flex-direction:column; grid-template-columns:1fr; }
  .mg-masthead,.mg-content { padding-left: 24px; padding-right: 24px; }
}

/* AUTH FIRST SCREEN */
.app-booting .auth-screen {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 10% 18%, rgba(72,149,239,0.14), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(244,162,89,0.16), transparent 26%),
    radial-gradient(circle at 54% 84%, rgba(82,183,136,0.09), transparent 24%),
    linear-gradient(160deg, #f9fbff 0%, #eef3fb 100%);
}

.auth-shell {
  width: min(500px, 100%);
}

.auth-stage {
  border-radius: 28px;
  border: 2px solid rgba(123, 143, 180, 0.16);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 28px 72px rgba(26, 26, 46, 0.14);
  overflow: hidden;
}

.auth-card {
  min-width: 0;
  padding: 26px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.96) 0%, rgba(248,251,255,0.96) 100%);
}

.auth-head {
  padding: 0 0 14px;
}

.auth-kicker {
  font: 500 10px 'DM Mono', monospace;
  color: #2563eb;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.auth-card-title {
  font-family: 'Caveat', cursive;
  font-size: 38px;
  line-height: .94;
  color: #1a1a2e;
}

.auth-card-sub {
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid #dbe8ff;
  border-radius: 999px;
  background: rgba(255,255,255,.84);
}

.auth-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 10px;
  background: transparent;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
}

.auth-tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.14);
}

.auth-panel {
  display: none;
  padding: 18px 0 0;
}

.auth-panel.active {
  display: block;
}

.auth-social-stack {
  display: grid;
  gap: 10px;
}

.auth-social-btn {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid #cfdcf2;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  color: #0f172a;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-social-btn:hover {
  transform: translateY(-1px);
  border-color: #a7c4e8;
  box-shadow: 0 12px 28px rgba(72,149,239,.12);
  background: #fff;
}

.auth-social-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f4a261, #4895ef);
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.auth-divider {
  position: relative;
  margin: 16px 0 14px;
  text-align: center;
}

.auth-divider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid #e2e8f0;
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: linear-gradient(165deg, rgba(255,255,255,0.96) 0%, rgba(248,251,255,0.96) 100%);
  font: 500 10px 'DM Mono', monospace;
  color: #94a3b8;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-field {
  margin-bottom: 11px;
}

.auth-field input {
  width: 100%;
  border: 1.5px solid #d7e2f2;
  border-radius: 14px;
  padding: 13px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  outline: none;
  background: rgba(255,255,255,0.96);
  color: #0f172a;
}

.auth-field input:focus {
  border-color: #4895ef;
  box-shadow: 0 0 0 4px rgba(72,149,239,0.12);
}

.auth-btn {
  width: 100%;
  border: 1px solid #111827;
  border-radius: 14px;
  padding: 13px;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #fff;
  background: #111827;
  box-shadow: 0 14px 30px rgba(17,24,39,0.16);
}

.auth-remember-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 12px 13px;
  border: 1.5px solid #d7e2f2;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,248,255,0.94));
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-remember-row:hover {
  border-color: #bfd3f2;
  box-shadow: 0 10px 20px rgba(72,149,239,0.08);
  transform: translateY(-1px);
}

.auth-remember-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 1px;
}

.auth-remember-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.auth-remember-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid #b8c7df;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-remember-control input:checked + .auth-remember-box {
  border-color: #5b7cfa;
  background: linear-gradient(180deg, #6d8cff, #5573eb);
  box-shadow: 0 6px 14px rgba(85, 115, 235, 0.28);
}

.auth-remember-control input:checked + .auth-remember-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-remember-control input:focus-visible + .auth-remember-box {
  outline: 2px solid rgba(85, 115, 235, 0.25);
  outline-offset: 3px;
}

.auth-remember-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-remember-title {
  color: #1e293b;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-remember-sub {
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.auth-note {
  margin-top: 10px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
}

@keyframes auth-rotate-border {
  100% {
    transform: rotate(1turn);
  }
}

.auth-marketplace-link {
  margin-top: 14px;
  width: 100%;
  position: relative;
  z-index: 0;
  overflow: hidden;
  text-decoration: none;
  border: none;
  border-radius: 20px 16px 22px 14px;
  background: transparent;
  color: #0f172a;
  padding: 14px 20px 14px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s;
}

.auth-marketplace-link:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 0 14px 32px rgba(26, 26, 46, 0.12);
}

.auth-marketplace-link::before {
  content: "";
  position: absolute;
  z-index: -2;
  left: -50%;
  top: -50%;
  width: 200%;
  height: 200%;
  background-image: conic-gradient(
    transparent,
    rgba(42, 157, 143, 0.9),
    transparent 30%
  );
  animation: auth-rotate-border 3s linear infinite;
}

.auth-marketplace-link:hover::before {
  background-image: conic-gradient(
    transparent,
    rgba(72, 149, 239, 1),
    transparent 30%
  );
  animation-duration: 1.4s;
}

.auth-marketplace-link::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px;
  border-radius: 18px 14px 20px 12px;
  background: linear-gradient(160deg, #f0fff8, #fff);
}

.auth-marketplace-link .start-btn-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-marketplace-link .start-btn-label {
  font:
    700 1.1rem 'Patrick Hand',
    cursive;
  color: #0f172a;
  line-height: 1;
}

.auth-marketplace-link .start-btn-sub {
  font:
    500 10px 'DM Mono',
    monospace;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.profile-sessions-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.profile-session-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.profile-session-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.profile-session-title {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
}

.profile-session-subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}

.profile-session-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  background: #eef2ff;
  color: #4338ca;
}

.profile-session-badge.current {
  background: #dcfce7;
  color: #166534;
}

.profile-session-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-session-meta-item {
  padding: 10px 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #edf2f7;
}

.profile-session-meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.profile-session-meta-value {
  margin-top: 4px;
  font-size: 11px;
  color: #1f2937;
  line-height: 1.45;
  word-break: break-word;
}

.profile-session-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.profile-session-btn {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid #f0b2b2;
  background: #fff6f6;
  color: #b42318;
  cursor: pointer;
  padding: 9px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.profile-session-btn:hover {
  border-color: #e48f8f;
  background: #ffecec;
}

.auth-status {
  min-height: 20px;
  padding: 12px 0 0;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
}

.auth-status.ok { color: #166534; }
.auth-status.err { color: #b91c1c; }

@media (max-width: 640px) {
  .auth-screen {
    padding: 12px;
  }

  .auth-card {
    padding: 22px 16px;
  }

  .auth-card-title {
    font-size: 34px;
  }
}

.auth-user-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.25);
  color: #d1ecff;
  min-width: 80px;
  text-align: center;
}

.logout-btn {
  height: 36px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  border-radius: 10px;
  border: 1px solid #121b32;
  background: #121b32;
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(18, 27, 50, 0.2);
}

.header-profile-avatar-btn {
  padding: 0 8px 0 4px;
  border-radius: 999px;
}

.header-profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e3a8a;
  border: 1px solid rgba(191, 219, 254, 0.85);
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.03em;
}

.logout-btn.notes-back-btn {
  height: 38px;
  padding: 0 12px;
  border: 2px solid #7b8fb4;
  border-radius: 14px 10px 13px 9px;
  background: #eef5ff;
  color: #24406f;
  box-shadow: 3px 3px 0 rgba(123, 143, 180, 0.2);
}

.logout-btn .btn-label {
  font-size: 12px;
  line-height: 1;
}

.logout-btn.notes-back-btn .btn-label {
  font-size: 12px;
}

.logout-btn:hover {
  background: #1f2b4d;
  border-color: #1f2b4d;
}

.logout-btn.notes-back-btn:hover {
  background: #e2edff;
  border-color: #6f86ae;
}

.notes-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background:
    radial-gradient(circle at 15% 18%, rgba(72,149,239,0.1), transparent 42%),
    radial-gradient(circle at 74% 68%, rgba(42,157,143,0.1), transparent 40%),
    linear-gradient(140deg, #f3f5f9 0%, #eef1f7 100%);
}

.notes-card {
  width: 100%;
  flex: 1;
  border-radius: 0;
  background: #f8f9fc;
  box-shadow: none;
  padding: 28px 36px;
}

.notes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.notes-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #111827;
  letter-spacing: -0.5px;
}

.notes-count {
  margin-top: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #9aa3b2;
}

.notes-new-btn {
  border: none;
  border-radius: 999px;
  background: #121b32;
  color: #fff;
  padding: 10px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(18, 27, 50, 0.25);
}

.notes-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notes-search-wrap {
  margin-bottom: 16px;
}

.notes-search {
  width: 100%;
  border: 2px solid #7b8fb4;
  border-radius: 18px 14px 16px 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.8)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 29px,
      rgba(59, 130, 246, 0.08) 29px,
      rgba(59, 130, 246, 0.08) 31px
    ),
    #eef5ff;
  padding: 12px 14px;
  box-shadow:
    0 6px 14px rgba(20, 29, 49, 0.06),
    3px 4px 0 rgba(123, 143, 180, 0.18);
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 18px;
  line-height: 1.2;
  color: #1f2937;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  transform: rotate(-0.2deg);
}

.notes-search:focus {
  border-color: #5f7fac;
  box-shadow:
    0 8px 18px rgba(20, 29, 49, 0.08),
    3px 4px 0 rgba(95, 127, 172, 0.22);
}

.notes-search::placeholder {
  color: #7b8798;
  font-family: 'Patrick Hand', 'DM Mono', monospace;
}

.notes-filter-wrap {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notes-filter-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #dbe1ec;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all 150ms ease;
  max-width: 120px;
}

.notes-filter-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.notes-filter-btn.active {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #3730a3;
}

.profile-messages-filter-wrap > .notes-filter-btn {
  flex: 1 1 0;
}

.notes-refresh-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ai-provider-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.ai-provider-card {
  border: 1px solid #e2e8f0;
  background: #f8fbff;
}

.ai-provider-add-card {
  background: #fff;
  border: 2px dashed #e2e8f0;
  cursor: pointer;
  min-height: 120px;
  transition: border-color 0.15s, background 0.15s;
}

.ai-provider-add-card:hover {
  border-color: #4895ef;
  background: #f0f7ff;
  color: #4895ef;
}

.ai-provider-add-card:hover span {
  color: #4895ef;
}

.ai-provider-card.is-default {
  border-color: #4895ef;
  box-shadow: 0 8px 20px rgba(72, 149, 239, 0.15);
}

.ai-provider-card.is-active {
  border-color: #2a9d8f;
}

.ai-provider-default-btn {
  color: #94a3b8;
}

.ai-provider-default-btn:hover {
  color: #64748b;
}

.ai-provider-default-btn.is-default,
.ai-provider-default-btn.is-default:hover {
  color: #f59e0b;
  border-color: #fcd34d;
  background: #fff7d1;
}

.ai-provider-card-meta {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: #556;
  margin-top: 6px;
}

.ai-provider-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ai-provider-endpoint-ellipsis {
  display: inline-block;
  max-width: 185px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.ai-provider-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #0f3d66;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.ai-prompt-card-meta {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: #556;
  margin-top: 6px;
}

.ai-prompt-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  min-height: 30px;
}

.ai-prompt-editor-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dbe1ec;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  padding: 16px;
  min-height: 320px;
}

.ai-prompt-editor-textarea {
  min-height: 260px;
  resize: vertical;
  font-family: 'DM Mono', monospace;
  line-height: 1.45;
}

.ai-runs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-run-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.ai-run-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-run-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-run-card-flow {
  font-weight: 600;
  color: #1e293b;
  font-size: 13px;
}

.ai-run-card-time {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
}

.ai-run-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.ai-run-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #475569;
  font-size: 11px;
}

.ai-run-card-meta-item {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ai-run-card-meta-label {
  color: #94a3b8;
}

.ai-run-card-error {
  color: #dc2626;
  font-size: 11px;
  word-break: break-word;
}

.ai-run-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-run-card-cost {
  color: #334155;
  font-size: 11px;
}

.ai-flow-chart {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-wrap: nowrap;
  margin: 4px 0;
  overflow-x: auto;
}
.ai-flow-chart-node {
  flex: 1;
  min-width: 90px;
  border: 1.5px dashed #c7d2de;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  font-family: 'DM Mono', monospace;
}
.ai-flow-chart-node-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ai-flow-chart-node-value {
  font-size: 12px;
  color: #334155;
  white-space: pre-line;
  word-break: break-all;
}
.ai-flow-chart-arrow {
  display: flex;
  align-items: center;
  color: #94a3b8;
  font-size: 16px;
  padding: 0 2px;
  flex-shrink: 0;
  align-self: center;
}

.notes-status {
  min-height: 18px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  margin-bottom: 10px;
  color: #637083;
}

.notes-earnings-card {
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(20, 29, 49, 0.05);
}

.notes-earnings-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.notes-earnings-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.notes-earnings-help {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

.notes-section {
  margin-bottom: 14px;
}

.notes-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.notes-content {
  min-width: 0;
}

.notes-section-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #a3adbc;
  margin-bottom: 8px;
}

.notes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.note-item {
  position: relative;
  border: 2px solid #7b8fb4;
  border-radius: 22px 16px 20px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,255,255,0.74)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 31px,
      rgba(59, 130, 246, 0.08) 31px,
      rgba(59, 130, 246, 0.08) 33px
    ),
    #eef5ff;
  padding: 14px;
  box-shadow:
    0 8px 20px rgba(20, 29, 49, 0.08),
    4px 5px 0 rgba(123, 143, 180, 0.18);
  cursor: pointer;
  transition: all 0.16s;
  min-height: 210px;
  height: 210px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transform: rotate(-0.35deg);
}

.note-item::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 2px dashed rgba(59, 130, 246, 0.16);
  border-radius: 16px 12px 15px 13px;
  pointer-events: none;
}

.note-item.card-blue { background: linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,255,255,0.74)), repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(59, 130, 246, 0.08) 31px, rgba(59, 130, 246, 0.08) 33px), #eef5ff; border-color: #7b8fb4; box-shadow: 0 8px 20px rgba(20, 29, 49, 0.08), 4px 5px 0 rgba(123, 143, 180, 0.18); }
.note-item.card-green { background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)), repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(34, 197, 94, 0.08) 31px, rgba(34, 197, 94, 0.08) 33px), #edf9f1; border-color: #7fb28f; box-shadow: 0 8px 20px rgba(20, 29, 49, 0.08), 4px 5px 0 rgba(127, 178, 143, 0.18); }
.note-item.card-orange { background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)), repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(249, 115, 22, 0.08) 31px, rgba(249, 115, 22, 0.08) 33px), #fff4ea; border-color: #d9a16d; box-shadow: 0 8px 20px rgba(20, 29, 49, 0.08), 4px 5px 0 rgba(217, 161, 109, 0.18); }
.note-item.card-purple { background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)), repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(139, 92, 246, 0.08) 31px, rgba(139, 92, 246, 0.08) 33px), #f5f0ff; border-color: #a18ac8; box-shadow: 0 8px 20px rgba(20, 29, 49, 0.08), 4px 5px 0 rgba(161, 138, 200, 0.18); }
.note-item.card-red { background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)), repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(239, 68, 68, 0.08) 31px, rgba(239, 68, 68, 0.08) 33px), #fff0f0; border-color: #d29a9a; box-shadow: 0 8px 20px rgba(20, 29, 49, 0.08), 4px 5px 0 rgba(210, 154, 154, 0.18); }

.note-item:hover {
  transform: rotate(-0.35deg) translateY(-1px);
  box-shadow:
    0 10px 24px rgba(20, 29, 49, 0.13),
    5px 6px 0 rgba(123, 143, 180, 0.22);
}

.note-item:has(.note-card-actions:hover),
.note-item:has(.note-card-actions:focus-within) {
  transform: rotate(-0.35deg);
  box-shadow:
    0 8px 20px rgba(20, 29, 49, 0.08),
    4px 5px 0 rgba(123, 143, 180, 0.18);
}

.note-item.pinned {
  background: #eef5ff;
}

.note-item.other {
  background: #eef5ff;
  border-color: #bed7ff;
}

.note-item.card-blue,
.note-item.other.card-blue,
.note-item.pinned.card-blue {
  background: #eef5ff;
  border-color: #bed7ff;
  --folder-border-color: #bed7ff;
}

.note-item.card-green,
.note-item.other.card-green,
.note-item.pinned.card-green {
  background: #edf9f1;
  border-color: #b6e6c4;
  --folder-border-color: #b6e6c4;
}

.note-item.card-orange,
.note-item.other.card-orange,
.note-item.pinned.card-orange {
  background: #fff4ea;
  border-color: #ffd7b0;
  --folder-border-color: #ffd7b0;
}

.note-item.card-purple,
.note-item.other.card-purple,
.note-item.pinned.card-purple {
  background: #f5f0ff;
  border-color: #d7c7ff;
  --folder-border-color: #d7c7ff;
}

.note-item.card-red,
.note-item.other.card-red,
.note-item.pinned.card-red {
  background: #fff0f0;
  border-color: #ffc4c4;
  --folder-border-color: #ffc4c4;
}

.note-card-top {
  display: block;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.note-item-title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.note-item-desc {
  position: relative;
  z-index: 1;
  font-family: 'Patrick Hand', sans-serif;
  font-size: 16px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 14px;
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  flex: 1;
  visibility: hidden;
}

.note-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.note-item-meta {
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 11px;
  color: #9aa3b2;
}

.note-visibility-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}

.note-visibility-badge.icon-only,
.note-payment-badge.icon-only {
  min-width: 28px;
  padding: 3px 7px;
  gap: 0;
}

.note-visibility-badge.public {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.note-visibility-badge.private {
  background: rgba(71, 85, 105, 0.14);
  color: #334155;
}

.note-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}

.note-price-badge.paid {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.note-price-badge.draft-status-creating {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.note-price-badge.draft-status-ready {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.note-price-badge.draft-status-failed {
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.note-payment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}

.note-payment-badge.free {
  background: rgba(16, 185, 129, 0.14);
  color: #166534;
}

.note-payment-badge.locked {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.note-payment-badge.unlocked {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.note-payment-badge.owned {
  background: rgba(99, 102, 241, 0.16);
  color: #3730a3;
}

.note-earnings-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.14);
  color: #166534;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}

.credits-dashboard {
  margin-top: 16px;
}

.credits-hidden-metrics {
  display: none;
}

.credit-wallet-card {
  transform: rotate(0.35deg);
}

.credit-balance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.credit-balance-row .profile-hero-name {
  margin-top: 0;
}

.credit-role-badge {
  margin-top: 2px;
  transform: rotate(-1.2deg);
}

.credit-motivation-note {
  margin-top: 6px;
  font-family: 'Patrick Hand', sans-serif;
  font-size: 15px;
  color: #64748b;
  transform: rotate(-0.6deg);
}

.credit-motivation-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.credit-pricing-cta {
  position: relative;
  isolation: isolate;
  border: 2px solid #bed7ff;
  font-size: 16px;
  font-weight: 700;
}


.credit-pricing-cta:hover {
  transform: translateY(-1px);
  border-color: #60a5fa;
  box-shadow:
    0 10px 22px rgba(18, 27, 50, 0.28),
    5px 6px 0 rgba(59, 130, 246, 0.28);
}

.credit-uses-card {
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.credit-uses-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.credit-uses-grid .profile-mini-stat {
  position: relative;
  min-height: 132px;
  border: 2px solid #7b8fb4;
  border-radius: 22px 16px 20px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,255,255,0.74)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 31px,
      rgba(59, 130, 246, 0.08) 31px,
      rgba(59, 130, 246, 0.08) 33px
    ),
    #eef5ff;
  box-shadow:
    0 8px 20px rgba(20, 29, 49, 0.08),
    4px 5px 0 rgba(123, 143, 180, 0.18);
  transform: rotate(-0.25deg);
  overflow: visible;
}

.credit-uses-grid .profile-mini-stat::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 2px dashed rgba(59, 130, 246, 0.16);
  border-radius: 16px 12px 15px 13px;
  pointer-events: none;
}

.credit-uses-grid .profile-mini-stat:nth-child(1) {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,255,255,0.74)),
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(59, 130, 246, 0.08) 31px, rgba(59, 130, 246, 0.08) 33px),
    #eef5ff;
}

.credit-uses-grid .profile-mini-stat:nth-child(2) {
  border-color: #7fb28f;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)),
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(34, 197, 94, 0.08) 31px, rgba(34, 197, 94, 0.08) 33px),
    #edf9f1;
  box-shadow:
    0 8px 20px rgba(20, 29, 49, 0.08),
    4px 5px 0 rgba(127, 178, 143, 0.18);
  transform: rotate(0.22deg);
}

.credit-uses-grid .profile-mini-stat:nth-child(2)::after {
  border-color: rgba(34, 197, 94, 0.16);
}

.credit-uses-grid .profile-mini-stat:nth-child(3) {
  border-color: #d9a16d;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.76)),
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(249, 115, 22, 0.08) 31px, rgba(249, 115, 22, 0.08) 33px),
    #fff4ea;
  box-shadow:
    0 8px 20px rgba(20, 29, 49, 0.08),
    4px 5px 0 rgba(217, 161, 109, 0.18);
  transform: rotate(-0.12deg);
}

.credit-uses-grid .profile-mini-stat:nth-child(3)::after {
  border-color: rgba(249, 115, 22, 0.16);
}

.credit-uses-grid .profile-mini-stat-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-family: 'Patrick Hand', 'DM Mono', monospace;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.credit-uses-grid .profile-mini-stat-help {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.credit-use-emoji {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px 8px 9px 7px;
  background: #fff;
  border: 1px solid rgba(123, 143, 180, 0.32);
  box-shadow: 2px 2px 0 rgba(190, 215, 255, 0.7);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  line-height: 1;
}

.credit-transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.credit-transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.credit-transaction-main {
  min-width: 0;
}

.credit-transaction-title {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.credit-transaction-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

.credit-transaction-amount {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.credit-transaction-amount.positive {
  color: #15803d;
}

.credit-transaction-amount.negative {
  color: #b91c1c;
}

.note-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.note-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #dbe1ec;
  background: #f9fbff;
  cursor: pointer;
  color: #607089;
  font-size: 12px;
}

.note-action-btn:hover {
  border-color: #9fb0cb;
}

.note-action-btn.delete:hover {
  border-color: #ef9a9a;
  color: #b91c1c;
}

.note-color-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 7px;
  border: 1px solid #dbe1ec;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(20, 29, 49, 0.12);
  backdrop-filter: blur(8px);
  z-index: 5;
  transform: translateX(-50%);
}

.note-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.note-color-swatch:hover {
  transform: scale(1.08);
}

.note-color-swatch.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.note-color-swatch.blue { background: #bed7ff; }
.note-color-swatch.green { background: #b6e6c4; }
.note-color-swatch.orange { background: #ffd7b0; }
.note-color-swatch.purple { background: #d7c7ff; }
.note-color-swatch.red { background: #ffc4c4; }

.note-color-action-wrap {
  position: relative;
  display: inline-flex;
}

.note-detail-view {
  display: none;
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 29, 49, 0.08);
  padding: 14px;
  min-height: calc(100vh - 170px);
}

.notes-card.detail-open .notes-main {
  display: none;
}

.notes-card.detail-open .notes-search-wrap {
  display: none;
}

.notes-card.detail-open .notes-count {
  display: none;
}

.notes-card.detail-open .notes-title {
  display: none;
}

.notes-card.detail-open .notes-top-actions {
  display: none;
}

#notes-detail-title {
  display: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.3px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

.notes-card.detail-open #notes-detail-title {
  display: block;
}

.notes-card.detail-open .note-detail-view {
  display: flex;
  flex-direction: column;
}

.note-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.note-detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.note-settings-title {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #0f172a;
}

.note-settings-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.note-settings-tab {
  border: 1px solid #dbe1ec;
  border-radius: 999px;
  background: #f8fbff;
  color: #64748b;
  padding: 7px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.note-settings-tab.active {
  background: #121b32;
  border-color: #121b32;
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 27, 50, 0.18);
}

.note-detail-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.note-settings-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #dbe1ec;
  background: #f9fbff;
  cursor: pointer;
}

.note-settings-field {
  margin-bottom: 10px;
}

.note-settings-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  display: block;
}

.note-settings-input,
.note-settings-select {
  width: 100%;
  border: 1px solid #dbe1ec;
  border-radius: 9px;
  padding: 9px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #0f172a;
  background: #fff;
}

.note-settings-text {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #0f172a;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.note-settings-btn {
  border: 1px solid #121b32;
  border-radius: 9px;
  background: #121b32;
  color: #fff;
  padding: 8px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
}

.note-settings-btn.secondary {
  background: #fff;
  color: #0f172a;
  border-color: #dbe1ec;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.note-settings-btn.copy-flash-ok {
  background: #edf9f1;
  border-color: #b6e6c4;
  color: #166534;
}

.note-settings-btn.copy-flash-err {
  background: #fff0f0;
  border-color: #ffc4c4;
  color: #b91c1c;
}

.note-settings-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.note-settings-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.note-settings-panel-section {
  display: none;
}

.note-settings-panel-section.active {
  display: block;
}

.note-tags-wrap {
  display: grid;
  gap: 8px;
}

.note-tag-group {
  display: grid;
  gap: 6px;
}

.note-tag-group-label {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.note-tag-group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-tag-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe1ec;
  border-radius: 999px;
  background: #f8fbff;
  color: #334155;
  font-size: 11px;
  padding: 3px 9px;
}

.note-settings-tag-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.note-settings-tag-status {
  font-size: 11px;
  color: #64748b;
}

@media (max-width: 700px) {
  .profile-hero-stats,
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .profile-dashboard {
    grid-template-columns: 1fr;
  }

  .profile-hero-card,
  .profile-info-card,
  .profile-stat-card {
    border-radius: 20px;
  }

  .profile-hero-card {
    padding: 22px 18px;
    transform: rotate(0deg);
  }

  .profile-info-card {
    padding: 22px 18px;
    transform: rotate(0deg);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0.78)),
      repeating-linear-gradient(
        180deg,
        transparent 0,
        transparent 35px,
        rgba(148, 163, 184, 0.08) 35px,
        rgba(148, 163, 184, 0.08) 37px
      ),
      #ffffff;
    border: 2px solid #c7cedb;
    box-shadow:
      0 10px 24px rgba(20, 29, 49, 0.08),
      4px 5px 0 rgba(199, 206, 219, 0.28);
  }

  .profile-hero-top {
    align-items: flex-start;
    gap: 14px;
  }

  .profile-hero-name {
    font-size: 30px;
  }

  .profile-kicker {
    font-size: 12px;
    padding: 4px 10px 3px;
  }

  .profile-badge {
    font-size: 12px;
    transform: none !important;
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 22px 16px 20px 14px;
    font-size: 24px;
  }

  .profile-detail-value {
    font-size: 16px;
  }

  .profile-info-title {
    font-size: 24px;
  }

  .profile-mini-stat-value {
    font-size: 24px;
  }

  .credit-wallet-card {
    padding: 20px 16px;
    transform: rotate(0deg);
  }

  .credit-uses-grid {
    grid-template-columns: 1fr;
  }

  .notes-screen {
    padding: 0;
  }

  .notes-card {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }

  .notes-title {
    font-size: 30px;
  }

  .notes-header {
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .notes-main { grid-template-columns: 1fr; }

  .note-detail-view {
    min-height: auto;
    overflow-x: hidden;
  }

  .note-settings-body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .note-detail-head-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .note-detail-head-meta {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    order: 1;
  }

  .note-settings-tabs {
    width: 100%;
    order: 2;
  }

  .note-settings-tab {
    flex: 1;
    text-align: center;
  }

  #private-access-form {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
  }

  #private-access-form > *,
  #private-access-form .picker-dropdown,
  #private-access-form .picker-trigger {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  #private-access-list {
    overflow-x: auto;
  }

  #notes-detail-title {
    max-width: 100%;
    font-size: 18px;
  }

  .ai-run-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .ai-run-card-top,
  .ai-run-card-meta,
  .ai-run-card-footer,
  .ai-run-card-meta-item {
    min-width: 0;
  }

  .ai-run-card-flow,
  .ai-run-card-time,
  .ai-run-card-meta-item {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ai-run-card-time {
    white-space: normal;
  }
}

