:root {
  color-scheme: light;
  font-family: "DM Sans", "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #203c36;
  background: #f2f5f0;
  --ink: #203c36;
  --muted: #576c61;
  --line: #dce4db;
  --paper: #fffefa;
  --green: #206652;
  --soft: #edf4ed;
  --rail: #153b33;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
[hidden], .glyphs { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(25px,2.1vw,34px); line-height: 1.24; letter-spacing: -.035em; }
h2 { font-size: 17px; line-height: 1.45; letter-spacing: -.015em; }
h3 { font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 7px 14px; border: 1px solid #cbd8ce; border-radius: 9px;
  background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer;
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
button:hover { background: #e9f1e9; border-color: #a6beae; }
button:active { background: #ddeadd; }
button:disabled { color: #79867c; border-color: var(--line); background: #f5f6f1; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #bf903f; outline-offset: 2px;
}
button.primary { background: var(--green); color: white; border-color: var(--green); }
button.primary:hover { background: #164f40; }
button.primary:disabled { background: #75897c; border-color: #75897c; }
.icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 10px 12px; background: #fff; color: var(--ink);
  border: 1px solid #c7d5cb; border-radius: 8px; font-size: 14px;
}
input::placeholder, textarea::placeholder { color: #64776b; }
textarea { resize: vertical; min-height: 96px; }
label { display: grid; align-content: start; gap: 7px; color: #375348; font-weight: 600; }
label :is(input, select, textarea) { font-weight: 400; }
code, .id { font-family: "Cascadia Mono", Consolas, monospace; }
.id { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.hint, .muted, small { color: var(--muted); font-size: 13px; }
.brand-mark {
  width: 42px; height: 42px; flex: none; position: relative; border-radius: 13px;
  background: linear-gradient(145deg,#315d4e,#1a463a); border: 1px solid #ffffff38;
  box-shadow: inset 0 1px #ffffff12;
}
.brand-mark i {
  position: absolute; display: block; width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 32% 25%,#fff8df 3%,#e8bb65 32%,#bb7d3a 87%);
  left: 18px; top: 7px; box-shadow: 0 2px 3px #12382d60;
}
.brand-mark i:nth-child(2) { left: 7px; top: 16px; background: radial-gradient(circle at 32% 25%,#ecfff6 3%,#8bdac1 32%,#36967a 87%); }
.brand-mark i:last-child { left: 19px; top: 23px; width: 10px; height: 10px; background: radial-gradient(circle at 32% 25%,#fff6e8 3%,#eeb79e 32%,#ba8571 87%); }
#login {
  display: grid; place-items: safe center; height: 100%; height: 100dvh; overflow: auto; padding: 16px;
  background: radial-gradient(ellipse at 20% 16%, #d8e7d8, transparent 62%), #eff2e9;
}
.login-card {
  width: min(900px,100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
  background: var(--paper); border: 1px solid #c6d6c9; border-radius: 22px; box-shadow: 0 18px 60px #204c3917;
}
.login-art { min-height: 370px; padding: 24px; background: linear-gradient(165deg,#0e302bd1,transparent 55%),url('/garden-cover.jpg') 60% center/cover,#1c4034; }
.login-brand { display: flex; align-items: center; gap: 12px; color: #fff6df; font-size: 19px; font-weight: 700; }
.login-panel { padding: clamp(24px,3vw,44px); align-self: center; }
.login-panel h1 { margin-bottom: 26px; }
#access { display: grid; gap: 15px; }
#access button { margin-top: 5px; width: 100%; }
#login-notice { color: var(--green); font-size: 13px; }
#login-error, #password-error { color: #9f422e; font-size: 13px; }
:is(#login-notice, #login-error, #password-error):empty { display: none; }
#app { height: 100%; height: 100dvh; display: grid; grid-template-columns: clamp(184px,15vw,224px) minmax(0,1fr); }
.rail {
  display: flex; flex-direction: column; gap: 26px; min-height: 0; padding: 24px 13px 18px;
  background: linear-gradient(164deg,#173f35 0%,#13362e 72%,#1b4033); color: #fbf9eb;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 4px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; white-space: nowrap; }
.brand small { font-size: 12px; color: #c0d3c5; letter-spacing: .1em; }
.rail nav { display: grid; gap: 5px; border-top: 1px solid #ffffff24; padding-top: 17px; }
.rail button { min-height: 43px; justify-content: start; padding-inline: 13px; gap: 12px; border: 1px solid transparent; color: #d2e0d4; background: transparent; }
.rail button:hover { background: #ffffff0f; color: white; }
.rail button[aria-current] { color: #fffce9; background: #385f4f; border-color: #67867166; }
.rail button[aria-current] .icon { color: #f3d49c; }
#logout { margin-top: auto; }
.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 16px 16px; }
.date { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.date .icon { width: 14px; height: 14px; }
.toolbar, .filter { display: flex; align-items: center; gap: 8px; }
.toolbar .icon, .text-btn .icon { width: 16px; height: 16px; }
#status { margin: 0 16px 10px; padding: 8px 12px; background: #fcf1d9; border-radius: 8px; color: #714e24; }
#content { min-height: 0; flex: 1; overflow: auto; padding: 0 16px 16px; scrollbar-color: #a6b8a8 transparent; scrollbar-width: thin; }
.overview-top, .overview-bottom, .compose-grid { display: grid; align-items: start; gap: 14px; grid-template-columns: minmax(0,1.65fr) minmax(265px,1fr); }
.overview-top { align-items: stretch; margin-bottom: 14px; }
.overview-bottom { align-items: stretch; }
.activity { margin-top: 14px; }
.activity-table .text-btn { text-align: left; overflow-wrap: anywhere; }
.card, .hero { min-width: 0; border-radius: 15px; }
.card { border: 1px solid var(--line); background: var(--paper); box-shadow: 0 2px 6px #234d3510; }
.card-head { min-height: 63px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero {
  display: grid; position: relative; overflow: hidden; isolation: isolate; color: #fffae9;
  background: #173f35; box-shadow: 0 2px 7px #17392e23;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg,#153d33 6%,#153d33e8 32%,#153d3355 62%,transparent 82%),
    url('/garden-cover.jpg') right 56%/78% auto no-repeat;
}
.hero-info { padding: 19px 22px; }
.hero h2 { color: #edf3df; }
.metrics { display: flex; gap: clamp(20px,3vw,56px); margin: 14px 0 12px; }
.metrics dt { font-size: 13px; font-weight: 500; color: var(--muted); }
.metrics dd { font-variant-numeric: tabular-nums; font-size: clamp(32px,3vw,46px); font-weight: 650; line-height: 1.18; letter-spacing: -.045em; }
.hero .metrics dt { color: #dae9d7; }
.hero .metrics dd { text-shadow: 0 2px 8px #173a2e60; }
.hero-link, .text-btn { border: 0; background: transparent; min-height: 30px; padding: 1px 0; font-size: 13px; color: var(--green); }
.hero-link { color: #f7dd9d; }
.hero-link .icon { width: 16px; height: 16px; }
.hero-link:hover, .text-btn:hover { background: transparent; text-decoration: underline; }
.delivery { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(115deg,#fffdf7,#f4f5ea); }
.delivery .card-head { min-height: 0; padding-bottom: 0; }
.delivery .metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 17px 19px 22px; gap: 12px; }
.delivery .metrics div + div { border-left: 1px solid #d7dfcf; padding-left: 18px; }
.delivery .metrics dd { margin-top: 4px; color: #355247; }
.tile { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; }
.tile.teal, .notice { background: #e3efe9; color: #286450; }
.petals { color: #995339; background: #fae9dc; }
.trial { color: #615786; background: #eeeaf8; }
#quick-actions { padding: 0 17px 8px; }
.quick { display: flex; align-items: center; width: 100%; justify-content: start; gap: 12px; padding: 10px 2px; border: 0; border-radius: 0; border-top: 1px solid var(--line); background: transparent; }
.quick > .icon:last-child { margin-left: auto; color: var(--muted); width: 15px; }
.quick:hover { background: #f4f7ef; }
.quick .tile { width: 35px; height: 35px; border-radius: 10px; }
.empty { display: grid; place-content: center; justify-items: center; gap: 12px; min-height: 164px; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.empty .tile { width: 46px; height: 46px; border-radius: 16px; background: #edf2e9; color: #61836d; }
.filter { flex: none; padding: 0 16px 12px; }
#search > button { flex: none; }
.search-field { display: flex; align-items: center; gap: 7px; width: min(100%,440px); padding-left: 11px; background: #fff; border: 1px solid #c7d5cb; border-radius: 9px; }
.search-field .icon { color: var(--muted); width: 16px; }
.search-field input { padding: 8px 10px 8px 0; border: 0; background: transparent; }
.counter, .type { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 650; }
.counter { background: var(--soft); color: var(--green); }
.type .icon { width: 14px; height: 14px; }
.roster-row { width: 100%; text-align: left; justify-content: start; border: 0; border-radius: 0; border-top: 1px solid var(--line); padding: 12px 16px; gap: 10px; position: relative; }
.roster-row > span:nth-child(2) { min-width: 0; }
.roster-row strong { overflow-wrap: anywhere; font-size: 14px; }
.roster-row small { display: block; font-weight: 400; }
.roster-row > .icon { margin-left: auto; width: 15px; }
.pager, .form-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 12px 16px; gap: 8px; }
.pager { font-size: 13px; color: var(--muted); }
.pager button { min-height: 32px; font-size: 13px; padding: 4px 10px; }
.form-body { padding: 0 19px 18px; }
#profile {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: min(680px, 94vw); max-width: 100%; height: 100%; height: 100dvh; max-height: 100dvh;
  border: 0; border-radius: 16px 0 0 16px; box-shadow: -12px 0 50px #102b2929;
  background: var(--paper); color: var(--ink); overflow: hidden; container-type: inline-size;
}
#profile[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
#profile::backdrop { background: #142e29a3; }
#profile-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#profile .profile-banner { border-radius: 0; flex-wrap: nowrap; }
#profile-close { flex: none; padding: 0; width: 38px; height: 38px; color: #fffbed; background: #173e34b3; border-color: #ffffff66; }
#profile-close:hover { background: #315b4f; }
.drawer-footer { display: flex; justify-content: flex-end; padding: 14px clamp(14px,3cqi,24px) max(14px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (prefers-reduced-motion:no-preference) {
  #profile[open] { animation: profile-enter .22s cubic-bezier(.2,.7,.25,1); }
  #profile[open]::backdrop { animation: profile-dim .18s ease-out; }
  @keyframes profile-enter { from { transform: translateX(100%); } }
  @keyframes profile-dim { from { opacity: 0; } }
}
.profile-banner {
  padding: 21px clamp(16px,3cqi,26px); border-radius: 14px 14px 0 0;
  background: linear-gradient(95deg,#173f35 14%,#163e34f2 39%,#183d35b8 65%,#132f2c89),
    url('/garden-cover.jpg') right 44% / cover;
  color: #fffbed;
}
.profile-identity { min-width: 0; }
.profile-identity h2 { font-size: 22px; letter-spacing: .02em; }
.profile-id { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px; margin-top: 5px; }
.profile-id span { font-size: 12px; color: #c8dbc9; }
.profile-id code { color: #e0ebe1; font-size: 13px; overflow-wrap: anywhere; }
.profile-stats {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px;
  padding: 17px clamp(14px,3cqi,24px) 0;
}
.profile-stats > div { min-width: 0; padding: 12px 13px; border-radius: 10px; background: var(--metric-wash); }
.stat-score { --metric-wash: #e8f2eb; --metric-ink: #2d6c55; }
.stat-trophy { --metric-wash: #f8f0dd; --metric-ink: #8a642c; }
.stat-steps { --metric-wash: #eaf0f2; --metric-ink: #456a76; }
.stat-petals { --metric-wash: #faece7; --metric-ink: #995b50; }
.profile-stats dt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--metric-ink); font-weight: 600; }
.profile-stats .icon { width: 16px; height: 16px; }
.profile-stats dd { margin-top: 5px; font-size: clamp(23px,3.8cqi,32px); font-variant-numeric: tabular-nums; line-height: 1.18; font-weight: 680; letter-spacing: -.035em; overflow-wrap: anywhere; }
.profile-groups { display: grid; grid-template-columns: 1.1fr 1fr; padding: 20px clamp(14px,3cqi,24px); gap: 20px; }
.profile-group { min-width: 0; }
.profile-group + .profile-group { padding-left: 20px; border-left: 1px solid var(--line); }
.profile-group h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-size: 15px; }
.profile-group h3 .icon { width: 17px; height: 17px; color: var(--green); }
.profile-group dl { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: baseline; gap: 0 12px; }
.profile-group :is(dt,dd) { padding: 6px 0; }
.profile-group dt { color: var(--muted); font-size: 13px; }
.profile-group dd { text-align: right; overflow-wrap: anywhere; font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; }
.details { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 18px; padding: 17px 0; }
.details dt { color: var(--muted); }
.details dd { overflow-wrap: anywhere; }
.note-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; border-block: 1px solid var(--line); padding: 13px clamp(14px,3cqi,24px) 16px; background: #f6f8f2; }
.note-feedback { grid-column: 1 / -1; color: var(--ink); font-size: 13px; }
.note-feedback:empty { display: none; }
.note-form button { flex: none; min-height: 43px; background: #e6eee5; border-color: #becfbd; color: #2c5b43; }
.note-form button:hover { background: #dbe9db; }
@container (max-width: 560px) {
  .profile-banner { flex-wrap: wrap; padding-block: 15px; }
  .profile-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-groups { grid-template-columns: 1fr; gap: 13px; padding-block: 15px; }
  .profile-group + .profile-group { padding: 13px 0 0; border: 0; border-top: 1px solid var(--line); }
  .profile-group :is(dt,dd) { padding-block: 4px; }
}
.form-body { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-footer { justify-content: end; }
#password-form { width: min(100%, 480px); }
.preview-paper { position: relative; margin: 0 18px; padding: 21px 18px; background: #f7f6ec; border: 1px solid #e2dfcc; border-radius: 9px; min-height: 165px; overflow-wrap: anywhere; }
.preview-paper h3 { color: #354c3d; margin: 12px 0 7px; }
.preview-paper p { color: #536354; white-space: pre-wrap; }
#preview-attachment { display: inline-block; margin-top: 18px; padding: 4px 9px; border: 1px solid #dac59e; background: #fff3d7; color: #6e5426; border-radius: 7px; font-weight: 600; }
.preview-target { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; padding: 15px 19px; font-size: 13px; color: var(--muted); }
.preview-target strong { overflow-wrap: anywhere; color: var(--ink); }
.mail-table { border-collapse: collapse; width: 100%; font-size: 13px; table-layout: fixed; }
.mail-table :is(th,td) { padding: 11px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.mail-table th { background: #f3f6ef; color: var(--muted); font-weight: 600; }
.mail-table th:first-child { width: 35%; }
.mail-table th:last-child { width: 26%; }
.mail-table td strong, .mail-table td small { display: block; }
.mail-table td strong { font-size: 14px; }
.mail-table td small { font-size: 12px; }
.mail-table .counts { font-variant-numeric: tabular-nums; }
.mail-table .counts span { display: inline-block; margin-right: 7px; }
#review { width: min(440px,calc(100% - 28px)); max-height: 90dvh; overflow: auto; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 16px 60px #122f3440; }
#review::backdrop { background: #142d29a8; }
.review-body { padding: 0 19px; overflow-wrap: anywhere; }
.review-body p { margin-top: 6px; white-space: pre-wrap; }
@media (max-width:1000px) {
  #app { grid-template-columns: 160px minmax(0,1fr); }
  .rail { padding-inline: 9px; }
  .brand { gap: 7px; }
  .brand strong { font-size: 15px; }
  .overview-top, .overview-bottom, .compose-grid { grid-template-columns: minmax(0,1.4fr) minmax(210px,1fr); }
  .mail-table :is(th,td) { padding-inline: 8px; }
}
@media (max-width:760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
  .rail { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 12px 6px; }
  .brand small { display: none; }
  .brand-mark { transform: scale(.8); margin: -5px; }
  #logout { margin: 0; min-height: 32px; font-size: 13px; }
  .rail nav { grid-row: 2; grid-column: 1/-1; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 0; border: 0; gap: 2px; }
  .rail nav button { justify-content: center; gap: 5px; padding: 5px 3px; font-size: 13px; min-height: 34px; }
  .rail nav .icon { width: 15px; height: 15px; }
  .bar { padding-block: 12px; }
  .overview-top, .overview-bottom, .compose-grid { grid-template-columns: 1fr; }
  .overview-top, .overview-bottom { gap: 10px; }
  .delivery { flex-direction: row; align-items: center; justify-content: space-between; }
  .delivery .card-head { padding: 12px; }
  .delivery .card-head .tile { display: none; }
  .delivery .metrics { flex: 1; max-width: 330px; margin: 10px 12px; }
  .delivery .metrics dd { font-size: 24px; }
  .hero-info { padding: 15px 18px; }
  .empty { min-height: 110px; }
  .login-card { grid-template-columns: 1fr; max-width: 430px; }
  .login-art { min-height: 132px; background-position: center 58%; }
}
@media (max-width:540px) {
  .rail nav button { flex-direction: column; gap: 2px; font-size: 12px; }
  #profile { width: 100%; border-radius: 0; }
  .drawer-footer .primary { width: 100%; }
  .bar, .filter { padding-inline: 12px; }
  #content { padding-inline: 12px; }
  #status { margin-inline: 12px; }
  .toolbar button { padding-inline: 9px; font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-body { padding-inline: 14px; }
  .mail-table th:first-child { width: 36%; }
  .mail-table th:last-child { width: 28%; }
  .mail-table .type { padding: 3px 6px; }
  .mail-table .type .icon { display: none; }
}
@media (max-height:540px) {
  .bar { padding-block: 7px; }
  .date { display: none; }
  .rail { gap: 5px; }
  .login-art { min-height: 80px; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none !important; } }
