:root {
  color-scheme: light;
  --ink: #211c1d;
  --ink-soft: #51494a;
  --muted: #817779;
  --line: #e8e2de;
  --paper: #f7f5f2;
  --white: #fff;
  --accent: #a47c5b;
  --accent-soft: #f2ebe4;
  --success: #4c745e;
  --danger: #aa3f3f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #caa986; outline-offset: 2px; }
.site-header { min-height: 70px; padding: 0 max(22px, calc((100% - 1120px) / 2)); background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; letter-spacing: 1.4px; }
.brand-mark { font-size: 23px; line-height: 1; }
.brand-name { font-size: 15px; font-weight: 800; }
.brand-divider { height: 22px; width: 1px; background: #5d5556; margin: 0 2px; }
.brand-section { color: #d5c4b5; font-size: 11px; font-weight: 600; letter-spacing: 2px; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.language-label { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; color: #e2dbd6 !important; font-size: 11px !important; font-weight: 500 !important; }
.language-picker { height: 31px !important; margin: 0 !important; padding: 0 7px !important; border: 1px solid #5d5556 !important; border-radius: 7px !important; background: #302a2b !important; color: white !important; font-size: 11px !important; }
.sync-indicator { display: inline-flex; align-items: center; gap: 8px; color: #e2dbd6; font-size: 12px; }
.sync-indicator i { width: 8px; height: 8px; border-radius: 50%; background: #95bd9b; box-shadow: 0 0 0 3px #95bd9b25; }
.sync-indicator.offline i { background: #dda26e; box-shadow: 0 0 0 3px #dda26e25; }
.logout { padding: 8px 0 8px 10px; background: none; border: 0; color: #e8e3df; font-size: 13px; }
.logout:hover { color: white; }
.logout span { margin-left: 4px; color: #b9a490; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 42px 24px 32px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 25px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: 2px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 38px); font-weight: 500; letter-spacing: -.6px; line-height: 1.12; }
.intro-copy { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 14px; }
.intro-count { min-width: 94px; padding: 10px 14px 11px; border-left: 1px solid #d9d0c8; text-align: right; }
.intro-count strong { display: block; font-family: Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1.1; }
.intro-count span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.card { background: var(--white); border: 1px solid #eee9e5; border-radius: 18px; box-shadow: 0 8px 28px #2b211b08; }
.directory { padding: 24px 26px 16px; }
.directory-toolbar { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; display: flex; align-items: center; flex: 1; margin: 0; }
.search-wrap input { width: 100%; min-width: 0; height: 48px; padding: 0 56px 0 43px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 14px; transition: border-color .16s, box-shadow .16s; }
.search-wrap input:focus { border-color: #b39478; outline: 0; box-shadow: 0 0 0 3px #b394781a; }
.search-wrap input::placeholder { color: #9a9190; }
.search-icon { position: absolute; left: 15px; z-index: 1; color: #817779; font-size: 24px; line-height: 1; transform: rotate(-20deg); }
.search-wrap kbd { position: absolute; right: 12px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: #9a9190; font: 11px ui-monospace, monospace; }
.primary, .secondary, .empty-action { min-height: 44px; padding: 11px 17px; border-radius: 10px; font-weight: 650; font-size: 13px; transition: background .15s, transform .15s, border-color .15s; }
.primary { border: 1px solid var(--ink); background: var(--ink); color: white; }
.primary:hover { background: #403638; transform: translateY(-1px); }
.primary span { margin-right: 5px; font-size: 17px; vertical-align: -1px; }
.secondary, .empty-action { border: 1px solid #ded6d0; background: white; color: var(--ink-soft); }
.secondary:hover, .empty-action:hover { background: #f9f6f3; border-color: #bca38d; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 27px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.list-heading h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .1px; }
.result-count { color: #988f8b; font-size: 12px; }
.client-list { min-height: 85px; }
.client-row { width: 100%; min-height: 80px; display: flex; align-items: center; gap: 14px; padding: 13px 5px; border: 0; border-bottom: 1px solid #f0ece8; border-radius: 0; background: white; color: var(--ink); text-align: left; transition: background .14s; }
.client-row:last-child { border-bottom: 0; }
.client-row:hover { background: #fcfaf8; }
.avatar { flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover; border: 1px solid #eee7e1; border-radius: 50%; background: #eee9e4; }
.client-info { min-width: 170px; display: flex; flex-direction: column; gap: 3px; }
.client-name { font-size: 14px; font-weight: 680; }
.client-phone { color: var(--muted); font-size: 12px; }
.last-color { min-width: 0; max-width: 47%; margin-left: auto; display: flex; flex-direction: column; gap: 3px; padding-left: 12px; text-align: right; }
.last-color-label { color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: 1px; }
.last-color-text { overflow: hidden; color: #5c5150; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.last-color-empty { color: #a29a96; font-size: 12px; }
.row-arrow { width: 20px; flex: 0 0 20px; color: #b0a6a0; font-size: 24px; text-align: right; }
.empty-state { min-height: 195px; padding: 29px 16px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 44px; height: 44px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.empty-state strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.empty-state p { max-width: 380px; margin: 5px 0 13px; color: var(--muted); font-size: 13px; }
.empty-action { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.sync-footnote { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid #f0ece8; color: #948b87; font-size: 11px; }
.sync-footnote span:first-child { color: var(--accent); font-size: 15px; }
.editor { margin-top: 24px; padding: 25px 28px 27px; scroll-margin-top: 18px; }
.editor-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.editor-title h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; color: #756b68; font-size: 24px; line-height: 1; }
.icon-button:hover { background: var(--paper); }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 19px 0 5px; }
.photo-frame { width: 76px; height: 76px; flex: 0 0 76px; padding: 3px; border: 1px solid #e8dfd7; border-radius: 50%; background: #faf8f6; }
.photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #eee9e4; }
.photo-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.photo-copy strong { font-size: 13px; }
.photo-copy > span { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.upload { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #e2d9d1; border-radius: 7px; background: #fff; color: #51494a; cursor: pointer; font-size: 11px; font-weight: 600; }
.upload:hover { border-color: #bca38d; background: #fcfaf8; }
.upload span { color: var(--accent); font-size: 15px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.section-heading { display: flex; align-items: flex-start; gap: 11px; margin: 23px 0 13px; }
.step { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 750; }
.section-heading h3 { margin: 0 0 2px; font-size: 14px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }
label:not(.search-wrap):not(.upload) { display: block; margin: 12px 0 5px; color: #62595a; font-size: 12px; font-weight: 600; }
label input, label textarea, label select { display: block; width: 100%; margin-top: 5px; border: 1px solid #ded8d3; border-radius: 9px; background: white; color: var(--ink); }
label input, label select { height: 43px; padding: 0 12px; }
label textarea { min-height: 83px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
label input::placeholder, label textarea::placeholder { color: #aaa19d; font-weight: 400; }
label input:focus, label textarea:focus, label select:focus { border-color: #b39478; outline: 0; box-shadow: 0 0 0 3px #b394781a; }
.optional { margin-left: 5px; color: #a39a96; font-size: 10px; font-weight: 400; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.save-hint { margin-left: auto; color: #948b87; font-size: 11px; }
.treatments { margin-top: 25px; padding-top: 3px; border-top: 1px solid var(--line); }
.latest-panel { padding: 15px 17px; border: 1px solid #e9dfd5; border-radius: 12px; background: #faf7f3; }
.latest-label { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.latest-label span { padding-right: 5px; font-size: 13px; }
.latest-date { display: block; margin-top: 6px; color: #86766b; font-size: 11px; }
.latest-formula, .history-formula { margin: 4px 0 0; color: #443c3a; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.latest-empty { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.treatment-actions { margin-top: 11px; }
.history-title { margin: 23px 0 8px; font-size: 12px; letter-spacing: .2px; }
.history-list { border-top: 1px solid var(--line); }
.history-item { display: flex; gap: 11px; padding: 13px 2px; border-bottom: 1px solid #f0ece8; }
.history-marker { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; border-radius: 50%; background: #b58d6b; box-shadow: 0 0 0 4px #f2ebe4; }
.history-date { color: var(--accent); font-size: 11px; font-weight: 700; }
.history-body { min-width: 0; }
.message { min-height: 21px; margin: 14px 3px 0; color: var(--success); font-size: 12px; }
.message.error { color: var(--danger); }
.page-footer { padding-top: 18px; color: #a49b97; font-size: 10px; text-align: center; }
.page-footer span { padding: 0 3px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

/* Sign-in screen shares the same salon palette. */
.login { width: min(460px, calc(100% - 28px)); margin: 8vh auto; }
.login .card { padding: 30px; }
.login-language { display: flex; justify-content: flex-end; }
.login-language label { display: flex; align-items: center; gap: 8px; margin: 0 !important; }
.login-language .language-picker { background: white !important; border-color: var(--line) !important; color: var(--ink) !important; }
.login h1 { margin-bottom: 7px; font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: 2px; }
.login h1 + p { color: var(--muted); font-size: 13px; }
.login label { margin-top: 21px; }
.login button { width: 100%; margin-top: 8px; }
.error { color: var(--danger); }
.success { color: var(--success); }

@media (max-width: 720px) {
  .site-header { min-height: 62px; padding: 0 17px; }
  .wrap { padding: 28px 16px 24px; }
  .intro { align-items: flex-start; }
  .intro-count { min-width: 72px; padding-right: 0; }
  .directory { padding: 18px 17px 13px; }
  .editor { padding: 20px 18px 22px; }
  .client-row { gap: 10px; }
  .client-info { min-width: 125px; }
  .last-color { max-width: 41%; }
}
@media (max-width: 520px) {
  body { font-size: 14px; }
  .brand { gap: 7px; letter-spacing: 1px; }
  .brand-mark { font-size: 19px; }
  .brand-name { font-size: 12px; }
  .brand-divider { height: 18px; }
  .brand-section { font-size: 9px; letter-spacing: 1.2px; }
  .header-actions { gap: 11px; }
  .language-label { gap: 4px; font-size: 9px !important; }
  .language-picker { max-width: 76px; padding: 0 3px !important; font-size: 10px !important; }
  .sync-indicator { gap: 6px; font-size: 10px; }
  .logout { font-size: 12px; }
  .wrap { padding: 24px 12px 20px; }
  .intro { gap: 9px; margin-bottom: 18px; }
  h1 { font-size: 27px; }
  .intro-copy { max-width: 280px; font-size: 12px; }
  .intro-count strong { font-size: 21px; }
  .intro-count span { font-size: 9px; }
  .directory { padding: 14px 13px 11px; border-radius: 14px; }
  .directory-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .search-wrap input { height: 45px; font-size: 12px; }
  .directory-toolbar .primary { width: 100%; }
  .list-heading { margin-top: 21px; }
  .client-row { min-height: 74px; gap: 8px; padding: 10px 1px; }
  .avatar { width: 40px; height: 40px; flex-basis: 40px; }
  .client-info { min-width: 0; flex: 1 1 44%; }
  .client-name { font-size: 12px; }
  .client-phone { font-size: 10px; }
  .last-color { max-width: 38%; padding-left: 0; }
  .last-color-label { font-size: 8px; letter-spacing: .5px; }
  .last-color-text, .last-color-empty { font-size: 10px; }
  .row-arrow { width: 12px; flex-basis: 12px; font-size: 18px; }
  .editor { margin-top: 15px; padding: 17px 14px 18px; border-radius: 14px; }
  .editor-title h2 { font-size: 23px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .save-hint { width: 100%; margin-left: 0; }
  .editor-actions .primary, .editor-actions .secondary { flex: 1; }
  .profile-head { gap: 12px; }
  .photo-frame { width: 66px; height: 66px; flex-basis: 66px; }
  .photo-copy > span { font-size: 10px; }
  .login { margin-top: 6vh; }
  .login .card { padding: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
