/* Firefox Marketplace archive. Flexbox only: must render in Gecko 32+ (Firefox OS 2.0+). */
:root {
  --bg: #f2f4f7;
  --card: #fff;
  --text: #1c2733;
  --muted: #6b7785;
  --line: #e1e6ec;
  --head: #1f3a5c;
  --head2: #2b5079;
  --accent: #e66000;
  --accent-dark: #c24f00;
  --ok: #2e8540;
  --priv: #6d3fb2;
  --warn-bg: #fff4e5;
  --warn: #8a4b00;
}

* { box-sizing: border-box; }
html { -moz-text-size-adjust: none; text-size-adjust: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 "Fira Sans", "Open Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--head2); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- header */
.top {
  background: var(--head);
  background: linear-gradient(180deg, var(--head2), var(--head));
  color: #fff;
  padding: 10px 12px 0;
  position: relative;
}
.top-row { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; color: #fff; }
.logo img { margin-right: 8px; border-radius: 6px; }
.logo-text { font-size: 18px; font-weight: 600; line-height: 1.1; }
.logo-text small { display: block; font-size: 11px; font-weight: 400; opacity: .75; }
.lang { color: #fff; opacity: .8; font-size: 13px; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; padding: 2px 7px; }
.search { display: flex; margin: 10px 0 6px; background: #fff; border-radius: 6px; overflow: hidden; }
.search input {
  flex: 1; min-width: 0; border: 0; padding: 9px 10px; font: inherit; color: var(--text); background: transparent;
  -moz-appearance: none; appearance: none;
}
.search button { border: 0; background: transparent; color: var(--muted); padding: 0 12px; }
.tabs { display: flex; margin: 0 -12px; overflow-x: auto; }
.tabs a {
  flex: 1; text-align: center; color: rgba(255,255,255,.75); padding: 9px 6px 8px; font-size: 13px;
  white-space: nowrap; border-bottom: 3px solid transparent;
}
.tabs a.on { color: #fff; border-bottom-color: var(--accent); }

main { max-width: 960px; margin: 0 auto; padding: 0 0 20px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 12px 24px; }

/* ---------- home */
.banner {
  margin: 12px; padding: 16px; border-radius: 8px; color: #fff;
  background: var(--accent);
  background: linear-gradient(135deg, #ff9500, #e66000 55%, #b33c00);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.banner h1 { font-size: 20px; }
.banner p { margin: 2px 0 0; opacity: .85; font-size: 13px; }
.add-home-status { width: 100%; margin: 6px 0 0; font-size: 12px; }
.add-home[disabled] { opacity: .7; }
.add-home { margin-top: 8px; background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: 4px; padding: 6px 10px; font: inherit; font-size: 13px; }

.chips { display: flex; overflow-x: auto; padding: 0 12px 4px; }
.chip {
  flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px;
  margin-right: 6px; font-size: 13px; color: var(--text); white-space: nowrap;
}

.shelf { margin: 14px 0 0; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 12px 6px; }
.shelf-head h2 { font-size: 16px; }
.shelf-head a { font-size: 13px; }
.tiles { display: flex; overflow-x: auto; padding: 0 6px 6px; -webkit-overflow-scrolling: touch; }
.tile {
  flex: none; width: 92px; margin: 0 3px; padding: 8px 4px; text-align: center; color: var(--text);
  display: flex; flex-direction: column; align-items: center; border-radius: 8px;
}
.tile:active { background: var(--line); }
.tile .icon { width: 64px; height: 64px; }
.tile-name {
  display: block; width: 100%; font-size: 12px; margin-top: 5px; line-height: 1.25; height: 2.5em; overflow: hidden;
}

.icon { border-radius: 12px; background: #fff; object-fit: contain; flex: none; }

/* ---------- stars & badges */
.stars {
  display: inline-block; position: relative; white-space: nowrap; vertical-align: middle;
  font-size: 12px; line-height: 1; letter-spacing: 1px; color: #cfd6de;
}
.stars span { position: absolute; left: 0; top: 0; overflow: hidden; color: #ffa400; }
.tile .stars { font-size: 10px; }
.count { color: var(--muted); font-size: 12px; margin: 0 4px 0 2px; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  border-radius: 3px; padding: 1px 5px; margin-right: 3px; vertical-align: middle;
  background: var(--line); color: var(--muted);
}
.badge.priv { background: #ece4f8; color: var(--priv); }
.badge.hosted { background: #e4eef8; color: var(--head2); }
.badge.paid { background: var(--warn-bg); color: var(--warn); }
.badge.cat { text-transform: none; font-weight: 400; font-size: 12px; }

/* ---------- lists */
.list-head { padding: 12px 12px 4px; }
.list-head h1, .page-h { font-size: 19px; }
.page-h { padding: 14px 12px 8px; }
.list-head small { font-size: 13px; color: var(--muted); font-weight: 400; }
.filters { display: flex; margin-top: 8px; }
.filters select {
  flex: 1; min-width: 0; margin-right: 6px; font: inherit; font-size: 14px; padding: 6px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--card); color: var(--text);
}
.filters select:last-of-type { margin-right: 0; }

.app-list { list-style: none; margin: 8px 0 0; padding: 0; background: var(--card); border-top: 1px solid var(--line); }
.app-row { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.app-link { flex: 1; min-width: 0; display: flex; align-items: center; color: var(--text); }
.app-row .icon { width: 56px; height: 56px; }
.app-meta { flex: 1; min-width: 0; padding: 0 10px; }
.app-meta h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.author { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin-top: 2px; }
.more-btn { display: block; margin: 12px; padding: 10px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }

/* ---------- install button */
.install {
  flex: none; min-width: 84px; padding: 7px 10px; font: inherit; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--accent); border: 0; border-radius: 4px; cursor: pointer;
  -moz-appearance: none; appearance: none;
}
.install:active { background: var(--accent-dark); }
.install.big { width: 100%; padding: 11px; font-size: 16px; }
.install.installing { background: #8a96a3; }
.install.ready { background: var(--ok); }
.install.error { background: #b3261e; }
.install[disabled] { background: #b7c0ca; }
.install.download { background: var(--head2); }
.install-status { font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 1em; text-align: center; }
.install-status.err { color: #b3261e; }
.progress { height: 3px; background: var(--line); margin-top: 6px; border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; }

/* ---------- detail */
.detail { background: var(--card); padding-bottom: 8px; }
.detail-head { display: flex; padding: 14px 12px 10px; }
.detail-head .icon.big { width: 88px; height: 88px; }
.detail-title { flex: 1; min-width: 0; padding-left: 12px; }
.detail-title h1 { font-size: 20px; line-height: 1.2; }
.badges { margin-top: 4px; }
.detail-actions { padding: 0 12px 10px; }
.note { margin: 0 12px 10px; padding: 8px 10px; border-radius: 4px; background: #eef2f6; font-size: 13px; color: var(--muted); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.shots { display: flex; overflow-x: auto; padding: 4px 8px 10px; }
.shot { flex: none; margin: 0 4px; }
.shot img { display: block; height: 220px; max-width: none; border-radius: 4px; border: 1px solid var(--line); }
.block { padding: 12px; border-top: 1px solid var(--line); }
.block h2 { font-size: 15px; margin-bottom: 6px; }
.desc { white-space: pre-line; word-wrap: break-word; overflow-wrap: break-word; }
.desc.collapsible.clamped { max-height: 9.8em; overflow: hidden; position: relative; }
.desc.collapsible.clamped:after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em;
  background: linear-gradient(rgba(255,255,255,0), #fff);
}
.expand { border: 0; background: none; color: var(--head2); font: inherit; padding: 4px 0; }
.perms { list-style: none; margin: 0; padding: 0; }
.perms li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.perms li:last-child { border-bottom: 0; }
.perms code { font-size: 13px; color: var(--priv); }
.perm-desc { color: var(--muted); font-size: 13px; }
.info { margin: 0; display: flex; flex-wrap: wrap; font-size: 14px; }
.info dt { width: 35%; color: var(--muted); padding: 4px 8px 4px 0; }
.info dd { width: 65%; margin: 0; padding: 4px 0; word-wrap: break-word; overflow-wrap: break-word; }
.mono { font-family: "Fira Mono", monospace; font-size: 12px; }
.detail .shelf { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 0; }

.lightbox {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.9); z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 100%; max-height: 100%; }

/* ---------- categories */
.cat-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-top: 1px solid var(--line); }
.cat-list a { display: flex; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.cat-list small { color: var(--muted); }

.prose { background: var(--card); border: 0; margin-top: 12px; }
.prose h1 { font-size: 19px; margin-bottom: 8px; }
.prose h2 { margin-top: 14px; }
.prose pre { background: #1c2733; color: #e6edf3; padding: 10px; border-radius: 4px; overflow-x: auto; }
.prose code { font-size: 13px; }
.prose li { margin-bottom: 4px; }
.prose a.dl { font-family: "Fira Mono", monospace; font-weight: 600; }

@media (min-width: 720px) {
  .top { padding: 12px 24px 0; }
  .top-row, .search, .tabs { max-width: 912px; margin-left: auto; margin-right: auto; }
  .tabs { margin-bottom: 0; }
  .tabs a { flex: none; padding: 9px 16px 8px; }
  .app-list { display: flex; flex-wrap: wrap; border: 0; background: transparent; padding: 0 6px; }
  .app-row { width: calc(50% - 12px); margin: 0 6px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
  .detail { margin-top: 12px; border-radius: 8px; }
  .install.big { width: auto; min-width: 200px; }
  .detail-actions { display: flex; align-items: center; }
  .install-status { margin: 0 0 0 12px; text-align: left; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #0f151c; --card: #18212b; --text: #e3e8ee; --muted: #93a0ae; --line: #2a3644; --warn-bg: #3a2a12; --warn: #ffc27a; }
  .search { background: #26323f; }
  .icon { background: #26323f; }
  .desc.collapsible.clamped:after { background: linear-gradient(rgba(24,33,43,0), #18212b); }
  .note { background: #212c38; }
  .badge.priv { background: #2e2342; color: #c7a9f2; }
  .badge.hosted { background: #1e3147; color: #9cc3ee; }
  a { color: #8ab8e8; }
}
