@layer reset, base, shell, components, pages, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, dl, dd { margin: 0; }
  img { display: block; max-width: 100%; }
  button, input, textarea { font: inherit; }
  a { color: inherit; }
}

@layer base {
  :root {
    --deep: #11362e;
    --pine: #19493e;
    --ink: #183b33;
    --sage: #74887d;
    --gold: #bb965d;
    --sand: #e5d2ac;
    --paper: #f3f0e9;
    --cream: #e9e4da;
    --white: #fffefa;
    --line: rgba(24, 59, 51, .14);
    --danger: #9b463d;
    --serif: "Bodoni 72", "Iowan Old Style", Baskerville, Georgia, serif;
    --sans: "Avenir Next", Avenir, "Century Gothic", sans-serif;
    --shadow: 0 28px 70px rgba(20, 47, 39, .10);
  }
  body { min-height: 100vh; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
  h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: .98; letter-spacing: -.035em; }
  h1 { font-size: clamp(3.8rem, 8vw, 7.4rem); }
  h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
  h3 { font-size: 1.75rem; }
  p { color: var(--sage); }
  em { color: var(--sand); font-weight: 400; }
  :focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
  ::selection { background: var(--sand); color: var(--deep); }
}

@layer shell {
  .page-shell { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
  .narrow-page { width: min(980px, calc(100% - 48px)); padding-block: 48px 100px; }
  .admin-page { padding-block: 44px 100px; }
  .form-page { width: min(820px, calc(100% - 40px)); padding-block: 42px 100px; }
  .site-header { min-height: 86px; padding: 12px max(32px, calc((100vw - 1240px) / 2)); display: grid; grid-template-columns: 190px 1fr auto; align-items: center; gap: 30px; border-bottom: 1px solid var(--line); background: rgba(255,254,250,.97); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(16px); }
  .brand { display: flex; width: 190px; height: 58px; align-items: center; gap: 9px; overflow: hidden; text-decoration: none; }
  .brand img { width: 45px; height: 45px; flex: 0 0 auto; object-fit: contain; transform: scale(1.65); }
  .brand strong, .brand small { display: block; text-transform: uppercase; }
  .brand strong { font: 15px/1 var(--serif); letter-spacing: .06em; white-space: nowrap; }
  .brand small { margin-top: 5px; color: var(--gold); font-size: 6px; font-weight: 700; letter-spacing: .2em; }
  .site-header nav { display: flex; justify-content: center; gap: 30px; }
  .site-header nav a, .account a, .link-button { border: 0; background: none; color: var(--sage); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .13em; text-decoration: none; text-transform: uppercase; }
  .site-header nav a:hover, .account a:hover, .link-button:hover { color: var(--gold); }
  .account { display: flex; align-items: center; gap: 15px; }
  .account form { display: inline-flex; margin: 0; }
  .link-button { padding: 0; line-height: inherit; }
  .site-footer { min-height: 180px; padding: 40px max(32px, calc((100vw - 1240px) / 2)); display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: 40px; background: #0c2d27; color: white; }
  .site-footer img { width: 150px; height: 90px; object-fit: contain; }
  .site-footer p { font-size: 9px; letter-spacing: .08em; text-align: center; }
  .site-footer a { color: var(--sand); font-size: 11px; letter-spacing: .08em; text-decoration: none; }
}

@layer components {
  .eyebrow { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
  .eyebrow.light { color: var(--sand); }
  .panel { border: 1px solid rgba(24,59,51,.08); background: var(--white); box-shadow: var(--shadow); }
  .button { min-height: 48px; padding: 13px 22px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--deep); background: var(--deep); color: white; cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; transition: .22s ease; }
  .button:hover { border-color: var(--gold); background: var(--gold); transform: translateY(-2px); }
  .button.gold { border-color: var(--gold); background: var(--gold); }
  .button.outline { background: transparent; color: var(--deep); }
  .button.small { min-height: 39px; padding: 10px 16px; font-size: 8px; }
  .button.full { width: 100%; }
  .text-link { color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
  .text-link:hover { color: var(--gold); }
  .text-link.light { color: white; }
  .actions { margin-top: 32px; display: flex; align-items: center; gap: 28px; }
  .flash { width: min(480px, calc(100% - 40px)); padding: 15px 18px; position: fixed; top: 105px; right: 22px; z-index: 70; border-left: 3px solid var(--gold); background: var(--deep); color: white; box-shadow: var(--shadow); font-size: 12px; animation: slide-in .35s ease both; }
  .flash.error { border-color: #d37064; }
  @keyframes slide-in { from { opacity: 0; transform: translateX(18px); } }
  .section-head, .section-title, .page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
  .section-head h2, .section-title h2, .page-intro h1 { margin-top: 8px; }
  .section-title { margin: 70px 0 28px; }
  .page-intro { padding: 20px 0 45px; }
  .page-intro p { max-width: 590px; margin-top: 15px; }
  .total { padding-left: 30px; border-left: 1px solid var(--line); text-align: right; }
  .total span { display: block; color: var(--sage); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
  .total strong { font-family: var(--serif); font-size: 34px; font-weight: 400; }
  .empty { min-height: 220px; padding: 40px; display: grid; place-items: center; align-content: center; text-align: center; }
  .empty > span { margin-bottom: 10px; color: var(--gold); font: 30px var(--serif); }
  .empty h3 { margin-bottom: 9px; }
  .empty p { max-width: 460px; font-size: 12px; }
  .calendar-badge { padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 30px; color: var(--sage); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .calendar-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
  .calendar-badge.connected i { background: #4d9d70; box-shadow: 0 0 0 4px rgba(77,157,112,.12); }
  .calendar-badge.error i { background: var(--danger); }
  label { color: var(--ink); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
  input, textarea { width: 100%; min-height: 50px; margin-top: 7px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 0; background: #faf9f5; color: var(--ink); }
  textarea { min-height: 90px; resize: vertical; }
  input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(187,150,93,.1); outline: none; }
}

@layer pages {
  .public-hero { height: min(760px, calc(100vh - 86px)); min-height: 600px; position: relative; overflow: hidden; background: var(--deep); color: white; }
  .hero-photo { width: 100%; height: 100%; object-fit: cover; filter: saturate(.55); animation: scale-in 1.2s ease both; }
  .hero-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(6,37,31,.9), rgba(6,37,31,.35) 60%, rgba(6,37,31,.05)), linear-gradient(0deg, rgba(6,37,31,.45), transparent 60%); }
  .hero-logo { width: 160px; height: 100px; object-fit: contain; position: absolute; top: 38px; left: max(38px, calc((100vw - 1240px) / 2)); z-index: 2; }
  .public-hero-copy { width: min(740px, calc(100% - 60px)); position: absolute; left: max(38px, calc((100vw - 1240px) / 2)); bottom: 80px; z-index: 2; animation: rise .8s .15s ease both; }
  .public-hero-copy h1 { margin: 12px 0 24px; }
  .public-hero-copy > p { max-width: 520px; color: rgba(255,255,255,.68); font-size: 16px; }
  @keyframes scale-in { from { opacity: .55; transform: scale(1.04); } }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } }
  .editorial-intro { padding: 100px 0 130px; display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 60px; }
  .editorial-intro .eyebrow { grid-column: 1 / -1; }
  .editorial-intro h2 { font-size: clamp(3rem, 6vw, 5.7rem); }
  .editorial-intro p { max-width: 430px; padding-bottom: 10px; }
  .overlap { margin-top: -70px; padding-bottom: 110px; }

  .service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .service-card { background: var(--white); box-shadow: var(--shadow); animation: rise .6s var(--delay) ease both; }
  .service-image { height: 290px; position: relative; overflow: hidden; background: var(--cream); }
  .service-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.55); transition: .5s ease; }
  .service-card:hover .service-image img { transform: scale(1.035); filter: saturate(.8); }
  .service-image span, .product-image span { padding: 9px 12px; position: absolute; top: 0; right: 0; background: var(--deep); color: white; font-family: var(--serif); }
  .service-copy { padding: 26px; }
  .service-copy h3 { min-height: 54px; margin: 8px 0 12px; }
  .service-copy > p { min-height: 65px; font-size: 11px; }
  .service-meta { margin: 20px 0 15px; padding-top: 15px; display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); }
  .service-meta strong { font: 23px var(--serif); }
  .service-meta span { color: var(--sage); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
  .compact-grid { margin-bottom: 100px; }

  .catalog-page { background: linear-gradient(var(--deep) 0 530px, var(--paper) 530px); }
  .catalog-hero { min-height: 445px; padding-block: 90px 110px; color: white; }
  .catalog-hero h1 { margin: 13px 0 20px; }
  .catalog-hero p { max-width: 480px; color: rgba(255,255,255,.62); }
  .catalog-grid { padding-bottom: 100px; }

  .shop-page { padding-block: 76px 110px; }
  .shop-intro { margin-bottom: 55px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; }
  .shop-intro .eyebrow { grid-column: 1 / -1; }
  .shop-intro p { max-width: 400px; padding-bottom: 10px; }
  .product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .product-card { background: var(--white); box-shadow: var(--shadow); }
  .product-image { height: 370px; position: relative; overflow: hidden; }
  .product-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72); transition: .5s ease; }
  .product-card:hover .product-image img { transform: scale(1.03); }
  .product-copy { padding: 28px; }
  .product-copy h2 { margin: 9px 0 12px; font-size: 28px; }
  .product-copy > p { min-height: 60px; font-size: 11px; }
  .product-copy footer { margin-top: 20px; padding-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
  .product-copy footer > strong { font: 24px var(--serif); }

  .login-page { min-height: calc(100vh - 86px); display: grid; grid-template-columns: 1.15fr .85fr; background: var(--white); }
  .login-image { min-height: 700px; position: relative; overflow: hidden; background: linear-gradient(160deg, #0c2d27 0%, #153a32 40%, #1f4d42 100%); color: white; }
  .login-image::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 30%, rgba(201,163,77,.15), transparent 60%); }
  .login-image > div { position: absolute; left: 60px; top: 50%; transform: translateY(-50%); }
  .login-panel { padding: 70px clamp(35px, 6vw, 100px); display: grid; place-items: center; }
  .login-form { width: min(420px, 100%); }
  .login-form h2 { margin: 12px 0 18px; font-size: 4.5rem; }
  .login-form > p { margin-bottom: 32px; }
  .login-form form { display: grid; gap: 20px; }
  .demo-box { margin-top: 25px; padding: 15px 18px; display: grid; border-left: 2px solid var(--gold); background: var(--paper); font-size: 10px; }
  .demo-box strong { margin-bottom: 5px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
  .demo-box span { color: var(--sage); }

  .dashboard-page { padding-block: 34px 100px; }
  .welcome-card { min-height: 380px; padding: 55px 60px; display: flex; align-items: end; justify-content: space-between; position: relative; overflow: hidden; background: linear-gradient(90deg, rgba(10,44,36,.95), rgba(10,44,36,.65)), url('/images/hotel-hero.jpg') center/cover; color: white; }
  .welcome-card h1 { margin: 13px 0 18px; font-size: clamp(4rem, 7vw, 6.5rem); }
  .welcome-card p { color: rgba(255,255,255,.6); }
  .room-stamp { width: 104px; height: 104px; display: grid; place-items: center; align-content: center; background: var(--gold); }
  .room-stamp span { font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }
  .room-stamp strong { font: 34px var(--serif); }
  .dashboard-grid { margin-top: 26px; display: grid; grid-template-columns: 1.25fr .75fr; gap: 26px; }
  .schedule-panel, .meal-card { padding: 36px 40px; }
  .event-row { min-height: 116px; display: grid; grid-template-columns: 44px 16px 1fr auto; align-items: center; gap: 13px; border-top: 1px solid var(--line); }
  .event-row:first-of-type { margin-top: 24px; }
  .event-row time { line-height: 1; text-align: center; }
  .event-row time strong, .event-row time span { display: block; }
  .event-row time strong { font: 29px var(--serif); }
  .event-row time span { color: var(--gold); font-size: 9px; }
  .event-dot { width: 7px; height: 7px; border: 2px solid var(--gold); border-radius: 50%; box-shadow: 0 0 0 5px var(--paper); }
  .event-row h3 { margin: 4px 0; font-size: 21px; }
  .event-row p { font-size: 10px; }
  .reschedule { position: relative; }
  .reschedule summary { padding: 7px 10px; border: 1px solid var(--line); color: var(--sage); cursor: pointer; font-size: 8px; font-weight: 700; letter-spacing: .08em; list-style: none; text-transform: uppercase; }
  .reschedule div { width: 125px; padding: 6px; position: absolute; top: 35px; right: 0; z-index: 4; display: grid; gap: 4px; background: var(--deep); box-shadow: var(--shadow); }
  .reschedule a { padding: 7px 9px; color: white; font-size: 9px; text-decoration: none; }
  .reschedule a:hover { background: var(--gold); }
  .meal-card h2 { margin: 8px 0 20px; }
  .meal-card dl > div { padding: 16px 0; border-top: 1px solid var(--line); }
  .meal-card dt { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
  .meal-card dd { margin-top: 4px; font-family: var(--serif); font-size: 17px; }
  .diet-note { margin-top: 18px; padding: 12px; border-left: 2px solid var(--gold); background: var(--paper); font-size: 9px; }
  .day-group { margin-bottom: 22px; padding: 36px 42px; }
  .day-group > h2 { margin-bottom: 5px; font-size: 28px; text-transform: capitalize; }

  .charge-list { padding: 10px 36px; }
  .charge-row { min-height: 88px; display: grid; grid-template-columns: 42px 1fr auto 100px; align-items: center; gap: 17px; border-bottom: 1px solid var(--line); }
  .charge-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--cream); color: var(--gold); font: 18px var(--serif); }
  .charge-row strong, .charge-row small { display: block; }
  .charge-row small { color: var(--sage); font-size: 9px; }
  .charge-row > b { font: 20px var(--serif); text-align: right; }
  .status { padding: 5px 9px; border: 1px solid rgba(59,119,89,.2); border-radius: 30px; background: rgba(59,119,89,.06); color: #3f745c; font-size: 8px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }

  .metric { display: flex; align-items: baseline; gap: 9px; }
  .metric strong { font: 48px var(--serif); }
  .metric span { color: var(--sage); font-size: 9px; }
  .patient-table { padding: 10px 30px; }
  .table-head, .table-row { min-height: 76px; display: grid; grid-template-columns: 1.5fr .45fr 1fr .7fr; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
  .table-head { min-height: 52px; color: var(--sage); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
  .table-row { color: var(--ink); font-size: 11px; text-decoration: none; }
  .table-row:hover { background: rgba(233,228,218,.38); }
  .patient-name { display: flex; align-items: center; gap: 12px; }
  .patient-name > b, .monogram { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--deep); color: white; font: 17px var(--serif); }
  .patient-name strong, .patient-name small { display: block; }
  .patient-name small { color: var(--sage); font-size: 9px; }

  .doctor-page { padding-block: 42px 100px; }
  .patient-header { margin: 30px 0; display: flex; align-items: center; gap: 20px; }
  .patient-header .monogram { width: 86px; height: 86px; flex: 0 0 auto; font-size: 30px; }
  .patient-header h1 { font-size: clamp(3.5rem, 7vw, 5.5rem); }
  .doctor-grid { margin-bottom: 24px; display: grid; grid-template-columns: 1.3fr .7fr; align-items: start; gap: 24px; }
  .doctor-calendar { padding: 34px; }
  .calendar-warning { margin: 22px 0; padding: 15px 17px; border-left: 3px solid var(--gold); background: #f7f0df; }
  .calendar-warning strong { font-size: 12px; }
  .calendar-warning p { margin-top: 4px; font-size: 10px; }
  .calendar-warning code { font-family: ui-monospace, monospace; }
  .doctor-events { margin-top: 22px; }
  .doctor-events > div { padding: 14px 0; display: grid; grid-template-columns: 145px 1fr auto; align-items: center; gap: 15px; border-top: 1px solid var(--line); }
  .doctor-events time { color: var(--gold); font-size: 9px; text-transform: capitalize; }
  .doctor-events strong { font-family: var(--serif); font-size: 17px; font-weight: 400; }
  .doctor-events small { color: var(--sage); font-size: 8px; }
  .appointment-form { margin-top: 26px; padding-top: 25px; display: grid; gap: 17px; border-top: 1px solid var(--line); }
  .appointment-form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .appointment-form h3 { margin-bottom: 4px; }
  .button:disabled { border-color: #aeb6b1; background: #aeb6b1; cursor: not-allowed; transform: none; }
  .doctor-side { display: grid; gap: 24px; }
  .comments-section { padding: 30px; display: grid; gap: 14px; border-top: 3px solid var(--deep); }
  .comments-section h2 { margin-top: -7px; }
  .comments-subtitle { margin-top: -10px; font-size: 10px; color: var(--sage); }
  .comment-form { display: grid; gap: 10px; }
  .comment-form textarea { width: 100%; resize: vertical; }
  .comment-list { display: grid; gap: 12px; margin-top: 6px; }
  .comment-item { padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--cream); border-radius: 0 6px 6px 0; }
  .comment-item header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
  .comment-item header strong { font-size: 10px; color: var(--deep); }
  .comment-item header time { font-size: 8px; color: var(--sage); }
  .comment-item p { font-size: 11px; line-height: 1.5; color: var(--sage); }
  .comment-empty { font-size: 10px; color: var(--sage); padding: 8px 0; }
  .safety-strip { margin-bottom: 22px; padding: 22px 26px; border-top: 3px solid var(--gold); background: var(--white); box-shadow: var(--shadow); }
  .safety-strip > strong { font: 22px var(--serif); }
  .allergen-panel { padding: 24px; display: grid; gap: 14px; border-top: 3px solid var(--danger); }
  .allergen-panel h2 { margin-top: -7px; }
  .allergen-form { display: grid; gap: 12px; }
  .allergen-form input { width: 100%; }
  .allergen-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .allergen-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--sage); font-size: 9px; background: var(--white); cursor: pointer; transition: .15s; font-family: var(--sans); }
  .allergen-chip:hover { border-color: var(--gold); }
  .allergen-chip.active { border-color: var(--danger); background: #f9ece9; color: var(--danger); }
  .menu-form { padding: 38px; display: grid; gap: 20px; scroll-margin-top: 100px; }
  .menu-overview { margin-top: 8px; width: 100%; }
  .menu-overview h3 { font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--sage); margin-bottom: 12px; }
  .menu-table { display: table; width: 100%; border-collapse: collapse; font-size: 11px; }
  .menu-table thead { display: table-header-group; }
  .menu-table tbody { display: table-row-group; }
  .menu-table tr { display: table-row; }
  .menu-table th { display: table-cell; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line); font-size: 8px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--sage); white-space: nowrap; }
  .menu-table td { display: table-cell; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.4; color: var(--sage); height: 48px; }
  .menu-table tr.selected td { background: rgba(21,58,50,.04); }
  .menu-table tr.today td { border-top: 2px solid var(--gold); }
  .menu-table tr.empty td { opacity: .45; }
  .menu-table-day { white-space: nowrap; vertical-align: top; padding-top: 14px; }
  .menu-table-day a { text-decoration: none; color: var(--deep); }
  .menu-table-day strong { font-size: 11px; display: block; }
  .menu-table-day span { font-size: 9px; color: var(--sage); }
  .menu-table-notes { font-size: 10px; }
  .menu-table .missing { color: #c4b8a5; }
  .form-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
  .form-head h2 { margin-top: 7px; }
  .menu-week-nav { display: flex; gap: 8px; }
  .menu-day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
  .menu-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--sage); background: var(--white); transition: .2s; position: relative; }
  .menu-day:hover { border-color: var(--gold); }
  .menu-day.selected { border-color: var(--deep); background: var(--deep); color: white; }
  .menu-day.today::after { content: ""; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
  .menu-day-name { font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .menu-day-num { font-size: 20px; font-weight: 700; font-family: var(--serif); }
  .menu-day-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
  .menu-day.selected .menu-day-dot { background: white; }
  .meal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .meal-card { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); transition: .2s; }
  .meal-card:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,163,77,.12); }
  .meal-card header { display: flex; align-items: center; gap: 10px; }
  .meal-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-size: 16px; }
  .meal-breakfast .meal-icon { background: #fef3d6; color: #b8860b; }
  .meal-lunch .meal-icon { background: #e8f5e0; color: #4a7c2e; }
  .meal-dinner .meal-icon { background: #e0e8f5; color: #3a5a8a; }
  .meal-card strong { font-size: 13px; font-weight: 700; color: var(--deep); }
  .meal-card small { display: block; font-size: 8px; color: var(--sage); }
  .meal-card textarea { width: 100%; resize: vertical; min-height: 80px; }
  .kitchen-notes { display: grid; gap: 6px; }
  .kitchen-notes span { font-size: 8px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--sage); }
  .kitchen-notes textarea { width: 100%; resize: vertical; }
  .form-footer { display: flex; align-items: center; gap: 18px; }
  .saved-at { font-size: 9px; color: var(--sage); }
  .menu-form .check { display: flex; align-items: center; gap: 10px; }
  .menu-form .check input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--deep); }

  .admin-products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .admin-products article { overflow: hidden; }
  .admin-products article.inactive { opacity: .55; }
  .admin-products article > img { width: 100%; height: 210px; object-fit: cover; filter: saturate(.6); }
  .admin-products article > div { padding: 25px; }
  .admin-products h2 { margin: 12px 0 9px; font-size: 27px; }
  .admin-products p { min-height: 55px; font-size: 11px; }
  .admin-products footer { margin-top: 18px; padding-top: 15px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
  .admin-products footer strong { font: 22px var(--serif); }
}

@layer components {
  .week-grid-wrap { margin: 26px 0; }
  .week-nav { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
  .week-nav h2 { font-size: clamp(1.4rem, 3vw, 2rem); text-transform: capitalize; }
  .week-nav nav { display: flex; gap: 8px; }
  .week-grid { display: grid; grid-template-columns: 52px repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
  .week-hours { display: grid; grid-template-rows: repeat(var(--hours), 56px); border-right: 1px solid var(--line); background: var(--paper); }
  .hour-label { padding: 4px 6px; text-align: right; font-size: 8px; font-weight: 700; letter-spacing: .06em; color: var(--sage); border-bottom: 1px solid var(--line); }
  .week-day { border-right: 1px solid var(--line); min-width: 0; }
  .week-day:last-child { border-right: 0; }
  .week-day > header { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); background: var(--paper); }
  .week-day > header strong { display: block; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sage); }
  .week-day > header span { font: 18px var(--serif); }
  .week-day.today > header { background: var(--gold); color: var(--white); }
  .week-day.today > header strong, .week-day.today > header span { color: var(--white); }
  .week-slots { position: relative; }
  .week-slot { position: absolute; left: 0; right: 0; border-bottom: 1px dashed var(--line); opacity: 0; transition: background .12s; }
  .week-slot:hover { background: rgba(187, 150, 93, .12); opacity: 1; }
  .week-event { position: absolute; left: 3px; right: 3px; z-index: 2; padding: 5px 7px; border-radius: 6px; background: var(--pine); color: var(--white); overflow: hidden; cursor: default; box-shadow: 0 3px 12px rgba(20, 47, 39, .18); }
  .week-busy { position: absolute; left: 3px; right: 3px; z-index: 1; padding: 5px 7px; border-radius: 6px; background: var(--cream); border: 1px dashed var(--sage); color: var(--sage); overflow: hidden; box-shadow: none; }
  .week-busy strong { display: block; font-size: 9px; font-weight: 700; line-height: 1.2; }
  .week-busy small { display: block; margin-top: 2px; font-size: 7px; opacity: .7; }
  .week-legend { margin-bottom: 10px; font-size: 9px; color: var(--sage); display: flex; align-items: center; gap: 6px; }
  .legend-busy { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--cream); border: 1px dashed var(--sage); }
  .legend-patient { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--pine); }
  .week-event strong { display: block; font-size: 9px; font-weight: 700; line-height: 1.2; }
  .week-event small { display: block; margin-top: 2px; font-size: 7px; opacity: .8; }
  .week-event span { display: block; margin-top: 1px; font-size: 7px; opacity: .65; font-style: italic; }
  .reschedule-inline { margin-top: 4px; }
  .reschedule-inline summary { font-size: 7px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; opacity: .8; list-style: none; }
  .reschedule-inline div { display: flex; gap: 4px; margin-top: 3px; }
  .reschedule-inline a { padding: 3px 6px; border-radius: 3px; background: rgba(255,255,255,.18); color: var(--white); font-size: 7px; text-decoration: none; }
  .reschedule-inline a:hover { background: var(--gold); }
}

@layer responsive {
  @media (max-width: 920px) {
    .site-header { grid-template-columns: 150px 1fr; }
    .site-header nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; overflow-x: auto; }
    .account { justify-self: end; }
    .public-hero { height: 720px; }
    .service-grid, .product-grid, .admin-products { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .login-page { grid-template-columns: 1fr; }
    .login-image { min-height: 420px; }
    .editorial-intro { grid-template-columns: 1fr; gap: 25px; }
    .week-grid-wrap { overflow-x: auto; }
    .week-grid { min-width: 720px; }
  }
  @media (max-width: 620px) {
    .page-shell, .narrow-page, .form-page { width: calc(100% - 28px); }
    .site-header { min-height: 68px; padding: 8px 15px; grid-template-columns: 175px 1fr; gap: 10px; }
    .brand { width: 170px; height: 46px; }
    .brand img { width: 40px; height: 40px; }
    .site-header nav { margin-inline: -15px; padding: 10px 15px 0; gap: 24px; border-top: 1px solid var(--line); }
    .account > a { display: none; }
    .site-footer { grid-template-columns: 1fr; gap: 18px; text-align: center; }
    .site-footer img { margin-inline: auto; }
    .public-hero { min-height: 670px; height: calc(100vh - 110px); }
    .hero-logo { width: 115px; height: 75px; top: 20px; left: 20px; }
    .public-hero-copy { left: 24px; bottom: 50px; }
    .public-hero-copy h1 { font-size: 4.3rem; }
    .actions { align-items: stretch; flex-direction: column; }
    .editorial-intro { padding: 70px 0 100px; }
    .service-grid, .product-grid, .admin-products { grid-template-columns: 1fr; }
    .service-image { height: 330px; }
    .catalog-page { background: linear-gradient(var(--deep) 0 500px, var(--paper) 500px); }
    .catalog-hero { min-height: 430px; padding-block: 70px 90px; }
    .shop-page { padding-top: 50px; }
    .shop-intro { grid-template-columns: 1fr; gap: 20px; }
    .product-image { height: 390px; }
    .login-image { min-height: 330px; }
    .login-image > div { left: 25px; top: 50%; transform: translateY(-50%); }
    .login-image h1 { font-size: 3.8rem; }
    .login-panel { padding: 48px 23px; }
    .welcome-card { min-height: 470px; padding: 38px 25px; align-items: end; }
    .welcome-card h1 { font-size: 4rem; }
    .room-stamp { width: 76px; height: 76px; position: absolute; top: 0; right: 0; }
    .schedule-panel, .meal-card, .day-group { padding: 28px 21px; }
    .section-head, .section-title, .page-intro { align-items: flex-start; flex-direction: column; }
    .event-row { grid-template-columns: 40px 11px 1fr; padding-block: 15px; }
    .reschedule { grid-column: 3; }
    .reschedule div { right: auto; left: 0; }
    .charge-list { padding-inline: 17px; }
    .charge-row { grid-template-columns: 38px 1fr auto; padding-block: 14px; }
    .charge-row .status { display: none; }
    .table-head, .table-row { min-width: 660px; }
    .patient-table { overflow-x: auto; }
    .patient-header { align-items: flex-start; }
    .patient-header .monogram { width: 64px; height: 64px; }
    .doctor-grid { grid-template-columns: 1fr; }
    .doctor-calendar, .comments-section { padding: 25px 20px; }
    .doctor-events > div { grid-template-columns: 1fr; gap: 3px; }
    .appointment-form > div { grid-template-columns: 1fr; }
    .form-head { align-items: stretch; flex-direction: column; }
    .form-head label { width: 100%; }
    .menu-form { padding: 28px 20px; }
    .meal-grid { grid-template-columns: 1fr; }
    .menu-day-strip { grid-template-columns: repeat(4, 1fr); }
    .menu-week-nav { flex-wrap: wrap; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
}
