/* 설이 팔레트: 크림(얼굴·가슴) 바탕, 세이블·차콜(등·귀 뒤) 글자·버튼, 호박색(눈) 포인트, 목줄 노랑·청록은 작은 강조만 */
:root {
  --bg: #faf6ef;          /* pale cream */
  --card: #fffdf9;        /* off-white */
  --field: #fffaf3;
  --ink: #2f2824;         /* charcoal */
  --muted: #6b5e54;
  --line: #e6ddcf;
  --sable: #6e5c4e;       /* sable grey-brown: primary buttons */
  --sable-dark: #4f4239;
  --sable-soft: #f1eae0;
  --amber: #c98a2e;       /* eye amber: accents (non-text) */
  --amber-ink: #85560f;   /* amber for text */
  --amber-soft: #fbf0da;
  --teal: #2a9d96;        /* leash teal: tiny highlights */
  --teal-ink: #1c6b66;
  --yellow: #f2c230;      /* leash yellow: tiny highlights */
  --pink: #ec8a9a;
  --danger: #a8382c;
  --radius: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-wrap: anywhere;
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
img, svg { max-width: 100%; }
.top { display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto; padding: 14px 16px 2px; }
.seori { width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover; object-position: top; background: #fffdf9; border: 2px solid #e8dccb; }
.brand { min-width: 0; }
.brand h1 { font-size: 24px; margin: 0; letter-spacing: -0.5px; color: var(--sable-dark); }
.brand .sub { margin: 0; color: var(--muted); font-size: 15px; }
.wrap { max-width: 520px; margin: 0 auto; padding: 8px 16px 32px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 12px 0; box-shadow: 0 2px 0 var(--line); min-width: 0; }
.card.center { text-align: center; }
h2:focus { outline: none; }
h2 { font-size: 20px; margin: 0 0 12px; color: var(--sable-dark); }
.hint { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
label { display: block; font-weight: 600; margin: 0 0 14px; min-width: 0; }
label small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 4px; }

/* form controls: never wider than their box, 16px+ text so iOS doesn't zoom */
input, select, textarea {
  display: block; width: 100%; max-width: 100%; min-width: 0; margin-top: 6px; min-height: 52px; padding: 10px 14px;
  font: inherit; font-size: 17px; color: var(--ink); background: var(--field); border: 2px solid var(--line); border-radius: 14px;
}
textarea { resize: vertical; line-height: 1.5; }
::placeholder { color: #776a60; opacity: 1; }
input[type="date"], input[type="time"], select {
  -webkit-appearance: none; appearance: none; height: 52px; line-height: normal; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%236e5c4e' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sable); box-shadow: 0 0 0 3px var(--sable-soft); }
input[readonly] { background: var(--sable-soft); }

/* date: Korean text underneath, the real (invisible) native date input on top catches the tap */
.datefield { position: relative; display: block; margin-top: 6px; overflow: hidden; border-radius: 14px; } /* clips iOS's wide native date control */
.datefield .shown {
  display: flex; align-items: center; height: 52px; padding: 0 40px 0 14px; font-weight: 600; font-size: 17px;
  background: var(--field); border: 2px solid var(--line); border-radius: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='2' y='3.5' width='14' height='12.5' rx='2.5' fill='none' stroke='%236e5c4e' stroke-width='1.8'/%3E%3Cpath d='M2 7.5h14M6 1.5v4M12 1.5v4' stroke='%236e5c4e' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.datefield input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.datefield:focus-within .shown { border-color: var(--sable); background-color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%;
  min-height: 52px; padding: 0 20px; font: inherit; font-weight: 700; color: var(--ink); white-space: nowrap;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--sable); border-color: var(--sable); color: #fff; }
.btn.primary:active { background: var(--sable-dark); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #ecc8c2; background: #fff; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 16px; }
.btn.icon { min-width: 52px; padding: 0; font-size: 28px; line-height: 1; }
.btn.block { width: 100%; margin-top: 10px; }
form .btn.primary { width: 100%; margin-top: 4px; }
.btn[disabled] { opacity: .55; }

.userbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 16px; }
.userbar .me { flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubtns { display: flex; gap: 6px; margin-left: auto; }
.ubtns .btn.small { padding: 0 12px; }

.calcard { padding-left: 10px; padding-right: 10px; }
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.monthnav h2 { margin: 0; font-size: 21px; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.dow { font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.sun { color: #b24141; } .sat { color: #2d65a3; }
.day {
  position: relative; min-width: 0; min-height: 50px; border-radius: 12px; border: 2px solid transparent; background: var(--field);
  font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); padding: 4px 0 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.day.other { visibility: hidden; }
.day.today { border-color: var(--yellow); background: #fff6d6; }
.day.sel { border-color: var(--sable); background: var(--sable-soft); }
.day .dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 3px; }
.day .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sable); display: block; }
.day .dots i.care { background: var(--amber); }
.day .dots b { font-size: 11px; line-height: 7px; color: var(--sable); }
.day.c0 { color: #b24141; } .day.c6 { color: #2d65a3; }
.legend { display: flex; justify-content: center; gap: 16px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.k-walk { background: var(--sable); } .k-care { background: var(--amber); }

.dayhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dayhead h2 { margin: 0; min-width: 0; }
.walks { list-style: none; margin: 0; padding: 0; }
.walk { border: 2px solid var(--line); border-left: 8px solid var(--sable); border-radius: 14px; padding: 12px 14px; margin-top: 10px; min-width: 0; }
.walk.care { border-left-color: var(--amber); }
.walk.mine { background: #fdf9f3; }
.walk .kind { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--sable-soft); color: var(--sable-dark); }
.walk.care .kind { background: var(--amber-soft); color: var(--amber-ink); }
.walk .time { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin-top: 4px; }
.walk .who { margin-top: 2px; font-size: 17px; }
.walk .who b { font-weight: 700; }
.walk .mine-tag { color: var(--teal-ink); font-weight: 700; }
.walk .tel { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--sable-soft); color: var(--ink); font-weight: 700; text-decoration: none; }
.walk .note { color: var(--muted); margin-top: 6px; font-size: 15px; }
.walk .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ho-chip { display: flex; align-items: flex-start; gap: 8px; width: 100%; min-height: 44px; margin-top: 10px; padding: 10px 12px; text-align: left;
  border: 2px solid #ecd6a8; border-radius: 12px; background: var(--amber-soft); color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; }
.ho-chip b { color: var(--amber-ink); white-space: nowrap; }
.ho-chip span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prev-ho { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #fff6d6; border: 2px dashed var(--yellow); font-size: 16px; white-space: pre-wrap; }
.prev-ho b { display: block; color: var(--amber-ink); font-size: 14px; white-space: normal; }
.empty { text-align: center; color: var(--muted); padding: 14px 0 6px; }
.empty img { width: 120px; height: auto; display: block; margin: 0 auto 4px; }

.notice { border-color: #ecd6a8; background: #fffaf0; }
.notice .label, .handover .label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--amber-ink); margin-bottom: 4px; }
.notice h3, .handover h3 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.notice .body { margin: 0; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.notice .btn, .handover .btn { margin-top: 10px; }
.handover { border-color: var(--yellow); background: #fff9e4; }
.handover .text { font-size: 18px; font-weight: 700; white-space: pre-wrap; margin: 2px 0 6px; }
.handover .meta, .notices .meta { color: var(--muted); font-size: 14px; }
.notices { list-style: none; margin: 0; padding: 0; }
.notices li { padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.notices li:first-child { border-top: 0; }
.notices h3 { margin: 0; font-size: 18px; }
.notices .body { margin: 6px 0 0; white-space: pre-wrap; }
.notices .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pin { color: var(--amber-ink); font-weight: 800; }

.invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; align-items: end; }
.invite input { margin: 0; font-size: 16px; text-overflow: ellipsis; }
.invite small { grid-column: 1 / -1; color: var(--muted); }
.mini { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.mini li { padding: 4px 0; border-top: 1px dashed var(--line); }
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.members li:first-child { border-top: 0; }
.members .info { flex: 1 1 160px; min-width: 0; }
.members .info b { display: block; }
.members .info span { color: var(--muted); font-size: 15px; }
.members .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: 13px; background: var(--sable-soft); color: var(--sable-dark); border-radius: 8px; padding: 1px 8px; margin-left: 6px; font-weight: 700; vertical-align: 2px; }
.tag.admin { background: var(--amber-soft); color: var(--amber-ink); }

dialog { border: 0; border-radius: 22px; padding: 20px 16px; width: min(480px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px); overflow: auto; color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(47, 40, 36, .45); }
dialog form { min-width: 0; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row2 > * { min-width: 0; }
.row2 .btn { width: 100%; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.btnrow .btn { flex: 1 1 calc(50% - 4px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.chip.on { border-color: var(--sable); background: var(--sable-soft); }
.seg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 0 0 14px; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; min-height: 0; padding: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 48px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg .seg-walk input:checked + span { background: var(--sable); color: #fff; }
.seg .seg-care input:checked + span { background: var(--amber-soft); color: var(--amber-ink); box-shadow: inset 0 0 0 2px var(--amber); }
.seg input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: -3px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 24px; height: 24px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--sable); }
.ho-text { font-size: 18px; font-weight: 600; white-space: pre-wrap; background: var(--amber-soft); border-radius: 12px; padding: 12px 14px; margin: 10px 0 14px; }
.err { color: var(--danger); font-weight: 600; min-height: 1.2em; margin: 0 0 10px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 10; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.toast.bad { background: var(--danger); }
@media (max-width: 360px) {
  .brand h1 { font-size: 21px; }
  .brand .sub { font-size: 14px; }
  .seori { width: 60px; height: 60px; }
  .walk .time { font-size: 20px; }
}
