:root {
  --bg-paper: #FFF6F8;
  --bg-dot: #F7DCE3;
  --surface-white: #FFFFFF;
  --surface-cream: #FFFBFD;
  --surface-mint: #EBF9F5;
  --surface-butter: #FFF9E6;
  --ink-black: #1F1A1C;
  --ink-muted: #66585E;
  --ribbon-crimson: #E31C58;
  --ribbon-crimson-hover: #C81349;
  --ribbon-soft: #FFE4EC;
  --marigold-gold: #FFB800;
  --marigold-soft: #FFF2C6;
  --mint-emerald: #12B886;
  --border-ink: 2.5px solid #1F1A1C;
  --shadow-lg: 6px 6px 0px #1F1A1C;
  --shadow-md: 4px 4px 0px #1F1A1C;
  --shadow-sm: 2.5px 2.5px 0px #1F1A1C;
  --font-display: 'Fredoka', 'Plus Jakarta Sans', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-paper);
  background-image: radial-gradient(var(--bg-dot) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--ink-black);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  padding: 20px 18px 44px;
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==================== Masthead ==================== */
.masthead {
  background: var(--surface-white);
  border: var(--border-ink);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bow-emblem {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ribbon-soft);
  border: var(--border-ink);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-black);
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.network-wallet-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-mint);
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint-emerald);
  box-shadow: 0 0 0 3px rgba(18, 184, 134, 0.25);
}

.chain-block-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface-white);
  border: 1.5px solid var(--ink-black);
  border-radius: 999px;
  padding: 2px 8px;
}

.wallet-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-butter);
  border: 2px solid var(--ink-black);
  border-radius: 14px;
  padding: 6px 10px 6px 12px;
}

.signer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.signer-mode-tag {
  background: var(--marigold-gold);
  border: 1.5px solid var(--ink-black);
  border-radius: 8px;
  padding: 2px 8px;
  font-weight: 700;
  font-size: 0.76rem;
}

.signer-address {
  font-family: var(--font-mono);
  font-weight: 600;
}

.signer-balance {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: 0.78rem;
}

/* ==================== Contract Strip ==================== */
.contract-strip {
  background: var(--surface-white);
  border: var(--border-ink);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
}

.contract-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-key {
  font-weight: 700;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.mono-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ribbon-crimson);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.verified-chip {
  background: var(--surface-mint);
  color: #097A58;
  border: 1.5px solid var(--ink-black);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.75rem;
  font-weight: 700;
}

.greeting-live-text {
  font-weight: 600;
  color: var(--ink-black);
  background: var(--ribbon-soft);
  border: 1.5px solid var(--ink-black);
  border-radius: 8px;
  padding: 2px 10px;
}

/* ==================== Main Studio Grid ==================== */
.studio-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 980px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== Left: Pocket Console ==================== */
.pocket-console {
  background: var(--surface-white);
  border: var(--border-ink);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.console-top-bezel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.console-token-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-id-badge {
  background: var(--ribbon-crimson);
  color: #FFFFFF;
  border: 2px solid var(--ink-black);
  border-radius: 12px;
  padding: 4px 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 2px 2px 0 var(--ink-black);
}

.active-kitty-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

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

.chip-toggle-btn {
  background: var(--surface-cream);
  border: 2px solid var(--ink-black);
  border-radius: 10px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink-black);
  transition: transform 0.1s ease;
}

.chip-toggle-btn:hover {
  background: var(--ribbon-soft);
}

.chip-toggle-btn:active {
  transform: translate(1.5px, 1.5px);
}

/* LCD / SVG Viewport */
.lcd-viewport {
  background: linear-gradient(180deg, #FFF5F8 0%, #FFFFFF 100%);
  border: 3px solid var(--ink-black);
  border-radius: 24px;
  padding: 18px;
  min-height: 375px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 4px 0 rgba(255, 182, 193, 0.28);
  overflow: hidden;
}

.lcd-corner-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--surface-white);
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  padding: 4px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  z-index: 2;
}

.color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-black);
  display: inline-block;
}

.lcd-level-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--marigold-gold);
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  padding: 4px 13px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 2px 2px 0 var(--ink-black);
  z-index: 2;
}

.svg-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.svg-stage svg {
  max-width: 310px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(31, 26, 28, 0.08));
}

.svg-stage.pet-bounce {
  transform: translateY(-10px) scale(1.03);
}

.pet-speech-bubble {
  position: absolute;
  bottom: 14px;
  background: var(--ink-black);
  color: var(--surface-white);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  z-index: 3;
}

.hidden {
  display: none !important;
}

/* URI Inspector */
.uri-inspector {
  background: #1F1A1C;
  color: #FCE7F3;
  border: 2px solid var(--ink-black);
  border-radius: 16px;
  padding: 12px 14px;
}

.uri-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.close-inline-btn {
  background: #3B3035;
  color: #FFFFFF;
  border: 1px solid #6E5A63;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.76rem;
}

.uri-code-box {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.45;
}

/* Vitals & Gauges */
.vitals-panel {
  background: var(--surface-cream);
  border: 2px solid var(--ink-black);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gauge-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.gauge-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 5px;
}

.gauge-track {
  height: 14px;
  background: #FFFFFF;
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  transition: width 0.35s ease;
}

.fill-crimson {
  background: var(--ribbon-crimson);
}

.fill-mint {
  background: var(--mint-emerald);
}

.kitty-attribute-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.attr-pill {
  background: var(--surface-white);
  border: 1.5px solid var(--ink-black);
  border-radius: 12px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attr-name {
  font-size: 0.73rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.attr-pill strong {
  font-size: 0.83rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Physical Console Buttons */
.console-hardware-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.console-push-btn {
  border: var(--border-ink);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  text-align: left;
  font-family: var(--font-body);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.console-push-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink-black);
}

.console-push-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-crimson {
  background: var(--ribbon-crimson);
  color: #FFFFFF;
}

.btn-gold {
  background: var(--marigold-gold);
  color: var(--ink-black);
}

.btn-icon {
  font-size: 1.55rem;
}

.btn-text {
  display: flex;
  flex-direction: column;
}

.btn-text strong {
  font-size: 0.94rem;
}

.btn-text small {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Roster Selector */
.roster-bar {
  border-top: 2px dashed #E5CED5;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
}

.roster-header small {
  color: var(--ink-muted);
  font-weight: 500;
}

.roster-list {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.roster-chip {
  background: var(--surface-cream);
  border: 2px solid var(--ink-black);
  border-radius: 12px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  box-shadow: 2px 2px 0 var(--ink-black);
}

.roster-chip.active {
  background: var(--ribbon-soft);
  border-color: var(--ink-black);
}

/* ==================== Right: Care Workbook ==================== */
.care-workbook {
  display: flex;
  flex-direction: column;
}

.folder-tabs {
  display: flex;
  gap: 8px;
  padding-left: 10px;
  flex-wrap: wrap;
}

.folder-tab {
  background: #FCE3EB;
  border: var(--border-ink);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}

.folder-tab.active {
  background: var(--surface-white);
  color: var(--ink-black);
  transform: translateY(2.5px);
  z-index: 2;
}

.workbook-sheet {
  background: var(--surface-white);
  border: var(--border-ink);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  min-height: 540px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.tab-pane.active {
  display: flex;
}

.sheet-heading h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.sheet-heading p {
  font-size: 0.86rem;
  color: var(--ink-muted);
}

/* Food Grid */
.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 580px) {
  .food-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.food-card {
  background: var(--surface-cream);
  border: 2px solid var(--ink-black);
  border-radius: 14px;
  padding: 11px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  box-shadow: 2.5px 2.5px 0 var(--ink-black);
}

.food-card.selected {
  background: var(--ribbon-soft);
  outline: 2px solid var(--ribbon-crimson);
}

.food-emoji {
  font-size: 1.4rem;
}

.food-card strong {
  font-size: 0.85rem;
}

.food-card small {
  font-size: 0.73rem;
  color: var(--ink-muted);
}

/* Forms & Inputs */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 700;
}

.inline-input-row {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  background: var(--surface-cream);
  border: 2px solid var(--ink-black);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-black);
}

input[type="text"]:focus {
  outline: 2px solid var(--ribbon-crimson);
  background: #FFFFFF;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-gold-action,
.btn-outline-sm,
.btn-ghost-sm {
  font-family: var(--font-body);
  font-weight: 700;
  border: 2px solid var(--ink-black);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn-primary {
  background: var(--ribbon-crimson);
  color: #FFFFFF;
  padding: 10px 18px;
  box-shadow: 3px 3px 0 var(--ink-black);
  font-size: 0.9rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--ribbon-crimson-hover);
}

.btn-secondary {
  background: var(--surface-mint);
  color: var(--ink-black);
  padding: 10px 16px;
  box-shadow: 3px 3px 0 var(--ink-black);
  font-size: 0.9rem;
}

.btn-gold-action {
  background: var(--marigold-gold);
  color: var(--ink-black);
  padding: 10px 16px;
  box-shadow: 3px 3px 0 var(--ink-black);
  font-size: 0.88rem;
  white-space: nowrap;
}

.btn-full {
  width: 100%;
  padding: 13px;
  font-size: 0.96rem;
}

.btn-outline-sm {
  background: #FFFFFF;
  padding: 5px 11px;
  font-size: 0.78rem;
  box-shadow: 2px 2px 0 var(--ink-black);
}

.btn-ghost-sm {
  background: var(--surface-cream);
  padding: 5px 11px;
  font-size: 0.78rem;
  box-shadow: 2px 2px 0 var(--ink-black);
}

.play-callout {
  background: var(--marigold-soft);
  border: 2px solid var(--ink-black);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.play-callout p {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Swatches & Presets */
.swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  background: var(--surface-white);
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  padding: 5px 11px 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
}

.color-swatch::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sw);
  border: 1.5px solid var(--ink-black);
}

.color-swatch.active {
  background: var(--ribbon-soft);
  box-shadow: 2px 2px 0 var(--ink-black);
}

.color-picker-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  width: 44px;
  height: 40px;
  border: 2px solid var(--ink-black);
  border-radius: 10px;
  background: #FFFFFF;
  cursor: pointer;
}

.preset-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.preset-chip {
  background: var(--surface-cream);
  border: 1.5px solid var(--ink-black);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.preset-chip:hover {
  background: var(--ribbon-soft);
}

.sheet-divider {
  border: none;
  border-top: 2px dashed #EAD2D9;
}

/* Greeting Card */
.greeting-card {
  background: var(--surface-cream);
  border: 2px solid var(--ink-black);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.greeting-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ribbon-crimson);
  margin-top: 4px;
}

.greeting-submeta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.mono-text {
  font-family: var(--font-mono);
}

/* ==================== Bottom Transaction Log ==================== */
.tx-log-section {
  background: var(--surface-white);
  border: var(--border-ink);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tx-log-header h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.tx-log-header p {
  font-size: 0.81rem;
  color: var(--ink-muted);
}

.tx-status-indicator {
  background: var(--surface-mint);
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.8rem;
  font-weight: 700;
}

.tx-status-indicator.pending {
  background: var(--marigold-gold);
}

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

.tx-row {
  background: var(--surface-cream);
  border: 1.5px solid var(--ink-black);
  border-radius: 12px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.83rem;
}

.tx-method-badge {
  background: var(--ribbon-soft);
  border: 1.5px solid var(--ink-black);
  border-radius: 8px;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.77rem;
}

.tx-summary {
  flex: 1;
  font-weight: 600;
}

.tx-meta-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
