:root {
  color-scheme: light;
  --ink: #31394c;
  --muted: #748096;
  --line: #c9d3dc;
  --paper: #ffffff;
  --sky: #dceaf1;
  --sky-deep: #b8d2e1;
  --blue: #55a3d7;
  --blue-deep: #367eae;
  --gold: #e5a52d;
  --gold-light: #fff3d3;
  --shadow: 0 5px 0 rgba(47, 62, 82, .11), 0 14px 30px rgba(47, 62, 82, .08);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: #e9edf0; }
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.pixel-sky { position: fixed; inset: 0 0 auto; height: 205px; z-index: -1; background-color: #dceaf1; background-image: linear-gradient(135deg, rgba(255,255,255,.22) 25%, transparent 25%), linear-gradient(225deg, rgba(255,255,255,.22) 25%, transparent 25%), linear-gradient(45deg, rgba(163,193,210,.16) 25%, transparent 25%), linear-gradient(315deg, rgba(163,193,210,.16) 25%, #dceaf1 25%); background-position: 14px 0, 14px 0, 0 0, 0 0; background-size: 28px 28px; border-bottom: 5px solid #c5d7e1; }
.pixel-sky::after { content: ""; position: absolute; inset: auto 0 0; height: 24px; opacity: .45; background: repeating-linear-gradient(90deg, transparent 0 23px, #a9c5d5 23px 25px); }
.brand-header { width: min(1440px, calc(100% - 48px)); margin: 18px auto 0; padding: 12px 18px; display: flex; align-items: center; gap: 24px; background: rgba(255,255,255,.94); border: 3px solid #fff; border-radius: 13px; box-shadow: 0 4px 0 rgba(53,75,95,.17); }
.brand-logo { display: block; width: 206px; height: 92px; object-fit: contain; image-rendering: pixelated; }
.brand-home { display: inline-flex; align-items: center; border-radius: 7px; }
.brand-home:focus-visible { outline: 3px solid var(--gold); }
.pixel-label { margin-left: auto; padding: 10px 14px; color: #556176; background: #eef3f6; border: 2px solid #d7e1e7; border-radius: 7px; font-weight: 900; font-size: .72rem; letter-spacing: .14em; box-shadow: inset 0 -3px rgba(57,75,95,.08); }
.auth-shell { min-height: 100vh; padding: 1px 0 44px; }
.auth-brand-header { margin-top: 28px; justify-content: center; position: relative; }
.auth-brand-header .pixel-label { position: absolute; right: 24px; }
.auth-main { width: min(560px, calc(100% - 32px)); margin: 60px auto 0; }
.auth-card { padding: 36px 42px 28px; background: var(--paper); border: 3px solid #fff; border-radius: 13px; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: var(--blue-deep); font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
.auth-card h1 { margin-bottom: 8px; font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.04em; }
.auth-intro { margin-bottom: 26px; color: var(--muted); line-height: 1.55; }
.auth-form, .app-dialog form { display: grid; gap: 17px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; background: #eff3f6; border-radius: 9px; }
.auth-tab { min-height: 44px; border: 0; border-radius: 7px; color: #7b8799; background: transparent; font-weight: 800; cursor: pointer; }
.auth-tab.active { background: #fff; color: var(--blue-deep); box-shadow: 0 2px 7px rgba(50,65,84,.12); }
label { display: grid; gap: 8px; color: #465168; font-weight: 800; font-size: .92rem; }
input, textarea { width: 100%; border: 2px solid #d7e0e6; border-radius: 8px; background: #fff; padding: 13px 14px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #aab3bf; }
input:focus, textarea:focus { border-color: #76b6df; box-shadow: 0 0 0 3px rgba(85,163,215,.16); }
textarea { resize: vertical; line-height: 1.55; }
input[type="file"] { padding: 10px; font-weight: 600; font-size: .88rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 10px 16px; border: 2px solid transparent; border-radius: 8px; font-weight: 900; font-size: .8rem; letter-spacing: .03em; cursor: pointer; transition: transform .12s, filter .12s, box-shadow .12s; }
.button:hover { filter: brightness(1.035); transform: translateY(-1px); }
.button:active { transform: translateY(1px); box-shadow: none; }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 4px 0 #367eae; }
.button-primary:hover { background: #62addf; }
.button-light { color: #59657a; background: #f0f4f6; border-color: #dbe3e8; box-shadow: 0 3px 0 rgba(52,74,94,.1); }
.button-wide { width: 100%; min-height: 51px; font-size: .92rem; }
.form-message { min-height: 1em; margin: -6px 0 0; color: #b34545; font-size: .86rem; }
.auth-footnote { margin: 25px 0 0; text-align: center; color: #8994a2; font-size: .68rem; font-weight: 900; letter-spacing: .13em; }
.app-header { position: relative; }
.main-nav { display: flex; align-self: stretch; align-items: center; gap: 7px; margin-left: 22px; }
.nav-tab { padding: 12px 18px; border: 0; border-radius: 7px; background: transparent; color: #69758a; font-size: .8rem; font-weight: 900; letter-spacing: .1em; cursor: pointer; }
.nav-tab.active { color: #fff; background: var(--blue); box-shadow: 0 3px 0 #367eae; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; position: relative; }
.notification-button { font-size: .68rem; white-space: nowrap; }
.notification-button.enabled { color: #536b43; background: #edf5e3; border-color: #d0e3b8; }
.notification-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #9aa6b2; }
.notification-button.enabled .notification-dot { background: #65a341; box-shadow: 0 0 0 3px rgba(101,163,65,.15); }
.profile-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 2px solid #e0e6ea; border-radius: 8px; background: #fff; color: #536076; font-size: .82rem; font-weight: 800; cursor: pointer; }
.profile-menu { position: absolute; z-index: 5; right: 0; top: calc(100% + 8px); min-width: 170px; display: grid; gap: 7px; padding: 11px; background: #fff; border: 2px solid #d8e1e7; border-radius: 8px; box-shadow: var(--shadow); }
.profile-menu span { padding: 6px; color: var(--muted); font-size: .82rem; }
.profile-menu button { padding: 9px; border: 0; border-radius: 6px; background: #f1f4f6; text-align: left; font-weight: 800; cursor: pointer; }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; display: inline-grid; place-items: center; border: 2px solid #fff; border-radius: 8px; color: #fff; font-weight: 900; box-shadow: 0 0 0 1px #d3dce3; }
.avatar-small { width: 30px; height: 30px; border-radius: 50%; font-size: .78rem; }
.avatar-a { background: #67b9c8; }.avatar-b { background: #d59e54; }.avatar-c { background: #7e91c2; }.avatar-d { background: #8ba76f; }.avatar-e { background: #bd7986; }
.app-main { width: min(1440px, calc(100% - 48px)); margin: 20px auto 54px; }
.online-panel, .welcome-strip, .page-section, .site-footer { background: #fff; border: 3px solid #fff; border-radius: 11px; box-shadow: 0 3px 0 rgba(53,75,95,.09); }
.online-panel { padding: 16px 20px 13px; }
.online-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.online-panel-heading .eyebrow { margin-bottom: 3px; }
.online-panel-heading h2 { margin-bottom: 0; font-size: 1.12rem; }
.online-counter { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.online-counter i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #69b55d; box-shadow: 0 0 0 3px #e4f3df; }
.online-users { display: flex; align-items: center; gap: 9px; min-height: 49px; margin-top: 12px; overflow: auto; }
.online-user { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; flex: 0 0 auto; background: #f1f4f6; border: 1px solid #e2e8ec; border-radius: 8px; font-size: .82rem; }
.online-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #d9e9ef; overflow: hidden; }
.online-avatar .avatar { width: 100%; height: 100%; border: 0; box-shadow: none; }
.online-empty { color: #99a3b0; font-size: .83rem; }
.welcome-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 15px 0 19px; padding: 19px 24px; background: #bad7e8; border-color: #bad7e8; }
.welcome-strip .eyebrow { color: #3e7292; }
.welcome-strip h1 { margin: 0 0 3px; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.04em; }
.welcome-copy { margin: 0; color: #4c6678; }
.welcome-badge { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; background: rgba(255,255,255,.7); border: 2px solid rgba(255,255,255,.8); border-radius: 8px; color: #506579; font-size: .77rem; font-weight: 900; white-space: nowrap; }
.pixel-status { width: 11px; height: 11px; background: var(--gold); box-shadow: 3px 3px 0 #bd8122; }
.page-section { padding: 22px 24px 26px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.section-heading h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.035em; }
.section-intro { margin: 12px 0 20px; color: var(--muted); line-height: 1.5; }
.post-list, .recipes-list { display: grid; gap: 11px; }
.post-card { overflow: hidden; background: #f7f9fa; border: 2px solid #dce4e9; border-radius: 9px; box-shadow: 0 3px 0 rgba(50,71,90,.07); }
.post-subject { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 15px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.post-subject:hover { background: #eef5f8; }
.post-subject::before { content: "▸"; width: 19px; color: var(--blue-deep); font-size: 1.1rem; transition: transform .15s; }
.post-card.expanded .post-subject::before { transform: rotate(90deg); }
.post-title-toggle { min-width: 0; flex: 1; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.post-title { display: block; overflow-wrap: anywhere; color: #354157; font-weight: 900; }
.post-meta { display: block; margin-top: 4px; color: #8994a2; font-size: .75rem; }
.like-button { display: inline-flex; align-items: center; gap: 6px; min-height: 35px; padding: 6px 10px; border: 2px solid #e0e6ea; border-radius: 7px; background: #fff; color: #67758a; font-size: .78rem; font-weight: 800; white-space: nowrap; cursor: pointer; }
.like-button.liked { color: #b25d4c; border-color: #f0d0c8; background: #fff3ef; }
.like-button:disabled { opacity: .6; cursor: wait; }
.post-actions, .management-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.manage-button { min-height: 32px; padding: 5px 8px; border: 1px solid #dce4e9; border-radius: 6px; background: #fff; color: #59657a; font-size: .68rem; font-weight: 800; white-space: nowrap; cursor: pointer; }
.manage-button:hover { background: #eef5f8; }
.manage-delete-recipe, .manage-delete-post { color: #a14848; border-color: #ead0cd; }
.manage-delete-recipe:hover, .manage-delete-post:hover { background: #fff1ef; }
.manage-button:disabled { opacity: .6; cursor: wait; }
.management-actions { justify-content: flex-start; margin-top: 10px; }
.post-body { margin: 0; padding: 0 20px 17px 47px; color: #566276; white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }
.menu-post-body { display: grid; gap: 11px; }
.menu-day-post { padding: 12px 14px; background: #fff; border: 1px solid #dce4e9; border-radius: 8px; }
.menu-day-name { margin: 0 0 3px; color: var(--blue-deep); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.menu-recipe-name { display: block; color: #354157; font-size: 1rem; }
.menu-recipe-details { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; }
.menu-recipe-image { width: 76px; height: 76px; flex: 0 0 auto; object-fit: cover; border: 1px solid #dce4e9; border-radius: 6px; background: #e9eff2; }
.menu-recipe-ingredients { margin: 0; color: #566276; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.menu-recipe-meta { display: block; margin-top: 8px; color: #8994a2; font-size: .7rem; }
.post-legacy-body { margin: 0; white-space: pre-wrap; }
.empty-state { padding: 40px 18px; text-align: center; background: #f8fafb; border: 2px dashed #d4dfe6; border-radius: 9px; }
.empty-state h3 { margin: 8px 0 5px; }.empty-state p { margin-bottom: 17px; color: var(--muted); }
.empty-pixels { color: var(--gold); font-size: 1.8rem; }
.recipe-card { display: grid; grid-template-columns: 118px minmax(0, 1fr); min-height: 112px; overflow: hidden; background: #f7f9fa; border: 2px solid #dce4e9; border-radius: 9px; box-shadow: 0 3px 0 rgba(50,71,90,.07); }
.recipe-image { width: 118px; height: 100%; min-height: 112px; max-height: 168px; object-fit: cover; background: #e9eff2; image-rendering: auto; }
.recipe-image-placeholder { display: grid; place-items: center; color: #8794a1; font-size: 1.7rem; background: #e7eef2; }
.recipe-info { min-width: 0; padding: 13px 16px; }
.recipe-name-button { padding: 0; border: 0; background: transparent; color: #354157; text-align: left; font-size: 1.05rem; font-weight: 900; cursor: pointer; }
.recipe-name-button:hover { color: var(--blue-deep); }
.recipe-meta { display: block; margin: 5px 0 8px; color: #8994a2; font-size: .75rem; }
.recipe-ingredients { margin: 9px 0 0; padding-top: 9px; border-top: 1px solid #e1e7eb; color: #566276; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.menu-picker-title { margin: 0 0 5px; color: #465168; font-weight: 900; font-size: .92rem; }
.menu-picker-hint { margin: 0; }
.menu-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.menu-day-select { gap: 6px; }
.menu-day-select span { color: #465168; font-size: .78rem; }
.menu-day-select select { width: 100%; min-height: 42px; padding: 9px 11px; border: 2px solid #d7e0e6; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: .85rem; outline: none; }
.menu-day-select select:focus { border-color: #76b6df; box-shadow: 0 0 0 3px rgba(85,163,215,.16); }
#menu-recipe-hint { min-height: 1.3em; margin: 10px 0 0; }
.label-optional { color: #8a95a2; font-size: .78rem; font-weight: 600; }
.field-hint { margin: -8px 0 0; color: var(--muted); font-size: .81rem; line-height: 1.5; }
.image-preview-wrap { display: flex; align-items: center; gap: 12px; padding: 10px; background: #f2f6f8; border: 1px solid #dce4e9; border-radius: 8px; }
.image-preview-wrap img { width: 78px; height: 78px; object-fit: cover; border-radius: 6px; background: #e3e9ed; }
.text-button { border: 0; background: none; color: var(--blue-deep); font-weight: 800; cursor: pointer; }
.site-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 11px; margin-top: 14px; padding: 9px 14px; color: #7f8b9a; font-size: .78rem; }
.site-footer img { width: 80px; height: 35px; object-fit: contain; image-rendering: pixelated; }
.site-footer span + span::before { content: "·"; margin-right: 11px; color: #bac4cc; }
.app-dialog { width: min(540px, calc(100% - 28px)); max-height: min(92vh, 900px); padding: 0; border: 3px solid #fff; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 12px 50px rgba(31,48,65,.28); }
.app-dialog::backdrop { background: rgba(32,46,60,.52); backdrop-filter: blur(2px); }
.app-dialog form { padding: 24px; overflow-y: auto; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 3px; }
.dialog-head h2 { margin: 0; font-size: 1.5rem; }
.dialog-close { width: 35px; height: 35px; border: 0; border-radius: 7px; background: #edf2f5; color: #637084; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 3px; }
.toast { position: fixed; z-index: 10; right: 20px; bottom: 20px; max-width: min(390px, calc(100% - 40px)); padding: 13px 16px; border: 2px solid #fff; border-radius: 8px; background: #354157; color: #fff; font-size: .9rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .brand-header, .app-main { width: min(100% - 28px, 720px); }
  .brand-header { flex-wrap: wrap; gap: 8px 14px; }
  .brand-logo { width: 170px; height: 76px; }
  .main-nav { margin-left: auto; }
  .header-actions { width: 100%; justify-content: flex-end; }
  .app-header .header-actions { position: static; }
  .profile-menu { top: auto; right: 17px; margin-top: 106px; }
  .welcome-strip { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .pixel-sky { height: 155px; }
  .brand-header { width: calc(100% - 20px); margin-top: 10px; padding: 9px 11px; border-width: 2px; }
  .auth-brand-header { justify-content: flex-start; }
  .auth-brand-header .pixel-label { position: static; margin-left: auto; padding: 8px; font-size: .55rem; }
  .brand-logo { width: 142px; height: 64px; }
  .auth-main { margin-top: 28px; }
  .auth-card { padding: 26px 21px 23px; }
  .app-header { gap: 5px; }
  .app-header .brand-home { flex: 1; }
  .app-header .brand-logo { width: 145px; height: 63px; }
  .main-nav { gap: 2px; margin-left: 0; }
  .nav-tab { padding: 9px 10px; font-size: .68rem; }
  .header-actions { gap: 8px; }
  .notification-button { min-height: 37px; padding: 7px 9px; font-size: .58rem; }
  .profile-chip { font-size: .74rem; }
  .app-main { width: calc(100% - 20px); margin-top: 12px; }
  .online-panel { padding: 13px 13px 10px; }
  .online-panel-heading h2 { font-size: 1rem; }
  .online-counter { font-size: .73rem; }
  .welcome-strip { margin: 10px 0 12px; padding: 16px; }
  .welcome-badge { font-size: .68rem; }
  .page-section { padding: 17px 13px 19px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading h2 { font-size: 1.45rem; }
  .section-heading .button { width: 100%; }
  .section-intro { margin: 10px 0 15px; font-size: .9rem; }
  .post-subject { gap: 8px; padding: 12px 10px; }
  .post-title { font-size: .92rem; }
  .post-meta { font-size: .68rem; }
  .like-button { min-height: 32px; padding: 5px 7px; font-size: .68rem; }
  .like-button .like-label { display: none; }
  .post-actions { flex-direction: column; align-items: flex-end; }
  .manage-button { min-height: 29px; padding: 4px 6px; font-size: .62rem; }
  .post-body { padding: 0 14px 14px 37px; font-size: .9rem; }
  .menu-day-post { padding: 10px; }
  .menu-recipe-image { width: 62px; height: 62px; }
  .menu-days { grid-template-columns: 1fr; gap: 8px; }
  .recipe-card { grid-template-columns: 82px minmax(0, 1fr); min-height: 90px; }
  .recipe-image { width: 82px; min-height: 90px; }
  .recipe-info { padding: 10px 11px; }
  .recipe-name-button { font-size: .96rem; }
  .recipe-meta { font-size: .68rem; }
  .recipe-ingredients { font-size: .86rem; }
  .site-footer { font-size: .68rem; gap: 6px; }
  .site-footer img { width: 61px; height: 28px; }
  .site-footer span + span::before { margin-right: 6px; }
  .app-dialog form { padding: 19px 17px; }
  .dialog-actions { flex-wrap: wrap; }
}
