/* Diamond Bay Contracts — UI v2 layer on top of app.css (which stays untouched
   as the v1 fallback's stylesheet). Adds the bottom tab bar, the Home screen,
   the More menu, and detail-page reorganization. Same brand tokens throughout. */

/* ---- Header: brand only on phones (tabs live at the bottom), inline links wide ---- */
.topnav { display: flex; gap: 2px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topnav a {
  text-decoration: none; color: var(--db-primary); font-weight: 600;
  padding: 8px 12px; border-radius: var(--db-radius); font-size: 15px;
}
.topnav a.active, .topnav a:active { background: var(--db-tint); }
@media (max-width: 639px) {
  .topnav { display: none; }
  .appbar { justify-content: center; padding: 9px 12px; }
}

/* ---- Bottom tab bar (phones only): the whole portal in four thumb taps ---- */
.tabbar { display: none; }
@media (max-width: 639px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--db-white); border-top: 1px solid var(--db-facet);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(15, 23, 42, .06);
  }
  body:has(.tabbar) { padding-bottom: 92px; }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: #64748B; font-size: 12px; font-weight: 600;
    padding: 3px 2px; -webkit-tap-highlight-color: transparent;
  }
  .tab-ico {
    display: flex; align-items: center; justify-content: center;
    width: 58px; height: 31px; border-radius: var(--db-radius-pill);
  }
  .tab.active { color: var(--db-primary); }
  .tab.active .tab-ico { background: var(--db-tint); }
}

/* ---- Home screen ---- */
.home-status { color: #475569; font-size: 15px; margin: -8px 0 16px; }
.attn-card {
  position: relative;
  background: var(--db-white); border: 1.5px solid var(--db-facet);
  border-radius: var(--db-radius); padding: 16px 46px 16px 18px; margin: 0 0 12px;
}
/* Dismiss (top-right x): silences that notice forever; new notices still show */
.dismiss { position: absolute; top: 6px; right: 6px; margin: 0; }
.dismiss button {
  border: 0; background: none; cursor: pointer; color: #94A3B8;
  font-size: 24px; line-height: 1; padding: 8px 10px; border-radius: var(--db-radius);
}
.dismiss button:active { background: var(--db-tint); color: var(--db-primary); }
.attn-card p { margin: 0; }
.attn-card .actions { margin: 12px 0 0; }
.attn-act { border-color: var(--db-accent); background: #FFFBEB; }
.attn-quiet { padding: 12px 18px; }
.attn-quiet a { font-weight: 600; }
.caught-up {
  display: flex; align-items: center; gap: 14px;
  background: #ECFDF5; border: 1px solid #A7F3D0;
  border-radius: var(--db-radius); padding: 18px; margin: 0 0 12px;
  font-weight: 600;
}
.caught-up .ok-ico {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--db-primary); color: var(--db-white);
  display: flex; align-items: center; justify-content: center;
}
.bigbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
@media (max-width: 359px) { .bigbtns { grid-template-columns: 1fr; } }
.bigbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; text-align: center; font-weight: 700; font-size: 17px; color: var(--db-ink);
  background: var(--db-accent); border-radius: var(--db-radius); padding: 22px 12px;
  border: 0; cursor: pointer; font-family: inherit;
}
.bigbtn:active { filter: brightness(.95); }
.bigbtn-secondary { background: var(--db-white); color: var(--db-primary); border: 2px solid var(--db-primary); padding: 20px 12px; }
.bigbtn svg { display: block; }

/* ---- More menu ---- */
.menu-list { margin: 0 0 18px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit;
  background: var(--db-white); border: 1px solid var(--db-facet);
  border-radius: var(--db-radius); padding: 15px 16px; margin-bottom: 10px;
}
.menu-item:active { background: var(--db-tint); }
.menu-item .mi-ico {
  flex: none; width: 42px; height: 42px; border-radius: var(--db-radius);
  background: var(--db-tint); color: var(--db-primary);
  display: flex; align-items: center; justify-content: center;
}
.menu-item .mi-body { flex: 1; min-width: 0; }
.menu-item .mi-title { display: block; font-weight: 700; font-size: 17px; }
.menu-item .mi-sub { display: block; color: #475569; font-size: 14px; margin-top: 1px; }
.menu-item::after { content: '\203A'; color: #94A3B8; font-size: 26px; line-height: 1; }

/* ---- Agreement page reorganization ---- */
.next-step { color: #475569; font-size: 16px; margin: -6px 0 16px; }

/* The hidden attribute must always win, even over display:flex rules like
   .actions (UA [hidden] loses to any author display rule otherwise). */
[hidden] { display: none !important; }

/* ---- Broadcast preview: in-place editing of the email body ---- */
[data-email-body][contenteditable="true"] {
  outline: 2px dashed var(--db-primary); outline-offset: 5px;
  border-radius: 4px; background: #FFFDF6; cursor: text;
}

/* ---- Small shared touches ---- */
.backlink { display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px; margin: 0 0 10px; }
.backlink::before { content: '\2039\00a0'; }
h1 { font-size: 24px; }
