
:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #1a1f2b;
  --muted: #4a5568;
  --accent: #0b5fff;
  --danger: #cc1f1a;
  --border: #d6dce5;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.split-mismatch {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(204, 31, 26, 0.08),
    rgba(204, 31, 26, 0.08) 24px,
    transparent 24px,
    transparent 48px
  );
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.language-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.language-flags {
  display: inline-flex;
  gap: 6px;
}

.flag-button {
  width: auto;
  height: auto;
  padding: 0;
  display: inline;
  font-size: 1.15rem;
  background: transparent;
  color: var(--text);
  border: none;
  opacity: 0.45;
}

.flag-button.active {
  opacity: 1;
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.header-button {
  width: auto;
  padding: 8px 12px;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.grow {
  flex: 1 1 220px;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

input,
select,
button,
textarea {
  width: 100%;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--text);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #9ab9ff;
  outline-offset: 1px;
}

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

.centered-action {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.plus-button {
  width: 64px;
  height: 64px;
  font-size: 2rem;
  line-height: 1;
  border-radius: 999px;
  padding: 0;
}

.account-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.account-item.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.account-item.clickable {
  cursor: pointer;
}

.account-main {
  display: grid;
  gap: 2px;
}

.account-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-weight: 600;
}

.qr-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.qr-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.triangle-nav {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

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

.trash-cell {
  display: flex;
  align-items: end;
}

.trash-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--border);
}

.split-balance-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: #fff4f4;
  border-top: 1px solid var(--danger);
  color: var(--danger);
  font-weight: 700;
  text-align: center;
  z-index: 1000;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0 0;
  border-bottom: 1px solid var(--border);
}

.tab {
  width: auto;
  padding: 8px 12px;
  background: #eef2f7;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-color: transparent;
  border-radius: 10px 10px 0 0;
  margin-bottom: -1px;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--surface);
}

.tab-panel {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 10px 10px 10px;
  padding: 12px;
  background: var(--surface);
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
}
