:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --bg-elevated: #1C1E21;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.5);
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.screen.hidden { display: none; }
.hidden { display: none !important; }

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
}

.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* HEADER */
.header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg-tertiary);
  margin-bottom: 16px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
  line-height: 1.1;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* HOME — SUMMARY CARDS */
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--bg-tertiary);
}

.card-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-weight: 600;
}

.card-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.card-value.accent { color: var(--accent); }

/* HOME — MENU */
.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.menu-btn {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  min-height: 72px;
  border: 2px solid var(--bg-tertiary);
  text-align: left;
  font-family: inherit;
}

.menu-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-tertiary);
  border-radius: 10px;
}

.menu-btn.danger .menu-icon { color: var(--danger); }

.menu-label {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.menu-meta {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.menu-btn:focus {
  background: var(--bg-tertiary);
  transform: translateX(2px);
}

/* LIST */
.list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.list::-webkit-scrollbar { width: 4px; }
.list::-webkit-scrollbar-track { background: transparent; }
.list::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 2px; }

/* PERSON ROW */
.person-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--bg-secondary);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  min-height: 60px;
  border: 2px solid var(--bg-tertiary);
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
}

.person-row .row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person-row .name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.person-row .meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.shares-badge {
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  min-width: 44px;
  text-align: center;
}

.person-row:focus .shares-badge {
  background: var(--accent);
  color: #000;
}

/* ACTIONS BAR */
.actions-bar {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--bg-tertiary);
  margin-top: 12px;
}

.action-btn {
  flex: 1;
  padding: 14px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  min-height: 64px;
  border: 2px solid var(--bg-tertiary);
  font-family: inherit;
  letter-spacing: 0.5px;
}

.action-btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.action-btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.action-btn:focus {
  transform: scale(1.02);
}

.action-btn.primary:focus {
  border-color: #ffffff;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.8);
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  padding: 30px;
  text-align: center;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
  font-weight: 200;
  color: var(--text-muted);
}

.empty-state .text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* PERSON EDIT */
.edit-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.share-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 3px;
  font-weight: 600;
}

.share-controls {
  display: flex;
  align-items: center;
  gap: 28px;
}

.share-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--accent);
  font-size: 40px;
  font-weight: 700;
  border: 2px solid var(--bg-tertiary);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.share-value {
  font-size: 80px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 120px;
  text-align: center;
  line-height: 1;
}

.share-amount-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-tertiary);
}

.share-amount-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 600;
}

.share-amount {
  font-size: 24px;
  color: var(--accent-secondary);
  font-weight: 700;
}

/* AMOUNT SCREEN */
.amount-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding: 14px 0 6px;
  gap: 4px;
}

.amount-currency {
  font-size: 36px;
  color: var(--text-secondary);
  font-weight: 600;
}

.amount-value {
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
}

.step-display {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.step-display span {
  color: var(--accent);
  font-weight: 700;
}

.amount-controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.amount-btn {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--accent);
  font-size: 56px;
  font-weight: 700;
  border: 2px solid var(--bg-tertiary);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* RESULT */
.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-tertiary);
  min-height: 56px;
}

.result-row .row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-row .name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.result-row .calc {
  font-size: 12px;
  color: var(--text-muted);
}

.result-row .amount {
  font-size: 22px;
  color: var(--accent-secondary);
  font-weight: 700;
}
