:root {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
  color: #3f3935;
  background: #efedea;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --paper: #fff;
  --canvas: #f7f6f4;
  --greige-50: #f2efeb;
  --greige-100: #e7e0d8;
  --greige-200: #d8ccc0;
  --greige-500: #8a796e;
  --brown: #51443c;
  --muted: #7d7671;
  --line: #e8e3de;
  --danger: #a24d50;
  --success: #627565;
  --shadow: 0 10px 30px rgba(68, 55, 47, .07);
}

* { box-sizing: border-box; }
html { background: #efedea; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { flex: 0 0 auto; }

.app-shell { min-height: 100vh; max-width: 760px; margin: 0 auto; background: var(--canvas); position: relative; box-shadow: 0 0 40px rgba(60, 48, 41, .08); }
.app-bar { height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); }
.brand-button { border: 0; background: transparent; min-height: 48px; padding: 0; display: flex; align-items: baseline; gap: 9px; cursor: pointer; }
.brand { font-family: Georgia, serif; font-size: 25px; letter-spacing: .06em; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.icon-text-button { min-height: 44px; border: 0; background: transparent; display: flex; gap: 6px; align-items: center; padding: 6px; cursor: pointer; color: var(--muted); }
.icon-text-button span { font-size: 12px; }

.page { padding: 24px 18px calc(96px + env(safe-area-inset-bottom)); }
.page-with-save { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); max-width: 760px; width: 100%; height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #938a84; font-size: 11px; min-height: 62px; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--brown); font-weight: 700; }

.login-page { min-height: 100vh; padding: calc(44px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom)); display: grid; place-items: center; background: radial-gradient(circle at top, #f9f7f4 0, #eee9e3 70%); }
.login-card { width: min(100%, 430px); background: rgba(255,255,255,.84); border: 1px solid rgba(218,207,196,.75); border-radius: 28px; box-shadow: 0 28px 70px rgba(72,56,45,.1); padding: 32px 24px; }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo span { display: block; font: 35px Georgia, serif; letter-spacing: .1em; }
.login-logo small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .25em; color: var(--muted); }
.login-title { text-align: center; }
.soft-icon { width: 52px; height: 52px; border-radius: 18px; margin: 0 auto 14px; background: var(--greige-100); display: grid; place-items: center; }
.login-title h1 { font-size: 21px; margin: 0 0 8px; }
.login-title p { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.demo-notice { display: flex; gap: 10px; align-items: center; padding: 13px; margin: 0 0 20px; background: #f5f1eb; border-radius: 14px; color: #6c5d53; }
.demo-notice div { display: flex; flex-direction: column; gap: 2px; }
.demo-notice strong { font-size: 13px; }.demo-notice span { font-size: 11px; color: var(--muted); }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; min-height: 52px; border: 1px solid #ddd6d0; background: #fff; border-radius: 13px; padding: 0 14px; font-size: 16px; }
.security-note { margin: 20px 0 0; text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted); }

.primary-button { border: 0; background: var(--brown); color: #fff; border-radius: 14px; min-height: 52px; padding: 12px 18px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; cursor: pointer; box-shadow: 0 7px 18px rgba(72, 58, 50, .16); }
.primary-button:disabled { opacity: .58; cursor: wait; }
.login-button { width: 100%; margin-top: 2px; }
.form-alert { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff0f0; color: var(--danger); font-size: 13px; }
.splash { min-height: 100vh; display: grid; place-content: center; font: 35px Georgia, serif; text-align: center; background: var(--canvas); }.splash span { font: 12px sans-serif; letter-spacing: .2em; }

.welcome { padding: 6px 2px 12px; position: relative; }
.welcome p { margin: 0 0 7px; color: var(--muted); font-size: 13px; }
.today-date { display: flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .02em; }
.welcome h1 { margin: 0; font-family: Georgia, "Yu Mincho", serif; font-size: 24px; font-weight: 500; letter-spacing: .02em; }
.welcome span { display: inline-block; margin-top: 11px; padding: 5px 9px; border-radius: 999px; background: #ede7e0; color: #78685e; font-size: 10px; font-weight: 700; }
.home-actions { display: grid; gap: 11px; margin: 18px 0 30px; }
.action-card { width: 100%; min-height: 78px; border: 1px solid var(--line); background: var(--paper); border-radius: 18px; display: flex; align-items: center; text-align: left; padding: 13px; gap: 14px; box-shadow: 0 6px 20px rgba(70,56,47,.045); cursor: pointer; }
.action-card > div { width: 48px; height: 48px; border-radius: 15px; background: var(--greige-50); display: grid; place-items: center; color: #726158; }
.action-card > span { display: grid; gap: 4px; }.action-card strong { font-size: 16px; }.action-card small { color: var(--muted); font-size: 12px; }
.action-search { min-height: 94px; background: linear-gradient(135deg, #71645c, #51443c); color: white; border: 0; }
.action-search > div { background: rgba(255,255,255,.14); color: white; }.action-search small { color: rgba(255,255,255,.72); }
.section-block { margin-top: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 12px; }
.section-title > div { display: flex; gap: 7px; align-items: center; }.section-title h2 { font-size: 16px; margin: 0; }.section-title a { min-height: 44px; font-size: 12px; color: var(--greige-500); padding: 10px 0; display: flex; align-items: center; }

.page-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; min-height: 46px; }
.page-heading h1 { font-size: 23px; margin: 2px 0 0; letter-spacing: .01em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; }
.back-button { width: 44px; height: 44px; margin-left: -10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.search-box { min-height: 54px; border: 1px solid #ddd7d1; border-radius: 16px; background: white; padding: 0 12px; display: flex; gap: 9px; align-items: center; box-shadow: 0 5px 20px rgba(60,50,44,.04); }
.search-box input { flex: 1; border: 0; outline: 0; min-width: 0; font-size: 16px; background: transparent; }
.search-box button { border: 0; background: transparent; color: var(--greige-500); font-size: 12px; min-height: 44px; }.search-box button.hidden { visibility: hidden; }
.outline-action { min-height: 50px; margin: 12px 0 0; border: 1px solid var(--greige-200); border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; background: #fff; }
.result-count { color: var(--muted); font-size: 12px; margin: 18px 2px 9px; }
.card-list { display: grid; gap: 10px; }
.customer-card { min-height: 122px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 18px; display: flex; gap: 12px; align-items: center; box-shadow: 0 5px 18px rgba(60,50,44,.04); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--greige-100); display: grid; place-items: center; font: 19px Georgia, serif; color: #67584f; }
.card-main { min-width: 0; flex: 1; }.card-main h2 { margin: 1px 0 8px; font-size: 17px; }.customer-number { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.visit-line { margin: 0; color: #6f665f; display: flex; align-items: center; gap: 5px; font-size: 11px; }
.visit-line span { color: var(--muted); }.visit-line strong { font-size: 12px; color: #4e443e; }
.menu-line { margin: 6px 0 0; display: flex; align-items: center; gap: 7px; min-width: 0; }
.menu-line span { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; background: #eee8e2; color: #77685e; font-size: 9px; font-weight: 700; }
.menu-line strong { min-width: 0; color: #574a42; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-action { display: flex; align-items: center; color: var(--greige-500); }.card-action span { font-size: 11px; }
.empty-state { min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); text-align: center; }.empty-state p { margin: 0; }

.summary-card { background: linear-gradient(145deg, #fff, #f2ede8); border: 1px solid #e3dcd5; border-radius: 22px; padding: 17px; box-shadow: var(--shadow); }
.summary-primary { display: grid; grid-template-columns: 1fr 1.12fr; gap: 9px; }
.summary-primary div { min-width: 0; padding: 13px 12px; border: 1px solid #e8e1da; border-radius: 14px; background: rgba(255,255,255,.8); }
.summary-card span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; font-weight: 700; letter-spacing: .02em; }
.summary-primary strong { display: block; font-size: 17px; line-height: 1.45; color: #403832; }
.priority-note { margin-top: 10px; padding: 15px; border-radius: 16px; background: linear-gradient(135deg, #675a51, #554840); color: #fff; display: flex; align-items: flex-start; gap: 11px; box-shadow: 0 8px 20px rgba(75,60,51,.15); }
.priority-note svg { width: 21px; height: 21px; margin-top: 1px; }.priority-note div { min-width: 0; }.priority-note span { color: rgba(255,255,255,.7); font-size: 11px; }.priority-note strong { display: block; font-size: 14px; line-height: 1.7; letter-spacing: .01em; }
.next-visit { margin-top: 9px; padding: 11px 13px; border-radius: 14px; border: 1px solid #ded5cc; background: #fff; display: flex; align-items: center; gap: 10px; }
.next-visit svg { color: #74645a; }.next-visit span { margin-bottom: 2px; }.next-visit strong { display: block; font-size: 16px; color: #493f39; }
.future-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 11px 1px 13px; }
.future-summary div { min-width: 0; }.future-summary p { margin: 0; color: #968b84; font-size: 11px; }.future-summary span { margin-bottom: 3px; }
.summary-card .primary-button { width: 100%; min-height: 51px; }
.tabs { margin: 20px -18px 16px; padding: 0 12px; overflow-x: auto; display: flex; border-bottom: 1px solid var(--line); scrollbar-width: none; }.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 67px; min-height: 58px; padding: 8px 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.tabs button svg { width: 19px; }.tabs button.active { border-color: var(--brown); color: var(--brown); font-weight: 700; }.tabs button:disabled { opacity: .35; }
.detail-sections, .history-list { display: grid; gap: 13px; }
.detail-card, .treatment-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
.detail-card h2 { margin: 0 0 8px; font-size: 15px; }.detail-card dl, .treatment-card dl { margin: 0; }
.info-row { padding: 11px 0; border-top: 1px solid #f0ece8; display: grid; grid-template-columns: minmax(100px, 35%) 1fr; gap: 12px; }.info-row dt { color: var(--muted); font-size: 12px; }.info-row dd { margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.treatment-heading { display: flex; justify-content: space-between; gap: 10px; }.treatment-heading time { color: var(--muted); font-size: 11px; }.treatment-heading h2 { margin: 3px 0; font-size: 16px; }.treatment-heading a { min-height: 44px; display: flex; align-items: center; gap: 5px; color: #74645b; font-size: 12px; }.treatment-heading a svg { width: 17px; }.price { margin: 7px 0 12px; font-size: 15px; font-weight: 700; }.price span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 8px; }

.form-section { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 18px 16px 20px; margin-bottom: 14px; }
.form-section > h2 { margin: 0 0 19px; font-size: 16px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.form-jump-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: -5px 0 14px; }
.form-jump-nav a { min-height: 50px; padding: 8px 11px; border: 1px solid #ddd5cd; border-radius: 14px; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 700; }
.form-jump-nav a span { width: 24px; height: 24px; border-radius: 50%; background: #e9e1d9; display: grid; place-items: center; color: #6e5e54; font-size: 9px; }
.basic-form-section, .hair-form-section { scroll-margin-top: 78px; overflow: hidden; }
.basic-form-section { border-top: 3px solid #b7a99e; }.hair-form-section { border-top: 3px solid #8c7d72; }
.form-section-heading { margin: -3px 0 20px; padding-bottom: 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.form-section-heading > span { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; background: #685a51; color: white; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.form-section-heading h2 { margin: 0; font-size: 16px; }.form-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.field { display: grid; gap: 8px; margin: 0 0 20px; }.field:last-child { margin-bottom: 0; }.field-label { font-size: 13px; font-weight: 700; }.field-label em { font-style: normal; font-size: 9px; color: #8a514f; background: #f9e9e7; padding: 3px 5px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.field input, .field textarea { width: 100%; border: 1px solid #dcd6d1; border-radius: 12px; background: #fdfdfc; padding: 12px 13px; outline: none; font-size: 16px; line-height: 1.5; color: var(--brown); }
.field input { min-height: 50px; }.field textarea { resize: vertical; min-height: 88px; }.field input:focus, .field textarea:focus { border-color: #98877c; box-shadow: 0 0 0 3px rgba(152,135,124,.12); }
.field-hint { font-size: 11px; color: var(--muted); }.field-error { color: var(--danger); font-size: 12px; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }.choice-chips button { min-height: 44px; border: 1px solid #dcd5cf; background: #fbfaf9; border-radius: 999px; padding: 9px 15px; font-size: 13px; cursor: pointer; }.choice-chips button.selected { background: #675950; color: #fff; border-color: #675950; font-weight: 700; }
.price-input { position: relative; }.price-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; }.price-input input { padding-left: 34px; }
.restore-notice { margin: -6px 0 14px; border-radius: 12px; padding: 11px 13px; background: #eaf0ea; color: #536458; font-size: 12px; }
.save-bar { position: fixed; z-index: 35; bottom: 0; left: 50%; transform: translateX(-50%); width: min(760px, 100%); min-height: calc(86px + env(safe-area-inset-bottom)); padding: 9px 15px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(18px); display: grid; grid-template-columns: minmax(115px, .8fr) minmax(170px, 1.2fr); gap: 10px; align-items: center; }
.save-button { width: 100%; min-height: 56px; }.draft-status { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 10px; color: var(--muted); text-align: center; }.draft-status.saved { color: var(--success); }.draft-status.error { color: var(--danger); }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.loading-card { min-height: 240px; display: grid; place-items: center; color: var(--muted); }

@media (min-width: 640px) {
  .page { padding-left: 30px; padding-right: 30px; }
  .tabs { margin-left: -30px; margin-right: -30px; padding-left: 24px; padding-right: 24px; }
  .home-actions { grid-template-columns: 1fr 1fr; }.action-search { grid-row: span 2; min-height: 167px; flex-direction: column; justify-content: center; text-align: center; }
  .detail-sections { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
