/* The website's own colours and type: navy, orange, Barlow. The buttons use a deeper orange so white text stays readable outdoors. */
:root {
  --navy: #070f1c; --navy-2: #101b2d; --navy-line: #24324a; --on-navy: #e9eef4; --on-navy-2: #9aa7b8;
  --orange: #f5811a; --brand: #c45a06; --brand-dark: #a84c04; --brand-soft: #fdf0e4;
  --ink: #141c28; --muted: #58636f; --line: #dde2e8; --line-strong: #bcc5cf; --bg: #f2f4f7; --card: #fff;
  --bad: #b3261e; --bad-soft: #fdecea; --ok: #17693a; --ok-soft: #e6f4ec;
  --radius: 10px; --shadow: 0 1px 2px rgba(7, 15, 28, .06), 0 2px 8px rgba(7, 15, 28, .05);
  --nav-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 Barlow, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
img { display: block; }
h1, h2 { font-family: "Barlow Condensed", Barlow, system-ui, sans-serif; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
h1 { font-size: 27px; margin: 0; }
h2 { font-size: 21px; margin: 0 0 4px; }
p { margin: 0 0 8px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
svg.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* frame */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--on-navy); border-bottom: 3px solid var(--orange); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 12px; max-width: 1040px; margin: 0 auto; padding: 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; background: #fff; }
.brand b { display: block; font: 700 19px/1.05 "Barlow Condensed", Barlow, sans-serif; letter-spacing: .02em; }
.brand span span { display: block; font-size: 12px; color: var(--on-navy-2); }
.top-acts { display: flex; gap: 4px; margin-left: auto; }
.top-acts a, .top-acts button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--on-navy); font: 500 14px Barlow, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.top-acts a:hover, .top-acts button:hover { background: var(--navy-2); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--navy); padding-bottom: env(safe-area-inset-bottom); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h); color: var(--on-navy-2); font-size: 13px; font-weight: 500; text-decoration: none; border-top: 3px solid transparent; }
.nav a.on { color: #fff; border-top-color: var(--orange); }
.nav svg.ico { width: 22px; height: 22px; }
main { max-width: 1040px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
body.has-bar .nav { display: none; }
body.has-bar main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-bottom: 4px; color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font: 600 16px Barlow, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: #e0aca8; }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary:disabled { opacity: 1; background: #e6eaef; border-color: #e6eaef; color: var(--muted); }
.btn.grow { flex: 1; }

/* forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card > :first-child { margin-top: 0; }
.field { display: block; margin-top: 14px; }
.field:first-of-type { margin-top: 10px; }
.field > b { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.field .hint { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.field .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: 400 16px/1.4 Barlow, system-ui, sans-serif; }
textarea { min-height: 170px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--bad); }
.err-text { display: block; margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.two .field { margin-top: 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 74px; }
.pw-wrap button { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--brand); font: 600 14px Barlow, system-ui, sans-serif; cursor: pointer; }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--line); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex: none; position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--line-strong); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { left: 23px; }
.switch input:focus-visible + i { outline: 3px solid var(--orange); outline-offset: 2px; }
.switch b { display: block; font-weight: 600; font-size: 15px; }
.switch span span { display: block; font-size: 14px; color: var(--muted); }

/* lists */
.tools { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tools .search { flex: 1 1 220px; position: relative; }
.tools .search input { padding-left: 40px; }
.tools .search svg { position: absolute; left: 11px; top: 14px; color: var(--muted); pointer-events: none; }
.filters { display: none; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
.filters.open { display: grid; }
.filter-btn { flex: none; }
.count { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; text-align: left; font: inherit; }
a.row:hover { border-color: var(--line-strong); }
.thumb { flex: none; width: 72px; height: 72px; border-radius: 7px; object-fit: cover; background: #e6eaef; }
.thumb.none { display: flex; align-items: center; justify-content: center; color: #8b96a3; }
.row-body { flex: 1; min-width: 0; }
.row-body b { display: block; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.row-body > span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e9edf1; color: #3f4a57; font-size: 12px; font-weight: 600; }
.pill.warn { background: #fdf0e4; color: #8c4503; }
.pill.star { background: var(--navy); color: #fff; }
.chev { color: #9aa5b1; }
.order-btns { display: flex; gap: 4px; }
.order-btns button { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.order-btns button:disabled { opacity: .35; cursor: default; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* photos */
.photos-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.ph { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ph.is-main { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.ph > button.view { display: block; padding: 0; border: 0; background: #e6eaef; cursor: zoom-in; }
.ph img { width: 100%; height: 118px; object-fit: cover; }
.badge { position: absolute; top: 6px; left: 6px; padding: 2px 9px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; }
.ph-acts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.ph-acts button { display: flex; align-items: center; justify-content: center; height: 44px; padding: 0; border: 0; background: #fff; color: var(--ink); cursor: pointer; }
.ph-acts button + button { border-left: 1px solid var(--line); }
.ph-acts button:disabled { color: #b8c0c9; cursor: default; }
.ph-acts .del { color: var(--bad); }
.ph-acts .is-star { color: var(--brand); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; margin-top: 12px; padding: 14px; border: 2px dashed var(--brand); border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); text-align: center; cursor: pointer; }
.drop b { font-size: 17px; font-weight: 600; }
.drop span { font-size: 14px; color: var(--muted); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop.over { background: #fbe0c6; }
.drop.busy { opacity: .6; pointer-events: none; }
.bar-prog { height: 8px; margin-top: 12px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-prog i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.notice { padding: 10px 12px; margin-top: 12px; border-radius: 8px; font-size: 14px; }
.notice.info { background: #edf1f5; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.fallback { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; background: #edf1f5; border-radius: 8px; font-size: 14px; }
.fallback img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; background: #dfe4ea; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* save bar */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(7, 15, 28, .08); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.savebar-in { display: flex; gap: 10px; max-width: 1040px; margin: 0 auto; }
.savebar .btn { flex: 1; }
.savebar .btn.primary { flex: 2; }

/* toast and dialogs */
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 40; display: flex; justify-content: center; pointer-events: none; }
body.has-bar #toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
.toast { max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--ok); color: #fff; font-weight: 500; box-shadow: 0 6px 22px rgba(7, 15, 28, .28); pointer-events: auto; }
.toast.bad { background: var(--bad); }
dialog { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 0; border-radius: 14px; box-shadow: 0 16px 48px rgba(7, 15, 28, .36); color: var(--ink); }
dialog::backdrop { background: rgba(7, 15, 28, .62); }
dialog h2 { margin-bottom: 8px; }
.dlg-acts { display: flex; gap: 10px; margin-top: 16px; }
.dlg-acts .btn { flex: 1; }
dialog.zoom { width: min(1000px, calc(100vw - 16px)); padding: 8px; background: var(--navy); color: #fff; }
dialog.zoom img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; }
dialog.zoom .btn { width: 100%; margin-top: 8px; }

/* sign in */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--navy); }
.login { width: 100%; max-width: 380px; padding: 24px; background: var(--card); border-top: 4px solid var(--orange); border-radius: 12px; }
.login img { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; object-fit: contain; background: #fff; }
.login h1 { text-align: center; }
.login p.sub { text-align: center; color: var(--muted); }
.login .btn { width: 100%; margin-top: 16px; }

/* help */
.help h2 { margin-top: 2px; }
.help ol { margin: 8px 0 0; padding-left: 22px; }
.help li { margin-bottom: 6px; }
.lang { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.lang button { min-height: 46px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: 600 15px Barlow, system-ui, sans-serif; cursor: pointer; }
.lang button.on { background: var(--navy); border-color: var(--navy); color: #fff; }

@media (min-width: 620px) {
  .filters.open { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 860px) {
  .nav { position: static; display: flex; justify-content: center; gap: 4px; padding: 0; background: var(--navy-2); }
  .nav a { flex-direction: row; gap: 8px; height: 48px; padding: 0 22px; border-top: 0; border-bottom: 3px solid transparent; font-size: 15px; }
  .nav a.on { border-bottom-color: var(--orange); }
  body.has-bar .nav { display: flex; }
  main, body.has-bar main { padding: 22px 24px 96px; }
  #toast { bottom: 24px; }
  body.has-bar #toast { bottom: 84px; }
  .cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 16px; align-items: start; }
}
