:root {
  --dock-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  --dock-clearance: calc(128px + var(--dock-bottom));
  scroll-padding-bottom: var(--dock-clearance);
}

.has-action-dock > footer { padding-bottom: calc(24px + var(--dock-clearance)); }

.action-dock {
  position: fixed;
  z-index: 30;
  inset-inline: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  bottom: var(--dock-bottom);
  max-width: 800px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 15px;
  color: #fffef9;
  background: #112b24;
  border: 1px solid #678779;
  border-radius: 21px;
  box-shadow: 0 12px 38px #0a221b44;
}

.dock-context { min-width: 0; display: flex; gap: 11px; align-items: center; }
.dock-context > .icon {
  width: 39px;
  height: 39px;
  padding: 9px;
  border: 1px solid #557367;
  border-radius: 11px;
  background: #244337;
  color: #d7ed9f;
}
.dock-heading { font-size: .93rem; font-weight: 750; line-height: 1.24; }
.dock-ad {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #c4d6c9;
  font-size: .68rem;
  line-height: 1.15;
}
.dock-ad b {
  font-family: var(--mono);
  font-weight: 700;
  color: #d8f36a;
  border: 1px solid #627b53;
  padding: 1px 5px;
  border-radius: 4px;
}
.dock-actions { min-width: 0; display: grid; align-items: stretch; grid-template-columns: repeat(2, minmax(0, auto)); gap: 8px; }
.action-dock-download-only .dock-actions { grid-template-columns: 1fr; }
.action-dock .button {
  justify-content: center;
  min-width: 44px;
  min-height: 50px;
  padding: 6px 12px;
  gap: 9px;
  border: 1px solid #547767;
  border-radius: 12px;
  background: #244337;
  color: #fffef9;
  font-size: .84rem;
  line-height: 1.18;
}
.action-dock .button:hover { background: #335748; }
.action-dock .button:focus-visible { outline: 2px solid #f1ffb7; outline-offset: 3px; }
.action-dock .button .icon { width: 19px; height: 19px; }
.action-dock .button small, .download-panel [data-apk] small { display: block; font-size: .75em; font-weight: 600; margin-top: 3px; }
.action-dock .button small { color: #cee0d4; }
.action-dock .dock-cta { width: 100%; height: 100%; }
.page-home .dock-cta, .page-app .dock-apk, .action-dock-download-only .dock-apk {
  color: #172e27;
  background: #d8f36a;
  border-color: #d8f36a;
}
.page-home .dock-cta:hover, .page-app .dock-apk:hover, .action-dock-download-only .dock-apk:hover { background: #edff9d; }
.page-home .dock-cta small, .page-app .dock-apk small, .action-dock-download-only .dock-apk small { color: #34491d; }
.page-login .dock-cta { border-color: #9ab883; }

.cta-affordance { position: relative; min-width: 0; }
.cta-tip {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(20rem, calc(100vw - 42px));
  padding: 10px 13px;
  color: #fffef9;
  background: #19382d;
  border: 1px solid #7d9d89;
  border-radius: 10px;
  box-shadow: 0 8px 26px #0a221b46;
  font-size: .8rem;
  line-height: 1.42;
  font-weight: 600;
  visibility: hidden;
}
.cta-tip::after { content: ''; position: absolute; inset: 100% 0 auto; height: 9px; }
@media (hover: hover) {
  .cta-affordance:not([data-tip-dismissed]):hover .cta-tip { visibility: visible; }
}
.cta-affordance:not([data-tip-dismissed]):has(a:focus-visible) .cta-tip { visibility: visible; }

.commercial[data-position="home-context"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px 24px;
  border: 1px solid #c9d6bc;
}
.commercial[data-position="home-context"] h2 { margin: 8px 0; }
.commercial[data-position="home-context"] p { margin: 0; }
.commercial[data-position="home-context"] .button { min-height: 48px; }
.commercial[data-position="home-context"] .button .icon { width: 18px; height: 18px; }

@media (max-width: 700px) {
  .commercial[data-position="home-context"] { grid-template-columns: 1fr; }
  .commercial .cta-affordance { justify-self: start; }
  .commercial .cta-tip { right: auto; left: 0; max-width: min(20rem, calc(100vw - 90px)); }
}
@media (max-width: 600px) {
  :root { --dock-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .action-dock { inset-inline: max(8px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 7px 8px 8px; border-radius: 16px; }
  .dock-context { gap: 6px; }
  .dock-context > .icon { width: 26px; height: 26px; padding: 5px; border-radius: 7px; }
  .dock-context > div { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; }
  .dock-heading { font-size: .75rem; }
  .dock-ad { margin-top: 0; font-size: .66rem; }
  .dock-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-dock .button { padding: 5px 6px; min-height: 46px; gap: 5px; }
  .action-dock .button .icon { width: 16px; height: 16px; }
}
@media (max-height: 355px) {
  :root { --dock-clearance: 0px; }
  .action-dock { position: relative; inset: auto; margin: 8px auto; width: calc(100% - 24px); }
}
@media print {
  :root { --dock-clearance: 0px; }
  .action-dock, .commercial[data-position="home-context"] { display: none; }
}
