/* ============================================================
   Becoming Better styles
   Release: V5.0 alpha 3, build 1
   ============================================================
   Sections follow the main application structure. Mobile-only
   overrides are grouped at the end of the file.
   ============================================================ */

/* ------------------------------------------------------------
   1. Reset and global page foundation
   ------------------------------------------------------------ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}
/* ------------------------------------------------------------
   2. Main navigation and page containers
   ------------------------------------------------------------ */

.nav {
  display: flex;
  background: #111;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  padding: 13px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aaa;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-btn.active {
  color: #fff;
  border-bottom-color: #fff;
}
.nav.nav-bottom {
  position: fixed;
  bottom: 0;
  top: auto;
  left: 0;
  right: 0;
  border-bottom: none;
  border-top: 1px solid #222;
}
.nav.nav-bottom .nav-btn {
  border-bottom: none;
  border-top: 2px solid transparent;
}
.nav.nav-bottom .nav-btn.active {
  border-top-color: #fff;
  border-bottom-color: transparent;
}
body.nav-is-bottom .page {
  padding-bottom: 72px;
}
.page {
  display: none;
  padding: 16px;
  max-width: 500px;
  margin: 0 auto;
}
.page.active {
  display: block;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 16px 0 6px;
}
.page-sub {
  font-size: 12px;
  color: #bbb;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
/* ------------------------------------------------------------
   3. Objectives and category cards
   ------------------------------------------------------------ */

.section-card {
  background: #161616;
  border: 1px solid #222;
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #1e1e1e;
  border-bottom: 1px solid #222;
}
.section-emoji {
  font-size: 18px;
}
.section-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1;
}
.section-count {
  font-size: 12px;
  color: #aaa;
}
.task-row {
  padding: 12px 16px;
  border-bottom: 1px solid #1a1a1a;
}
.task-row:last-child {
  border-bottom: none;
}
.task-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.task-label {
  font-size: 15px;
  flex: 1;
}
.status-group {
  display: flex;
  gap: 5px;
}
.s-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #444;
  background: none;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.s-btn.active-yes {
  background: #1a3a1a;
  border-color: #2d7a2d;
  color: #5dff5d;
}
.s-btn.active-no {
  background: #3a1a1a;
  border-color: #7a2d2d;
  color: #ff5d5d;
}
.s-btn.active-partial {
  background: #3a2a00;
  border-color: #7a5a00;
  color: #ffcc00;
}
.s-btn.active-na {
  background: #1a1a2a;
  border-color: #444;
  color: #bbb;
}
.task-detail {
  margin-top: 4px;
}
.detail-input {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 7px 10px;
  color: #ffffff;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: inherit;
  font-style: italic;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}
.detail-input:focus {
  border-color: #6a5020;
}
.detail-input::placeholder {
  color: #555;
  font-style: normal;
}
.partial-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.partial-label {
  font-size: 12px;
  color: #ccc;
  white-space: nowrap;
}
.partial-input {
  width: 40px;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 4px 6px;
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}
.add-task-row {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  background: #111;
}
.add-input {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.add-input:focus {
  border-color: #444;
}
.add-btn {
  padding: 8px 14px;
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.add-btn:hover {
  background: #2a2a2a;
}
.del-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.del-btn:hover {
  color: #ff5d5d;
}
.visible-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #444;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.visible-toggle input {
  accent-color: #e8c97a;
  width: 13px;
  height: 13px;
  cursor: pointer;
}
.visible-toggle.on {
  color: #e8c97a;
}
.add-section-wrap {
  margin-top: 8px;
}
.add-section-btn {
  width: 100%;
  padding: 12px;
  background: #111;
  border: 1px dashed #333;
  border-radius: 14px;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 0.05em;
}
.add-section-btn:hover {
  border-color: #555;
  color: #888;
}
/* ------------------------------------------------------------
   4. Daily scores, productive time, and comments
   ------------------------------------------------------------ */

.day-comment-wrap {
  background: #161616;
  border: 1px solid #222;
  border-radius: 14px;
  margin-bottom: 14px;
  padding: 16px;
}
.day-comment-wrap textarea {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffffff;
  font-size: 14px;
  font-style: italic;
  resize: none;
  outline: none;
  font-family: inherit;
  min-height: 80px;
}
.day-comment-wrap textarea:focus {
  border-color: #6a5020;
}
.day-comment-wrap textarea::placeholder {
  color: #444;
  font-style: normal;
}
.score-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ddd;
  margin-bottom: 14px;
}
.score-row {
  margin-bottom: 16px;
}
.score-row:last-child {
  margin-bottom: 0;
}
.score-lbl {
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.score-val-disp {
  font-weight: 700;
  color: #fff;
}
input[type="range"] {
  width: 100%;
  accent-color: #fff;
}
.prod-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.prod-lbl {
  font-size: 14px;
  color: #eee;
}
.prod-input {
  width: 70px;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.score-unit {
  color: #ccc;
  font-size: 13px;
}

.score-title-compact {
  margin-bottom: 10px;
}
/* ------------------------------------------------------------
   5. Dashboard
   ------------------------------------------------------------ */
.dash-hero {
  background: linear-gradient(135deg, #1a1a1a, #222);
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 22px 20px;
  margin-bottom: 12px;
  text-align: center;
}
.dash-hero-pct {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}
.dash-hero-label {
  font-size: 12px;
  color: #666;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}
.dash-hero-bar-track {
  background: #1a1a1a;
  border-radius: 99px;
  height: 6px;
  margin: 14px 0 6px;
  overflow: hidden;
}
.dash-hero-bar-fill {
  height: 6px;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-hero-sub {
  font-size: 12px;
  color: #555;
}
.dash-card {
  background: #161616;
  border: 1px solid #222;
  border-radius: 14px;
  padding: 14px 16px;
}
.dash-card-label {
  font-size: 11px;
  color: #bbb;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dash-card-value {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin: 4px 0 2px;
}
.dash-card-sub {
  font-size: 11px;
  color: #aaa;
}
/* Dashboard card groups and reusable spacing. */

.dash-summary-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-summary-card {
  flex: 1;
  text-align: center;
}

.dash-scores-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-section-card {
  margin-bottom: 12px;
}

.dash-section-title {
  margin-bottom: 12px;
}

/* Current daily rating chips. */

.dash-score-chip {
  flex: 1;
  background: #161616;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.dash-score-chip .lbl {
  font-size: 10px;
  color: #555;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dash-score-chip .val {
  margin-top: 2px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}
/* Seven-day historical score chart. */

.dash-history-card {
  padding: 16px 12px 12px;
  margin-bottom: 12px;
}

.dash-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-history-sub {
  margin-top: 4px;
  color: #666;
  font-size: 11px;
  line-height: 1.4;
}

.dash-history-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.dash-history-status {
  min-height: 18px;
  margin-top: 6px;
  color: #666;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.dash-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dash-cat-row:last-child {
  margin-bottom: 0;
}
.dash-cat-emoji {
  font-size: 16px;
  width: 24px;
}
.dash-cat-name {
  font-size: 13px;
  color: #ccc;
  flex: 1;
}
.dash-cat-count {
  font-size: 12px;
  font-weight: 700;
  width: 36px;
  text-align: right;
}
.dash-cat-track {
  flex: 2;
  background: #1a1a1a;
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
}
.dash-cat-fill {
  height: 5px;
  border-radius: 99px;
  transition: width 0.5s ease;
}
.dash-quote {
  background: #111;
  border-left: 3px solid #e8c97a;
  border-radius: 0 12px 12px 0;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  font-style: italic;
  color: #ddd;
  line-height: 1.5;
}
.dash-quote span {
  color: #e8c97a;
  font-weight: 700;
  font-style: normal;
  display: block;
  font-size: 11px;
  margin-top: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.commit-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(135deg, #1a1200 0%, #0f0f0f 100%);
  border: 1px solid #3a2a00;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.commit-icon {
  font-size: 26px;
  flex-shrink: 0;
  margin-top: 2px;
}
.commit-body {
  flex: 1;
}
.commit-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8c97a;
  margin-bottom: 6px;
}
.commit-text {
  font-size: 13px;
  color: #ccc;
  line-height: 1.55;
}
/* ------------------------------------------------------------
   6. Preferences
   ------------------------------------------------------------ */

.pref-section {
  background: #111;
  border: 1px solid #222;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.pref-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8c97a;
  margin-bottom: 10px;
}
.pref-desc {
  font-size: 14px;
  color: #ccc;
  line-height: 1.5;
}
/* Read-only account tier badge. */

.pref-user-tier-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.pref-user-tier-label {
  color: #666;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tier-badge-bronze {
  background: rgba(201, 138, 90, 0.1);
  border-color: #c98a5a;
  color: #d9a278;
}

.tier-badge-silver {
  background: rgba(207, 211, 216, 0.1);
  border-color: #aeb4bc;
  color: #d5d9de;
}

.tier-badge-gold {
  background: rgba(232, 201, 122, 0.1);
  border-color: #e8c97a;
  color: #e8c97a;
}

/* Tier-based history allowance. */

.pref-history-allowance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #1e1e1e;
  color: #777;
  font-size: 11px;
}

.pref-history-allowance strong {
  color: #ddd;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pref-history-note {
  margin-top: 4px;
  color: #555;
  font-size: 10px;
  line-height: 1.4;
}

/* Server-verified account activity. */

.pref-activity-card {
  padding: 14px 16px;
  margin-top: 10px;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
}

.pref-activity-title {
  margin-bottom: 12px;
  color: #e8c97a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pref-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pref-activity-stat {
  min-width: 0;
  padding: 10px 6px;
  background: #0b0b0b;
  border: 1px solid #222;
  border-radius: 10px;
  text-align: center;
}

.pref-activity-value {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.pref-activity-label {
  margin-top: 5px;
  color: #777;
  font-size: 10px;
  line-height: 1.3;
}

.pref-activity-last {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: #777;
  font-size: 11px;
}

.pref-activity-last strong {
  color: #ccc;
  font-weight: 700;
  text-align: right;
}

.pref-activity-status {
  min-height: 16px;
  margin-top: 8px;
  color: #666;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.pref-choice-btn {
  flex: 1;
  padding: 10px 20px;
  background: #1a1a1a;
  border: 1.5px solid #333;
  border-radius: 10px;
  color: #aaa;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.pref-choice-btn:hover {
  border-color: #666;
  color: #fff;
}
.pref-choice-btn.active {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}

/* ------------------------------------------------------------
   7. Share page, slides, themes, and image manager
   ------------------------------------------------------------ */
   /* ------------------------------------------------------------
      Share-page control groups
      ------------------------------------------------------------ */

   .theme-picker {
     display: flex;
     gap: 8px;
     margin-bottom: 14px;
   }

   .share-control-group {
     margin-bottom: 14px;
   }

   .share-control-label {
     margin-bottom: 8px;
     color: #555;
     font-size: 11px;
     letter-spacing: 0.08em;
     text-transform: uppercase;
   }

   .textmode-picker {
     display: flex;
     gap: 8px;
   }

   .textmode-icon {
     display: block;
     margin-bottom: 3px;
     font-size: 16px;
   }

   /* Background-image manager controls. */

   .img-manager-head {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 10px;
     margin-bottom: 10px;
   }

   .img-manager-head .img-manager-title {
     margin-bottom: 0;
   }

   .img-manager-actions {
     display: flex;
     gap: 6px;
   }

   .img-manager-action-btn {
     padding: 5px 12px;
     background: #222;
     border: 1px solid #333;
     border-radius: 8px;
     color: #fff;
     font-size: 12px;
     font-weight: 600;
     letter-spacing: 0.04em;
     cursor: pointer;
   }

   .img-manager-action-btn-secondary {
     background: #1a1a1a;
     border-color: #2a2a2a;
     color: #888;
   }

   .img-more-btn {
     display: none;
     width: 100%;
     padding: 8px;
     margin-bottom: 8px;
     background: #1a1a1a;
     border: 1px solid #2a2a2a;
     border-radius: 8px;
     color: #888;
     font-size: 12px;
     cursor: pointer;
   }

   .slide-order-hint {
     margin: 4px 0 10px;
     color: #bbb;
     font-size: 11px;
     text-align: center;
   }

   /* Day-number selector. */

   .day-selector {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 12px;
     margin-bottom: 12px;
   }

   .day-selector-label {
     color: #bbb;
     font-size: 12px;
     letter-spacing: 0.08em;
     text-transform: uppercase;
   }

   .day-selector-btn {
     width: 30px;
     height: 30px;
     background: #1a1a1a;
     border: 1px solid #333;
     border-radius: 8px;
     color: #fff;
     font-size: 16px;
     line-height: 1;
     cursor: pointer;
   }

   .day-selector-input {
     width: 64px;
     background: transparent;
     border: none;
     outline: none;
     color: #e8c97a;
     font-size: 26px;
     font-weight: 900;
     text-align: center;
     -moz-appearance: textfield;
   }

   /* Intro-slide tagline settings. */

   .intro-tagline-card {
     padding: 14px 16px;
     margin-bottom: 14px;
     background: #111;
     border: 1px solid #222;
     border-radius: 12px;
   }

   .intro-tagline-title {
     margin-bottom: 10px;
     color: #666;
     font-size: 11px;
     letter-spacing: 0.08em;
     text-transform: uppercase;
   }

   .objective-presets {
     display: flex;
     flex-wrap: wrap;
     gap: 7px;
     margin-bottom: 10px;
   }

   .obj-preset-custom {
     border-color: #555;
     color: #888;
   }

   .custom-obj-wrap {
     display: none;
   }

   .custom-obj-input {
     width: 100%;
     padding: 9px 12px;
     background: #0d0d0d;
     border: 1px solid #333;
     border-radius: 8px;
     outline: none;
     color: #fff;
     font-family: inherit;
     font-size: 14px;
   }

   /* Optional quote-slide control. */

   .quote-toggle-row {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 12px;
     padding: 12px 16px;
     margin-bottom: 16px;
     background: #111;
     border: 1px solid #222;
     border-radius: 12px;
     box-shadow: 0 0 0 0 transparent;
     transition:
       border-color 0.3s,
       box-shadow 0.3s;
   }

   .quote-toggle-title {
     margin-bottom: 2px;
     color: #fff;
     font-size: 13px;
     font-weight: 700;
   }

   .quote-toggle-sub {
     color: #aaa;
     font-size: 12px;
   }

   .quote-toggle-btn {
     padding: 7px 20px;
     background: #1a1a1a;
     border: 1.5px solid #333;
     border-radius: 20px;
     color: #aaa;
     font-size: 13px;
     font-weight: 800;
     letter-spacing: 0.05em;
     text-shadow: none;
     cursor: pointer;
     transition: all 0.25s;
   }

   /* Generated-slide export controls. */

   .gallery-save-btn {
     width: 100%;
     padding: 13px;
     margin-top: 10px;
     background: #1a1a1a;
     border: 1px solid #333;
     border-radius: 12px;
     color: #fff;
     font-size: 14px;
     font-weight: 700;
     letter-spacing: 0.04em;
     cursor: pointer;
   }

   .export-caption-card {
     padding: 16px;
     margin-top: 14px;
     background: #111;
     border: 1px solid #222;
     border-radius: 14px;
   }

   .export-caption-title {
     margin-bottom: 10px;
     color: #e8c97a;
     font-size: 13px;
     font-weight: 800;
     letter-spacing: 0.06em;
     text-transform: uppercase;
   }

   .caption-box {
     min-height: 80px;
     padding: 12px;
     background: #0d0d0d;
     border: 1px solid #2a2a2a;
     border-radius: 10px;
     color: #ddd;
     font-size: 13px;
     line-height: 1.7;
     white-space: pre-wrap;
   }

   .caption-copy-btn {
     width: 100%;
     padding: 10px;
     margin-top: 10px;
     background: #1a1a1a;
     border: 1px solid #333;
     border-radius: 10px;
     color: #fff;
     font-size: 13px;
     font-weight: 700;
     letter-spacing: 0.04em;
     cursor: pointer;
   }

.gen-btn {
  width: 100%;
  padding: 15px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.gen-btn:hover {
  background: #eee;
}
.slide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.slide-nav-btn {
  padding: 8px 18px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.slide-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.slide-counter {
  font-size: 13px;
  color: #666;
}
.canvas-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #222;
}
canvas {
  display: block;
  width: 100%;
}
.hint {
  text-align: center;
  font-size: 12px;
  color: #444;
  margin-top: 10px;
  letter-spacing: 0.05em;
}
.img-manager {
  background: #161616;
  border: 1px solid #222;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}
.img-manager-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 12px;
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.img-thumb {
  position: relative;
  aspect-ratio: 9/16;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #333;
  cursor: pointer;
  transition: border-color 0.2s;
}
.img-thumb.selected {
  border-color: #fff;
  border-width: 3px;
}
.img-thumb .slide-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #fff;
  color: #000;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-thumb .img-del {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  border-radius: 4px;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  backdrop-filter: blur(2px);
}
.img-thumb .img-del:hover {
  background: rgba(255, 255, 255, 0.2);
}
.img-upload-btn {
  width: 100%;
  padding: 10px;
  background: #111;
  border: 1px dashed #333;
  border-radius: 10px;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.img-upload-btn:hover {
  border-color: #666;
  color: #aaa;
}
.img-upload-input {
  display: none;
}
.theme-btn {
  flex: 1;
  padding: 10px 6px;
  background: #161616;
  border: 1.5px solid #2a2a2a;
  border-radius: 12px;
  color: #666;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.theme-btn:hover {
  border-color: #555;
  color: #aaa;
}
.theme-btn.active {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}
.textmode-btn {
  flex: 1;
  padding: 8px 4px;
  background: #161616;
  border: 1.5px solid #2a2a2a;
  border-radius: 10px;
  color: #666;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.textmode-btn:hover {
  border-color: #555;
  color: #aaa;
}
.textmode-btn.active {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}
.obj-preset {
  padding: 6px 12px;
  background: #161616;
  border: 1.5px solid #2a2a2a;
  border-radius: 20px;
  color: #bbb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
}
.obj-preset:hover {
  border-color: #666;
  color: #fff;
}
.obj-preset.active {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}

/* ------------------------------------------------------------
   8. Advanced slide settings
   ------------------------------------------------------------ */
.adv-panel {
  background: #111;
  border: 1px solid #222;
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}
.adv-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}
.adv-panel-header:active {
  background: #1a1a1a;
}
.adv-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}
.adv-panel-chevron {
  font-size: 11px;
  color: #555;
  transition: transform 0.25s;
}
.adv-panel-chevron.open {
  transform: rotate(180deg);
}
.adv-body {
  padding: 0 16px 16px;
  display: none;
}
.adv-body.open {
  display: block;
}
.adv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #1a1a1a;
  gap: 12px;
}
.adv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.adv-label {
  font-size: 13px;
  color: #ccc;
  font-weight: 600;
  flex: 1;
}
.adv-sub {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
}
.adv-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.adv-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.adv-toggle-slider {
  position: absolute;
  inset: 0;
  background: #2a2a2a;
  border-radius: 24px;
  cursor: pointer;
  transition: 0.2s;
}
.adv-toggle-slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #555;
  border-radius: 50%;
  transition: 0.2s;
}
.adv-toggle input:checked + .adv-toggle-slider {
  background: rgba(232, 201, 122, 0.25);
  border: 1px solid #e8c97a;
}
.adv-toggle input:checked + .adv-toggle-slider:before {
  transform: translateX(18px);
  background: #e8c97a;
}
.adv-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.adv-slider {
  -webkit-appearance: none;
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: #2a2a2a;
  outline: none;
  cursor: pointer;
}
.adv-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e8c97a;
  cursor: pointer;
}
.adv-slider-val {
  font-size: 12px;
  color: #e8c97a;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}
.adv-chip-group {
  display: flex;
  gap: 5px;
}
.adv-chip {
  padding: 5px 10px;
  background: #1a1a1a;
  border: 1.5px solid #2a2a2a;
  border-radius: 20px;
  color: #666;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.03em;
}
.adv-chip:hover {
  border-color: #555;
  color: #aaa;
}
.adv-chip.active {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}
.theme-btn .theme-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}
/* ------------------------------------------------------------
   9. Modal dialogs
   ------------------------------------------------------------ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: #161616;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
}
.modal h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}
.modal input {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 15px;
  outline: none;
  margin-bottom: 10px;
  font-family: inherit;
}
.modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.modal-ok {
  flex: 1;
  padding: 11px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.modal-cancel {
  flex: 1;
  padding: 11px;
  background: #222;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* ------------------------------------------------------------
   10. Task library
   ------------------------------------------------------------ */
.lib-plan {
  background: #161616;
  border: 1px solid #222;
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.lib-plan-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}
.lib-plan-head:active {
  background: #1a1a1a;
}
.lib-plan-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.lib-plan-info {
  flex: 1;
}
.lib-plan-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.lib-plan-desc {
  font-size: 12px;
  color: #666;
  margin-top: 3px;
}
.lib-plan-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid;
  flex-shrink: 0;
}
.lib-plan-chevron {
  font-size: 11px;
  color: #444;
  transition: transform 0.25s;
  margin-left: 4px;
}
.lib-plan-chevron.open {
  transform: rotate(180deg);
}
.lib-plan-body {
  display: none;
  padding: 0 16px 16px;
}
.lib-plan-body.open {
  display: block;
}
.lib-science {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #0d0d0d;
  border-radius: 10px;
  border-left: 3px solid #333;
}
.lib-science b {
  color: #bbb;
}
.lib-task-preview {
  margin-bottom: 14px;
}
.lib-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #1a1a1a;
}
.lib-task-item:last-child {
  border-bottom: none;
}
.lib-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.lib-task-content {
  flex: 1;
}
.lib-task-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.lib-task-note {
  font-size: 11px;
  color: #666;
}
.lib-intensity-wrap {
  margin-bottom: 14px;
  background: #0d0d0d;
  border-radius: 10px;
  padding: 12px 14px;
}
.lib-intensity-label {
  font-size: 11px;
  color: #666;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 700;
}
.lib-intensity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lib-intensity-name {
  font-size: 12px;
  color: #aaa;
  min-width: 56px;
  font-weight: 600;
}
.lib-intensity-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #222;
  outline: none;
  cursor: pointer;
}
.lib-intensity-val {
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}
.lib-stats-wrap {
  background: #0d0d0d;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #1e1e1e;
}
.lib-stats-title {
  font-size: 11px;
  color: #666;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px;
}
.lib-stats-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.lib-stats-field {
  flex: 1;
}
.lib-stats-label {
  font-size: 11px;
  color: #555;
  font-weight: 600;
  margin-bottom: 4px;
}
.lib-stats-input {
  width: 100%;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.2s;
}
.lib-stats-input:focus {
  border-color: #e8c97a;
}
.lib-stats-calc-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  letter-spacing: 0.03em;
}
.lib-stats-result {
  margin-top: 10px;
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  padding: 8px 10px;
  background: #111;
  border-radius: 8px;
  display: none;
}
.lib-stats-result b {
  color: #e8c97a;
}
.lib-add-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}
.lib-add-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}
.lib-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
.lib-added-badge {
  display: none;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: #0a1a0a;
  border: 1.5px solid #2d7a2d;
  color: #5dff5d;
  letter-spacing: 0.04em;
}
.lib-training-wrap {
  margin-bottom: 14px;
}
.lib-training-btn {
  width: 100%;
  padding: 11px 14px;
  background: #111;
  border: 1px solid #222;
  border-radius: 10px;
  color: #777;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.18s;
  letter-spacing: 0.04em;
}
.lib-training-btn:hover {
  border-color: #444;
  color: #ccc;
}
.lib-training-body {
  display: none;
  margin-top: 8px;
  background: #0a0a0a;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1a1a1a;
}
.lib-training-body.open {
  display: block;
}
.lib-training-day {
  padding: 12px 14px;
  border-bottom: 1px solid #141414;
}
.lib-training-day:last-child {
  border-bottom: none;
}
.lib-training-day-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lib-training-ex {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #0f0f0f;
}
.lib-training-ex:last-child {
  border-bottom: none;
}
.lib-training-ex-name {
  font-size: 13px;
  color: #ddd;
  font-weight: 600;
}
.lib-training-ex-spec {
  font-size: 11px;
  color: #555;
  font-weight: 600;
  font-family: monospace;
}
/* ------------------------------------------------------------
   11. Authentication
   ------------------------------------------------------------ */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  overflow-y: auto;
}
.auth-logo {
  font-size: 40px;
  margin-bottom: 6px;
}
.auth-brand {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.auth-sub {
  font-size: 13px;
  color: #555;
  margin-bottom: 32px;
}
.auth-box {
  width: 100%;
  max-width: 360px;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: 1.5px solid #222;
  border-radius: 10px;
  background: #111;
  color: #666;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.04em;
}
.auth-tab.active {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}
.auth-field {
  margin-bottom: 14px;
}
.auth-field label {
  display: block;
  font-size: 11px;
  color: #666;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  background: #111;
  border: 1.5px solid #222;
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.auth-field input:focus {
  border-color: #e8c97a;
}
.auth-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #e8c97a;
  color: #000;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.18s;
  margin-top: 4px;
}
.auth-submit:hover {
  background: #f5d87a;
}
.auth-submit:active {
  transform: scale(0.98);
}
.auth-error {
  color: #ff5555;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  min-height: 18px;
  text-align: center;
}
/* ------------------------------------------------------------
   12. Cloud-sync status indicators
   ------------------------------------------------------------ */

#sync-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#sync-bar.saving {
  opacity: 1;
  background: linear-gradient(90deg, #0a0a0a, #e8c97a, #0a0a0a);
  background-size: 200% 100%;
  animation: sync-sweep 1s infinite linear;
}
#sync-bar.saved {
  opacity: 1;
  background: #4caf82;
  animation: sync-fade 1.5s forwards;
}
#sync-bar.error {
  opacity: 1;
  background: #ff4444;
}
@keyframes sync-sweep {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
@keyframes sync-fade {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
#sync-dot {
  position: fixed;
  top: 10px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 997;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ------------------------------------------------------------
   13. Onboarding
   ------------------------------------------------------------ */

#onboarding {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  overflow-y: auto;
}
.ob-logo {
  font-size: 36px;
  margin-bottom: 6px;
}
.ob-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}
.ob-sub {
  font-size: 13px;
  color: #aaa;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 36px;
}
.ob-step {
  width: 100%;
  max-width: 380px;
}
.ob-q {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.ob-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.ob-opt {
  flex: 1;
  min-width: 110px;
  padding: 14px 10px;
  background: #161616;
  border: 1.5px solid #2a2a2a;
  border-radius: 14px;
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.ob-opt:hover {
  border-color: #777;
  color: #fff;
}
.ob-opt.selected {
  border-color: #e8c97a;
  color: #e8c97a;
  background: rgba(232, 201, 122, 0.08);
}
.ob-opt .ob-opt-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}
.ob-next {
  width: 100%;
  padding: 15px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-top: 4px;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.ob-next:disabled {
  opacity: 0.3;
  cursor: default;
}
.ob-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 32px;
}
.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #222;
  transition: background 0.2s;
}
.ob-dot.active {
  background: #e8c97a;
}
.ob-dot.done {
  background: #555;
}
.ob-name-input {
  width: 100%;
  background: #161616;
  border: 1.5px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  margin-bottom: 28px;
}
.ob-name-input:focus {
  border-color: #e8c97a;
}

/* ------------------------------------------------------------
   14. Mobile overrides, up to 430px
   ------------------------------------------------------------
   Improves navigation, objective controls, touch targets,
   narrow-screen forms, safe areas, and iPhone input behavior.
   ------------------------------------------------------------ */

@media (max-width: 430px) {
  .page {
    width: 100%;
    max-width: 100%;
    padding: 14px 12px;
  }

  .page-title {
    font-size: 24px;
    line-height: 1.1;
  }

  .page-sub {
    font-size: 11px;
    line-height: 1.45;
    letter-spacing: 0.08em;
  }

  /* Keep all seven navigation destinations visible. */
  .nav {
    overflow: hidden;
  }

  .nav-btn {
    flex: 1 1 0;
    min-width: 44px;
    min-height: 54px;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .nav-icon {
    margin-right: 0;
    font-size: 18px;
    line-height: 1;
  }

  .nav-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-btn-settings {
    flex: 0 0 48px;
  }

  .nav-btn-settings .nav-label {
    display: none;
  }

  .nav.nav-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }

  body.nav-is-bottom .page {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  /* Dashboard scaling. */
  .dash-hero-pct {
    font-size: 52px;
  }

  /* Objective card spacing. */
  .section-head {
    padding: 12px;
  }

  .task-row {
    padding: 12px;
  }

  /*
   * Objective controls use two rows:
   * delete, task title, visibility
   * status buttons underneath
   */
  .task-top {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    grid-template-areas:
      "delete label visible"
      "status status status";
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .task-top > .del-btn {
    grid-area: delete;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .task-top > .task-label {
    grid-area: label;
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .task-top > .visible-toggle {
    grid-area: visible;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    justify-self: end;
  }

  .task-top > .status-group {
    grid-area: status;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .visible-toggle input {
    width: 18px;
    height: 18px;
  }

  .s-btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  /* Keep category delete buttons easy to tap. */
  .section-head > .del-btn {
    min-width: 40px;
    min-height: 40px;
  }

  /* Prevent the add-task controls from being compressed. */
  .add-task-row {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px auto;
    align-items: center;
    gap: 8px;
  }

  .add-input {
    width: 100%;
    min-width: 0;
  }

  .add-task-row > input[type="checkbox"] {
    width: 22px;
    height: 22px;
    justify-self: center;
  }

  .add-btn {
    min-height: 44px;
    padding: 8px 12px;
  }

  /*
   * iPhone Safari can zoom when focusing an input whose text is
   * smaller than 16px.
   */
  .detail-input,
  .add-input,
  .partial-input,
  .day-comment-wrap textarea,
  .auth-field input,
  .modal input,
  .lib-stats-input,
  #leaderboard-display-name,
  #notif-time,
  #custom-obj-input {
    font-size: 16px !important;
  }

  /* Advanced slide controls may wrap onto a second line. */
  .adv-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .adv-row > div:first-child {
    flex: 1 1 150px;
    min-width: 0;
  }

  .adv-chip-group {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
  }

  .adv-slider-wrap {
    margin-left: auto;
  }

  .adv-slider {
    width: 96px;
  }

  .adv-chip {
    min-height: 40px;
    padding: 8px 10px;
  }
}
