/* Borderless goal surfaces: depth and a diffuse gold glow, not a luminous outline. */
.app-shell .goal-card,
#modal.goal-dialog .goal-focus {
  border:0;
  box-shadow:0 5px 10px #0006,0 16px 28px -8px #000b,0 0 24px #ffc24f1a,0 9px 26px -5px #efb23925;
}
.app-shell .goal-card[data-flow-gold],
#modal.goal-dialog .goal-focus[data-flow-gold] {
  box-shadow:0 5px 10px #0006,0 16px 28px -8px #000b,0 0 24px #ffc24f1a,0 9px 26px -5px #efb23925 !important;
}
/* Remove only the decorative top stripe, not today's glow or drag/drop cues. */
.app-shell .day-column.is-today:not(.drop-target) {
  border-top-color:transparent;
  box-shadow:0 0 6px #ffd16b70,0 0 18px #ffc24f38,0 0 30px #efb2391c;
}
.today-columns .section-heading:has(.today-score-control) { flex-wrap:wrap; align-items:center; }
.today-score-control { display:flex; flex-direction:column; align-items:flex-end; gap:3px; margin-left:auto; }
.today-score-caption { font-size:10px; letter-spacing:.08em; color:#bcb5a7; }
.today-score-picker { display:flex; gap:4px; }
.today-score-picker button { min-height:44px; padding:7px 10px; border:1px solid #ffffff20; border-radius:10px; font-size:11px; font-weight:750; background:#202328; color:#bdb8af; }
.today-score-picker button.active { border-color:#ffd16b; background:#362f20; color:#ffe4a2; }

/* Focused routine view and editor, using the same hierarchy as the goal workspace. */
#modal.routine-dialog { width:min(640px,calc(100% - 24px)); max-width:640px; }
#modal.routine-dialog .sheet { padding:0; }
#modal.routine-dialog .sheet>header { margin:0; padding:15px 20px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:4; background:#1b1e22; border-bottom:1px solid #ffffff12; }
#modal.routine-dialog .sheet>header h2 { font-size:18px; line-height:1.35; }
#modal.routine-dialog #modal-body { padding:10px 20px 22px; }
.routine-view-tools { display:flex; justify-content:flex-end; margin:0 0 3px; }
#modal.routine-dialog .routine-view-tools .btn { border:0; background:transparent; color:#ffda87; padding:4px 0; min-height:44px; }
.routine-focus { padding:15px 17px; margin-bottom:10px; border-radius:18px; background:linear-gradient(135deg,#30291c,#1d1e22 65%); box-shadow:0 7px 20px #0008,0 0 25px #ffc24f19; }
.routine-focus-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:7px; }
.routine-state { font-size:12px; line-height:1.4; text-align:right; color:#e1cd9f; }
.routine-focus h3 { font-size:clamp(22px,5.6vw,29px); line-height:1.25; letter-spacing:-.025em; overflow-wrap:anywhere; }
.routine-focus .routine-date { color:#c5bdad; font-size:13px; line-height:1.4; margin-top:5px; }
.routine-step-meter { margin-top:11px; }
.routine-step-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:5px; font-size:14px; color:#e7dcc5; }
.routine-step-percent { color:#ffda87; font-size:22px; }
.routine-step-track { height:7px; background:#090a0c; border-radius:10px; overflow:hidden; }
.routine-step-track i { display:block; width:0; height:100%; background:linear-gradient(90deg,#c39230,#ffdf89); border-radius:inherit; }
.routine-content>.detail-note { margin:0 0 16px; font-size:16px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
#modal.routine-dialog .routine-instructions { border:0; background:#222328; border-radius:12px; padding:10px 12px; margin:0 0 9px; }
#modal.routine-dialog .routine-instructions p { font-size:15px; line-height:1.4; margin:3px 0 0; }
.routine-steps { margin:10px 0; }
.routine-steps>h3,.routine-week-focus>h3 { font-size:16px; margin:0 0 6px; }
.routine-steps .review-steps { display:grid; gap:6px; margin:0; }
.routine-steps .guided-step { border-radius:11px; background:linear-gradient(140deg,#2b2e34,#1e2025); box-shadow:inset 0 1px 0 #ffffff0b,0 4px 10px #0004; padding:6px 10px; }
#modal.routine-dialog .routine-steps .tick { margin:0; gap:10px; min-height:40px; font-size:15px; line-height:1.28; font-weight:650; }
.routine-steps input[type=checkbox] { width:22px; height:22px; flex:0 0 22px; accent-color:#ffcf61; }
.routine-steps .tick>span { overflow-wrap:anywhere; }
.routine-steps .guided-step .step-detail { margin:0 0 5px 32px; font-size:13px; color:#c6c0b4; line-height:1.32; }
#modal.routine-dialog .routine-finish { position:sticky; bottom:-24px; z-index:3; background:#101215f5; padding:10px 0 max(10px,env(safe-area-inset-bottom)); margin:18px 0 0; }
.routine-finish-hint { font-size:13px; line-height:1.45; color:#c6bdab; margin:0 0 8px; }
#modal.routine-dialog .routine-finish .form-actions { position:static; border:0; margin:0; padding:0; display:flex; }
#modal.routine-dialog .routine-complete-button { flex:1; width:100%; max-width:none; min-height:50px; font-weight:800; }
.routine-fold { margin:14px 0; border-top:1px solid #ffffff18; }
.routine-fold>summary { min-height:48px; padding:12px 0; font-size:14px; font-weight:650; color:#dfc99c; }
.routine-fold p { font-size:14px; color:#bfb8ab; line-height:1.6; margin:7px 0; }
#modal.routine-dialog .routine-editor-guidance { font-size:14px; line-height:1.55; color:#bfb8ab; margin:0 0 18px; }
#modal.routine-dialog .routine-editor :is(fieldset.form-section,.routine-editor-intro) { border:0; background:transparent; box-shadow:none; padding:0; margin:0 0 18px; }
#modal.routine-dialog .routine-editor fieldset.form-section>legend { font-size:18px; font-weight:750; color:#f5eedf; padding:0; margin-bottom:12px; }
#modal.routine-dialog .routine-editor-intro h3 { font-size:24px; margin-bottom:7px; }
#modal.routine-dialog .routine-editor-intro p { font-size:14px; color:#bfb8ab; }
#modal.routine-dialog .routine-editor :is(input:not([type=checkbox]):not([type=radio]),textarea,select) { background:#15171b; border-color:#ffffff26; font-size:16px; min-height:48px; }
#modal.routine-dialog .routine-editor .routine-fold { padding:0 12px; border:1px solid #ffffff1f; border-radius:12px; background:#1b1e22; margin:12px 0; }
#modal.routine-dialog .routine-editor .routine-fold>summary { margin-bottom:0; min-height:48px; padding:12px 0; font-size:15px; color:#ead8b2; }
#modal.routine-dialog .routine-editor .routine-fold[open]>summary { margin-bottom:12px; }
#modal.routine-dialog .routine-editor .steps-builder { margin:0; }
#modal.routine-dialog .routine-editor .step-edit-row { background:#24262b; border-color:#ffffff20; padding:10px; margin:9px 0; }
#modal.routine-dialog .routine-editor .step-title-row { align-items:center; gap:8px; }
#modal.routine-dialog .routine-editor .step-title-row [data-step-title] { min-width:0; }
#modal.routine-dialog .routine-editor .step-title-row [data-step-action=remove] { flex:0 0 44px; }
#modal.routine-dialog .routine-editor .routine-step-extra { padding:0; border:0; background:transparent; margin:2px 0 0; }
#modal.routine-dialog .routine-editor .routine-step-extra>summary { min-height:44px; font-size:13px; padding:9px 0; color:#c8b587; }
#modal.routine-dialog .routine-editor .routine-step-extra textarea { margin:0; }
#modal.routine-dialog .routine-editor .routine-scope-note { font-size:13px; line-height:1.55; color:#c8bca3; margin:10px 0 15px; }
#modal.routine-dialog .routine-editor .weekday-picks { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px; }
#modal.routine-dialog .routine-editor .weekday-picks label { min-width:0; }
#modal.routine-dialog .routine-editor .weekday-picks span { width:100%; min-width:0; min-height:44px; font-size:11px; }
#modal.routine-dialog .routine-editor .form-actions { border-color:#ffffff18; margin-top:18px; }
#modal.routine-dialog .routine-editor .form-actions [type=submit] { flex:1; max-width:none; min-height:48px; }
@media(max-width:600px) {
  #modal.routine-dialog { width:calc(100% - 16px); border-radius:18px; }
  #modal.routine-dialog .sheet>header { margin:0; padding:13px 16px; }
  #modal.routine-dialog #modal-body { padding:9px 14px 20px; }
  .routine-focus { padding:13px 14px; }
}
@media(prefers-reduced-motion:reduce) { #modal.routine-dialog * { scroll-behavior:auto; transition:none; } }
@media(forced-colors:active) {
  .app-shell .goal-card,#modal.goal-dialog .goal-focus,.app-shell .day-column.is-today,.routine-focus { box-shadow:none!important; outline:1px solid CanvasText; }
  .routine-step-track i { background:Highlight; }
}

.routine-scope-prompt{position:sticky;bottom:8px;z-index:4;margin:14px 0 6px;padding:14px;border-radius:13px;background:#24262bf7;border:1px solid #e7bd5b4a;box-shadow:0 10px 28px #0009,0 0 18px #e7bd5b12;backdrop-filter:blur(10px)}
.routine-scope-prompt h3{font-size:17px;margin:0 0 5px}
.routine-scope-prompt p{font-size:13px;line-height:1.45;color:#c8c0b1;margin:0 0 12px}
.routine-scope-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.routine-scope-actions .btn{min-height:46px;margin:0}
#modal.routine-dialog .routine-editor>label.field:has([name="note"]){margin:4px 0 10px}
#modal.routine-dialog .routine-editor>label.field:has([name="note"]) textarea{min-height:74px}
@media(max-width:420px){.routine-scope-actions{grid-template-columns:1fr}}

#modal.routine-dialog .routine-editor [type="submit"]:disabled{opacity:.58;cursor:default}
