/* Phone layout: the extension's design (popup.css) stretched to fill an iPhone screen,
   with room for the notch and home bar, and bigger touch targets. */
html { -webkit-text-size-adjust: 100%; }
body, body.wide {
  width: auto;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  overscroll-behavior: none;
}
body > header { top: calc(env(safe-area-inset-top) + 6px); }

/* iPhone zooms into text boxes with small text; 16px stops that */
input, button, select { font-size: 16px !important; }
.range-tabs button, .ghost { font-size: 14px !important; }

/* The company list and detail view scroll inside the screen, between header and footer */
#cards { max-height: calc(100dvh - 160px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
#detail { max-height: calc(100dvh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
footer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

/* No hovering on a phone: show the remove button and grip, and make the grip easy to hit */
.remove { opacity: .55; width: 32px; height: 32px; font-size: 20px; }
.handle { opacity: .75; font-size: 18px; padding: 6px 12px 6px 4px; margin: -6px 0 -6px -8px; }
.icon-btn { width: 38px; height: 38px; font-size: 17px; }

/* Detail view, one column */
.detail-head { flex-direction: column; align-items: flex-start; gap: 8px; }
.detail-price { text-align: left; }
.detail-name { font-size: 26px; }
.chart-top { flex-direction: column; align-items: stretch; gap: 10px; }
.range-tabs { justify-content: space-between; }
.stats { grid-template-columns: repeat(2, 1fr); }
.chart-hint { display: none; }

/* Settings: room to tap */
.toggle { padding: 7px 0; flex-wrap: wrap; }
.toggle input[type="checkbox"] { width: 20px; height: 20px; }
#settings { margin: 0 12px 12px; max-height: calc(100dvh - 160px - env(safe-area-inset-top)); overflow-y: auto; }

/* Sign-in screen (shown until you sign in to your Zazu account) */
#signin { display: none; }
html.signed-out body > :not(#entry):not(#signin):not(#pw-reset):not(.captcha-box):not(script) { display: none !important; }
html.signed-out #signin {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); gap: 6px;
}
#signin h1 { font-family: var(--serif); font-size: 34px; margin: 10px 0 14px; letter-spacing: -.03em; }
#signin-box { width: 100%; max-width: 360px; }
#signin-box .auth-seg { justify-self: center; }
#signin-box .auth-title, #signin-box .auth-sub, #signin-box .auth-intro { text-align: center; }
#signin-box .auth-form input { padding: 12px 16px; font-size: 16px; } /* 16px stops iPhone zooming in */
#signin-box .auth-submit { padding: 12px; }
.big-logo { width: 56px; height: 56px; border-radius: 16px; }
.big-logo svg { width: 30px; height: 30px; }

/* Report page */
body.report { padding-bottom: env(safe-area-inset-bottom); }
.report .wrap { padding: 12px 16px 24px; }
.report h1 { font-size: 32px; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--text); text-decoration: none; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.report .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.company .head { align-items: flex-start; }
.chart { min-height: 0; }

/* Portfolio, one column */
#portfolio, #history, #market, #calendar { max-height: calc(100dvh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.pf-stats { grid-template-columns: repeat(2, 1fr); }
.pf-facts { grid-template-columns: 1fr 1fr; }
.pf-head-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
.pf-grid { grid-template-columns: 1fr 1fr; }
.pf-grid .pf-field:last-child { grid-column: 1 / -1; }
.pf-seg button { padding: 8px 26px; }
.suggest-row { padding: 11px 10px; }

/* Accounts */
.auth-seg button { padding: 8px 18px; }
.auth-form input { padding: 12px 16px; }
.auth-submit { padding: 12px; }
.account-row { flex-wrap: wrap; }

/* Links to the privacy policy, terms and support page */
.legal-links { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.legal-links a, .signin-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-links a:hover, .signin-legal a:hover { color: var(--text); }
.signin-legal { margin: 12px auto 0; max-width: 320px; font-size: 11px; line-height: 1.5; color: var(--muted); text-align: center; }
.captcha-box { display: flex; justify-content: center; margin-top: 10px; }
.captcha-box:empty { display: none; }
body > .captcha-box { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; margin: 0; }
