:root{
  --ink:#3b2117;--red:#ef3d23;--orange:#ff8d25;--gold:#ffd454;--paper:rgba(255,252,245,.95);
  --muted:#7d6a60;--mint:#46cfbc;--ok:#168867;--bad:#c64035;--shadow:0 9px 24px rgba(55,28,10,.18)
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",Meiryo,sans-serif}
body{background:#ffefd5}button,input,textarea,select{font:inherit}button{cursor:pointer}::placeholder{color:#b8afa8!important;opacity:1}

.festival-wash{position:fixed;inset:0;z-index:-2;background:linear-gradient(180deg,rgba(255,255,255,0) 0%,rgba(255,248,228,.02) 18%,rgba(255,245,224,.38) 32%,rgba(255,239,210,.94) 62%,rgba(255,239,210,.98) 100%)}
.app-shell{--content-start:clamp(116px,31.5vw,227px);position:relative;max-width:720px;margin:0 auto;padding:var(--content-start) 12px 88px}
.app-top{position:absolute;top:calc(var(--content-start) - 41px);left:12px;right:12px;display:flex;justify-content:flex-end;pointer-events:none}.app-top .settings-btn{pointer-events:auto}
.settings-btn,.nav-btn,.tab-btn,.task-action{border:2px solid var(--ink);border-radius:10px;background:#fff4c7;color:var(--ink);box-shadow:2px 2px 0 var(--ink);font-weight:900}.settings-btn{padding:8px 12px}
.goal-card{width:100%;display:flex;align-items:center;gap:12px;text-align:left;color:var(--ink);background:linear-gradient(135deg,rgba(255,247,220,.98),rgba(255,231,182,.98));border:3px solid var(--red);border-radius:18px;padding:12px 14px;box-shadow:0 7px 0 rgba(173,52,27,.23),var(--shadow)}
.goal-card.goal-hidden{display:none}.goal-icon{font-size:27px;flex:none}.goal-copy{flex:1;min-width:0}.goal-copy span{display:block;color:#a33d23;font-size:12px;font-weight:1000}.goal-copy strong{display:block;margin-top:2px;font-size:19px;line-height:1.3;font-weight:1000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.goal-copy strong.is-empty{color:var(--red)}.goal-arrow{font-size:26px;font-weight:1000}
.tabs-wrap{margin-top:12px}.tab-page{display:none}.tab-page.active{display:block}.glass-card{background:var(--paper);border:2px solid rgba(59,33,23,.85);border-radius:17px;box-shadow:var(--shadow);backdrop-filter:blur(10px) saturate(1.08)}
.hero{padding:13px}.hero-row{display:flex;justify-content:space-between;align-items:center;gap:10px}.hero-row strong{font-size:15px}.hero-progress{font-size:13px;font-weight:900;color:var(--muted)}
.progress-track{height:12px;background:rgba(255,255,255,.75);border:2px solid var(--ink);border-radius:999px;overflow:hidden;margin-top:11px}.progress-bar{height:100%;width:0;background:linear-gradient(90deg,var(--mint),var(--gold),var(--red));transition:.2s}.done-banner{margin-top:9px;background:#fff0ad;border:2px dashed var(--red);border-radius:11px;text-align:center;padding:8px;font-weight:1000}
.task-list{display:flex;flex-direction:column;gap:8px}.page-gap{margin-top:11px}.task{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:10px;background:var(--paper);border:2px solid rgba(59,33,23,.82);border-radius:14px;padding:11px;box-shadow:var(--shadow);backdrop-filter:blur(9px)}.task.done{opacity:.65}.task.overdue{background:rgba(255,236,231,.96);border-color:var(--bad)}
.check-btn{width:36px;height:36px;flex:none;border:3px solid var(--ink);border-radius:50%;background:#fff7df;display:grid;place-items:center;font-weight:1000}.task.done .check-btn{background:var(--mint)}
.status-chip{width:76px;min-width:76px;height:30px;display:flex;align-items:center;justify-content:center;padding:4px 5px;border-radius:999px;border:2px solid var(--ink);font-size:10px;font-weight:1000;white-space:nowrap}.status-today{background:#ffd7d1;color:#b12117}.status-tomorrow{background:#ffe99a}.status-date{background:#fff0b8}.status-over{background:#ffb9b3;color:#8f120a}
.task-main{min-width:0}.task-title{font-weight:900;font-size:14px;line-height:1.42;overflow-wrap:anywhere}.task-sub{font-size:11px;color:var(--muted);margin-top:3px;line-height:1.45}.task-side{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.task-action{padding:6px 8px;font-size:11px;white-space:nowrap}
.card-pad{padding:12px}.field{display:flex;flex-direction:column;gap:6px;margin:0;font-size:13px;font-weight:900}.field input,.field textarea,.field select,textarea{width:100%;border:2px solid rgba(59,33,23,.68);border-radius:11px;background:rgba(255,255,255,.96);padding:10px;color:var(--ink);outline:none;font-size:16px!important}.field-space{margin-top:13px}textarea{resize:vertical}
.insert-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.button-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.ai-action-row{grid-template-columns:minmax(0,2fr) minmax(120px,1fr)}
.primary-btn,.secondary-btn,.ghost-btn,.danger-btn{border:2px solid var(--ink);border-radius:11px;padding:10px 11px;font-weight:900;box-shadow:2px 2px 0 var(--ink)}.primary-btn{background:linear-gradient(145deg,#ff5635,var(--red));color:#fff}.secondary-btn{background:linear-gradient(145deg,#fff2b8,#ffd66c);color:var(--ink)}.ghost-btn{background:#fffaf0;color:var(--ink)}.danger-btn{background:#ffd8d3;color:#842c27}.full{width:100%}.mini-btn{border:1.5px solid var(--ink);border-radius:9px;background:#fff0b4;padding:6px 8px;font-size:11px;font-weight:900;white-space:nowrap}.hint{font-size:11px;color:var(--muted);line-height:1.55;margin:9px 0 0}.hint.topless{margin-top:0}.toast{margin-top:8px;border-radius:10px;padding:8px 10px;background:#eef9f4;color:#20735e;font-size:11px;font-weight:900}.add-bottom{margin-top:10px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 2px}.section-head strong{font-size:14px}
.bottom-tabs{position:fixed;left:50%;transform:translateX(-50%);bottom:0;z-index:15;width:min(720px,100%);display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));background:rgba(255,247,225,.93);backdrop-filter:blur(10px);border-top:2px solid rgba(59,33,23,.24)}.tab-btn{padding:10px 4px;font-size:11px;background:#fff7df}.tab-btn.active{background:linear-gradient(145deg,#ff6842,var(--red));color:#fff}
.calendar-head{display:flex;justify-content:center;align-items:center;gap:12px;margin-bottom:8px;background:rgba(255,250,239,.88);border-radius:12px;padding:7px 9px;backdrop-filter:blur(8px)}.calendar-head span{font-weight:1000}.calendar-card{padding:9px}.weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.weekdays span{text-align:center;font-size:10px;color:var(--muted);padding:3px;font-weight:900}
.day{min-height:62px;border:1.5px solid rgba(59,33,23,.22);border-radius:9px;background:rgba(255,255,255,.72);display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:5px 2px;gap:2px;color:var(--ink)}.day.blank{border:none;background:transparent}.day.today{border:2px solid var(--red);background:#fff3cc}.day-num{font-size:12px;font-weight:1000}.day-plan{font-size:9px;font-weight:1000;background:#ffe3a0;border-radius:999px;padding:2px 4px;white-space:nowrap}.day-progress{font-size:9px;font-weight:1000;color:var(--muted)}.day-progress.all{color:var(--ok)}.day-progress.some{color:#ba741c}.day-progress.none{color:var(--bad)}
.modal-backdrop{position:fixed;inset:0;background:rgba(35,19,9,.48);backdrop-filter:blur(3px);z-index:20}.modal{position:fixed;z-index:21;left:0;right:0;bottom:0;margin:0 auto;width:min(720px,100%);max-height:92vh;overflow:auto;overflow-x:hidden;background:#fff5df;border:3px solid var(--ink);border-bottom:none;border-radius:22px 22px 0 0;padding:15px 13px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -14px 40px rgba(0,0,0,.22)}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.modal-head h3{margin:0;font-size:17px}.close-btn{border:2px solid var(--ink);background:#fff0b5;border-radius:9px;padding:5px 8px;font-weight:900}.settings-block{padding:14px 0;border-top:2px dashed #d6b38f}.settings-block.first{border-top:none;padding-top:0}.settings-block h4{margin:0 0 9px}.edit-form{width:100%;overflow-x:hidden;display:flex;flex-direction:column;gap:10px}.edit-save-btn{margin-top:2px}
.weekday-picks{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.weekday-picks label{display:grid;place-items:center;gap:3px;background:#fff0b8;border:2px solid var(--ink);border-radius:8px;padding:6px 1px;font-size:11px}.weekday-picks input{width:17px;height:17px}.detail-row{background:#fffaf0;border:2px solid var(--ink);border-radius:11px;padding:9px;margin-bottom:7px}.detail-row.done{opacity:.65}.detail-title{font-weight:900;font-size:13px}.detail-status{font-size:11px;color:var(--muted);margin-top:3px}.day-check{margin-top:7px;border:1.5px solid var(--ink);border-radius:8px;padding:5px 8px;background:#fff0b4;font-size:11px;font-weight:900}
.picker-body{display:flex;flex-direction:column;gap:10px}.picker-day{background:#fffaf0;border:2px solid rgba(59,33,23,.72);border-radius:12px;padding:10px}.picker-date{font-size:12px;font-weight:1000;color:#a33d23;margin-bottom:6px}.picker-item{display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:13px;font-weight:800}.picker-item input{width:19px;height:19px;flex:none}.picker-insert{margin-top:12px}.empty-state{background:var(--paper);border:2px solid rgba(59,33,23,.55);border-radius:13px;padding:12px;text-align:center;color:var(--muted);font-size:12px}
.hidden{display:none!important}.file-btn{text-align:center;display:block}.file-btn input{display:none}
@media(max-width:560px){
  .goal-copy strong{font-size:17px}.button-row,.ai-action-row,.insert-row{grid-template-columns:1fr}
  .task{grid-template-columns:auto minmax(0,1fr);column-gap:10px;row-gap:5px}.task>.check-btn,.task>.status-chip{grid-column:1;grid-row:1 / span 2}.task>.task-main{grid-column:2;grid-row:1}.task>.task-side{grid-column:2;grid-row:2;justify-content:flex-start}.task-title,.task-sub{writing-mode:horizontal-tb;word-break:normal;overflow-wrap:anywhere}
  .status-chip{width:76px;min-width:76px}.day{min-height:58px}.day-plan,.day-progress{font-size:8.5px}
}
@media(max-width:360px){.app-shell{padding-left:9px;padding-right:9px}.status-chip{width:72px;min-width:72px}.calendar-card{padding:7px}.calendar-grid,.weekdays{gap:3px}.day{min-height:54px}}



.field,.field input,.field textarea,.field select{min-width:0}
.edit-form .field{width:100%}
.edit-form .field input,
.edit-form .field textarea,
.edit-form .field select{width:100%;max-width:100%;display:block}
.edit-form .field input[type="date"],
.edit-form .field input[type="time"]{appearance:none;-webkit-appearance:none;min-width:0;max-width:100%;width:100%;display:block}
.edit-form .field input[type="date"]::-webkit-date-and-time-value,
.edit-form .field input[type="time"]::-webkit-date-and-time-value{text-align:left}
.edit-form .field input[type="date"]::-webkit-calendar-picker-indicator,
.edit-form .field input[type="time"]::-webkit-calendar-picker-indicator{opacity:1}
.modal{padding-left:max(13px, env(safe-area-inset-left));padding-right:max(13px, env(safe-area-inset-right))}
.edit-save-btn{display:block;width:100%}



.edit-form{padding-right:2px}
.edit-form .field{width:100%;min-width:0}
.edit-form .field input,
.edit-form .field select,
.edit-form .field textarea{max-width:100%;width:100%}
.edit-form .field input[type="date"],
.edit-form .field input[type="time"]{
  display:block;
  width:100%;
  max-width:100%;
  min-height:58px;
  height:58px;
  padding:12px 20px;
  line-height:1.2;
  font-weight:900;
}
.edit-form .field input[type="time"]::-webkit-date-and-time-value,
.edit-form .field input[type="date"]::-webkit-date-and-time-value{
  min-height:1.2em;
  text-align:left;
}
.edit-form .field input[type="time"]::-webkit-calendar-picker-indicator,
.edit-form .field input[type="date"]::-webkit-calendar-picker-indicator{margin-left:auto}
.edit-save-btn{
  width:calc(100% - 4px);
  margin-right:4px;
  align-self:flex-start;
}
.modal{overflow-x:hidden}
@media(max-width:560px){
  .edit-save-btn{width:calc(100% - 4px)}
}



.edit-form{
  width:100%;
  padding-right:0;
  overflow:visible;
}
.edit-form .field{
  width:100%;
  min-width:0;
}
.edit-form .field > input,
.edit-form .field > select{
  box-sizing:border-box;
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  padding:0 14px;
  line-height:normal;
}
.edit-form .field > input[type="date"],
.edit-form .field > input[type="time"]{
  -webkit-appearance:auto;
  appearance:auto;
  height:44px;
  min-height:44px;
  max-height:44px;
  padding:0 14px;
}
.edit-form .field > input[type="date"]::-webkit-date-and-time-value,
.edit-form .field > input[type="time"]::-webkit-date-and-time-value{
  min-height:0;
  text-align:left;
}
.edit-save-btn{
  box-sizing:border-box;
  display:block;
  width:100%;
  max-width:100%;
  min-height:44px;
  margin:2px 0 10px;
  box-shadow:none;
}
.modal{
  overflow-x:hidden;
  padding-bottom:calc(30px + env(safe-area-inset-bottom));
}




/* Show the full "稼げや祭り" lantern title before content begins. */
.app-shell{
  --content-start:clamp(132px,36vw,248px);
}

/* Goal stays readable while letting the festival background show through. */
.goal-card{
  background:linear-gradient(
    135deg,
    rgba(255,247,220,.82),
    rgba(255,231,182,.72)
  );
  backdrop-filter:blur(4px) saturate(1.08);
  -webkit-backdrop-filter:blur(4px) saturate(1.08);
}

/* Settings lives inside image/post cards, not over the festival artwork. */
.has-inline-settings{position:relative}
.inline-settings-btn{
  position:absolute;
  top:8px;
  right:8px;
  z-index:2;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  padding:0;
  border:1.5px solid rgba(59,33,23,.72);
  border-radius:10px;
  background:rgba(255,250,239,.82);
  color:var(--ink);
  font-size:17px;
  font-weight:900;
  box-shadow:none;
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
}
.has-inline-settings > .field:first-of-type > span{padding-right:42px}

/* iPhone native date/time controls are contained by a fixed-size shell. */
.edit-form{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:hidden;
  padding-right:0;
}
.edit-form .field{
  width:100%;
  max-width:100%;
  min-width:0;
}
.edit-form .field > input:not([type="date"]):not([type="time"]),
.edit-form .field > select{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  padding:0 14px;
}
.native-field-shell{
  box-sizing:border-box;
  position:relative;
  width:100%;
  max-width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  overflow:hidden;
  border:2px solid rgba(59,33,23,.68);
  border-radius:11px;
  background:rgba(255,255,255,.96);
}
.native-field-shell input[type="date"],
.native-field-shell input[type="time"]{
  box-sizing:border-box!important;
  position:absolute;
  inset:0;
  display:block;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0 14px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--ink);
  font-size:16px!important;
  font-weight:900;
  line-height:44px!important;
  -webkit-appearance:none;
  appearance:none;
}
.native-field-shell input[type="date"]::-webkit-date-and-time-value,
.native-field-shell input[type="time"]::-webkit-date-and-time-value{
  min-height:0!important;
  height:auto!important;
  padding:0!important;
  margin:0!important;
  text-align:left;
  line-height:44px!important;
}
.native-field-shell input[type="date"]::-webkit-calendar-picker-indicator,
.native-field-shell input[type="time"]::-webkit-calendar-picker-indicator{
  margin:0 0 0 auto;
}

.edit-save-btn{
  box-sizing:border-box;
  display:block;
  width:100%;
  max-width:100%;
  min-height:44px;
  margin:2px 0 18px;
  box-shadow:none!important;
}

/* Give the bottom of the sheet enough room above Safari's controls. */
.modal{
  box-sizing:border-box;
  width:calc(100% - 12px);
  max-width:708px;
  left:6px;
  right:6px;
  padding-left:13px;
  padding-right:13px;
  padding-bottom:calc(38px + env(safe-area-inset-bottom));
  overflow-x:hidden;
}

@media(max-width:560px){
  .app-shell{--content-start:clamp(132px,36vw,160px)}
}



.day-add-btn{
  margin-top:12px;
}



.day.state-none{
  background:rgba(255,255,255,.72);
}
.day.state-some{
  background:linear-gradient(180deg,rgba(255,244,209,.96),rgba(255,218,145,.92));
  border-color:#e9a13a;
}
.day.state-all{
  background:linear-gradient(160deg,#ef3d23 0%,#ff7a28 52%,#ffd454 100%);
  border-color:#b72a19;
  color:#fff;
  box-shadow:0 3px 8px rgba(198,64,53,.28);
}
.day.state-all .day-num{
  color:#fff;
  text-shadow:0 1px 2px rgba(92,31,9,.45);
}
.day-progress.state-none-label{
  color:var(--muted);
}
.day-progress.state-some-label{
  color:#9a5b00;
  font-weight:1000;
}
.day-progress.state-all-label{
  color:#fff;
  font-weight:1000;
  text-shadow:0 1px 2px rgba(92,31,9,.45);
}


.festival-art{position:fixed;z-index:-3;top:0;left:50%;transform:translateX(-50%);width:min(100vw,720px);height:auto;display:block;pointer-events:none;user-select:none}
.festival-wash{background:linear-gradient(180deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 24%,rgba(255,245,224,.20) 34%,rgba(255,239,210,.90) 62%,rgba(255,239,210,.98) 100%)!important}
.goal-settings{flex:none;border:1.5px solid rgba(59,33,23,.55);border-radius:9px;padding:6px 8px;background:rgba(255,250,239,.68);font-size:11px;font-weight:900;white-space:nowrap}
.inline-settings-btn{width:auto!important;min-width:68px;padding:0 9px!important;font-size:12px!important;white-space:nowrap}
.day{min-height:68px;padding:5px 2px 4px;justify-content:flex-start;overflow:hidden}
.day-num{flex:none;font-size:12px;line-height:1.1}
.day-progress{flex:1;width:100%;min-width:0;display:flex;align-items:center;justify-content:center;margin:2px 0 0;padding:0 1px;font-size:clamp(13px,3.6vw,18px);line-height:1;font-weight:1000;letter-spacing:-.5px;white-space:nowrap;color:var(--muted)}
.day.state-empty{background:rgba(255,255,255,.72)}
.day.state-none{background:rgba(255,255,255,.78)}
.day.state-some{background:linear-gradient(180deg,rgba(255,245,218,.97),rgba(255,211,127,.94));border-color:#e59b2f}
.day.state-some .day-progress{color:#8c4f00}
.day.state-all{position:relative;color:#fff;border-color:#a92217;background-color:#e43a23;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80'%3E%3Cg fill='%23fff' fill-opacity='.16'%3E%3Cpath d='M18 76c-9-8-10-20-3-30 5-7 9-10 8-23 13 10 18 20 13 31 5-2 9-7 11-14 8 15 6 29-4 36z'/%3E%3Cpath d='M55 78c-12-10-13-25-4-37 7-9 12-14 11-31 17 13 23 26 17 40 7-3 12-9 15-18 11 19 8 37-6 46z'/%3E%3Cpath d='M92 76c-8-7-9-18-3-27 4-6 7-9 7-20 11 9 15 18 11 28 4-2 8-6 10-12 7 13 5 25-4 31z'/%3E%3C/g%3E%3C/svg%3E"),linear-gradient(160deg,#d92919 0%,#ef4624 58%,#ff8a2a 100%);background-repeat:no-repeat,no-repeat;background-position:center bottom,center;background-size:100% 78%,100% 100%;box-shadow:0 3px 8px rgba(198,64,53,.28)}
.day.state-all .day-num,.day.state-all .day-progress{color:#fff;text-shadow:0 1px 2px rgba(92,31,9,.55)}
.day.today{border:1.5px solid rgba(59,33,23,.22)!important}
.day-plan{display:none!important}
.day-task-row{display:grid;grid-template-columns:38px minmax(0,1fr);gap:9px;align-items:center}
.round-check{width:34px;height:34px;border:2px solid var(--ink);border-radius:50%;background:#fff7df;font-weight:1000;color:var(--ink)}
.day-task-row.done .round-check{background:var(--mint)}
.day-task-edit{min-width:0;width:100%;border:0;background:transparent;padding:3px 0;text-align:left;color:inherit}
.day-task-edit .detail-title,.day-task-edit .detail-status{display:block}
.modal{box-sizing:border-box!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:min(calc(100vw - 24px),696px)!important;max-height:calc(100dvh - 24px - env(safe-area-inset-top))!important;border:3px solid var(--ink)!important;border-radius:20px!important;padding:15px 13px 24px!important;overflow-y:auto!important;overflow-x:hidden!important}
.edit-form,.edit-form .field{width:100%!important;max-width:100%!important;min-width:0!important}
.edit-form .field>input:not([type="date"]):not([type="time"]),.edit-form .field>select,.native-field-shell{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;max-height:44px!important}
.native-field-shell{position:relative;overflow:hidden}
.native-field-shell input[type="date"],.native-field-shell input[type="time"]{box-sizing:border-box!important;position:absolute!important;inset:0!important;width:100%!important;max-width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:0 12px!important;border:0!important;background:transparent!important;font-size:16px!important;line-height:44px!important;-webkit-appearance:none!important;appearance:none!important}
.edit-save-btn{box-sizing:border-box!important;display:block!important;width:100%!important;max-width:100%!important;min-height:44px!important;margin:2px 0 6px!important;box-shadow:none!important}
@media(max-width:560px){.day{min-height:66px}.day-progress{font-size:clamp(13px,3.7vw,17px)}}
@media(max-width:360px){.day{min-height:62px}.day-progress{font-size:12.5px}}


/* Bottom navigation: remove the visible empty strip below the tabs on iPhone. */
.bottom-tabs{
  bottom:0!important;
  padding-top:8px!important;
  padding-left:10px!important;
  padding-right:10px!important;
  padding-bottom:max(4px, env(safe-area-inset-bottom))!important;
}
.tab-btn{
  align-self:end;
}


/* Stabilize short pages (especially Today) on iPhone Safari/PWA. */
html{
  min-height:100%;
  width:100%;
  overflow-x:hidden;
  background:#ffefd5;
}
body{
  min-height:100dvh;
  width:100%;
  overflow-x:hidden;
  overscroll-behavior-x:none;
}
.app-shell{
  box-sizing:border-box;
  min-height:100dvh;
  width:100%;
}
.tabs-wrap,
.tab-page{
  min-width:0;
  width:100%;
}
.tab-page.active{
  min-height:calc(100dvh - var(--content-start) - 92px);
}

/* Pin the navigation without translate-based positioning, which can jitter on iOS. */
.bottom-tabs{
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  transform:none!important;
  margin:0 auto!important;
  width:min(720px,100%)!important;
  max-width:720px!important;
  box-sizing:border-box!important;
  z-index:100!important;
}

/* Prevent horizontal rubber-band from moving the whole UI. */
.festival-art,
.festival-wash{
  max-width:100vw;
}


/* Restore festival artwork above html/body backgrounds while keeping UI above it. */
.festival-art{
  z-index:0!important;
}
.festival-wash{
  z-index:1!important;
  pointer-events:none;
}
.app-shell{
  position:relative!important;
  z-index:2!important;
}


/* Smaller day-detail add button to avoid accidental taps near close */
.day-add-btn{
  display:block!important;
  width:auto!important;
  min-width:0!important;
  max-width:calc(100% - 40px)!important;
  margin:14px auto 4px!important;
  padding:10px 16px!important;
  min-height:0!important;
  font-size:15px!important;
  line-height:1.2!important;
  border-radius:14px!important;
}

/* Clearer full-complete flame: one big flame behind the count */
.day.state-all{
  background-color:#e43a23!important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cdefs%3E%3CradialGradient id='g' cx='50%25' cy='70%25' r='60%25'%3E%3Cstop offset='0%25' stop-color='%23fff6c9' stop-opacity='.95'/%3E%3Cstop offset='45%25' stop-color='%23ffd15a' stop-opacity='.85'/%3E%3Cstop offset='80%25' stop-color='%23ff8a2a' stop-opacity='.45'/%3E%3Cstop offset='100%25' stop-color='%23ff8a2a' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M60 12c8 12 8 23 2 34 10-5 17-15 18-27 18 18 22 42 8 61-11 15-31 22-48 18C24 94 14 80 14 62c0-16 8-29 21-40 1 12 6 20 14 27-2-16 2-27 11-37z'/%3E%3Cpath fill='%23fff4b5' fill-opacity='.55' d='M61 33c4 7 3 15-2 23 7-4 11-10 12-18 11 11 12 27 4 38-8 11-22 16-34 13-11-3-19-15-19-27 0-10 5-18 14-26 1 7 4 12 9 16-2-10 0-16 6-19z'/%3E%3C/svg%3E"),
    linear-gradient(160deg,#d92919 0%,#ef4624 60%,#ff8a2a 100%)!important;
  background-repeat:no-repeat,no-repeat!important;
  background-position:center 72%,center!important;
  background-size:56% 68%,100% 100%!important;
}


/* Bigger single flame for fully completed calendar cells */
.day.state-all{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  background-image:linear-gradient(160deg,#d92919 0%,#ef4624 60%,#ff8a2a 100%)!important;
  background-size:100% 100%!important;
  background-position:center!important;
}
.day.state-all::before{
  content:"";
  position:absolute;
  left:4%;
  right:4%;
  bottom:0;
  height:88%;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cdefs%3E%3CradialGradient id='g' cx='50%25' cy='74%25' r='58%25'%3E%3Cstop offset='0%25' stop-color='%23fff6cf' stop-opacity='.98'/%3E%3Cstop offset='36%25' stop-color='%23ffe07d' stop-opacity='.96'/%3E%3Cstop offset='68%25' stop-color='%23ffb037' stop-opacity='.82'/%3E%3Cstop offset='100%25' stop-color='%23ff7d1f' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M60 8c13 17 16 29 11 45 12-7 19-18 21-31 18 26 16 50 1 67-8 9-20 15-33 15s-25-6-33-15C12 72 10 48 28 22c2 13 9 24 20 31-5-16-2-28 12-45z'/%3E%3Cpath fill='%23fff9de' fill-opacity='.65' d='M60 28c6 9 8 18 5 28 6-3 10-8 11-15 10 14 9 28 1 38-4 5-10 8-17 8s-13-3-17-8c-8-10-9-24 1-38 1 7 5 12 11 15-3-10-1-19 5-28z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:center bottom;
  background-size:contain;
  opacity:.97;
  pointer-events:none;
  z-index:0;
}
.day.state-all .day-num,
.day.state-all .day-progress{
  position:relative;
  z-index:1;
}
