/* jhorn-mobile skin. Loaded AFTER /static/floor.css (the frontend floor,
   copied verbatim from ~/.claude/lib/frontend_floor/floor.css). This file only
   sets the palette (jhornlaw-os dark) and the phone layout: touch-sized
   targets, 16px gutters. The app is dark in both OS schemes on purpose. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-app:        #06070a;
  --bg-panel:      #0e1116;
  --bg-panel-soft: #12151c;
  --bg-inset:      #181c25;

  --text-primary:   #f2efe6;
  --text-secondary: #b8b2a4;
  --text-muted:     #9a968a;
  --text-on-accent: #111111;

  --border:        #232833;
  --border-strong: #3a4150;

  --accent:      #d5a84f;
  --accent-soft: rgba(213, 168, 79, 0.14);
  --accent-bright: #e6c37a;
  --success:     #5bc47b;
  --warning:     #e0a33a;
  --danger:      #ff8078;
  --focus-ring:  #e6c37a;

  --badge-neutral-bg: #1c212b;  --badge-neutral-fg: #a9a498;
  --badge-success-bg: #12301f;  --badge-success-fg: #5dc57c;
  --badge-warning-bg: #332411;  --badge-warning-fg: #e0a43c;
  --badge-danger-bg:  #3a1a17;  --badge-danger-fg:  #ff827a;
  --badge-info-bg:    #2b2415;  --badge-info-fg:    #e6c37a;

  --gutter: 16px;
  --hit-min: 48px;   /* touch, not mouse */
}

/* the hidden attribute must win over any display rule below */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-size: 1.0625rem;  /* 17px reads better on a phone */
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

.bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: env(safe-area-inset-top) var(--space-3) 0 var(--space-3);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.bar h1 {
  flex: 1; margin: 0; padding-left: var(--space-3);
  font-size: var(--text-lg); color: var(--accent-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.icon-btn {
  min-width: var(--hit-min); padding: 0 var(--space-3);
  background: none; border: 0; font-size: var(--text-xl); color: var(--accent);
}
.icon-btn.text { font-size: var(--text-base); font-weight: var(--weight-bold); }
.icon-btn:hover { background: none; }

.btn {
  display: block; width: 100%;
  padding: var(--space-4) var(--gutter);
  border-radius: var(--radius-md); border: 1px solid var(--accent);
  background: var(--accent); color: var(--text-on-accent);
  font-weight: var(--weight-bold);
}
.btn:hover { background: var(--accent-bright); }
.btn.secondary { background: transparent; color: var(--accent-bright); }
.btn + .btn { margin-top: var(--space-4); }

main { flex: 1; overflow-y: auto; padding: var(--gutter); }
main.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }

.card {
  display: block; width: 100%; text-align: left;
  min-height: 64px; height: auto;
  background: var(--bg-panel-soft); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--gutter); margin-bottom: var(--space-4);
}
.card h2 { margin: 0 0 var(--space-2); font-size: var(--text-xl); color: var(--accent-bright); }
.card .sub { color: var(--text-secondary); font-size: var(--text-base); }
.card .meta { color: var(--text-muted); font-size: var(--text-sm); margin-top: var(--space-2); }

label { display: block; color: var(--text-secondary); margin: var(--space-5) 0 var(--space-2); }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  min-height: var(--hit-min);
  font-size: var(--text-lg);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-panel-soft);
  border-radius: var(--radius-md);
}
.err { color: var(--danger); margin: var(--space-4) 0; }
.note { color: var(--text-muted); font-size: var(--text-sm); margin: var(--space-4) 0; }

.msgs {
  flex: 1; overflow-y: auto; padding: var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.bubble { max-width: 86%; padding: var(--space-3) var(--space-5); border-radius: var(--radius-lg); }
.bubble p { margin: 0 0 var(--space-3); }
.bubble p:last-child, .bubble ul:last-child { margin-bottom: 0; }
.bubble ul { margin: 0 0 var(--space-3); padding-left: var(--space-6); }
.bubble a { color: var(--accent-bright); }
.bubble.j {
  align-self: flex-end; white-space: pre-wrap;
  background: #2a2416; border: 1px solid #4a3d20; border-bottom-right-radius: var(--space-2);
}
.bubble.persona {
  align-self: flex-start;
  background: var(--bg-panel-soft); border: 1px solid var(--border); border-bottom-left-radius: var(--space-2);
}
.bubble.working { color: var(--text-secondary); font-style: italic; }
.bubble.failed { border-color: var(--danger); }
.bubble.failed .why { color: var(--danger); margin-bottom: var(--space-3); }
.bubble .retry { border-color: var(--danger); background: transparent; }

.composer {
  display: flex; gap: var(--space-3); align-items: flex-end;
  padding: var(--space-4) var(--gutter) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: var(--bg-panel); border-top: 1px solid var(--border);
}
.composer textarea { flex: 1; max-height: 40vh; resize: none; line-height: 1.35; }
.composer .send {
  min-width: 72px; border: 0; border-radius: var(--radius-md);
  background: var(--accent); color: var(--text-on-accent); font-weight: var(--weight-bold);
}
.composer .send:hover { background: var(--accent-bright); }

.tabs {
  display: flex; background: var(--bg-panel); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; min-height: 56px; border: 0; border-radius: 0;
  background: none; color: var(--text-muted); font-size: var(--text-sm);
}
.tab:hover { background: none; }
.tab.active { color: var(--accent-bright); font-weight: var(--weight-bold); }

.pre { white-space: pre-wrap; margin-top: var(--space-3); }

/* status line: the terminal status line, per thread */
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.statusline {
  display: block; width: 100%; height: auto; text-align: left;
  min-height: 36px; padding: var(--space-2) var(--gutter);
  background: var(--bg-inset); color: var(--text-secondary);
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  font-size: 0.8125rem; font-weight: normal; line-height: 1.4;
  white-space: normal; overflow-wrap: anywhere;
}
.statusline:hover { background: var(--bg-inset); }
.statussheet {
  padding: var(--space-3) var(--gutter);
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.statussheet .srow { display: flex; gap: var(--space-3); padding: 2px 0; }
.statussheet .k { flex: 0 0 96px; color: var(--text-muted); }
.statussheet .v { flex: 1; color: var(--text-primary); overflow-wrap: anywhere; }
.statussheet .note { margin: var(--space-3) 0 0; }
.today { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-4); }
