/* Namespace everything under .gg-app to avoid fighting the theme. */
.gg-app {
  --gg-bg-0: #f6f7ff;
  --gg-bg-1: #f2fbff;
  --gg-surface: rgba(255, 255, 255, 0.94);
  --gg-text: #0f172a;
  --gg-muted: rgba(15, 23, 42, 0.66);
  --gg-border: rgba(15, 23, 42, 0.10);

  --gg-primary: #4f46e5;
  --gg-primary-2: #06b6d4;
  --gg-green: #16a34a;
  --gg-green-2: #10b981;
  --gg-red: #ef4444;
  --gg-amber: #f59e0b;
  --gg-blue: #4f46e5;

  --gg-shadow: 0 18px 40px rgba(2, 6, 23, 0.10);
  --gg-shadow-soft: 0 8px 22px rgba(2, 6, 23, 0.08);
  --gg-radius: 18px;

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--gg-text);
  max-width: 900px;
  margin: 0 auto;
}

/* Fullscreen template mode (plugin-owned page template). */
body.gg-template-fullscreen {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #f6f7ff, #f2fbff);
}

.gg-template-main {
  min-height: 100vh;
  min-height: 100dvh;
}

body.gg-template-fullscreen .gg-app {
  max-width: none;
  margin: 0;
  min-height: inherit;
}

body.gg-template-fullscreen .gg-shell {
  min-height: inherit;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.gg-template-fullscreen .gg-topbar {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-top: max(14px, env(safe-area-inset-top));
}

body.gg-template-fullscreen .gg-content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

body.gg-template-fullscreen .gg-bottomnav {
  width: min(1120px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 782px) {
  body.admin-bar.gg-template-fullscreen .gg-template-main {
    min-height: calc(100dvh - 46px);
  }
}

@media (min-width: 783px) {
  body.admin-bar.gg-template-fullscreen .gg-template-main {
    min-height: calc(100dvh - 32px);
  }
}

.gg-app,
.gg-app * {
  box-sizing: border-box;
}

.gg-shell {
  position: relative;
  border: 1px solid var(--gg-border);
  border-radius: var(--gg-radius);
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(79, 70, 229, 0.20), transparent 60%),
    radial-gradient(700px 380px at 105% 40%, rgba(6, 182, 212, 0.20), transparent 55%),
    linear-gradient(180deg, var(--gg-bg-0), var(--gg-bg-1));
  box-shadow: var(--gg-shadow-soft);
  overflow: hidden;
}

/* Topbar */
.gg-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-primary-2) 100%);
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  box-shadow: 0 18px 30px rgba(79, 70, 229, 0.28);
}

.gg-topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gg-title {
  flex: 1;
  min-width: 0;
}

.gg-title h1 {
  font-size: 18px;
  line-height: 1.15;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.gg-title .sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-top: 3px;
  opacity: 0.92;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.gg-title .sub svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.95;
}

.gg-topbar-controls {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.gg-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gg-topbar-select {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
}

.gg-topbar-select:focus {
  border-color: rgba(255, 255, 255, 0.60);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.gg-topbar-select option {
  color: var(--gg-text);
}

.gg-iconbtn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.10);
}

.gg-iconbtn:active {
  transform: translateY(1px);
}

.gg-iconbtn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.gg-iconbtn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gg-iconbtn.sm {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  box-shadow: none;
}

.gg-iconbtn.danger {
  border-color: rgba(239, 68, 68, 0.30);
  background: rgba(239, 68, 68, 0.10);
  color: #991b1b;
}

/* Content */
.gg-content {
  padding: 14px 12px 110px;
}

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

.gg-row > * {
  flex: 1 1 160px;
}

.gg-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 2px 10px;
}

.gg-section-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: rgba(11, 31, 22, 0.72);
}

.gg-section-head .hint {
  font-size: 12px;
  color: var(--gg-muted);
}

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

.gg-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(11, 31, 22, 0.86);
  font-weight: 800;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Cards */
.gg-card {
  border: 1px solid var(--gg-border);
  border-radius: 16px;
  padding: 14px;
  background: var(--gg-surface);
  box-shadow: var(--gg-shadow-soft);
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}

.gg-card.compact {
  padding: 12px;
}

/* Buttons */
.gg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(11, 31, 22, 0.16);
  background: #0b1f16;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.15px;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(11, 31, 22, 0.18);
  font-family: inherit;
}

.gg-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gg-btn:active {
  transform: translateY(1px);
}

.gg-btn.full {
  width: 100%;
}

.gg-btn.sm {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: none;
}

.gg-btn.ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--gg-text);
  box-shadow: none;
}

.gg-btn.primary {
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-primary-2) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 30px rgba(79, 70, 229, 0.28);
}

.gg-btn.secondary {
  background: rgba(255, 255, 255, 0.78);
  color: rgba(11, 31, 22, 0.92);
  border-color: rgba(11, 31, 22, 0.14);
  box-shadow: none;
}

.gg-btn.danger {
  background: #fff;
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.30);
  box-shadow: none;
}

.gg-btn.is-loading {
  opacity: 0.9;
}

.gg-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: rgba(255, 255, 255, 0.10);
  animation: gg-spin 0.9s linear infinite;
}

.gg-btn.secondary .gg-spinner,
.gg-btn.ghost .gg-spinner,
.gg-btn.danger .gg-spinner {
  border-color: rgba(11, 31, 22, 0.30);
  border-top-color: rgba(11, 31, 22, 0.08);
}

@keyframes gg-spin {
  to { transform: rotate(360deg); }
}

/* Fields */
.gg-field {
  margin-bottom: 12px;
}

.gg-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: rgba(11, 31, 22, 0.72);
  margin: 0 0 6px;
}

.gg-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gg-muted);
}

.gg-errorline {
  margin-top: 6px;
  font-size: 12px;
  color: #991b1b;
  font-weight: 700;
}

.gg-input,
.gg-select,
.gg-textarea {
  width: 100%;
  min-height: 44px;
  padding: 12px 12px;
  border: 1px solid rgba(11, 31, 22, 0.16);
  border-radius: 14px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--gg-text);
  outline: none;
}

.gg-input:focus,
.gg-select:focus,
.gg-textarea:focus {
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.gg-textarea {
  min-height: 92px;
  resize: vertical;
}

/* Banner */
.gg-banner {
  border: 1px solid rgba(11, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--gg-shadow-soft);
}

.gg-banner-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.gg-banner-text {
  font-weight: 800;
}

.gg-banner.is-error {
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

.gg-banner.is-notice {
  border-color: rgba(20, 184, 106, 0.25);
  color: #065f46;
}

.gg-banner.is-warn {
  border-color: rgba(245, 158, 11, 0.35);
  color: rgba(146, 64, 14, 1);
}

.gg-error {
  color: #991b1b;
}

.gg-notice {
  color: #065f46;
}

.gg-card.gg-error {
  border-color: rgba(239, 68, 68, 0.25);
}

.gg-card.gg-notice {
  border-color: rgba(20, 184, 106, 0.25);
}

/* Grid */
.gg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .gg-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

/* Chips */
.gg-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(11, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  color: rgba(11, 31, 22, 0.72);
}

.gg-chip.skel {
  color: transparent;
  background: linear-gradient(90deg, rgba(11,31,22,0.08), rgba(11,31,22,0.12), rgba(11,31,22,0.08));
  background-size: 200% 100%;
  animation: gg-shimmer 1.2s ease-in-out infinite;
}

.gg-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 2px 10px;
}

/* Home group card */
.gg-group-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  box-shadow: var(--gg-shadow-soft);
  cursor: pointer;
}

.gg-group-card:active {
  transform: translateY(1px);
}

.gg-group-card .name {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.1px;
}

.gg-group-card .meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gg-sticky-cta {
  position: sticky;
  bottom: 0;
  padding: 10px 0 0;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(247, 251, 248, 0), rgba(247, 251, 248, 0.92) 40%, rgba(247, 251, 248, 0.98));
}

/* Search */
.gg-search {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--gg-shadow-soft);
  margin-bottom: 10px;
}

.gg-search-ic svg {
  width: 18px;
  height: 18px;
  fill: rgba(11, 31, 22, 0.62);
}

.gg-search-in {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--gg-text);
  min-height: 44px;
}

/* Lists */
.gg-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.gg-expense-row {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.gg-expense-row:active {
  transform: translateY(1px);
}

.gg-expense-left {
  min-width: 0;
  flex: 1;
}

.gg-expense-left .concept {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gg-expense-left .sub {
  margin-top: 6px;
  color: rgba(11, 31, 22, 0.66);
  font-size: 12px;
}

.gg-expense-config-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: rgba(11, 31, 22, 0.72);
  font-size: 12px;
  display: grid;
  gap: 2px;
}

.gg-expense-config-list li {
  margin: 0;
}

.gg-expense-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.gg-expense-right .amount {
  font-weight: 900;
  font-size: 16px;
}

.gg-expense-right .gg-btn.sm {
  min-height: 34px;
  min-width: 88px;
  padding: 6px 12px;
  border-radius: 10px;
}

.gg-pager {
  margin-top: 10px;
}

/* Empty */
.gg-empty {
  border: 1px dashed rgba(11, 31, 22, 0.22);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--gg-shadow-soft);
}

.gg-empty-ttl {
  font-weight: 900;
  font-size: 15px;
}

.gg-empty-body {
  margin-top: 6px;
  color: var(--gg-muted);
  font-size: 13px;
  line-height: 1.35;
}

.gg-empty-cta {
  margin-top: 12px;
}

/* Skeleton */
.gg-skel {
  display: grid;
  gap: 10px;
}

.gg-skel-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(11,31,22,0.08), rgba(11,31,22,0.12), rgba(11,31,22,0.08));
  background-size: 200% 100%;
  animation: gg-shimmer 1.2s ease-in-out infinite;
}

@keyframes gg-shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* Hero */
.gg-hero {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(6, 182, 212, 0.14));
  margin-bottom: 12px;
}

.gg-hero .big {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.3px;
  margin: 6px 0 0;
  color: #0b5f8a;
}

.gg-hero .label {
  font-size: 12px;
  color: rgba(11, 31, 22, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.gg-export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gg-export-card-head {
  min-width: 0;
  flex: 1 1 260px;
  display: grid;
  gap: 4px;
}

.gg-export-card-head .title {
  font-weight: 900;
  font-size: 14px;
}

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

@media (max-width: 560px) {
  .gg-export-card-actions,
  .gg-export-card .gg-btn {
    width: 100%;
  }

  .gg-export-card-actions .gg-btn {
    width: 100%;
  }
}

/* Unit card (dashboard) */
.gg-unit-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74));
  box-shadow: var(--gg-shadow-soft);
}

.gg-unit-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--accent, rgba(11, 31, 22, 0.30));
}

.gg-unit-card .name {
  font-weight: 900;
  font-size: 14px;
}

.gg-unit-card .balance {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.gg-unit-card .meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  color: rgba(11, 31, 22, 0.70);
  font-size: 12px;
}

.gg-unit-card .meta div strong {
  display: block;
  color: rgba(11, 31, 22, 0.92);
  font-size: 13px;
  margin-top: 2px;
}

.gg-eq-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.gg-eq-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gg-eq-total-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(11, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
}

.gg-eq-total-card .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: rgba(11, 31, 22, 0.62);
}

.gg-eq-total-card .v {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 900;
}

.gg-eq-total-card.is-total .v {
  color: #0369a1;
}

.gg-eq-total-card.is-contrib .v {
  color: #0f766e;
}

.gg-eq-total-card.is-owed .v {
  color: #b45309;
}

.gg-eq-total-card.is-pending .v {
  color: #b91c1c;
}

.gg-eq-total-card.is-balanced .v {
  color: #166534;
}

.gg-eq-row {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(11, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
}

.gg-eq-row.is-positive {
  border-color: rgba(22, 163, 74, 0.28);
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.10), rgba(255, 255, 255, 0.95));
}

.gg-eq-row.is-negative {
  border-color: rgba(217, 119, 6, 0.30);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.11), rgba(255, 255, 255, 0.95));
}

.gg-eq-row.is-zero {
  border-color: rgba(3, 105, 161, 0.24);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.10), rgba(255, 255, 255, 0.95));
}

.gg-eq-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.gg-eq-name {
  font-size: 16px;
  font-weight: 900;
  color: #0b1f16;
}

.gg-eq-chip {
  font-size: 11px;
  font-weight: 800;
}

.gg-eq-row.is-positive .gg-eq-chip {
  color: #166534;
  border-color: rgba(22, 163, 74, 0.36);
  background: rgba(22, 163, 74, 0.16);
}

.gg-eq-row.is-negative .gg-eq-chip {
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.36);
  background: rgba(245, 158, 11, 0.16);
}

.gg-eq-row.is-zero .gg-eq-chip {
  color: #075985;
  border-color: rgba(3, 105, 161, 0.34);
  background: rgba(14, 165, 233, 0.16);
}

.gg-eq-metrics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gg-eq-metric .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: rgba(11, 31, 22, 0.62);
}

.gg-eq-metric .v {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 900;
}

.gg-eq-metric.contrib .v {
  color: #0369a1;
}

.gg-eq-metric.owed .v {
  color: #c2410c;
}

.gg-eq-row.is-positive .gg-eq-metric.pending .v {
  color: #15803d;
}

.gg-eq-row.is-negative .gg-eq-metric.pending .v {
  color: #b45309;
}

.gg-eq-row.is-zero .gg-eq-metric.pending .v {
  color: #0369a1;
}

@media (max-width: 720px) {
  .gg-eq-total-card .v {
    font-size: 24px;
  }

  .gg-eq-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gg-eq-metric .v {
    font-size: 18px;
  }
}

/* Settlement rows */
.gg-balance-row {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
}

.gg-balance-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--accent, rgba(11, 31, 22, 0.30));
}

.gg-balance-row .name {
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gg-balance-row .nums {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gg-balance-row .nums .k {
  font-size: 11px;
  color: rgba(11, 31, 22, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.gg-balance-row .nums .v {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
}

.gg-balance-row .nums .v.strong {
  font-weight: 900;
}

.gg-balance-row .sub {
  font-size: 12px;
  color: rgba(11, 31, 22, 0.64);
}

.gg-transfer-row {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.gg-transfer-row .concept {
  font-weight: 900;
  font-size: 14px;
}

.gg-transfer-row .sub {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(11, 31, 22, 0.62);
}

.gg-transfer-row .amount {
  font-weight: 900;
  font-size: 16px;
}

.gg-transfer-row .right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gg-debt-list {
  margin-bottom: 12px;
}

.gg-debt-row {
  border-color: rgba(79, 70, 229, 0.22);
  background:
    linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(255, 255, 255, 0.95)),
    rgba(255, 255, 255, 0.95);
}

.gg-debt-row .concept {
  font-size: 15px;
}

.gg-debt-row .sub {
  font-weight: 700;
  color: rgba(11, 31, 22, 0.72);
}

.gg-debt-row .right {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.gg-debt-row .amount {
  font-size: 22px;
  color: var(--gg-blue);
  line-height: 1;
}

.gg-card.gg-debt-empty {
  border-color: rgba(16, 185, 129, 0.30);
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.10), rgba(255, 255, 255, 0.94)),
    rgba(255, 255, 255, 0.94);
}

.gg-card.gg-debt-empty .title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 6px;
  color: #065f46;
}

/* Participants rows */
.gg-unit-row {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gg-unit-row .name {
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gg-unit-row .sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(11, 31, 22, 0.62);
}

.gg-unit-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gg-unit-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
}

.gg-unit-chip.type-family {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
  color: #0369a1;
}

.gg-unit-chip.type-individual {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
}

.gg-unit-chip.status-active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #166534;
}

.gg-unit-chip.status-inactive {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #92400e;
}

.gg-tight-chiprow {
  margin-top: 6px;
  gap: 6px;
}

.gg-unit-row .right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.gg-unit-actions {
  margin-left: auto;
}

.gg-unit-actions-main {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.gg-unit-row .right .gg-btn.sm {
  min-height: 34px;
  min-width: 96px;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: 800;
}

.gg-unit-row .right .gg-iconbtn {
  border-color: rgba(11, 31, 22, 0.16);
  background: rgba(11, 31, 22, 0.06);
  color: rgba(11, 31, 22, 0.82);
  box-shadow: none;
}

@media (max-width: 740px) {
  .gg-unit-actions {
    width: 100%;
    justify-content: space-between;
  }

  .gg-unit-actions-main {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
}

.gg-inline-cta {
  margin-bottom: 10px;
}

/* Expense detail */
.gg-expense-detail-hero {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
  margin-bottom: 12px;
}

.gg-expense-detail-hero .concept {
  font-weight: 900;
  font-size: 15px;
}

.gg-expense-detail-hero .amount {
  margin-top: 8px;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.gg-expense-detail-hero .meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gg-ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* Bottom nav */
.gg-bottomnav {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
  margin: 0 12px 12px;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid rgba(11, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--gg-shadow);
  backdrop-filter: blur(12px);
}

.gg-bottomnav-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.gg-navbtn {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(11, 31, 22, 0.66);
  padding: 10px 8px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  min-height: 54px;
}

.gg-navbtn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gg-navbtn .lbl {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.gg-navbtn.active {
  background: rgba(79, 70, 229, 0.14);
  color: rgba(11, 31, 22, 0.92);
}

/* FAB */
.gg-fab {
  position: fixed;
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, var(--gg-blue) 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 18px 34px rgba(79, 70, 229, 0.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gg-fab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Drawer */
.gg-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 22, 0.42);
  z-index: 80;
  backdrop-filter: blur(6px);
}

.gg-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.94);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  border: 1px solid rgba(11, 31, 22, 0.14);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.18);
  padding: 14px 12px 12px;
  max-height: 92vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

@media (min-width: 720px) {
  .gg-drawer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 560px;
    border-radius: 26px;
    top: 64px;
    bottom: auto;
    max-height: calc(100vh - 120px);
  }
}

.gg-drawer-handle {
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: rgba(11, 31, 22, 0.20);
  margin: 0 auto 10px;
}

.gg-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.gg-drawer-head .ttl {
  font-weight: 900;
  font-size: 14px;
}

.gg-drawer-body {
  overflow: auto;
  padding: 2px 2px 10px;
}

.gg-drawer-foot {
  display: grid;
  gap: 10px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.gg-details summary {
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
}

/* Segmented */
.gg-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gg-segbtn {
  appearance: none;
  border: 1px solid rgba(11, 31, 22, 0.14);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  min-height: 48px;
  text-align: left;
  font-family: inherit;
}

.gg-segbtn.active {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.gg-segbtn .t {
  font-weight: 900;
  font-size: 13px;
}

/* Checklist */
.gg-checklist {
  border: 1px solid rgba(11, 31, 22, 0.12);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.74);
  margin: 8px 0 12px;
}

.gg-checkrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 14px;
  cursor: pointer;
  min-height: 44px;
}

.gg-checkrow input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.gg-checkrow:active {
  background: rgba(79, 70, 229, 0.10);
}

/* Toggle */
.gg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.gg-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.gg-toggle .lbl {
  font-weight: 800;
}

/* Switcher rows */
.gg-switch-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(11, 31, 22, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--gg-shadow-soft);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.gg-switch-row .name {
  font-weight: 900;
}

.gg-switch-row .sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(11, 31, 22, 0.62);
}

.gg-switch-row .right svg {
  width: 18px;
  height: 18px;
  fill: var(--gg-primary);
}

.gg-switch-row.active {
  outline: 2px solid rgba(79, 70, 229, 0.22);
}

/* Modal */
.gg-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 22, 0.50);
  z-index: 120;
  backdrop-filter: blur(6px);
}

.gg-modal {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 18vh;
  z-index: 130;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(11, 31, 22, 0.14);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.20);
  padding: 14px;
}

@media (min-width: 640px) {
  .gg-modal {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 520px;
  }
}

.gg-modal-head .ttl {
  font-weight: 900;
  font-size: 14px;
}

.gg-modal-body {
  margin-top: 10px;
}

.gg-modal-foot {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

/* Toasts */
.gg-toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 140;
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .gg-toasts {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 520px;
  }
}

.gg-toast {
  border-radius: 16px;
  border: 1px solid rgba(11, 31, 22, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gg-toast .txt {
  font-weight: 800;
}

.gg-toast.is-success {
  border-color: rgba(20, 184, 106, 0.28);
}

.gg-toast.is-error {
  border-color: rgba(239, 68, 68, 0.28);
}

.gg-toast.is-warn {
  border-color: rgba(245, 158, 11, 0.35);
}
