/* G002 BAMT parser demo. Same look as groups/g001/bamt-parser-demo.html,
   plus the favorites row and the opened grouping panel. */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #dde1e6;
  --text: #1b1f24;
  --muted: #6b7280;
  --accent: #1f6feb;
  --tv-bg: #0c0d10;
  --favorite: #ff6b81;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 1320px;
  padding: 20px 32px 60px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, Segoe UI, Arial, sans-serif;
}

a {
  color: var(--accent);
}

.back {
  font-size: 13px;
  text-decoration: none;
}

h1 {
  font-size: 21px;
  margin: 10px 0 6px;
}

.subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  max-width: 960px;
  line-height: 1.55;
}

.note-box {
  background: #fff6e0;
  border: 1px solid #f0d38a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.55;
  max-width: 960px;
}

.howto {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.howto h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 12px;
}

.howto ol {
  margin: 0;
  padding-left: 20px;
}

.howto li {
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text);
}

.tab-btn.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(460px, 680px) 1fr;
  gap: 24px;
  align-items: start;
}

.layout > div {
  min-width: 0;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.tv-frame {
  background: #1a1b1e;
  border-radius: 14px;
  padding: 18px;
}

.tv-topbar {
  color: #9aa0a6;
  font-size: 12.5px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.tv-screen {
  background: var(--tv-bg);
  border-radius: 8px;
  min-height: 220px;
  padding: 16px 20px 20px;
}

.row-label {
  color: #9aa0a6;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 4px 0 8px;
}

.tile-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-content: start;
  min-height: 40px;
  margin-bottom: 14px;
}

.empty-row {
  color: #7c828a;
  font-size: 12px;
  align-self: center;
}

.icon-tile {
  width: 88px;
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  font-size: 11px;
  text-align: center;
  padding: 4px;
  border: 2px solid transparent;
  position: relative;
  background: #555555;
}

.icon-tile:hover {
  border-color: #ffffff88;
}

.icon-tile .vc {
  font-family: monospace;
  font-size: 9.5px;
  opacity: 0.85;
}

.icon-tile.is-favorite-copy {
  border-color: var(--favorite);
}

.badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ffffff;
  color: #111111;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
}

.badge-favorite {
  position: absolute;
  top: -7px;
  left: -7px;
  background: var(--favorite);
  color: #ffffff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
}

.star-btn {
  position: absolute;
  bottom: 3px;
  right: 3px;
  border: 0;
  background: #00000055;
  color: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  padding: 3px 5px;
  cursor: pointer;
}

.star-btn.is-on {
  color: #ffd43b;
}

.filler-tile {
  background: #3a3d42;
  color: #b7bcc2;
  cursor: default;
}

.more-tile {
  background: #26282c;
  color: #7c828a;
  font-size: 10.5px;
  cursor: default;
}

/* The opened grouping takes a full line right after the grouping icon. */
.grouping-panel {
  flex-basis: 100%;
  border: 1px dashed #d2691e;
  border-radius: 10px;
  padding: 10px 12px 2px;
}

.grouping-panel .row-label {
  margin-top: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.panel-spaced {
  margin-top: 18px;
}

.panel h2 {
  font-size: 15px;
  margin: 0 0 12px;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.field-table th,
.field-table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 7px 8px;
}

.field-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  white-space: nowrap;
  width: 46%;
}

code.inline {
  background: #f0f1f3;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.xml-source {
  background: #0c0d10;
  color: #d7dbe0;
  padding: 16px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 460px;
}

.xml-tag {
  color: #7ee787;
}

.xml-attr {
  color: #79c0ff;
}

.xml-comment {
  color: #6b7280;
}

.app-preview-frame {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.app-preview-header {
  background: #f0f1f3;
  padding: 7px 10px;
  font-size: 12px;
  font-family: monospace;
  display: flex;
  justify-content: space-between;
}

/* The app is laid out at 1280x720 and scaled to the box width (../../app-screen.js). */
.app-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #202226;
}

.app-screen iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  border: 0;
  transform-origin: 0 0;
}

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 34px 10px;
  text-align: center;
}
