/* Carrier design language: light-grey canvas, white cards, Carrier blue accent. */

:root {
  --canvas: #eceef1;
  --surface: #ffffff;
  --fg: #0b1b33;
  --fg-soft: #3f4a5e;
  --muted: #6a7488;
  --border: #e1e4ea;
  --border-strong: #cfd4dd;
  --accent: #2570eb;
  --accent-hover: #1a5bc8;
  --accent-soft: #e9f0fd;
  --radius: 8px;
  --radius-pill: 999px;
  --topbar-h: 56px;

  --shadow-card: 0 1px 2px rgba(10, 22, 40, 0.06);
  --shadow-pop: 0 4px 16px rgba(10, 22, 40, 0.1);
}

/* Light theme only — the portal ignores the OS dark preference on purpose. */
:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-home {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brandmark {
  height: 26px;
  width: auto;
  display: block;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-soft);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.btn-home:hover {
  background: var(--canvas);
  color: var(--fg);
}

.btn-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar .divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------- account */

.account {
  position: relative;
  margin-left: auto;
}

.avatar {
  display: grid;
  place-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.avatar:hover {
  background: #dbe7fb;
}

.avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 208px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.account-email {
  margin: 0;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  /* Long addresses must wrap rather than widen the popover past the viewport. */
  overflow-wrap: anywhere;
}

.account-item {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-soft);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.account-item:hover {
  background: var(--canvas);
  color: var(--fg);
}

.account-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ------------------------------------------------------------------- buttons */

/* Carrier pill buttons: solid for primary actions, blue-outline for secondary. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent-soft);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------- layout */

.layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - var(--topbar-h));
  padding: 16px 20px;
}

/* -------------------------------------------------------------------- viewer */

.viewer {
  position: relative;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.viewer iframe {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.viewer iframe.visible {
  display: block;
}

.placeholder,
.error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

.placeholder .title {
  color: var(--fg);
  font-size: 16px;
  font-weight: 600;
}

.placeholder .hint,
.muted {
  color: var(--muted);
}

.btn-retry {
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease;
}

.btn-retry:hover {
  background: var(--accent-hover);
}

.btn-retry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted {
  padding: 8px 10px;
}
