.browser-page {
  min-height: 100svh;
  margin: 0;
  background: #0b0d0f;
  color: #f7f4ec;
}

.browser-app {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: linear-gradient(180deg, #171b20 0%, #0b0d0f 100%);
}

.browser-chrome,
.toolbar,
.browser-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-chrome {
  padding-bottom: 0;
  align-items: end;
}

.tabs {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: end;
  gap: 6px;
  overflow-x: auto;
}

.tab {
  width: min(220px, 42vw);
  min-width: 132px;
  height: 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 0 8px 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfc8bb;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: #232930;
  color: #fffaf0;
}

.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 760;
}

.tab-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tab-close:hover,
.tab-close:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.toolbar {
  background: #232930;
}

.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf0;
  font: inherit;
  font-size: 20px;
  font-weight: 820;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.mode-button,
.browser-footer button,
.admin-panel button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf0;
  font: inherit;
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.mode-button[data-state="on"] {
  border-color: #8bc5ff;
  background: rgba(139, 197, 255, 0.18);
}

.address-form {
  flex: 1;
  min-width: 0;
}

.address-form input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 18px;
  background: #11161b;
  color: #fffaf0;
  font: inherit;
  outline: none;
}

.address-form input:focus {
  border-color: #8bc5ff;
  box-shadow: 0 0 0 3px rgba(139, 197, 255, 0.2);
}

.viewport-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

#viewer {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

#viewer[hidden] {
  display: none;
}

.source-view {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 0;
  background: #f7f4ec;
  color: #151719;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.source-view[hidden] {
  display: none !important;
}

.fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: radial-gradient(circle at top, #263647, #0d1117 68%);
  color: #fffaf0;
  text-align: center;
}

.fallback[hidden] {
  display: none !important;
}

.fallback h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1;
}

.fallback p {
  max-width: 520px;
  margin: 0;
  color: #cfc8bb;
}

.fallback button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #fffaf0;
  color: #101214;
  font: inherit;
  font-weight: 820;
  cursor: pointer;
}

.browser-footer {
  justify-content: end;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  background: #11161b;
}

.browser-footer a {
  color: #cfc8bb;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.browser-footer button {
  margin-right: auto;
  color: #cfc8bb;
}

.browser-footer a:hover,
.browser-footer a:focus-visible,
.browser-footer button:hover,
.browser-footer button:focus-visible,
.admin-panel button:hover,
.admin-panel button:focus-visible,
.mode-button:hover,
.mode-button:focus-visible {
  color: #fffaf0;
  outline: none;
}

.admin-dialog {
  width: min(620px, calc(100% - 28px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0;
  background: #151a20;
  color: #fffaf0;
}

.admin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.admin-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.admin-panel header,
.admin-actions,
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-panel header {
  justify-content: space-between;
}

.admin-panel input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 12px;
  background: #0d1117;
  color: #fffaf0;
  font: inherit;
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
}

.admin-row {
  justify-content: space-between;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.admin-row span {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .browser-chrome,
  .toolbar {
    padding-inline: 8px;
  }

  .tab {
    min-width: 116px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

}
