:root {
  --app-petrol: #315f50;
  --app-petrol-dark: #24483d;
  --app-cream: #f4f2e9;
  --app-gold: #c8aa67;
  --app-shadow: 0 16px 48px rgba(34, 64, 53, .11);
}

.tl-app-shell main { padding-bottom: 108px; }
.app-home-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin-bottom: 34px;
  padding: 34px 38px;
  border: 1px solid #d3dfd7;
  border-radius: 26px;
  background: linear-gradient(135deg, #e5eee8 0%, #f8f7f0 72%);
  box-shadow: var(--app-shadow);
}
.app-home-hero h1 { margin: 8px 0 4px; font-size: clamp(34px, 5vw, 54px); }
.app-home-hero p { margin: 0; color: var(--muted); }
.app-home-hero > img { width: 150px; height: 150px; object-fit: contain; opacity: .13; transform: rotate(-7deg); }
.app-role-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.app-role-list span { padding: 6px 11px; border: 1px solid #bdd0c4; border-radius: 999px; background: rgba(255,255,255,.72); color: var(--app-petrol); font-size: 12px; font-weight: 700; }

.app-primary-actions { margin-bottom: 38px; }
.app-action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.app-action-grid a {
  display: flex;
  min-width: 0;
  min-height: 172px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 7px 24px rgba(35, 66, 55, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.app-action-grid a:hover { transform: translateY(-3px); border-color: #8dad9e; box-shadow: var(--app-shadow); }
.app-action-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: auto; border-radius: 13px; background: #e6efe9; color: var(--app-petrol); font: 700 20px/1 Georgia, serif; }
.app-action-grid strong { margin-top: 18px; font-size: 15px; line-height: 1.25; }
.app-action-grid small { margin-top: 5px; color: var(--muted); line-height: 1.35; }

.app-office-action { margin: 0 0 36px; }
.app-office-action > a { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 26px; border-radius: 18px; background: var(--app-petrol); color: #fff; text-decoration: none; box-shadow: var(--app-shadow); }
.app-office-action > a > span:first-child { display: grid; gap: 4px; }
.app-office-action .eyebrow { color: #d7e8df; }
.app-office-action strong { font-size: 18px; }
.app-office-action small { color: #d7e2dd; }
.app-office-action > a > span:last-child { font-size: 25px; }
.app-all-heading { margin-top: 10px; }

.app-install-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: 0 0 28px; padding: 18px 20px; border: 1px solid #c9d8d0; border-radius: 18px; background: linear-gradient(135deg, #edf4ef 0%, #fbfaf4 100%); box-shadow: 0 8px 26px rgba(34,64,53,.07); }
.app-install-panel[hidden] { display: none; }
.app-install-panel > div { min-width: 0; max-width: 720px; }
.app-install-panel .eyebrow { margin: 0 0 3px; }
.app-install-panel h2 { margin: 0 0 4px; font-size: clamp(20px, 2.4vw, 25px); line-height: 1.2; }
.app-install-panel p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.app-install { position: static; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 16px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: var(--app-petrol); color: #fff; box-shadow: 0 8px 22px rgba(20,47,38,.2); font-weight: 700; cursor: pointer; }
.app-install:hover { background: var(--app-petrol-dark); }
.app-install:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.app-install.is-ready::after { width: 7px; height: 7px; border-radius: 50%; background: #f0d590; content: ""; }
.app-install[hidden] { display: none; }
.app-install-dialog { width: min(520px, calc(100vw - 32px)); padding: 26px; border: 1px solid #cbd8d0; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 28px 90px rgba(20,47,38,.28); }
.app-install-dialog::backdrop { background: rgba(20,37,31,.52); backdrop-filter: blur(3px); }
.app-install-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 18px; }
.app-install-dialog h2 { margin: 3px 0 0; font-size: 28px; }
.app-install-dialog p { line-height: 1.55; }
.app-install-dialog ol { display: grid; gap: 9px; margin: 12px 0 20px; padding-left: 23px; }
.app-install-dialog li { padding-left: 4px; line-height: 1.45; }
.app-install-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 24px; line-height: 1; }
.app-install-note { margin: 18px 0 0; padding: 14px 15px; border-radius: 13px; background: #eef3ef; color: var(--muted); font-size: 14px; }
.app-bottom-nav { display: none; }

@media (max-width: 900px) {
  .app-action-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .tl-app-shell { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .tl-app-shell header.portal-header { position: sticky; z-index: 20; top: 0; }
  .tl-app-shell main { padding: 25px 16px 45px; }
  .app-home-hero { margin-bottom: 28px; padding: 25px 22px; border-radius: 21px; }
  .app-home-hero h1 { font-size: 34px; letter-spacing: -1.1px; }
  .app-home-hero > img { position: absolute; right: -22px; bottom: -28px; width: 128px; height: 128px; }
  .app-home-hero > div { position: relative; z-index: 1; }
  .app-action-grid { gap: 10px; }
  .app-action-grid a { min-height: 154px; padding: 16px; border-radius: 16px; }
  .app-action-grid strong { font-size: 14px; }
  .app-office-action > a { padding: 19px; }
  .app-office-action strong { font-size: 16px; }
  .app-install-panel { align-items: stretch; flex-direction: column; gap: 15px; margin-bottom: 22px; padding: 17px; border-radius: 16px; }
  .app-install { width: 100%; }
  .app-install-dialog { padding: 22px; border-radius: 19px; }
  .app-bottom-nav {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 68px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid #d7dfd9;
    background: rgba(255,255,255,.97);
    box-shadow: 0 -8px 24px rgba(31,55,47,.08);
  }
  .app-bottom-nav a { display: grid; place-items: center; align-content: center; gap: 1px; min-width: 0; padding: 3px; color: #64746e; text-decoration: none; font-size: 10px; font-weight: 700; }
  .app-bottom-nav a span { font: 700 20px/1.1 Georgia, serif; }
  .app-bottom-nav a.active { color: var(--app-petrol); }
  .tl-app-shell footer, .tl-app-shell .tl-identity-footer { display: none; }
}

@media (display-mode: standalone) {
  .tl-app-shell .portal-header { padding-top: calc(12px + env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  .app-action-grid a { transition: none; }
}
