/* HVAC Lens — app chrome, license gate, settings, help, logs, work-session.
   Loaded after styles.css + stylesdark.css on /app/ pages.
   Public acquire styles live in styles/pwa-acquire.css. */

/* App home only: photo backgrounds (set by app-shell.js after successful image load).
   Other app pages use solid theme colours. Body background-color is the fallback. */
html.app-bg-image body.app-home {
  background-image: var(--app-bg-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

/* App shell */
.app-header {
  background: var(--header-bg);
  color: #fff;
  padding: calc(12px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 12px calc(16px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 1.1rem;
  margin: 0;
}

.app-header-back {
  color: #fff;
  text-decoration: none;
}

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

/* ~70% of the old Offline Site .btn (42px / 0.85rem) — output only */
.app-network-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.app-network-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.app-network-status.is-online {
  background: rgba(34, 197, 94, 0.22);
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.45);
}

.app-network-status.is-online::before {
  background: #86efac;
  box-shadow: 0 0 6px rgba(134, 239, 172, 0.8);
}

.app-network-status.is-offline {
  background: rgba(245, 158, 11, 0.28);
  box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.55);
}

.app-network-status.is-offline::before {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
}

.app-settings-gear,
.app-help-link,
.app-header .app-theme-toggle,
.app-header .dark-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.2s;
}

.app-help-link {
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  width: auto;
}

.app-header .app-theme-toggle,
.app-header .dark-mode-toggle {
  border: none;
  cursor: pointer;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 600;
  width: auto;
  font-family: inherit;
}

.app-settings-gear:hover,
.app-help-link:hover,
.app-header .app-theme-toggle:hover,
.app-header .dark-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
}

.app-top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
  background: var(--header-bg);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 150;
}

.app-top-bar-back {
  justify-self: start;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

.app-top-bar-title {
  justify-self: center;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.app-top-bar .stepper-nav {
  justify-self: center;
  display: flex;
  gap: 0.35rem;
}

.app-top-bar .stepper-nav button {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid #fff;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.app-top-bar .stepper-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Back | title | Help | gear */
.app-top-bar:has(.app-help-link) {
  grid-template-columns: 1fr auto auto auto;
}

/* Non-calculator tool bars keep Back | title | Help | gear. Version and status sit in the title. */
.app-top-bar .app-top-bar-title:has(.app-header-meta) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  overflow: visible;
  white-space: nowrap;
  max-width: none;
}

.app-header-version {
  font-size: 0.6rem;
  font-weight: 400;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
}

.app-top-bar .app-settings-gear {
  justify-self: end;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.1rem;
}

.app-top-bar .app-help-link {
  justify-self: end;
  width: auto;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.875rem;
  margin-right: 2px;
}

/* Calculator header: text links, gear without a button box, title centered, version under it. */
.calc-top-bar,
.calc-top-bar:has(.app-help-link),
.calc-top-bar:has(.app-top-bar-links) {
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: calc(4px + env(safe-area-inset-top, 0px));
  padding-bottom: 4px;
}

.calc-top-bar .app-top-bar-links {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-top-bar .app-top-bar-back,
.calc-top-bar .app-help-link,
.calc-top-bar .app-settings-gear {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 2px 0;
  border-radius: 0;
  background: none;
  color: #fff;
  line-height: 1.2;
  text-decoration: none;
}

.calc-top-bar .app-top-bar-back,
.calc-top-bar .app-help-link {
  font-size: 0.85rem;
  font-weight: 600;
}

.calc-top-bar .app-settings-gear {
  font-size: 1.1rem;
}

.calc-top-bar .app-top-bar-back:hover,
.calc-top-bar .app-help-link:hover,
.calc-top-bar .app-settings-gear:hover {
  background: none;
  text-decoration: underline;
}

.calc-top-bar .app-top-bar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  overflow: visible;
  white-space: nowrap;
  line-height: 1.15;
  max-width: none;
}

.calc-top-bar .app-header-version {
  font-size: 0.6rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.1;
}

.app-footer-bar {
  display: none;
}

.app-version-line {
  margin: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.85rem;
  color: #000;
}

.app-version-line a {
  color: var(--primary-blue);
}

html.dark .app-version-line {
  color: #e8edf4;
}

.app-settings-subheading {
  font-size: 0.95rem;
  margin: 16px 0 6px;
  color: #334155;
}

.app-device-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.app-device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.app-device-info {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.4;
}

.app-device-seen {
  font-size: 0.8rem;
  color: #64748b;
}

.app-device-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-blue);
}

.app-btn-remove-device {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.app-btn-remove-device:hover {
  background: #f1f5f9;
}

.app-btn-remove-device:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-license-bar {
  background: #f0fdfa;
  padding: 8px 16px;
  font-size: 0.85rem;
  text-align: center;
  color: #334155;
}

.app-license-bar-inset {
  border-radius: 8px;
  margin-bottom: 14px;
}

html.dark .app-license-bar {
  background: #1a2540;
  color: #94a3b8;
}

.app-btn-remove-key {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #dc3545;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.app-btn-remove-key:hover {
  background: #c82333;
}

body.app-home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.app-home .app-tool-grid {
  flex: 1;
  align-content: center;
}

.app-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.app-tool-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  text-decoration: none;
  color: inherit;
  display: block;
}

html.dark .app-tool-card {
  background: #1e293b;
  border-color: #334155;
}

.app-tool-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
}

.app-tool-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--primary-blue);
}

.app-tool-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.app-tool-card.is-default-tool {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

html.dark .app-tool-card.is-default-tool {
  border-color: #5dd879;
  box-shadow: 0 0 0 2px rgba(93, 216, 121, 0.2);
}

.app-default-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #28a745;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

.app-tool-card .app-default-badge {
  display: block;
  margin-top: 8px;
}

/* Settings page */
.app-header-compact h1 {
    font-size: 1.35rem;
    margin-bottom: 0.15rem;
}

.app-header-sub {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0;
    font-weight: 400;
}

.ref-calc-switcher {
    max-width: 420px;
    margin: 0 auto 1rem;
    padding: 0 16px;
}

.app-settings-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.app-settings-section {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 16px;
  margin-bottom: 16px;
}

html.dark .app-settings-section {
  background: #1e293b;
  border-color: #334155;
}

.app-settings-section h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--primary-blue);
}

.app-settings-hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: #64748b;
}

.app-settings-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.app-settings-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}

html.dark .app-settings-option {
  border-color: #334155;
}

.app-settings-option:has(input:checked) {
  border-color: var(--primary-blue);
  background: #f0fdfa;
}

html.dark .app-settings-option:has(input:checked) {
  background: #1a2540;
}

.app-settings-option input {
  margin: 0;
}

.app-settings-warning {
    color: #b45309;
    border-left: 3px solid #f59e0b;
    padding-left: 12px;
}

html.dark .app-settings-warning {
    color: #fbbf24;
}

.app-settings-section-danger {
    border-color: #fecaca;
}

html.dark .app-settings-section-danger {
    border-color: #7f1d1d;
}

.app-settings-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

html.dark .app-settings-note {
  color: #cbd5e1;
}

.app-settings-link-btn[hidden] {
  display: none !important;
}

.app-settings-link-btn {
  display: block;
  text-align: center;
  padding: 12px 16px;
  border-radius: 8px;
  background: #f0fdfa;
  color: var(--primary-blue);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid #99f6e4;
  transition: border-color 0.2s, background 0.2s;
}

/* Help index — compact bullet topics + search */
.help-search-input {
  margin-top: 8px;
  margin-bottom: 1rem;
  max-width: 32rem;
  width: 100%;
  box-sizing: border-box;
}

.help-topic-list {
  list-style: disc;
  margin: 0 0 1rem 1.15rem;
  padding: 0;
}

.help-topic-list .help-item {
  margin: 0.28rem 0;
  line-height: 1.35;
}

.help-topic-list .help-item a {
  color: var(--primary-blue);
  font-weight: 600;
  text-decoration: none;
}

.help-topic-list .help-item a:hover {
  text-decoration: underline;
}

html.dark .help-topic-list .help-item a {
  color: var(--primary-blue);
}

.help-item-hint {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 400;
  margin-top: 0.1rem;
  margin-left: 0;
}

html.dark .help-item-hint {
  color: #94a3b8;
}

.help-no-results {
  text-align: center;
  color: #64748b;
  font-style: italic;
  padding: 1.5rem 0.5rem;
  margin: 0;
}

.help-article-nav {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.help-article-nav a {
  color: var(--primary-blue);
  font-weight: 600;
  text-decoration: none;
}

.help-article-nav a:hover {
  text-decoration: underline;
}

html.dark .help-article-nav a {
  color: var(--primary-blue);
}

.app-settings-link-btn:hover {
  border-color: var(--primary-blue);
  background: #ccfbf1;
}

html.dark .app-settings-link-btn {
  background: #1a2540;
  border-color: #334155;
  color: var(--primary-blue);
}

/* Settings and Manage devices: headings and rows, no cards. Help keeps its sections. */
.app-settings-plain .app-settings-section,
html.dark .app-settings-plain .app-settings-section,
.app-settings-plain .app-settings-section-danger,
html.dark .app-settings-plain .app-settings-section-danger {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 14px;
}

.app-settings-plain .app-settings-section h2 {
  font-size: 0.95rem;
  margin: 0 0 2px;
}

.app-settings-plain .app-settings-options {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
}

.app-settings-plain .app-settings-option,
html.dark .app-settings-plain .app-settings-option,
.app-settings-plain .app-settings-option:has(input:checked),
html.dark .app-settings-plain .app-settings-option:has(input:checked) {
  background: none;
  border: none;
  border-radius: 0;
  padding: 2px 0;
}

.app-settings-plain .app-settings-license-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.app-settings-plain .app-settings-license-line h2 {
  margin: 0;
}

.app-settings-plain .app-license-bar,
html.dark .app-settings-plain .app-license-bar {
  background: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.app-settings-plain .app-license-bar-inset {
  border-radius: 0;
  margin-bottom: 8px;
}

.app-settings-plain .app-device-item {
  background: none;
  border: none;
  border-radius: 0;
  flex-wrap: nowrap;
  padding: 4px 0;
  margin-bottom: 0;
}

.app-settings-plain .app-device-info {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-settings-plain .app-device-list {
  margin-top: 4px;
}

.app-settings-plain .app-settings-hint {
  margin: 2px 0 0;
}

html.dark .app-settings-plain .app-settings-subheading,
html.dark .app-settings-plain .app-device-info {
  color: var(--text);
}

html.dark .app-settings-plain .app-device-seen {
  color: var(--text-light);
}

.app-settings-plain .app-settings-link-btn,
html.dark .app-settings-plain .app-settings-link-btn,
.app-settings-plain .app-settings-link-btn:hover,
html.dark .app-settings-plain .app-settings-link-btn:hover {
  display: inline;
  width: auto;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  text-align: left;
  font-weight: 600;
}

.app-settings-plain .app-settings-link-btn:hover,
html.dark .app-settings-plain .app-settings-link-btn:hover {
  text-decoration: underline;
}

.ref-info-modal-content {
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

.ref-info-section {
  margin-top: 1.25rem;
}

.ref-info-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #334155;
}

.ref-info-section ul {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.ref-info-section li + li {
  margin-top: 0.35rem;
}

.ref-info-section a {
  color: var(--primary-blue);
}

.ref-info-empty {
  list-style: none;
  margin-left: -1.25rem;
  color: #64748b;
  font-style: italic;
}

html.dark .ref-info-section h3 {
  color: #cbd5e1;
}

html.dark .ref-info-section a {
  color: var(--primary-blue);
}

html.dark .ref-info-empty {
  color: #94a3b8;
}

/* App development log */
.app-log-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.app-log-heading {
  color: var(--primary-blue);
  font-size: 1.25rem;
  margin: 0 0 8px;
}

.app-log-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 24px;
}

.app-log-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-log-entry {
  display: block;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

html.dark .app-log-entry {
  border-color: #334155;
}

.app-log-entry:hover {
  border-color: var(--primary-blue);
}

.app-log-date {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 4px;
}

.app-log-title {
  display: block;
  font-weight: 600;
  color: var(--primary-blue);
}

.app-log-section {
  margin-bottom: 24px;
}

.app-log-section h3 {
  color: #334155;
  font-size: 1rem;
  margin: 0 0 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

html.dark .app-log-section h3 {
  color: #e2e8f0;
  border-bottom-color: #334155;
}

.app-log-section ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.app-log-section li {
  margin-bottom: 6px;
}

.app-log-section code {
  font-size: 0.85em;
  background: #f0fdfa;
  padding: 1px 5px;
  border-radius: 4px;
}

html.dark .app-log-section code {
  background: #1a2540;
}

/* License gate overlay — scrollable so email/password form is reachable
   on short home-icon / phone viewports (flex center no longer clips). */
.license-gate {
  position: fixed;
  inset: 0;
  background: #0f172a;
  z-index: 20000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px
    max(16px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.license-gate[hidden] {
  display: none;
}

.license-gate-panel {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  margin: auto 0;
  max-height: none;
  box-sizing: border-box;
}

html.dark .license-gate-panel {
  background: #1e293b;
  color: #e2e8f0;
}

.license-gate-panel h2 {
  color: var(--primary-blue);
  margin: 0 0 12px;
}

.license-gate-offline-msg {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}

.license-gate-panel .acquire-error.license-gate-msg-ok {
  color: #28a745;
}

html.dark .license-gate-panel .acquire-error.license-gate-msg-ok {
  color: #3dd68c;
}

.license-gate-login-error {
  margin: 8px 0 0;
  font-size: 0.9rem;
  text-align: left;
}

.license-gate-login-hint {
  margin: 16px 0 8px;
  font-size: 0.9rem;
  color: #64748b;
}

html.dark .license-gate-login-hint {
  color: #94a3b8;
}

/* Update toast */
.sw-update-toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 30000;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sw-update-toast[hidden] {
  display: none;
}

.sw-update-toast button {
  background: #fff;
  color: var(--primary-blue);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Work session — Reload last session (app-wide modal) */
.work-session-reload-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.work-session-reload-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.work-session-reload-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--primary-blue);
  background: linear-gradient(135deg, #ccfbf1 0%, #f0fdfa 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  box-sizing: border-box;
}

html.dark .work-session-reload-modal-panel {
  background: linear-gradient(135deg, #1a2540 0%, #0f172a 100%);
  border-color: var(--primary-blue);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.work-session-reload-modal-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #115e59;
}

html.dark .work-session-reload-modal-title {
  color: #bfdbfe;
}

.work-session-reload-text {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.45;
}

html.dark .work-session-reload-text {
  color: #e2e8f0;
}

.work-session-reload-time {
  font-weight: 400;
  color: #64748b;
  font-size: 0.9rem;
}

html.dark .work-session-reload-time {
  color: #94a3b8;
}

.work-session-reload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.work-session-reload-actions .pwa-get-btn {
  margin: 0;
  width: auto;
  min-width: 0;
  padding: 10px 16px;
  font-size: 0.95rem;
}

.work-session-dismiss {
  padding: 8px 14px;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid #94a3b8;
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
}

html.dark .work-session-dismiss {
  border-color: #64748b;
  color: #cbd5e1;
}

.work-session-never-btn {
  display: block;
  width: 100%;
  margin: 12px 0 0;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  text-align: center;
}

html.dark .work-session-never-btn {
  color: #94a3b8;
}

.work-session-never-btn:hover {
  color: #0f766e;
}

html.dark .work-session-never-btn:hover {
  color: #93c5fd;
}

.work-session-reload-msg {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: #15803d;
  font-weight: 600;
}

html.dark .work-session-reload-msg {
  color: #4ade80;
}

/* Legacy home banner class (if any leftover markup) */
.work-session-reload-bar {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--primary-blue);
  background: linear-gradient(135deg, #ccfbf1 0%, #f0fdfa 100%);
  box-sizing: border-box;
}

/* License-gate / work-session share these with the public acquire sheet. */
.pwa-get-btn[hidden] {
  display: none !important;
}

.pwa-get-btn {
  display: inline-block;
  background: var(--cta-free);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 32px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 260px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.38);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

a.pwa-get-btn:hover {
  color: #fff;
}

.pwa-get-btn:hover {
  background: var(--cta-free-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.45);
}

.pwa-get-btn:focus-visible {
  outline: 3px solid var(--cta-free-focus);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .pwa-get-btn {
    min-width: 0;
    width: 100%;
  }
}

.acquire-email-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin: 16px 0;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
}

.acquire-email-input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--primary-blue);
}

html.dark .acquire-email-input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark .acquire-email-input:focus-visible {
  border-color: var(--primary-blue);
}

.acquire-error {
  color: #dc3545;
  font-size: 0.9rem;
  margin-top: 8px;
}

.acquire-error.device-limit-error,
#device-list-status.device-limit-error {
  color: #dc2626;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
}

html.dark .acquire-error.device-limit-error,
html.dark #device-list-status.device-limit-error {
  color: #f87171;
}

/* Help pages without inline styles (Peter, 2026-10-08). */
.app-header h1 a.app-header-home {
    color: #fff;
    text-decoration: none;
}
.license-gate-panel .pwa-get-btn.license-gate-wide {
    width: 100%;
}
.license-gate-panel .license-gate-beta-line {
    margin-top: 16px;
}
.license-gate-panel .pwa-get-btn.license-gate-beta-btn,
.license-gate-panel .pwa-get-btn.license-gate-beta-btn:hover {
    min-width: 0;
    padding: 12px 16px;
    font-size: 1.05rem;
    background: transparent;
    color: var(--cta-free);
    border: 2px solid var(--cta-free);
    box-shadow: none;
}
.help-article-nav.help-article-nav-end {
    margin-top: 1.25rem;
}
.app-settings-hint.help-list {
    line-height: 1.7;
}
.help-table-wrap {
    overflow-x: auto;
    margin: 0 0 14px;
}
.help-limits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: var(--text);
}
.help-limits-table th,
.help-limits-table td {
    padding: 6px 8px;
    border: 1px solid var(--border);
    text-align: right;
}
.help-limits-table th {
    font-weight: 700;
}
.help-limits-table th:first-child,
.help-limits-table td:first-child {
    text-align: left;
}
