:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #25231f;
  background: #f8f6f1;
  font-synthesis: none;
  --ink: #25231f;
  --muted: #6c665e;
  --surface: #fffdfa;
  --line: #e7e0d5;
  --accent: #d4f688;
  --green: #293818;
  --lavender: #eee5f7;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 6vw, 42px); font-weight: 780; letter-spacing: -.045em; }
h2 { font-size: 17px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; min-height: 44px; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #65509a; outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.icon { display: inline-grid; place-items: center; flex-shrink: 0; }
.icon svg { display: block; width: 21px; height: 21px; }
.icon:has(ellipse) svg { fill: currentColor; stroke: none; }
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-inner { display: flex; align-items: center; gap: 10px; width: min(100% - 32px, 760px); margin: auto; min-height: 65px; }
.brand { display: grid; place-items: center; width: 44px; border-radius: 15px; border: 0; background: var(--accent); }
.brand-title { font-weight: 750; letter-spacing: -.015em; }
.header-actions { display: flex; gap: 3px; margin-left: auto; }
.icon-button { display: grid; place-items: center; width: 44px; border: 0; border-radius: 14px; background: transparent; }
.icon-button:hover, .back:hover { background: #efeae0; }
.shell { width: min(100% - 32px, 690px); margin: auto; padding: 28px 0 max(36px, env(safe-area-inset-bottom)); }
.dog-home { display: grid; gap: 16px; }
.home-title { display: grid; gap: 5px; padding: 5px 0 1px; }
.day-label, .muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score { min-width: 0; display: grid; gap: 5px; padding: 14px 17px; border-radius: 18px; background: #efeadf; }
.score:nth-child(2) { background: var(--lavender); }
.score span { color: #4e493e; font-size: 13px; font-weight: 650; }
.score strong { font-size: 28px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quick-panel { display: grid; gap: 3px; border: 1px solid #dce8c6; border-radius: 22px; padding: 9px; background: #edf2e4; }
.quick-button { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; border: 1px solid #c1d9a1; border-radius: 15px; background: var(--accent); color: var(--green); min-height: 73px; font-size: 24px; font-weight: 800; }
.quick-button:hover, .primary:hover { background: #c6ec73; }
.quick-button .icon svg { width: 25px; height: 25px; }
.quick-caption { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: 8px; min-height: 42px; color: #4d5b3c; font-size: 13px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0 5px; font-weight: 700; text-decoration: underline; }
.text-button .icon svg { width: 15px; height: 15px; }
.rows { display: grid; gap: 8px; }
.row { width: 100%; display: flex; align-items: center; gap: 11px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; min-height: 58px; padding: 8px 12px; }
.row:hover { border-color: #b8ad9b; }
.row-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: #f0ebdf; color: #514737; }
.row .row-icon svg { width: 18px; height: 18px; }
.row-label { display: grid; gap: 3px; flex: 1; font-weight: 650; }
.row-label small { font-weight: 450; color: var(--muted); font-size: 12px; }
.row > .icon { color: var(--muted); }
.row > .icon svg { width: 16px; height: 16px; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.section-title h1 { flex: 1; }
.back { display: inline-flex; gap: 2px; align-items: center; border: 0; background: transparent; border-radius: 11px; color: var(--muted); font-size: 14px; padding: 0 7px 0 2px; }
.back svg { width: 16px; height: 16px; }
.panel, .login-card { border: 1px solid var(--line); border-radius: 21px; padding: 18px; background: var(--surface); }
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(100%, 410px); padding: clamp(20px, 7vw, 36px); }
.login-card .form-stack { margin-top: 25px; }
.login-mark { display: grid; place-items: center; width: 57px; height: 57px; margin-bottom: 14px; border-radius: 18px; background: var(--accent); }
.login-mark svg { width: 31px; height: 31px; }
.form-stack { display: grid; gap: 16px; }
.form-stack label, .field-label { display: block; font-weight: 650; font-size: 14px; }
.form-stack label small, .field-label small { color: var(--muted); font-weight: 450; }
input:not([type=file]), textarea, select { display: block; width: 100%; max-width: 100%; min-height: 45px; border: 1px solid #d9d0c3; border-radius: 10px; background: #fffefa; color: var(--ink); padding: 10px 11px; font-size: 16px; }
.form-stack label input:not([type=file]), .form-stack label textarea, .form-stack label select, .media-field { margin-top: 7px; }
textarea { resize: vertical; line-height: 1.5; }
.file-box { position: relative; display: flex !important; align-items: center; justify-content: center; gap: 7px; min-height: 53px; color: #514b41; border: 1px dashed #a59a8a; border-radius: 10px; cursor: pointer; text-align: center; padding: 5px 10px; }
.file-box:focus-within { outline: 3px solid #65509a; outline-offset: 2px; }
.file-input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.file-names { color: var(--muted); overflow-wrap: anywhere; font-size: 13px; margin-top: 7px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 6px; }
.form-error { color: #9d302d; background: #fff0ed; border-radius: 8px; padding: 8px 10px; font-size: 14px; overflow-wrap: anywhere; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; padding: 9px 17px; border: 1px solid #c3dba2; border-radius: 11px; background: var(--accent); color: var(--green); font-weight: 730; }
.secondary { border-color: #d9d0c3; background: var(--surface); color: var(--ink); }
.secondary:hover { background: #f4eee3; }
.danger { color: #9d302d; }
.wide { width: 100%; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
.quick-photo { width: min(100%, 380px); padding: 4px 8px 8px; gap: 8px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 33px 16px; text-align: center; margin-top: 4px; }
.empty > .icon { border-radius: 15px; padding: 11px; background: var(--lavender); }
.loading { color: var(--muted); text-align: center; padding: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs { display: flex; flex: 1; border: 1px solid var(--line); padding: 3px; background: #efeae1; border-radius: 12px; white-space: nowrap; }
.tabs button { flex: 1; min-height: 44px; border: 0; background: transparent; border-radius: 8px; padding: 6px 9px; font-weight: 650; font-size: 13px; }
.tabs button[aria-pressed=true] { background: var(--surface); }
.filters select { width: auto; flex: 1; }
.entry-list { display: grid; gap: 10px; margin-bottom: 12px; }
.entry { min-width: 0; display: grid; gap: 12px; }
.entry-header { display: flex; align-items: flex-start; gap: 8px; }
.entry-title { flex: 1; min-width: 0; }
.entry-title time { font-size: 12px; color: var(--muted); }
.status { flex-shrink: 0; font-size: 12px; border-radius: 30px; padding: 4px 7px; background: #eee7da; }
.status.approved { background: #e7f1d8; }
.status.rejected { background: #f7e1dd; }
.entry-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 15px; }
.attachments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.attachments a, .attachments video { display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 9px; background: #272727; }
.attachments img { width: 100%; height: 100%; object-fit: contain; }
.entry details, .feedback { border-top: 1px solid var(--line); padding-top: 8px; }
.entry summary { cursor: pointer; min-height: 44px; line-height: 44px; font-weight: 670; color: #475432; }
.review-form { gap: 8px; }
.review-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.feedback { display: grid; gap: 6px; }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.violation { color: #9d302d; }
#notice { position: fixed; z-index: 2; bottom: max(15px, env(safe-area-inset-bottom)); left: 0; right: 0; display: grid; justify-content: center; pointer-events: none; padding: 0 15px; }
.toast { border-radius: 20px; background: #2c2b23; color: #fffefa; padding: 11px 16px; text-align: center; font-size: 14px; }
@media (min-width: 650px) {
  .shell { padding-top: 38px; }
  .dog-home { gap: 20px; }
  .score { padding: 17px 21px; }
  .quick-button { min-height: 94px; }
  .row { min-height: 62px; }
  .panel { padding: 21px; }
  .filters select { flex: 0 1 160px; }
}

.owner-menu { position: relative; }
.owner-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  min-height: 44px;
  padding: 3px 9px 3px 4px;
  border: 1px solid #e5ded3;
  border-radius: 16px;
}
.owner-menu > summary::-webkit-details-marker { display: none; }
.owner-avatar { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; background: #343a57; }
.owner-name { font-weight: 650; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.owner-actions {
  position: absolute;
  z-index: 4;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  gap: 8px;
  min-width: 168px;
  padding: 12px;
  border: 1px solid #e5ded3;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(40, 31, 15, .12);
}
.owner-actions button[aria-pressed="true"] { background: #e8f2d9; }
.dog-domain { margin-bottom: 16px; }
.dog-domain a { display: inline-block; margin-top: 6px; overflow-wrap: anywhere; }

.owner-heading { display: flex; gap: 9px 14px; align-items: center; flex-wrap: wrap; }
.owner-heading h1 { margin-right: 0; }
.current-dog { margin-right: auto; font-weight: 750; color: #714024; }
.owner-workspace { display: grid; gap: 14px; }
.work-card { display: grid; gap: 12px; justify-items: start; }
.work-card h2 { margin: 0; }
.card-title, .work-actions, .entry-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.card-title time { color: var(--muted); }
.unread-badge { background: #bd252f; color: white; min-width: 23px; height: 23px; border-radius: 999px; padding: 0 5px; text-align: center; line-height: 23px; font-size: .79rem; font-weight: 800; }
.day-grid, .feature-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.day-grid { width: 100%; grid-auto-rows: 1fr; }
.day-category { min-height: 62px; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 3px 7px; align-content: center; text-align: left; background: #f8f6ef; border: 1px solid #e3dccb; border-radius: 11px; padding: 8px 10px; }
.day-category-label, .feature-options label span { white-space: nowrap; }
.day-category small { grid-column: 2; color: #656051; }
.day-category:disabled { background: #eeeeeb; color: #72716c; opacity: 1; cursor: default; }
.history-days { display: flex; flex-wrap: wrap; gap: 7px; }
.diary-chart { width: 100%; }
.diary-chart svg { display: block; width: 100%; height: auto; }
.chart-bar { fill: #527333; }
.chart-zero { fill: #d8dccd; }
.chart-dates { display: flex; justify-content: space-between; color: var(--muted); font-size: .83rem; }
.diary-chart details { margin-top: 10px; }
.trend-data { margin-block: 6px; }
.trend-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.trend-tabs .secondary { font-size: .87rem; padding-inline: 12px; }
.trend-tabs [aria-pressed="true"] { background: #e8f2d9; border-color: #b8c89d; }
.trend-content { min-width: 0; width: 100%; }
.heat-date { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.heat-date input { min-height: 44px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.heat-summary { margin-block: 2px 9px; }
.heatmap { display: grid; gap: 9px; margin-block: 4px 9px; }
.heat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.heat-cell { padding: 2px; border: 0; border-radius: 7px; font-size: .78rem; font-variant-numeric: tabular-nums; }
.heat-legend { display: flex; gap: 4px; color: var(--muted); font-size: .76rem; }
.heat-legend span { min-width: 24px; padding: 2px 4px; border-radius: 4px; text-align: center; }
.heat-tone-0 { background: #f0eee8; color: #524d43; }
.heat-tone-1 { background: #e0ebcb; color: #2c411d; }
.heat-tone-2 { background: #becf9d; color: #24381a; }
.heat-tone-3 { background: #648545; color: #101a08; }
.heat-tone-4 { background: #385824; color: #fff; }
.export-actions { margin: 0 0 12px; }
.entry-tools { justify-content: flex-end; }
.entry-tools label { margin-right: auto; display: inline-flex; align-items: center; gap: 7px; }
.diary-group { margin-block: 8px 0; }
.feature-options { padding: 0; margin: 0; min-width: 0; border: 0; }
.feature-options label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.feature-options label input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; flex: 0 0 17px; accent-color: #527333; }
.feature-save { justify-self: start; }
@media (min-width: 570px) {
  .day-grid, .feature-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .heat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.media-item { min-width: 0; }
.media-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; font-size: .78rem; }
.media-meta dd { margin: 0; overflow-wrap: anywhere; }
.media-meta dt { font-weight: 700; }
.task-panel, .task-list, .task-extra { display: grid; gap: 12px; }
.task-title { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; }
.task-title time { font-weight: 700; font-variant-numeric: tabular-nums; }
.task-card { display: grid; justify-items: start; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #f8f6ef; min-width: 0; }
.task-card .task-title { width: 100%; }
.task-completed { color: #355123; font-weight: 700; }
.task-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.task-moves { padding-inline-start: 19px; margin: 0; }
.task-editor { border-block: 1px solid var(--line); padding-block: 14px; }
.task-form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.task-weekdays { display: flex; flex-wrap: wrap; gap: 6px 13px; margin: 0; border: 0; padding: 0; }
.task-weekdays legend { font-weight: 650; margin-bottom: 4px; }
.task-weekdays label { display: inline-flex; align-items: center; gap: 5px; min-height: 37px; }
.task-weekdays label input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; accent-color: #527333; }
.task-move-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 68px) minmax(0, 85px) auto; align-items: end; gap: 6px; }
.task-move-editor button { padding-inline: 8px; }
.emotion-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emotion-button { border: 1px solid #d9d0c3; border-radius: 13px; min-height: 59px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 750; }
.emotion-button.unwell { background: #f8e8da; color: #703419; }
.emotion-button.excited { background: #e6efce; color: #385123; }
