:root {
  --bg: #eef5f7;
  --paper: #ffffff;
  --ink: #12212d;
  --muted: #6b7a86;
  --line: #dce7ec;
  --accent: #087ea4;
  --accent-2: #11a3b7;
  --danger: #b42318;
  --success: #157347;
  --warning-bg: #fff8db;
  --shadow: 0 18px 50px rgba(18, 33, 45, .12);
  --radius-xl: 28px;
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; background: radial-gradient(circle at top left, rgba(17,163,183,.22), transparent 40%), var(--bg); }
a { color: inherit; }
button, input, textarea { font: inherit; }

/* Guest app */
.guest-body { min-height: 100vh; }
.phone-shell { width: min(720px, 100%); margin: 0 auto; min-height: 100vh; background: linear-gradient(180deg, #f8fcfd, #eef5f7); box-shadow: 0 0 0 1px rgba(18,33,45,.04); }
.app-hero { padding: 22px 18px 20px; background: linear-gradient(135deg, #075f7e, #087ea4 52%, #11a3b7); color: #fff; border-bottom-left-radius: 34px; border-bottom-right-radius: 34px; position: relative; overflow: hidden; }
.app-hero::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.13); top: -80px; right: -65px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; opacity: .78; }
.app-hero h1 { font-size: clamp(28px, 7vw, 46px); line-height: .98; margin: 9px 0 8px; max-width: 480px; }
.subtitle { margin: 0; opacity: .9; font-size: 15px; line-height: 1.45; }
.lang-switch { display: flex; gap: 7px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.lang-pill { padding: 7px 9px; border-radius: 999px; text-decoration: none; color: #fff; font-weight: 800; font-size: 12px; }
.lang-pill.active { background: #fff; color: #075f7e; }
.location-card { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; margin-top: 22px; padding: 13px; border-radius: 20px; background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px); }
.location-icon { width: 42px; height: 42px; display: grid; place-items: center; background: rgba(255,255,255,.18); border-radius: 14px; font-size: 22px; }
.location-card strong { display: block; font-size: 15px; }
.location-card span { display: block; margin-top: 3px; opacity: .86; font-size: 13px; }
.quick-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.quick-btn { text-decoration: none; padding: 12px 8px; border-radius: 17px; background: #fff; color: #075f7e; font-weight: 850; text-align: center; box-shadow: 0 10px 22px rgba(0,0,0,.12); font-size: 13px; }
.quick-btn span { display: block; font-size: 20px; margin-bottom: 2px; }
.app-main { padding: 16px; }
.status-banner { padding: 14px 15px; border-radius: 20px; background: var(--warning-bg); color: #5f4600; border: 1px solid #f2dda0; line-height: 1.35; font-size: 14px; margin: 2px 0 14px; }
.status-banner.success { background: #e8f8ee; border-color: #bce9cd; color: #0f5132; }
.search-wrap { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 12px 14px; box-shadow: 0 10px 24px rgba(18,33,45,.06); position: sticky; top: 8px; z-index: 5; }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.section-pills { display: flex; gap: 9px; overflow-x: auto; padding: 13px 1px 10px; scrollbar-width: none; }
.section-pills::-webkit-scrollbar { display: none; }
.section-pills a { flex: 0 0 auto; text-decoration: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.78); color: #1c3a48; font-weight: 750; font-size: 13px; }
.top-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 5px 0 16px; }
.mini-card { min-width: 0; padding: 13px 10px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 22px rgba(18,33,45,.05); }
.mini-card span { font-size: 22px; }
.mini-card small { display: block; margin-top: 8px; color: var(--muted); font-weight: 700; font-size: 11px; }
.mini-card strong { display: block; margin-top: 4px; font-size: 15px; }
.guide-section { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 17px; margin: 14px 0; box-shadow: 0 12px 32px rgba(18,33,45,.075); scroll-margin-top: 82px; }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.section-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; background: linear-gradient(135deg, rgba(8,126,164,.13), rgba(17,163,183,.2)); font-size: 23px; }
.section-heading h2 { margin: 0; line-height: 1.1; font-size: 22px; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.item-list { display: grid; gap: 10px; }
.guide-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border-radius: 18px; background: #f8fbfc; border: 1px solid #edf3f5; }
.item-content { min-width: 0; }
.item-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.item-value { white-space: pre-line; line-height: 1.42; font-size: 15px; }
.item-link { color: var(--accent); font-weight: 850; }
.secret-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; font-weight: 850; color: #0e4f69; }
.copy-btn { border: 0; border-radius: 999px; padding: 9px 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 850; cursor: pointer; }
.locked-box { background: repeating-linear-gradient(-45deg, #fff, #fff 12px, #f9fbfc 12px, #f9fbfc 24px); }
.app-footer { text-align: center; color: var(--muted); padding: 22px 16px 38px; font-weight: 700; }
.app-footer small { display: block; margin-top: 4px; font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: #12212d; color: #fff; padding: 12px 17px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 800; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Admin */
.admin-body { background: #edf3f6; }
.admin-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; width: min(1280px, 100%); margin: 0 auto; padding: 18px; }
.admin-layout.single { display: block; width: min(920px, 100%); }
.admin-sidebar { position: sticky; top: 18px; align-self: start; background: #083e55; color: #fff; border-radius: 28px; padding: 20px; box-shadow: var(--shadow); }
.brand-box h1 { font-size: 25px; line-height: 1.05; margin: 10px 0 8px; }
.brand-box p { color: rgba(255,255,255,.78); margin: 0; }
.admin-nav { display: grid; gap: 8px; margin: 22px 0; }
.admin-nav a, .admin-links a { display: block; text-decoration: none; padding: 11px 13px; border-radius: 15px; background: rgba(255,255,255,.1); color: #fff; font-weight: 780; }
.admin-links { display: grid; gap: 8px; margin-top: 20px; }
.admin-links a { background: #fff; color: #083e55; }
.admin-content { min-width: 0; }
.admin-hero, .admin-card { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 20px; box-shadow: 0 12px 32px rgba(18,33,45,.07); margin-bottom: 16px; }
.admin-hero { background: linear-gradient(135deg, #083e55, #087ea4); color: #fff; margin-bottom: 18px; }
.admin-hero h1 { margin: 8px 0; font-size: 34px; }
.admin-hero p { margin: 0; color: rgba(255,255,255,.82); }
.admin-card h2 { margin: 0 0 14px; font-size: 23px; }
.admin-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.admin-card-head h2 { margin: 0; }
.admin-card-head span { padding: 7px 10px; border-radius: 999px; background: #eef7fa; color: #075f7e; font-weight: 850; font-size: 12px; }
.guide-list { display: grid; gap: 10px; }
.guide-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); text-decoration: none; background: #f8fbfc; }
.guide-row strong { display: block; }
.guide-row small { display: block; color: var(--muted); margin-top: 3px; }
.inline-form { display: flex; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
label { display: grid; gap: 7px; margin: 12px 0; color: #35515f; font-weight: 800; font-size: 13px; }
input, textarea { width: 100%; border: 1px solid #d7e4ea; border-radius: 15px; padding: 12px 13px; background: #fbfdfe; color: var(--ink); outline: none; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(8,126,164,.12); }
textarea { min-height: 86px; resize: vertical; line-height: 1.4; }
textarea.tall { min-height: 170px; }
.json-editor { min-height: 560px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
button { border: 0; border-radius: 15px; padding: 12px 16px; background: var(--accent); color: #fff; font-weight: 900; cursor: pointer; }
.hint { color: var(--muted); margin-top: -4px; line-height: 1.42; }
code { background: #eef5f7; padding: 2px 6px; border-radius: 6px; }
.private-card { border-color: #ffdd9a; background: linear-gradient(180deg, #fffaf0, #fff); }
.admin-alert { padding: 14px 16px; border-radius: 18px; margin-bottom: 14px; font-weight: 800; }
.admin-alert.success { background: #e8f8ee; color: var(--success); border: 1px solid #bce9cd; }
.admin-alert.error { background: #fff0ee; color: var(--danger); border: 1px solid #ffc9c3; }
.sticky-save { position: sticky; bottom: 14px; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 22px; background: rgba(255,255,255,.88); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); margin: 18px 0; }
.sticky-save a { color: #075f7e; font-weight: 850; text-decoration: none; }

@media (max-width: 860px) {
  .admin-layout { display: block; padding: 10px; }
  .admin-sidebar { position: static; margin-bottom: 12px; }
  .admin-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .inline-form { display: grid; }
}

@media (max-width: 430px) {
  .app-hero { border-bottom-left-radius: 28px; border-bottom-right-radius: 28px; }
  .hero-top { display: block; }
  .lang-switch { width: fit-content; margin-top: 14px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .top-grid { grid-template-columns: 1fr; }
  .guide-item { align-items: flex-start; }
  .copy-btn { flex: 0 0 auto; }
}
