:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --panel: #ffffff;
  --ink: #161817;
  --muted: #5d655f;
  --line: #d5d8d2;
  --good: #3f6657;
  --watch: #8a6e3f;
  --danger: #8b4f4a;
  --state: var(--watch);
}

:root[data-state="good"] { --state: var(--good); }
:root[data-state="watch"] { --state: var(--watch); }
:root[data-state="danger"] { --state: var(--danger); }

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

a,
button,
input,
select {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button,
.file-button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

button,
.file-button {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

input,
select {
  width: 100%;
  padding: 8px 9px;
}

button:hover,
button:focus-visible,
.file-button:hover,
.file-button:focus-within,
select:focus-visible,
input:focus-visible {
  border-color: #636963;
  outline: 0;
}

button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .58;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.ao-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-weight: 900;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1;
}

h2 {
  font-size: 1.1rem;
  line-height: 1.1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suite-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  overflow: hidden;
}

.suite-brand-cluster,
.suite-app-brand,
.suite-topbar-actions {
  display: inline-flex;
  align-items: center;
}

.suite-brand-cluster {
  gap: 10px;
  min-width: 0;
}

.suite-ao-home,
.suite-app-brand {
  text-decoration: none;
}

.suite-ao-home {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.suite-ao-home img {
  display: block;
  width: 42px;
  height: 42px;
}

.suite-app-brand {
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  text-transform: lowercase;
}

.suite-app-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
}

.suite-app-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suite-topbar-actions {
  gap: 8px;
  overflow-x: auto;
}

.storage-state {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
  white-space: nowrap;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.shell {
  width: min(calc(100% - 24px), 920px);
  margin: 12px auto 28px;
}

.lock-panel {
  width: min(calc(100% - 24px), 620px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin: 12px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.lock-panel[hidden] {
  display: none;
}

.lock-panel #accessMessage {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
}

.primary-state,
.summary-block,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.primary-state {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: center;
  padding: 16px;
  border-left: 5px solid var(--state);
}

.primary-state strong {
  font-size: clamp(2rem, 7vw, 4.4rem);
  line-height: .9;
}

.primary-state span,
.summary-block span,
.advisor-panel span,
.row span,
.tx span,
.empty {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.28;
  font-weight: 700;
}

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

.summary-block {
  display: grid;
  align-content: space-between;
  min-height: 110px;
  gap: 8px;
  padding: 12px;
}

.summary-block strong {
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: .98;
  overflow-wrap: anywhere;
}

.panel {
  margin-top: 10px;
}

.advisor-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.advisor-panel strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

summary {
  cursor: pointer;
  padding: 12px;
  font-weight: 900;
}

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

.control-row label {
  display: grid;
  gap: 5px;
}

.detail-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.detail-grid section {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
}

.rows,
.transactions {
  display: grid;
}

.row,
.tx {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child,
.tx:last-child {
  border-bottom: 0;
}

.row strong,
.tx strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.empty {
  padding: 8px 0;
}

.boot-error {
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--danger);
  background: #fff;
  color: var(--danger);
  white-space: pre-wrap;
}

@media (max-width: 660px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .suite-topbar {
    gap: 8px;
    min-height: 58px;
    padding: 0 12px;
  }

  .suite-brand-cluster {
    gap: 7px;
  }

  .suite-ao-home {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .suite-ao-home img {
    width: 38px;
    height: 38px;
  }

  .suite-app-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .suite-app-name {
    display: none;
  }

  .suite-topbar-actions {
    gap: 6px;
  }

  .top-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .summary-row,
  .control-row,
  .lock-panel {
    grid-template-columns: 1fr;
  }

  .primary-state {
    min-height: 112px;
  }
}
