/* XENIA — visual system */
:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #fffefa;
  --surface-soft: #edf2eb;
  --sage: #6f8b75;
  --sage-dark: #45634e;
  --sage-deep: #304b3b;
  --rose: #bd899b;
  --rose-soft: #f5e9ed;
  --ink: #39483e;
  --muted: #788278;
  --line: #e4e8df;
  --shadow: 0 12px 34px rgba(48, 75, 59, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; padding: 0 0 max(22px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 10% 0%, #edf2e9 0, transparent 34rem), var(--bg);
  color: var(--ink); font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  text-align: center; line-height: 1.75;
}
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--sage-dark); }
header {
  position: relative; overflow: hidden; padding: 42px 18px 34px;
  background: linear-gradient(135deg, #e5eee3 0%, #d7e5d8 55%, #f0e5e9 100%);
  border-radius: 0 0 34px 34px; box-shadow: 0 8px 26px rgba(64, 91, 70, .07);
}
header::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid rgba(111,139,117,.16); inset-inline-end: -85px; top: -110px;
  box-shadow: 0 0 0 22px rgba(255,255,255,.10), 0 0 0 46px rgba(255,255,255,.08);
  pointer-events: none;
}
header h1 { position: relative; z-index: 1; margin: 0; color: var(--sage-dark); font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1.2; letter-spacing: .12em; font-weight: 750; }
header p { position: relative; z-index: 1; margin: 10px 0 18px; color: #806b77; font-size: 1.02rem; }
header button { position: relative; z-index: 1; }
main { width: min(100% - 30px, 1040px); margin: 0 auto; padding: 30px 0 24px; }
main > h2 { margin: 8px 0 8px; color: var(--sage-dark); font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.45; }
main > p { max-width: 760px; margin: 8px auto 18px; color: var(--muted); }
.site-nav {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px;
  width: min(100% - 28px, 1050px); margin: 18px auto 4px; padding: 10px;
  background: rgba(255,254,250,.84); border: 1px solid rgba(220,228,218,.9);
  border-radius: 18px; box-shadow: 0 6px 20px rgba(48,75,59,.045);
}
.site-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 13px; border-radius: 999px; color: var(--sage-dark); text-decoration: none; font-size: .88rem; font-weight: 650; transition: .2s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-soft); color: var(--sage-deep); }
.site-nav a:focus-visible, button:focus-visible, .card:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #a9c5ad; outline-offset: 3px; }
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 43px; padding: 9px 18px; margin: 5px 3px; border: 1px solid transparent;
  border-radius: 999px; background: var(--sage); color: #fff; font-weight: 650;
  font-size: .93rem; cursor: pointer; box-shadow: 0 4px 10px rgba(69,99,78,.12); transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.button:hover, button:hover { background: var(--sage-dark); transform: translateY(-1px); box-shadow: 0 7px 15px rgba(69,99,78,.16); }
.button-language { min-height: 36px; padding: 6px 15px; background: rgba(255,255,255,.72); color: var(--sage-dark); border-color: rgba(111,139,117,.2); box-shadow: none; }
.button-language:hover { background: #fff; color: var(--sage-deep); }
.button-soft { background: var(--rose-soft); color: #895d70; box-shadow: none; }
.button-soft:hover { background: #efdce3; color: #74485b; }
.button-small { min-height: 34px; padding: 5px 13px; font-size: .82rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin: 30px auto 12px; text-align: start; }
.card {
  display: block; min-width: 0; padding: 24px 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-4px); border-color: #cbd9ca; box-shadow: 0 17px 36px rgba(48,75,59,.12); }
.card h3:first-child { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin: 0 0 12px; border-radius: 17px; background: var(--surface-soft); font-size: 1.8rem; }
.card h3 { margin: 0 0 6px; color: var(--sage-dark); font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.8; }
section:not(.card) {
  width: min(100%, 790px); margin: 18px auto; padding: clamp(18px, 4vw, 27px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); text-align: start;
}
section h2, section h3 { color: var(--sage-dark); line-height: 1.5; }
section h2 { margin-top: 0; font-size: 1.3rem; }
section h3 { margin: 4px 0 10px; font-size: 1.08rem; }
section p { color: #5e6b61; line-height: 1.95; }
.intro { background: linear-gradient(135deg, #fffefa, #f3f5ef) !important; }
.small-note, .notice, .privacy-note { color: var(--muted); font-size: .88rem; }
.week-card { margin: 12px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fffefa; text-align: start; }
.week-card h3 { color: var(--sage-dark); }
.week-card p { margin-bottom: 0; }
label { display: block; margin: 13px 0 6px; color: var(--sage-dark); font-weight: 650; }
input, textarea, select {
  display: block; width: 100%; min-height: 46px; margin: 7px 0 16px; padding: 11px 13px;
  border: 1px solid #dce4da; border-radius: 13px; background: #fcfcf8; color: var(--ink);
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus, select:focus { border-color: #91ad96; box-shadow: 0 0 0 3px rgba(145,173,150,.15); }
textarea { min-height: 100px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a0a99f; }
canvas { display: block; width: 100%; max-width: 100%; height: auto; margin: 14px auto; border-radius: 14px; background: #f8faf6; }
#dailyHistory { display: grid; gap: 10px; margin-top: 14px; }
.history-entry { padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcf8; }
.history-entry h4 { margin: 0 0 6px; color: var(--sage-dark); }
.history-entry p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { color: var(--muted); text-align: center; font-size: .9rem; }
#saveMessage { min-height: 1.6em; color: var(--sage-dark); font-weight: 650; }
.site-footer { width: min(100% - 30px, 1000px); margin: 28px auto 0; padding: 16px 12px; color: var(--muted); font-size: .85rem; text-align: center; }
.site-footer p { margin: 4px 0; }
.site-footer .privacy-note { font-size: .78rem; }
@media (max-width: 650px) {
  header { padding: 32px 15px 26px; border-radius: 0 0 26px 26px; }
  .site-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: 8px; }
  .site-nav a { flex: 0 0 auto; font-size: .82rem; }
  main { width: min(100% - 24px, 1040px); padding-top: 24px; }
  .cards { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .card { padding: 20px; }
  section:not(.card) { margin: 14px auto; padding: 17px; border-radius: 18px; }
  .week-card { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
