:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --ink: #1d2530;
  --muted: #69717d;
  --line: #dfe4ea;
  --teal: #008d8d;
  --teal-dark: #006b6b;
  --coral: #d55c35;
  --gold: #f2b705;
  --green: #2f8f5b;
  --shadow: 0 18px 42px rgba(29, 37, 48, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--surface-alt);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background: var(--surface-alt);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 20px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

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

.text-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 700;
  font-size: 13px;
}

.text-button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.web-stage {
  position: relative;
  min-height: 0;
  height: 100dvh;
  background: #111820;
  overflow: hidden;
}

.web-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #f8fafc;
  background:
    linear-gradient(135deg, rgba(0, 141, 141, 0.9), rgba(213, 92, 53, 0.86)),
    #23303d;
}

.empty-state strong {
  font-size: 20px;
  line-height: 26px;
}

.empty-state span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 20px;
}

.launch-actions {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 18px;
}

.launch-button {
  min-width: 210px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 800;
}

.launch-button.primary {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--teal-dark);
}

.launch-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.external-action {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--gold);
  color: #1d2530;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.status-line {
  min-height: 34px;
  margin: 0;
  padding: 8px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 18px;
}

.fab-group {
  position: absolute;
  right: 14px;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 92px));
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.fab-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.fab-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--surface);
  font-weight: 900;
  box-shadow: var(--shadow);
  padding: 0;
}

.fab-button img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.contact-fab {
  background: var(--green);
}

.main-fab {
  width: 58px;
  height: 58px;
}

.main-fab img {
  width: 58px;
  height: 58px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(29, 37, 48, 0.48);
  padding-top: env(safe-area-inset-top);
}

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

.sheet-panel {
  max-height: min(76dvh, 720px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sheet-header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.sheet-header h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 24px;
}

.sheet-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 14px max(16px, env(safe-area-inset-bottom));
}

.list {
  display: grid;
  gap: 10px;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.item-card h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
}

.item-card time,
.item-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.item-card p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: #303945;
  font-size: 13px;
  line-height: 20px;
}

.item-card img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
  background: var(--surface-alt);
}

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

.empty-list {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

@media (min-width: 780px) {
  .app-shell {
    max-width: 460px;
    min-height: min(100dvh, 960px);
    margin: 0 auto;
    border-inline: 1px solid var(--line);
  }

  .sheet {
    place-items: center;
    padding: 24px;
  }

  .sheet-panel {
    width: min(520px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }
}
