/* Common UI helpers shared across day pages */
:root {
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(26, 26, 24, 0.12);
  --nav-text: rgba(26, 26, 24, 0.78);
  --nav-text-strong: rgba(26, 26, 24, 0.92);
  --nav-pill-bg: rgba(245, 245, 243, 0.9);
  --nav-pill-border: rgba(26, 26, 24, 0.18);
}

.course-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--nav-bg);
  border: 0.5px solid var(--nav-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.course-nav .nav-left,
.course-nav .nav-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.course-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--nav-pill-bg);
  border: 0.5px solid var(--nav-pill-border);
  color: var(--nav-text-strong);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
}

.course-nav a[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  color: var(--nav-text);
}

.course-nav .nav-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 140px;
}

.course-nav .nav-mid .nav-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--nav-text-strong);
}

.course-nav .nav-mid .nav-title {
  font-size: 11px;
  color: var(--nav-text);
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 420px) {
  .course-nav {
    padding: 10px 10px;
  }
  .course-nav .nav-mid {
    min-width: 0;
  }
  .course-nav .nav-mid .nav-title {
    display: none;
  }
}

/* ── Submission memo (prefer text/URL over screenshots) ── */
.submit-memo {
  background: rgba(250, 236, 231, 0.85);
  border: 0.5px solid rgba(153, 60, 29, 0.22);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin: 14px 0 0;
}

.submit-memo .sm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.submit-memo .sm-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(74, 27, 12, 0.92);
}
.submit-memo .sm-hint {
  font-size: 11px;
  color: rgba(74, 27, 12, 0.68);
}

.submit-memo label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(74, 27, 12, 0.8);
  margin: 10px 0 6px;
}

.submit-memo input[type="text"],
.submit-memo textarea {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(26, 26, 24, 0.92);
  background: rgba(255, 255, 255, 0.9);
  border: 0.5px solid rgba(26, 26, 24, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
}
.submit-memo textarea { min-height: 92px; resize: vertical; }

.submit-memo .sm-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
.submit-memo .sm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.submit-memo .sm-btn {
  appearance: none;
  border: 0.5px solid rgba(26, 26, 24, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(26, 26, 24, 0.86);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.submit-memo .sm-btn.primary {
  background: rgba(83, 74, 183, 0.10);
  border-color: rgba(83, 74, 183, 0.25);
  color: rgba(38, 33, 92, 0.92);
}
.submit-memo .sm-btn.success {
  background: rgba(29, 158, 117, 0.12);
  border-color: rgba(29, 158, 117, 0.30);
  color: rgba(8, 80, 65, 0.95);
}
.submit-memo .sm-btn.danger {
  background: rgba(226, 75, 74, 0.10);
  border-color: rgba(226, 75, 74, 0.25);
  color: rgba(80, 19, 19, 0.92);
}
.submit-memo .sm-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.submit-memo .sm-status {
  font-size: 12px;
  color: rgba(74, 27, 12, 0.78);
  min-height: 18px;
  margin-top: 8px;
}
.submit-memo .sm-done {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(8, 80, 65, 0.92);
  font-weight: 600;
}

/* ── Retention progress widget ── */
.retention-card {
  margin: 10px 0 14px;
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: linear-gradient(135deg, rgba(83,74,183,0.10), rgba(29,158,117,0.10));
  border: 0.5px solid rgba(83,74,183,0.18);
}
.retention-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.retention-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(38,33,92,0.95);
}
.retention-count {
  font-size: 12px;
  font-weight: 700;
  color: rgba(8,80,65,0.95);
}
.retention-bar-bg {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  overflow: hidden;
}
.retention-bar-fill {
  height: 10px;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(29,158,117,0.95), rgba(83,74,183,0.95));
  transition: width .35s ease;
}
.retention-next {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(38,33,92,0.86);
  line-height: 1.5;
}
.retention-meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(38,33,92,0.75);
}
.retention-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.retention-actions a,
.retention-actions button {
  appearance: none;
  border: 0.5px solid rgba(83,74,183,0.25);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(38,33,92,0.92);
  text-decoration: none;
  cursor: pointer;
}
.retention-actions .go-next {
  background: rgba(29,158,117,0.12);
  border-color: rgba(29,158,117,0.35);
  color: rgba(8,80,65,0.95);
}
.retention-actions .jump-submit {
  background: rgba(83,74,183,0.10);
  border-color: rgba(83,74,183,0.28);
}
.retention-actions .easy-toggle {
  background: rgba(255, 248, 220, 0.85);
  border-color: rgba(186,117,23,0.35);
  color: rgba(99,56,6,0.95);
}

/* ── Outcome tracker (P0/P1) ── */
.outcome-card {
  margin: 8px 0 12px;
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(255,255,255,0.94);
  border: 0.5px solid rgba(26,26,24,0.12);
}
.outcome-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(26,26,24,0.92);
  margin-bottom: 6px;
}
.outcome-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.outcome-label {
  font-size: 11px;
  color: rgba(26,26,24,0.75);
}
.outcome-bar-bg {
  height: 8px;
  border-radius: 999px;
  background: rgba(245,245,243,0.95);
  overflow: hidden;
}
.outcome-bar-fill {
  height: 8px;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(29,158,117,0.95), rgba(83,74,183,0.95));
}
.outcome-count {
  font-size: 11px;
  font-weight: 700;
  color: rgba(38,33,92,0.9);
  min-width: 46px;
  text-align: right;
}
.outcome-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.outcome-actions button {
  appearance: none;
  border: 0.5px solid rgba(26,26,24,0.2);
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(26,26,24,0.86);
}

/* ── Practical templates (Day15-17) ── */
.tpl-card {
  margin: 8px 0 12px;
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(255,255,255,0.95);
  border: 0.5px solid rgba(26,26,24,0.12);
}
.tpl-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(26,26,24,0.92);
  margin-bottom: 6px;
}
.tpl-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tpl-tab {
  appearance: none;
  border: 0.5px solid rgba(26,26,24,0.2);
  background: rgba(245,245,243,0.95);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(26,26,24,0.86);
}
.tpl-tab.active {
  background: rgba(83,74,183,0.10);
  border-color: rgba(83,74,183,0.3);
  color: rgba(38,33,92,0.95);
}
.tpl-body {
  border: 0.5px solid rgba(26,26,24,0.14);
  background: rgba(255,255,255,0.98);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(26,26,24,0.92);
  white-space: pre-wrap;
}
.tpl-actions {
  margin-top: 8px;
}
.tpl-copy {
  appearance: none;
  border: 0.5px solid rgba(29,158,117,0.35);
  background: rgba(29,158,117,0.12);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(8,80,65,0.95);
}

/* ── Resume ribbon ── */
.resume-ribbon {
  margin: 8px 0 12px;
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.92);
  border: 0.5px solid rgba(26,26,24,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.resume-ribbon .txt {
  font-size: 12px;
  color: rgba(26,26,24,0.86);
  line-height: 1.4;
}
.resume-ribbon .btn {
  appearance: none;
  border: 0.5px solid rgba(29,158,117,0.35);
  background: rgba(29,158,117,0.12);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(8,80,65,0.95);
  text-decoration: none;
}

/* ── Global help (mobile) ── */
.help-fab {
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 50;
  appearance: none;
  border: 0.5px solid rgba(83,74,183,0.35);
  background: rgba(83,74,183,0.92);
  color: #fff;
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
.help-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  border: 0.5px solid rgba(26,26,24,0.14);
  padding: 12px 12px 14px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.14);
}
.help-sheet[hidden] { display: none; }
.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.help-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(26,26,24,0.92);
}
.help-close {
  appearance: none;
  border: 0.5px solid rgba(26,26,24,0.2);
  background: rgba(245,245,243,0.95);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
}
.help-list {
  margin: 0;
  padding-left: 18px;
}
.help-list li {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(26,26,24,0.88);
  margin: 3px 0;
}

/* ── Easy mode (low literacy) ── */
body.easy-mode .tabs,
body.easy-mode .level-tabs {
  display: none !important;
}
body.easy-mode #lv2,
body.easy-mode #lv3,
body.easy-mode .pane#lv2,
body.easy-mode .pane#lv3,
body.easy-mode .level-content#lv2,
body.easy-mode .level-content#lv3 {
  display: none !important;
}
body.easy-mode #lv1,
body.easy-mode .pane#lv1,
body.easy-mode .level-content#lv1 {
  display: block !important;
}
body.easy-mode .tip-item:nth-child(n+3) {
  display: none !important;
}
body.easy-mode .msg-box,
body.easy-mode .message-box,
body.easy-mode .final-msg-card {
  display: none !important;
}
body.easy-mode .subtitle {
  margin-bottom: 10px !important;
}

/* ── First day quick guide ── */
.quick-guide {
  margin: 10px 0 14px;
  border-radius: 14px;
  padding: 12px;
  background: rgba(238, 237, 254, 0.88);
  border: 0.5px solid rgba(83, 74, 183, 0.28);
}
.quick-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.quick-guide-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(38, 33, 92, 0.95);
}
.quick-guide-close {
  border: 0.5px solid rgba(83, 74, 183, 0.3);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: rgba(38, 33, 92, 0.88);
  cursor: pointer;
}
.quick-guide-list {
  margin: 8px 0 0;
  padding-left: 18px;
}
.quick-guide-list li {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(38, 33, 92, 0.9);
  margin: 2px 0;
}

/* ── Daily focus line ── */
.daily-focus {
  margin: 8px 0 12px;
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(225, 245, 238, 0.88);
  border: 0.5px solid rgba(29, 158, 117, 0.3);
  color: rgba(8, 80, 65, 0.95);
  font-size: 12px;
  line-height: 1.5;
}
.daily-focus b {
  font-weight: 700;
}

.submit-memo .sm-user {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 8px 0 2px;
}
.submit-memo .sm-user input[type="text"] {
  margin: 0;
}
.submit-memo .sm-user .sm-btn {
  min-width: 84px;
}

