:root {
  color-scheme: light;
  --page: #f6f3eb;
  --surface: #fffefb;
  --surface-muted: #f4f8f3;
  --ink: #183328;
  --muted: #68776f;
  --line: #dce5de;
  --green: #2f684f;
  --green-dark: #204c39;
  --green-soft: #e5f0e8;
  --blue-soft: #edf6ff;
  --blue: #2769b5;
  --danger: #a63d3d;
  --danger-soft: #fff0ef;
  --warning: #865f11;
  --warning-soft: #fff7dc;
  --shadow: 0 18px 45px rgba(36, 62, 49, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(39, 105, 181, 0.45);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(var(--content), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(220, 229, 222, 0.9);
  background: rgba(255, 254, 251, 0.92);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 850;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #3f7f61, #24543f);
  color: #fff;
  font-size: 1.55rem;
  box-shadow: 0 8px 18px rgba(47, 104, 79, 0.23);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.language-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 10px;
  color: var(--green-dark);
  font-weight: 750;
  text-underline-offset: 4px;
}

.save-mode,
.account-label {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 30%, rgba(200, 223, 181, 0.52), transparent 19rem),
    linear-gradient(115deg, #fffefb 5%, #f6f1e7 55%, #f4f6e9 100%);
}

.hero::before {
  content: "";
  position: absolute;
  right: 12%;
  bottom: -90px;
  width: 370px;
  height: 230px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 80px rgba(215, 212, 190, 0.26);
}

.hero-inner {
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-block: 42px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.15rem, 5.5vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.hero h1 em {
  position: relative;
  color: var(--green-dark);
  font-style: normal;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.05em;
  left: 0;
  z-index: -1;
  height: 0.23em;
  border-radius: 99px;
  background: #dbe8c8;
}

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
  color: #56665e;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.hero-decoration {
  position: relative;
  width: 170px;
  height: 160px;
  flex: 0 0 auto;
  opacity: 0.78;
}

.plant-pot {
  position: absolute;
  right: 40px;
  bottom: 0;
  width: 70px;
  height: 54px;
  border-radius: 6px 6px 26px 26px;
  background: linear-gradient(120deg, #d6c59d, #f0e2bf);
}

.plant-pot::before {
  content: "";
  position: absolute;
  left: 33px;
  bottom: 48px;
  width: 5px;
  height: 76px;
  border-radius: 9px;
  background: #5f8751;
}

.plant-leaf {
  position: absolute;
  z-index: 1;
  width: 56px;
  height: 27px;
  border-radius: 100% 0 100% 0;
  background: #84a960;
}

.leaf-one {
  right: 75px;
  top: 29px;
  transform: rotate(17deg);
}

.leaf-two {
  right: 27px;
  top: 53px;
  transform: scaleX(-1) rotate(20deg);
}

.leaf-three {
  right: 81px;
  top: 78px;
  transform: rotate(-12deg);
}

.content-stack {
  display: grid;
  gap: 30px;
  padding-block: 32px 64px;
}

.content-stack > *,
.routines-section,
.routine-list,
#routine-rows,
.routine-row,
.routine-main,
.routine-actions {
  min-width: 0;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.button.primary {
  background: linear-gradient(145deg, #3b7b5d, #285d46);
  color: white;
  box-shadow: 0 8px 16px rgba(47, 104, 79, 0.2);
}

.button.primary:hover {
  background: var(--green-dark);
}

.button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #b9cbbf;
  background: var(--surface-muted);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button.compact {
  min-height: 44px;
  padding: 8px 13px;
  font-size: 0.86rem;
}

.button.full {
  width: 100%;
}

.danger-button {
  border-color: #d48b8b;
  background: var(--danger);
  color: white;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: #b9cbbf;
  background: var(--surface-muted);
}

.icon-button.danger {
  color: var(--danger);
}

.calendar-toolbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 13px;
}

.calendar-navigation h2 {
  min-width: 170px;
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

/* スマホ専用の凡例・円表示。PC・タブレットでは非表示にして従来表示を維持します。 */
.calendar-legend,
.calendar-markers {
  display: none;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f9faf8;
}

.weekday-row span {
  padding: 8px 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-width: 0;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:hover {
  background: #fbfdf9;
}

.calendar-day.outside {
  background: #fbfcfa;
  color: #a3ada7;
}

.calendar-day.is-today {
  background: #f2f6e8;
}

.calendar-day.is-selected {
  box-shadow: inset 0 0 0 3px var(--green);
}

.day-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.84rem;
  font-weight: 850;
}

.calendar-day.is-today .day-number {
  background: var(--green);
  color: white;
}

.calendar-event,
.calendar-more {
  display: block;
  overflow: hidden;
  border-radius: 7px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.scheduled {
  background: var(--warning-soft);
  color: var(--warning);
}

.calendar-event.completed {
  background: var(--green-soft);
  color: var(--green-dark);
}

.calendar-more {
  color: var(--muted);
}

.selected-panel {
  padding: 17px 20px 20px;
  background: var(--surface-muted);
}

.selected-panel h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.selected-date-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.selected-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px;
  background: white;
}

.selected-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-badge,
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.73rem;
  font-weight: 850;
  white-space: nowrap;
}

.event-badge.scheduled {
  background: var(--warning-soft);
  color: var(--warning);
}

.event-badge.completed {
  background: var(--green-soft);
  color: var(--green);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed #bfcfc4;
  border-radius: 13px;
  padding: 15px;
  color: var(--muted);
  background: white;
  text-align: center;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.section-heading p:not(.eyebrow) {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.89rem;
}

#routine-count {
  margin-left: 5px;
  color: var(--green);
  font-weight: 800;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 12px;
  scrollbar-width: thin;
}

.category-tab {
  min-height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.category-tab.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.routine-list {
  overflow: clip;
}

.routine-head,
.routine-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) 125px 125px 120px minmax(260px, auto);
  align-items: center;
  gap: 12px;
}

.routine-head {
  padding: 10px 18px;
  background: #f7f9f6;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 850;
}

.routine-row {
  min-height: 76px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: white;
}

.routine-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.routine-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  font-size: 1.25rem;
}

.routine-name-box {
  min-width: 0;
}

.routine-name-box h3 {
  overflow: hidden;
  margin: 0;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-name-box p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.routine-cell {
  min-width: 0;
  font-size: 0.84rem;
}

.cell-label {
  display: none;
}

.status-unrecorded {
  background: #edf1ee;
  color: #5f6e66;
}

.status-due {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-upcoming {
  background: var(--green-soft);
  color: var(--green);
}

.routine-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.routine-actions .button {
  min-width: 110px;
}

.list-empty {
  margin: 18px;
}

.explanation-stack {
  display: grid;
  gap: 14px;
}

.explanation-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 19px;
  align-items: start;
  border: 1px solid #cdddcf;
  border-radius: 20px;
  padding: 22px 26px;
}

.explanation-card.how-to {
  background: linear-gradient(100deg, #eef6e8, #fbfdf7);
}

.explanation-card.about {
  border-color: #cadeef;
  background: linear-gradient(100deg, var(--blue-soft), #fbfdff);
}

.explanation-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 1.45rem;
  font-weight: 900;
}

.about .explanation-icon {
  background: var(--blue);
}

.explanation-card h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.explanation-card > div > p {
  margin: 0;
  color: #4d6359;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 9px;
}

.steps li > span {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
}

.steps strong {
  display: block;
  font-size: 0.88rem;
}

.steps p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.share-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 22px 28px;
}

.share-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.share-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.share-actions {
  display: flex;
  gap: 15px;
}

.share-button {
  min-width: 58px;
  min-height: 76px;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.share-button > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef1ef;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(25, 45, 35, 0.12);
}

.share-button:hover > span {
  transform: translateY(-2px);
}

.share-button.facebook > span {
  background: #1877f2;
  color: white;
  font: 800 1.7rem Arial, sans-serif;
}

.share-button.x > span {
  background: #111;
  color: white;
  font-size: 1.3rem;
}

.share-button.line > span {
  background: #06c755;
  color: white;
  font-size: 0.63rem;
}

.share-button.copy > span {
  background: #e5e8e6;
}

.share-button small {
  font-size: 0.68rem;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fffefb;
}

.footer-inner {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-block: 28px;
}

.footer-inner p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-inner nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  text-align: right;
}

.footer-inner nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  text-underline-offset: 4px;
}

.feedback-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--green);
  color: white;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(24, 51, 40, 0.28);
}

.legal-page {
  background: var(--cream);
}

.legal-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.96);
}

.legal-header .container {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.legal-language {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
  font-weight: 800;
}

.legal-main {
  width: min(860px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: 54px 72px;
}

.legal-main > header {
  margin-bottom: 32px;
}

.legal-main h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.legal-main h2 {
  margin: 36px 0 10px;
  color: var(--green-dark);
  font-size: 1.25rem;
}

.legal-main p,
.legal-main li {
  line-height: 1.85;
}

.legal-main li + li {
  margin-top: 8px;
}

.legal-note {
  border-left: 4px solid var(--mustard);
  border-radius: 0 14px 14px 0;
  padding: 15px 18px;
  background: #fff8df;
}

.legal-actions {
  margin-top: 42px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.feedback-shell {
  width: min(720px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: 48px 72px;
}

.feedback-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(22px, 5vw, 38px);
  background: white;
  box-shadow: 0 16px 40px rgba(36, 62, 49, 0.08);
}

.feedback-panel h1 {
  margin-top: 8px;
}

.feedback-panel textarea {
  min-height: 190px;
  resize: vertical;
}

.form-alert {
  border-radius: 14px;
  padding: 14px 16px;
  margin-block: 18px;
}

.form-alert.error {
  border: 1px solid #e6b5ad;
  background: #fff0ed;
  color: #852f24;
}

.form-alert.success {
  border: 1px solid #9fcbb5;
  background: #edf8f2;
  color: #205a40;
}

.form-alert ul {
  margin-block: 0;
}

.privacy-reminder {
  color: var(--muted);
  font-size: 0.9rem;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 18px;
  background: rgba(15, 34, 26, 0.58);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(600px, 100%);
  max-height: min(90vh, 800px);
  overflow-y: auto;
  border-radius: 22px;
  background: white;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.modal.small {
  width: min(470px, 100%);
}

.modal-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.22rem;
}

.modal-body {
  padding: 20px;
}

.modal-body > p:first-child {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 14px 20px 20px;
}

.modal-actions.stacked {
  display: grid;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 15px;
}

.field label,
fieldset legend {
  font-size: 0.84rem;
  font-weight: 850;
}

.field label span {
  color: var(--danger);
  font-size: 0.72rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bdcbc2;
  border-radius: 11px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border: 2px solid var(--danger);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-error {
  min-height: 1em;
  margin: 0;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 750;
}

.warning-box {
  border: 1px solid #ecc5c2;
  border-radius: 13px;
  padding: 13px;
  background: var(--danger-soft);
  color: #773737;
}

.google-button {
  width: 100%;
  margin-top: 8px;
  border-color: #cdd7d1;
  background: white;
  color: #24362f;
  box-shadow: 0 5px 14px rgba(24, 51, 40, 0.1);
}

.data-actions {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.data-actions h3 {
  margin: 0 0 12px;
}

.data-actions form {
  margin-top: 17px;
}

.data-actions fieldset {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.danger-zone {
  border: 1px solid #ecc5c2;
  border-radius: 14px;
  padding: 14px;
  background: #fffafa;
}

.danger-zone p {
  color: var(--muted);
  font-size: 0.82rem;
}

.danger-zone .button + .button {
  margin-top: 9px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 150;
  min-width: min(440px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 13px;
  padding: 12px 15px;
  background: #172d24;
  color: white;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 25px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.toast button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #b7efcc;
  font-weight: 850;
}

.copy-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
}

@media (max-width: 1050px) {
  .routine-head,
  .routine-row {
    grid-template-columns: minmax(220px, 1.6fr) 110px 115px 112px minmax(230px, auto);
    gap: 9px;
  }

  .routine-actions .button {
    min-width: 96px;
    padding-inline: 9px;
  }
}

@media (max-width: 860px) {
  .header-inner {
    align-items: flex-start;
    padding-block: 11px;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .save-mode,
  .account-label {
    display: none;
  }

  .hero-decoration {
    display: none;
  }

  .hero-inner {
    min-height: 200px;
  }

  .calendar-day {
    min-height: 93px;
  }

  .selected-date-list {
    grid-template-columns: 1fr;
  }

  .routine-head {
    display: none;
  }

  .routine-row {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    padding: 16px;
  }

  .routine-main {
    grid-column: 1 / -1;
  }

  .routine-cell::before,
  .routine-actions::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
  }

  .cell-label {
    display: none;
  }

  .routine-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .routine-actions::before {
    width: 100%;
  }

  .routine-actions .button {
    flex: 1;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .share-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(var(--content), calc(100% - 18px));
  }

  .site-header {
    position: static;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }

  .language-link {
    min-height: 44px;
    padding-inline: 5px;
    font-size: 0.76rem;
  }

  .header-button {
    min-height: 44px;
    padding: 7px 9px;
    font-size: 0.74rem;
  }

  #login-button span {
    font-size: 0.66rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .hero-inner {
    min-height: 180px;
    padding-block: 31px;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .content-stack {
    gap: 23px;
    padding-block: 18px 50px;
  }

  .card {
    border-radius: 18px;
  }

  .calendar-toolbar {
    min-height: 68px;
    padding: 11px;
  }

  .calendar-navigation {
    gap: 5px;
  }

  .calendar-navigation h2 {
    min-width: 112px;
    font-size: 1rem;
  }

  .calendar-toolbar .icon-button {
    width: 44px;
    height: 44px;
  }

  .calendar-day {
    min-height: 68px;
    gap: 2px;
    padding: 3px;
  }

  .day-number {
    width: 26px;
    height: 26px;
    font-size: 0.76rem;
  }

  .calendar-legend {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 13px;
    padding: 0 11px 9px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
  }

  .calendar-legend-item,
  .calendar-markers {
    align-items: center;
  }

  .calendar-legend-item {
    display: inline-flex;
    gap: 5px;
  }

  .calendar-event,
  .calendar-more {
    display: none;
  }

  .calendar-markers {
    min-height: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 1px;
  }

  .calendar-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    display: inline-block;
    box-sizing: border-box;
    border-radius: 50%;
  }

  .calendar-dot.scheduled {
    border: 2px solid var(--warning);
    background: white;
  }

  .calendar-dot.completed {
    border: 2px solid var(--green);
    background: var(--green);
  }

  .selected-panel {
    padding: 13px 11px;
  }

  .selected-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-item .button {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading .button {
    width: 100%;
  }

  .routine-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .routine-main,
  .routine-actions {
    grid-column: 1;
  }

  .routine-actions .button {
    width: 100%;
    flex-basis: 100%;
  }

  .routine-actions .icon-button {
    flex: 1;
  }

  .explanation-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .explanation-icon {
    width: 45px;
    height: 45px;
  }

  .share-card {
    padding: 20px;
  }

  .share-actions {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
  }

  .share-button > span {
    width: 48px;
    height: 48px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner nav {
    width: 100%;
    justify-content: flex-end;
    text-align: right;
  }

  .feedback-button {
    right: 9px;
    bottom: 9px;
    min-height: 46px;
    padding: 9px 13px;
    font-size: 0.76rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .button {
    width: 100%;
  }

  .modal-actions.stacked {
    display: grid;
  }
}

@media (max-width: 340px) {
  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .container {
    width: calc(100% - 12px);
  }

  .brand,
  .footer-inner nav a {
    min-width: 44px;
    min-height: 44px;
  }

  .calendar-card {
    border-width: 0;
  }

  .weekday-row,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
  }

  #today-button {
    min-width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.footer-link-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.analytics-consent-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 1000;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  border: 2px solid #214d3b;
  border-radius: 14px;
  color: #17251f;
  background: #fff;
  box-shadow: 0 8px 28px rgb(20 50 39 / 24%);
}

.analytics-consent-banner[hidden] {
  display: none;
}

.analytics-consent-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  width: min(100%, 1100px);
  margin: 0 auto;
}

.analytics-consent-content h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.analytics-consent-content p {
  margin: 0;
  line-height: 1.65;
}

.analytics-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.analytics-consent-actions .button {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .analytics-consent-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-consent-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-consent-actions .button {
    width: 100%;
  }
}
