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

:root {
  --bg: #111318;
  --surface: #1a1e27;
  --surface2: #22283a;
  --border: #2e3448;
  --accent: #7b8cde;
  --accent2: #a78bfa;
  --text: #dde1f0;
  --text-dim: #8892b0;
  --text-faint: #4a5568;
  --gold: #e8b84b;
  --green: #4ade80;
  --red: #f87171;
  --radius: 0.5rem;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
}

.app-wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-icon {
  font-size: 1.4rem;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.header-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-left: 0.4rem;
  border-left: 1px solid var(--border);
  margin-left: 0.2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

.home-btn {
  text-decoration: none;
  font-size: 1.1rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.home-btn:hover { opacity: 1; }

/* Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-title {
  padding: 0.7rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lawyer-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.loading-msg {
  color: var(--text-dim);
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

/* Lawyer card */
.lawyer-card {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lawyer-card:hover {
  border-color: var(--accent);
  background: #1e2438;
}

.lawyer-card.selected {
  border-color: var(--accent);
  background: #1e2438;
  box-shadow: 0 0 0 1px var(--accent);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.card-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.card-specialty {
  font-size: 0.72rem;
  color: var(--accent2);
  margin-bottom: 0.3rem;
}

.card-tagline {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 0.3rem;
}

.card-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
}

/* Office panel */
.office-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.no-selection {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  gap: 0.6rem;
}

.no-selection-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.no-selection-text {
  font-size: 1rem;
  color: var(--text-dim);
}

.no-selection-sub {
  font-size: 0.8rem;
  max-width: 280px;
  text-align: center;
  line-height: 1.5;
}

/* Lawyer office (when selected) */
.lawyer-office {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.office-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.office-emoji {
  font-size: 2.2rem;
}

.office-info {
  flex: 1;
}

.office-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.office-specialty {
  font-size: 0.8rem;
  color: var(--accent2);
  margin-bottom: 0.15rem;
}

.office-tagline {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

.office-price-badge {
  background: var(--surface2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.office-price-badge span {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-dim);
  text-align: center;
}

.office-desc {
  padding: 0.75rem 1.4rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  line-height: 1.5;
}

/* Consultation form */
.consult-form {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.situation-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.situation-input:focus {
  outline: none;
  border-color: var(--accent);
}

.situation-input::placeholder {
  color: var(--text-faint);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

.hire-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.hire-btn:hover:not(:disabled) {
  background: #6475d4;
}

.hire-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.form-status.error { color: var(--red); }
.form-status.loading { color: var(--accent); }

/* History */
.history-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-title {
  padding: 0.5rem 1.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.history-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.75rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-empty {
  color: var(--text-faint);
  font-size: 0.82rem;
  text-align: center;
  padding: 2rem 0;
}

/* Consultation entry */
.consult-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.entry-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.entry-cost {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
}

.entry-situation {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-style: italic;
}

.entry-response {
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

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