:root {
  --bg: #f6f0e7;
  --bg-accent: #efe4d2;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #fffdf9;
  --border: rgba(88, 62, 34, 0.12);
  --text: #1f1914;
  --muted: #6d5a49;
  --accent: #b85c38;
  --accent-soft: #e6a15f;
  --forest: #2f5d50;
  --shadow: 0 24px 60px rgba(52, 36, 18, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(232, 188, 134, 0.45), transparent 34%),
    radial-gradient(circle at bottom right, rgba(70, 107, 93, 0.18), transparent 22%),
    linear-gradient(160deg, var(--bg) 0%, #f9f5ef 46%, var(--bg-accent) 100%);
}

.app-body,
.login-body {
  position: relative;
}

.app-shell,
.login-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.login-panel,
.panel,
.summary-card,
.asset-card,
.dialog-panel {
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-radius: 32px;
  margin-bottom: 24px;
}

.hero h1,
.login-panel h1,
.panel h2,
.dialog-header h2,
.asset-card h3,
.summary-card h3 {
  font-family: var(--serif);
  margin: 0;
}

.hero h1,
.login-panel h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.94;
  max-width: 10ch;
}

.hero-copy {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1rem;
  line-height: 1.6;
  margin: 16px 0 0;
}

.eyebrow,
.section-label,
.summary-card p,
.filter-field span,
.asset-category,
.detail-row span {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.eyebrow,
.section-label,
.asset-category {
  color: var(--accent);
  font-weight: 700;
}

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

.pill {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
  animation: float-up 480ms ease both;
}

.panel-collapsible {
  padding: 0;
  overflow: hidden;
}

.panel-wide {
  grid-column: span 2;
}

.summary-grid {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  border-radius: 24px;
  padding: 20px;
  animation: float-up 520ms ease both;
}

.summary-card h3 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  margin-top: 10px;
}

.summary-card span,
.stack-card p,
.asset-meta,
.asset-measures span,
.detail-note,
.empty-state {
  color: var(--muted);
  line-height: 1.5;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 2rem;
}

.panel-header-split {
  align-items: end;
}

.panel-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 24px;
  cursor: pointer;
}

.panel-summary::-webkit-details-marker {
  display: none;
}

.panel-summary h2 {
  font-size: 2rem;
}

.panel-summary-hint {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  min-width: 108px;
  text-align: center;
  font-size: 0;
}

.panel-summary-hint::after {
  content: "Show panel";
  font-size: 0.9rem;
}

.panel-collapsible[open] .panel-summary-hint {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(78, 56, 31, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.panel-collapsible[open] .panel-summary-hint::after {
  content: "Hide panel";
}

.panel-collapsible-body {
  padding: 0 24px 24px;
}

.allocation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.allocation-list,
.list-stack,
.asset-grid,
.detail-section,
.dialog-content {
  display: grid;
  gap: 14px;
}

.allocation-item {
  display: grid;
  gap: 10px;
}

.allocation-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}

.allocation-label span {
  color: var(--muted);
}

.allocation-bar {
  height: 12px;
  background: rgba(94, 70, 39, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.allocation-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--accent-soft));
}

.stack-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.stack-side {
  text-align: right;
}

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

.filter-field {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.filter-field input,
.filter-field select,
.primary-button,
.secondary-button,
.ghost-button {
  border: 1px solid rgba(78, 56, 31, 0.14);
  border-radius: 14px;
  font: inherit;
}

.filter-field input,
.filter-field select {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.asset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.asset-card {
  border-radius: 22px;
  padding: 20px;
  display: grid;
  gap: 14px;
  animation: float-up 540ms ease both;
}

.asset-topline,
.asset-measures {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.asset-value {
  font-weight: 700;
}

.asset-meta {
  margin: -8px 0 0;
}

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

.asset-tags span,
.pill strong,
.stack-side strong {
  color: var(--text);
}

.asset-tags span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(184, 92, 56, 0.08);
  font-size: 0.84rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--forest), #5d8b7b);
  color: #fff;
  padding: 14px 18px;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  padding: 11px 14px;
}

.ghost-button {
  background: transparent;
  padding: 11px 16px;
  color: var(--text);
}

.asset-dialog {
  width: min(860px, calc(100% - 24px));
  border: none;
  padding: 0;
  background: transparent;
}

.asset-dialog::backdrop {
  background: rgba(20, 17, 14, 0.5);
  backdrop-filter: blur(8px);
}

.dialog-panel {
  padding: 24px;
  border-radius: 28px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-row {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.detail-section h3,
.subheading {
  margin: 0 0 10px;
  font-size: 1rem;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-list a {
  color: var(--forest);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  max-width: 560px;
  border-radius: 32px;
  padding: 32px;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.error-text {
  min-height: 1.3em;
  color: #a12922;
}

.empty-state {
  margin: 0;
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .summary-grid,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero,
  .panel-header,
  .panel-header-split,
  .dialog-header,
  .panel-summary {
    flex-direction: column;
  }

  .content-grid,
  .summary-grid,
  .allocation-grid,
  .asset-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .panel-wide,
  .summary-grid {
    grid-column: auto;
  }

  .hero-actions {
    align-items: stretch;
  }

  .stack-card,
  .asset-topline,
  .asset-measures,
  .allocation-label {
    flex-direction: column;
    align-items: start;
  }

  .stack-side {
    text-align: left;
  }
}
