/* Home screen refinements requested from iPhone review */
.topbar:has(+ .hero) > div:first-child { display:none; }
.topbar:has(+ .hero) { justify-content:flex-end; min-height:48px; margin-bottom:14px; }
.topbar:has(+ .hero) .top-actions { margin-left:auto; }
.topbar.home-empty-topbar { display:none !important; }

/* Settings: white outline gear over the upper-right corner of the photo. */
.hero-visual { position:relative; }
.hero-visual .photo-settings-button {
  position:absolute;
  top:14px;
  right:14px;
  z-index:20;
  width:44px;
  height:44px;
  min-width:44px;
  padding:0;
  margin:0;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:transparent !important;
  font-size:0 !important;
  line-height:0;
  display:grid;
  place-items:center;
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
}
.hero-visual .photo-settings-button::before {
  content:"";
  display:block;
  width:30px;
  height:30px;
  background:#fff;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M9.6 3.4l.45-1.4h3.9l.45 1.4a8.8 8.8 0 0 1 1.7.7l1.3-.67 2.76 2.76-.67 1.3c.3.54.54 1.11.7 1.7l1.4.45v3.9l-1.4.45a8.8 8.8 0 0 1-.7 1.7l.67 1.3-2.76 2.76-1.3-.67a8.8 8.8 0 0 1-1.7.7l-.45 1.4h-3.9l-.45-1.4a8.8 8.8 0 0 1-1.7-.7l-1.3.67-2.76-2.76.67-1.3a8.8 8.8 0 0 1-.7-1.7l-1.4-.45v-3.9l1.4-.45c.16-.59.4-1.16.7-1.7l-.67-1.3L6.6 3.43l1.3.67a8.8 8.8 0 0 1 1.7-.7Z'/%3E%3Ccircle cx='12' cy='11.6' r='3.1' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M9.6 3.4l.45-1.4h3.9l.45 1.4a8.8 8.8 0 0 1 1.7.7l1.3-.67 2.76 2.76-.67 1.3c.3.54.54 1.11.7 1.7l1.4.45v3.9l-1.4.45a8.8 8.8 0 0 1-.7 1.7l.67 1.3-2.76 2.76-1.3-.67a8.8 8.8 0 0 1-1.7.7l-.45 1.4h-3.9l-.45-1.4a8.8 8.8 0 0 1-1.7-.7l-1.3.67-2.76-2.76.67-1.3a8.8 8.8 0 0 1-.7-1.7l-1.4-.45v-3.9l1.4-.45c.16-.59.4-1.16.7-1.7l-.67-1.3L6.6 3.43l1.3.67a8.8 8.8 0 0 1 1.7-.7Z'/%3E%3Ccircle cx='12' cy='11.6' r='3.1' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center/contain no-repeat;
}
.hero-visual .photo-settings-button:active { transform:scale(.94); opacity:.75; }

/* Home cards share one exterior shape. */
.hero,.stat,.panel { border:1px solid var(--line) !important; border-radius:16px !important; box-shadow:none; }
.hero { overflow:hidden; }
.stats,.grid-two { align-items:stretch; }
.stat,.grid-two > .panel { min-height:142px; }

/* Global spacing system. */
:root { --screen-gap:24px; --section-gap:24px; --card-gap:24px; }
main { padding-left:var(--screen-gap); padding-right:var(--screen-gap); }
.hero,.stats,.grid-two,.toolbar,.list,.form-card,.detail,.calendar-controls,.calendar,.week-calendar,.day-calendar { margin-top:0; margin-bottom:var(--section-gap); }
.stats,.grid-two,.detail { gap:var(--card-gap); }
.stat,.panel,.detail-card,.form-card { padding:var(--card-gap); }

@media (max-width:850px) {
  :root { --screen-gap:28px; --section-gap:28px; --card-gap:28px; }
  main { padding-left:var(--screen-gap) !important; padding-right:var(--screen-gap) !important; }
  .hero,.stat,.panel { border-radius:16px !important; }
  .stats,.grid-two,.detail { gap:var(--card-gap) !important; }
  .stat,.panel,.detail-card,.form-card { padding:var(--card-gap); }
  .stat,.grid-two > .panel { min-height:142px; }
  .hero-visual .photo-settings-button { top:12px; right:12px; width:42px; height:42px; min-width:42px; }
  .hero-visual .photo-settings-button::before { width:29px; height:29px; }
}
