/* Bombay Gold — admin panel (logo colours: navy #1B2944, gold #DDB36A) */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Montserrat:wght@400;500;600&display=swap');
:root {
  --navy: #1B2944; --navy-deep: #111C33; --gold: #DDB36A; --ink: #0D2B48; --text: #34485C; --muted: #5F7186;
  --line: #DCE3EB; --soft: #F6F2E9; --white: #fff; --danger: #B3261E;
  --sans: 'Montserrat', 'Segoe UI', system-ui, sans-serif; --serif: 'Cormorant Garamond', Georgia, serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--soft); }
a { color: var(--navy); }
h1, h2 { font-family: var(--serif); font-weight: 600; color: var(--navy); margin: 0; line-height: 1.2; }
h2 { font-size: 22px; margin-bottom: 16px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.side :focus-visible { outline-color: var(--gold); }

.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; width: 264px; height: 100vh; flex: none; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; color: #C4D1DF; background: linear-gradient(180deg, #16233F 0%, var(--navy-deep) 55%, #0C1528 100%); border-right: 1px solid rgba(221, 179, 106, .14); }
.side__glow { position: absolute; top: -120px; right: -120px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(221, 179, 106, .22), rgba(221, 179, 106, 0) 68%); pointer-events: none; animation: glow 9s ease-in-out infinite alternate; }
@keyframes glow { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.15); } }
.side__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 20px 18px; }
.side__brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.side__mono { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--navy-deep); background: linear-gradient(135deg, #F6E3B4, var(--gold) 45%, #B98A3E); box-shadow: 0 0 0 3px rgba(221, 179, 106, .2), 0 10px 22px -10px rgba(221, 179, 106, .8); overflow: hidden; }
.side__mono::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%); transform: translateX(-120%); animation: monoShine 5s ease-in-out 1s infinite; }
@keyframes monoShine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.side__names { display: flex; flex-direction: column; min-width: 0; }
.side__a { font-weight: 600; font-size: 16.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__b { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.side__hello { position: relative; margin: 0 20px 6px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); font-size: 13.5px; color: #9FB0C4; }
.side__hello b { color: var(--white); font-weight: 600; }
.side__nav { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 12px; flex: 1; }
.side__nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #C4D1DF; text-decoration: none; overflow: hidden; transition: color .25s, background-color .25s, transform .3s var(--ease); }
.side__nav a::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); transform: scaleY(0); transition: transform .3s var(--ease); }
.side__ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: rgba(255, 255, 255, .05); color: #D9E2EC; transition: background-color .3s, color .3s, transform .35s var(--ease); }
.side__txt { flex: 1; min-width: 0; }
.side__nav a:hover { color: var(--white); background: rgba(255, 255, 255, .05); transform: translateX(3px); }
.side__nav a:hover .side__ico { background: rgba(221, 179, 106, .16); color: var(--gold); transform: rotate(-6deg) scale(1.06); }
.side__nav a.is-active { color: var(--white); background: linear-gradient(90deg, rgba(221, 179, 106, .2), rgba(221, 179, 106, .04)); }
.side__nav a.is-active::before { transform: none; }
.side__nav a.is-active .side__ico { background: linear-gradient(135deg, #F0D9A4, var(--gold) 50%, #B98A3E); color: var(--navy-deep); box-shadow: 0 8px 18px -8px rgba(221, 179, 106, .8); }
.pill { background: var(--gold); color: var(--navy-deep); font-size: 12px; font-weight: 600; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 12px; animation: pillPulse 2.2s ease-in-out infinite; }
@keyframes pillPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(221, 179, 106, .55); } 50% { box-shadow: 0 0 0 6px rgba(221, 179, 106, 0); } }
.side__foot { position: relative; display: grid; grid-template-columns: 1fr; gap: 8px; padding: 16px 20px 22px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side__foot form { margin: 0; display: flex; }
.side__site, .side__foot button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease); }
.side__site { color: var(--navy-deep); background: var(--gold); border: 1px solid var(--gold); }
.side__site:hover { background: #F0D9A4; transform: translateY(-2px); }
.side__foot button { background: none; border: 1px solid rgba(255, 255, 255, .22); color: var(--white); }
.side__foot button:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); transform: translateY(-2px); }
.side__site svg, .side__foot button svg { width: 18px; height: 18px; }

.main { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 22px 34px; background: var(--white); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 28px; }
.content { padding: 28px 34px 60px; max-width: 1400px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 26px 28px; margin-bottom: 24px; }
.card--narrow { max-width: 780px; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.cols--wide { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
.mute { color: var(--muted); margin: 0 0 12px; }
.backlink { margin: 0 0 18px; }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.inline { display: inline; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 4px; padding: 20px 22px; text-decoration: none; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -20px rgba(27, 41, 68, .5); }
.stat strong { font-family: var(--serif); font-size: 36px; font-weight: 500; color: var(--navy); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }

/* Buttons */
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--navy); text-decoration: none; font-weight: 500; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease); }
.abtn:hover { border-color: var(--navy); transform: translateY(-1px); }
.abtn--primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.abtn--primary:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.abtn--danger { color: var(--danger); }
.abtn--danger:hover { background: var(--danger); border-color: var(--danger); color: var(--white); }
.abtn--sm { min-height: 36px; padding: 5px 12px; font-size: 14.5px; }
.abtn--block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions--sticky { margin-top: 0; }

.switch { min-height: 34px; padding: 4px 12px 4px 30px; position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--muted); font-size: 14px; cursor: pointer; transition: border-color .25s, color .25s; }
.switch::before { content: ''; position: absolute; left: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #B8C3CF; transition: background-color .25s; }
.switch.is-on { color: var(--navy); border-color: var(--navy); }
.switch.is-on::before { background: var(--gold); box-shadow: 0 0 0 2px var(--navy); }

/* Tables */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th { text-align: left; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background-color .2s; }
.table tbody tr:hover { background: var(--soft); }
.table tr.is-off td:not(:last-child) { opacity: .55; }
.table tr.is-unread td { font-weight: 600; color: var(--ink); }
.table tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.thumb { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; background: var(--soft); display: block; }
.thumb--wide { width: 110px; }
.strong { font-weight: 600; text-decoration: none; }
.indent { color: var(--muted); margin-left: 8px; }
.apager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.apager a { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; }
.apager a.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; }

/* Forms */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; align-items: start; }
.fld > label { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); font-weight: 500; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=password], select, textarea {
  width: 100%; min-height: 44px; border: 1px solid #C5D0DB; border-radius: 3px; background: var(--white); padding: 9px 12px; transition: border-color .25s, box-shadow .25s;
}
.filterbar input, .filterbar select { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(221, 179, 106, .55); }
.fld small { color: var(--muted); font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font-size: 16px !important; color: var(--text) !important; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.imgpick { display: flex; gap: 16px; align-items: flex-start; }
.imgpick > img { width: 110px; height: 110px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; background: var(--soft); flex: none; }
.imgpick > img[data-preview=logo], .imgpick > img[data-preview=footer_logo] { object-fit: contain; background: var(--white); padding: 6px; }
.imgpick > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
input[type=file] { max-width: 100%; }
.gallerypick { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.gallerypick label { display: flex; flex-direction: column; gap: 2px; }
.gallerypick img { width: 92px; height: 92px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; }
.gallerypick .check { font-size: 14px !important; min-height: 30px; }

.flash { padding: 13px 16px; margin-bottom: 18px; border-radius: 3px; border-left: 4px solid var(--gold); background: #FBF3E1; color: var(--ink); animation: flashin .5s var(--ease); }
.flash--err { border-left-color: var(--danger); background: #FCEEEE; }
@keyframes flashin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tabs a { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 3px; background: var(--white); text-decoration: none; transition: background-color .25s, color .25s, border-color .25s; }
.tabs a:hover { border-color: var(--navy); }
.tabs a.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); box-shadow: inset 0 -3px 0 var(--gold); }

.detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; margin: 0 0 24px; }
.detail dt { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.detail dd { margin: 2px 0 0; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.message { background: var(--soft); border-left: 4px solid var(--gold); padding: 16px 18px; overflow-wrap: anywhere; }

/* Login / setup */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #2D3F66, var(--navy) 50%, var(--navy-deep)); }
.auth__card { width: 100%; max-width: 420px; background: var(--white); padding: 38px 34px; border-top: 4px solid var(--gold); border-radius: 4px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); animation: flashin .6s var(--ease); }
.auth__logo { height: 60px; width: auto; display: block; margin: 0 auto 22px; }
.auth__card h1 { font-size: 26px; text-align: center; margin-bottom: 22px; }
.auth__intro { color: var(--muted); margin: -8px 0 20px; text-align: center; }
.auth__back { text-align: center; margin: 20px 0 0; }

/* File pickers look like proper buttons */
input[type=file] { width: 100%; padding: 7px; border: 1px dashed #C5D0DB; border-radius: 3px; background: var(--soft); font-size: 14px; color: var(--muted); cursor: pointer; transition: border-color .25s; }
input[type=file]:hover { border-color: var(--navy); }
input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 1px solid var(--navy); border-radius: 3px; background: var(--navy); color: var(--white); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background-color .25s, color .25s; }
input[type=file]:hover::file-selector-button { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.side__close, .side-scrim, .top__site, .bnav, .m-only { display: none; }
#form { scroll-margin-top: 90px; }

@media (max-width: 1100px) { .cols, .cols--wide { grid-template-columns: minmax(0, 1fr); } }

/* ============ PHONES & TABLETS ============ */
@media (max-width: 860px) {
  /* Full-screen menu that opens as a circle from the button you tap */
  .side { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; height: 100dvh; padding-bottom: env(safe-area-inset-bottom); border-right: 0;
    background: radial-gradient(circle at 85% 0%, #2D3F66 0%, rgba(45, 63, 102, 0) 45%), radial-gradient(circle at 0% 100%, rgba(221, 179, 106, .16) 0%, rgba(221, 179, 106, 0) 40%), linear-gradient(180deg, #16233F, var(--navy-deep) 60%, #0B1427);
    clip-path: circle(0 at var(--ox, 28px) var(--oy, 32px)); visibility: hidden; transition: clip-path .65s cubic-bezier(.7, 0, .2, 1), visibility 0s linear .65s; }
  .side.is-open { clip-path: circle(150% at var(--ox, 28px) var(--oy, 32px)); visibility: visible; transition: clip-path .7s cubic-bezier(.7, 0, .2, 1), visibility 0s; }
  .side__glow { width: 340px; height: 340px; }
  .side__head { padding: 18px 16px 14px; }
  .side__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border: 1px solid rgba(221, 179, 106, .4); border-radius: 50%; background: rgba(255, 255, 255, .04); color: var(--gold); cursor: pointer; transform: rotate(-180deg) scale(.4); opacity: 0; transition: transform .6s var(--ease) .25s, opacity .4s .25s, background-color .25s; }
  .side.is-open .side__close { transform: none; opacity: 1; }
  .side__close:active { background: var(--gold); color: var(--navy-deep); }
  .side__hello { margin: 0 16px 4px; }
  .side__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; padding: 14px 16px; overflow-y: auto; }
  .side__nav a { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 104px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); font-size: 15px; font-weight: 500; line-height: 1.25;
    opacity: 0; transform: translateY(26px) scale(.94); transition: opacity .5s var(--ease), transform .55s var(--ease), background-color .25s, border-color .25s; }
  .side.is-open .side__nav a { opacity: 1; transform: none; transition-delay: calc(.18s + var(--i, 1) * .045s); }
  .side__nav a::before { display: none; }
  .side__nav a:hover { transform: none; }
  .side__nav a:active { transform: scale(.96) !important; transition-delay: 0s !important; }
  .side__ico { width: 42px; height: 42px; border-radius: 12px; background: rgba(221, 179, 106, .12); color: var(--gold); }
  .side__nav a.is-active { background: linear-gradient(140deg, rgba(221, 179, 106, .3), rgba(221, 179, 106, .08)); border-color: rgba(221, 179, 106, .55); }
  .side__nav a.is-active::after { content: ''; position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(221, 179, 106, .25); }
  .side__nav .pill { position: absolute; top: 12px; right: 12px; }
  .side__foot { grid-template-columns: 1fr 1fr; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .side.is-open .side__foot { opacity: 1; transform: none; transition-delay: .55s; }
  .side__head, .side__hello { opacity: 0; transform: translateY(-10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .side.is-open .side__head, .side.is-open .side__hello { opacity: 1; transform: none; transition-delay: .15s; }
  .side-scrim { display: none; }
  body.side-open { overflow: hidden; }

  /* Top bar */
  .top { padding: 10px 12px; gap: 6px; position: sticky; top: 0; z-index: 30; box-shadow: 0 6px 20px -16px rgba(27, 41, 68, .6); }
  .top h1 { flex: 1; min-width: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top__site { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--navy); transition: background-color .25s, color .25s, border-color .25s; }
  .top__site:active { background: var(--gold); border-color: var(--gold); }

  /* Bottom bar with the most-used pages */
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--navy-deep); padding: 4px 4px env(safe-area-inset-bottom); box-shadow: 0 -10px 30px -14px rgba(0, 0, 0, .45); }
  .bnav a, .bnav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 4px 0; border: 0; background: none; color: #AEBBCB; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .25s; }
  .bnav a::before, .bnav button::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); transform: scaleX(0); transition: transform .35s var(--ease); }
  .bnav .is-active { color: var(--gold); }
  .bnav .is-active::before { transform: none; }
  .bnav a:active svg, .bnav button:active svg { transform: scale(.86); }
  .bnav svg { transition: transform .2s var(--ease); }
  .bnav .bnav__add::before { display: none; }
  .bnav__plus { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; background: linear-gradient(135deg, #F0D9A4, var(--gold) 50%, #B98A3E); color: var(--navy-deep); box-shadow: 0 0 0 5px var(--navy-deep), 0 10px 20px -6px rgba(221, 179, 106, .7); transition: transform .3s var(--ease); }
  .bnav__add:active .bnav__plus { transform: scale(.9) rotate(90deg); }
  .bnav__badge { position: absolute; top: 5px; left: 50%; margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--navy-deep); font-size: 11px; line-height: 18px; text-align: center; }

  .content { padding: 16px 12px calc(96px + env(safe-area-inset-bottom)); }
  .card { padding: 18px 14px; margin-bottom: 16px; }
  h2 { font-size: 21px; margin-bottom: 12px; }
  .m-only { display: inline-flex; }
  .cols { display: block; }
  form.cols > div { display: contents; }

  /* Save buttons stay in reach above the bottom bar */
  .actions--sticky, .content .pf-save { position: sticky; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 20; margin: 0 -12px; padding: 10px 12px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); box-shadow: 0 -12px 24px -18px rgba(27, 41, 68, .5); }
  .content .pf-save .abtn:not(.abtn--primary) { display: none; }
  .card .actions--sticky { margin: 18px -14px -18px; padding: 10px 14px; }
  .actions--sticky .abtn, .content .pf-save .abtn { flex: 1 1 0; padding-left: 10px; padding-right: 10px; }

  /* Dashboard */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .stat { padding: 14px 14px 12px; }
  .stat strong { font-size: 32px; }
  .stat span { font-size: 11px; letter-spacing: .1em; }
  .todo li { flex-wrap: wrap; gap: 8px 12px; }
  .todo li > span { flex: 1 1 180px; }
  .quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick .abtn { padding: 8px 10px; font-size: 14px; text-align: center; }
  .quick .abtn--primary { grid-column: 1 / -1; }

  /* Search and filter bar */
  .card__head > .filterbar { width: 100%; }
  .filterbar input[type=search] { flex: 1 1 100%; width: 100%; }
  .filterbar select { flex: 1 1 0; min-width: 0; width: auto; }
  .card__head > .abtn--primary:not(.abtn--sm) { width: 100%; }

  /* Settings tabs scroll sideways in one row */
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 16px; padding: 2px 12px 6px; scrollbar-width: none; scroll-behavior: smooth; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; white-space: nowrap; }

  /* Picture fields: preview on top, picker full width */
  .imgpick { flex-wrap: wrap; gap: 10px; }
  .imgpick > div { flex: 1 1 100%; }
  .gallerypick img { width: 84px; height: 84px; }
  .detail dd { font-size: 16px; }
}

@media (min-width: 561px) and (max-width: 860px) {
  .side__nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px 16px; }
  .side__nav a { min-height: 120px; }
  .table--cards tr.has-thumb.multi-switch { grid-template-columns: 72px repeat(3, minmax(0, 1fr)) !important; column-gap: 16px !important; }
  .table--cards tr.has-thumb.multi-switch > td { grid-column: 2 / -1 !important; }
  .table--cards tr.has-thumb.multi-switch > td:first-child { grid-column: 1 !important; grid-row: 1 / span var(--rows1, 1) !important; }
  .table--cards tr.has-thumb.multi-switch > td.td-switch { grid-column: auto !important; }
  .table--cards tr.has-thumb.multi-switch > td:last-child:not([data-label]) { grid-column: 1 / -1 !important; }
}
/* Tables become cards on phones and tablets */
@media (max-width: 860px) {
  .tablewrap { overflow: visible; }
  .table.table--cards { min-width: 0; display: block; }
  .table--cards thead { display: none; }
  .table--cards tbody { display: block; }
  .table--cards tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 4px; border-bottom: 1px solid var(--line); animation: rowin .5s var(--ease) both; }
  .table--cards tr:nth-child(2) { animation-delay: .04s; } .table--cards tr:nth-child(3) { animation-delay: .08s; } .table--cards tr:nth-child(4) { animation-delay: .12s; } .table--cards tr:nth-child(n+5) { animation-delay: .16s; }
  .table--cards tr.has-thumb { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
  .table--cards td { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; grid-column: 1 / -1; text-align: left; white-space: normal; }
  .table--cards tr.has-thumb > td { grid-column: 2; }
  .table--cards tr.has-thumb > td:first-child { grid-column: 1; grid-row: 1 / span var(--rows, 1); align-self: start; }
  .table--cards td[data-label]::before { content: attr(data-label); flex: none; width: 82px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .table--cards tr.has-thumb > td:nth-child(2)::before, .table--cards tr:not(.has-thumb) > td:first-child::before { display: none; }
  .table--cards tr:not(.has-thumb) > td:first-child, .table--cards tr.has-thumb > td:nth-child(2) { font-weight: 600; color: var(--ink); font-size: 16.5px; }
  .table--cards .cell { min-width: 0; overflow-wrap: anywhere; }
  .table--cards .cell .mute { font-weight: 400; font-size: 14px; }
  .table--cards td:last-child:not([data-label]) { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 6px; }
  .table--cards td:last-child:not([data-label]) > .abtn, .table--cards td:last-child:not([data-label]) > form { flex: 1 1 0; }
  .table--cards td:last-child:not([data-label]) form .abtn { width: 100%; }
  .table--cards tr.has-thumb.multi-switch { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 10px; }
  .table--cards tr.has-thumb.multi-switch > td { grid-column: 3 / -1; }
  .table--cards tr.has-thumb.multi-switch > td:first-child { grid-column: 1 / 3; }
  .table--cards tr.multi-switch > td.td-switch { grid-column: span 2; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px; }
  .table--cards tr.multi-switch > td.td-switch::before { width: auto; }
  .table--cards tr.multi-switch .switch { font-size: 13px; }
  .table--cards tr.has-thumb > td:last-child:not([data-label]) { grid-column: 1 / -1; }
  .table--cards td[colspan] { display: block; }
  .table--cards .thumb { width: 72px; height: 72px; }
  .table--cards .thumb--wide { width: 96px; height: 60px; }
  .table--cards tbody tr:hover { background: none; }
  .table--cards tr.is-unread { box-shadow: inset 3px 0 0 var(--gold); padding-left: 12px; }
  .table--cards tr.is-unread td:first-child { box-shadow: none; }
  @keyframes rowin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 420px) {
  .auth { padding: 16px; }
  .auth__card { padding: 30px 20px; }
}

/* ================= POP-UP MENU (phones & tablets) ================= */
@media (max-width: 860px) {
  /* a floating glass card pops out of the button you tap */
  .menu-4 .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(17, 28, 51, .5); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
  .menu-4 .side-open .side-scrim { opacity: 1; visibility: visible; }
  .menu-4 .side { inset: auto 10px calc(72px + env(safe-area-inset-bottom)) 10px; width: auto; height: auto; max-height: calc(100dvh - 150px); overflow-y: auto; padding-bottom: 0; border-radius: 26px; border: 1px solid rgba(221, 179, 106, .28); background: rgba(17, 28, 51, .9); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7); clip-path: none; opacity: 0; transform: scale(.25); transform-origin: calc(var(--ox, 300px) - 10px) 100%; transition: transform .55s cubic-bezier(.34, 1.4, .64, 1), opacity .3s, visibility 0s linear .55s; }
  .menu-4 .side[data-from=top] { inset: 66px 10px auto 10px; transform-origin: calc(var(--ox, 30px) - 10px) 0; }
  .menu-4 .side.is-open { opacity: 1; transform: none; transition: transform .55s cubic-bezier(.34, 1.4, .64, 1), opacity .3s, visibility 0s; }
  .menu-4 .bnav { z-index: 58; }
  .menu-4 .side__glow { width: 220px; height: 220px; top: -90px; right: -60px; }
  .menu-4 .side__head { padding: 14px 14px 8px; }
  .menu-4 .side__mono { width: 40px; height: 40px; font-size: 22px; }
  .menu-4 .side__close { width: 38px; height: 38px; }
  .menu-4 .side__hello { display: none; }
  .menu-4 .side__nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px 8px 8px; overflow: visible; }
  .menu-4 .side__nav a { align-items: center; justify-content: flex-start; gap: 7px; min-height: 0; padding: 10px 2px; border: 0; border-radius: 16px; background: none; text-align: center; font-size: 11.5px; line-height: 1.2; transform: scale(.4); transition: opacity .4s var(--ease), transform .55s cubic-bezier(.34, 1.7, .64, 1), background-color .25s; }
  .menu-4 .side.is-open .side__nav a { transition-delay: calc(.12s + var(--i, 1) * .035s); }
  .menu-4 .side__ico { width: 50px; height: 50px; border-radius: 16px; background: rgba(255, 255, 255, .07); color: var(--gold); }
  .menu-4 .side__nav a.is-active { background: rgba(221, 179, 106, .12); border: 0; }
  .menu-4 .side__nav a.is-active::after { top: 8px; right: 8px; width: 6px; height: 6px; }
  .menu-4 .side__nav .pill { top: 4px; right: 6px; font-size: 10.5px; min-width: 20px; padding: 0 5px; }
  .menu-4 .side__foot { padding: 10px 14px 14px; }
  .menu-4 .side__site, .menu-4 .side__foot button { min-height: 40px; }
}
@media (min-width: 561px) and (max-width: 860px) {
  .menu-4 .side, .menu-4 .side[data-from=top] { left: 50%; right: auto; width: 520px; margin-left: -260px; }
  .menu-4 .side, .menu-4 .side[data-from=top] { transform-origin: 50% 100%; }
  .menu-4 .side[data-from=top] { transform-origin: 0 0; }
  .menu-4 .side__nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .menu-4 .side__nav a { min-height: 0; }
}

/* ================= SEARCH ================= */
.top h1 { flex: 1; min-width: 0; }
.top__search { display: inline-flex; align-items: center; gap: 10px; flex: none; min-width: 260px; height: 44px; padding: 0 10px 0 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--soft); color: var(--muted); font-size: 14.5px; cursor: pointer; transition: border-color .25s, box-shadow .25s, background-color .25s; }
.top__search span { flex: 1; text-align: left; }
.top__search kbd { font: inherit; font-size: 12px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--muted); }
.top__search:hover { border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 4px rgba(221, 179, 106, .2); }
.top__search .ico { color: var(--navy); }

.asearch { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 16px; background: rgba(17, 28, 51, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.asearch[hidden] { display: none; }
.asearch.is-open { opacity: 1; }
.asearch__box { width: 100%; max-width: 640px; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--white); border-top: 3px solid var(--gold); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); transform: translateY(-24px) scale(.96); transition: transform .45s cubic-bezier(.34, 1.4, .64, 1); }
.asearch.is-open .asearch__box { transform: none; }
.asearch__form { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); color: var(--navy); }
.asearch__form input[type=search] { flex: 1; min-width: 0; border: 0; box-shadow: none; padding: 10px 0; font-size: 17px; background: none; }
.asearch__form input[type=search]:focus { box-shadow: none; }
.asearch__close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--soft); color: var(--navy); cursor: pointer; transition: background-color .25s, transform .3s var(--ease); }
.asearch__close:hover { background: var(--gold); transform: rotate(90deg); }
.asearch__results { overflow-y: auto; overscroll-behavior: contain; padding: 6px 10px 14px; }
body.search-open { overflow: hidden; }

.sr-results { position: relative; transition: opacity .2s; }
.sr-results.is-loading { opacity: .55; }
.sr-empty { margin: 18px 8px; color: var(--muted); }
.sr-group h3 { display: flex; align-items: center; gap: 8px; margin: 14px 8px 6px; font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sr-group h3 span { min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--soft); text-align: center; letter-spacing: 0; color: var(--navy); }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--text); animation: srIn .4s var(--ease) both; animation-delay: calc(var(--n, 1) * 25ms); transition: background-color .2s, transform .2s var(--ease); }
.sr-item:hover, .sr-item:focus { background: var(--soft); transform: translateX(3px); outline: none; }
.sr-item:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
@keyframes srIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sr-thumb { flex: none; width: 46px; height: 46px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); }
.sr-thumb--wide { width: 64px; height: 40px; }
.sr-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: #F1E7D2; color: #B98A3E; }
.sr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-txt b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-txt small { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-go { flex: none; font-size: 22px; color: #B8C3CF; transition: color .2s, transform .2s; }
.sr-item:hover .sr-go { color: var(--gold); transform: translateX(3px); }
.sr-results mark { background: rgba(221, 179, 106, .45); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-form { display: flex; gap: 10px; margin-bottom: 6px; }
.sr-form input { flex: 1; }

@media (max-width: 860px) {
  .top { padding: 10px 12px 10px 16px; }
  .top__search { min-width: 0; width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; background: var(--white); }
  .top__search span, .top__search kbd { display: none; }
  .top__search:active { background: var(--gold); border-color: var(--gold); }
  .asearch { padding: 10px; }
  .asearch__box { max-height: calc(100dvh - 90px); border-radius: 20px; }
  .sr-item { padding: 9px 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }