:root {
  --bg: #fff; --card: #fff; --border: #e6e9f2; --text: #14192b; --dim: #64708a;
  --accent: #2b3a67; --accent-2: #4f8cff; --soft: #f5f7fb;
  --ok: #1e9e63; --warn: #d18700; --err: #d64545;
  --radius: 14px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #171b23; --border: #262c38; --text: #e6e9ef; --dim: #98a1b3;
    --accent: #dfe6ff; --accent-2: #6ea0ff; --soft: #12151c;
    --ok: #3ecf8e; --warn: #f5a623; --err: #ff5c5c; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ── Шапка ── */
.header { border-bottom: 1px solid var(--border); background: var(--card); }
.navbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { font-weight: 700; font-size: 19px; color: var(--text); }
.brand span { color: var(--dim); font-weight: 500; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--dim); font-weight: 500; font-size: 15px; white-space: nowrap; }
@media (max-width: 560px) {
  .navbar { height: 58px; }
  .brand { font-size: 17px; }
  .nav { gap: 14px; }
  .nav a { font-size: 14px; }
}
@media (max-width: 400px) { .nav { display: none; } }

/* ── Пошук ── */
.hero { padding: 56px 0 34px; text-align: center; }
.hero h1 { font-size: clamp(24px, 3.4vw, 38px); line-height: 1.25; margin: 0 0 14px; letter-spacing: -.02em; }
.lead { color: var(--dim); max-width: 720px; margin: 0 auto 26px; }
.search-form { max-width: 780px; margin: 0 auto; }
.input-group { display: flex; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden; transition: border-color .15s; }
.input-group:focus-within { border-color: var(--accent-2); }
.input-group .form-control { flex: 1; min-width: 0; font: inherit; font-size: 17px;
  padding: 16px 18px; border: none; background: transparent; color: var(--text); }
.input-group .form-control:focus { outline: none; }
.btn-search { font: inherit; font-weight: 600; padding: 0 30px; border: none; cursor: pointer;
  background: var(--accent-2); color: #fff; display: flex; align-items: center; gap: 9px; }
.btn-search:disabled { opacity: .65; cursor: default; }
.is-loading .btn-search .label { opacity: .8; }
.btn-search .spinner { display: none; }
.is-loading .btn-search .spinner { display: inline-block; }
@media (max-width: 620px) {
  .input-group { flex-direction: column; }
  .btn-search { padding: 14px; justify-content: center; }
}

/* Збережені номери — чипси під пошуком */
.recent { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 0; margin: 18px auto 0; max-width: 900px; }
.recent li { display: flex; align-items: center; gap: 2px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); padding: 4px 6px 4px 12px; }
.recent a { font-family: var(--mono); font-size: 14px; color: var(--text); }
.recent button { border: none; background: none; cursor: pointer; font-size: 13px;
  color: var(--dim); padding: 4px 5px; border-radius: 7px; }
.recent button:hover { background: var(--soft); color: var(--text); }

/* ── Результат ── */
.tracking-info { padding: 8px 0 20px; }
.tracking-info.empty { display: none; }
.tracking-info h2 { font-size: 18px; text-align: center; margin: 0 0 18px; font-weight: 600; }
.tracking-info .number { font-family: var(--mono); }

/* ── Текстові секції ── */
.section { padding: 60px 0; }
.section h2 { font-size: clamp(21px, 2.4vw, 28px); margin: 0 0 12px; text-align: center; }
.section .lead { margin-bottom: 34px; }
.muted-bg { background: var(--soft); }
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.info-card h3 { margin: 0 0 8px; font-size: 17px; }
.info-card p { margin: 0; color: var(--dim); font-size: 15px; }
.info-card code { font-family: var(--mono); font-size: 13.5px; background: var(--soft);
  padding: 1px 5px; border-radius: 5px; }

/* Блок служби/магазину: логотип згори, як на seguimiento */
.single-feature { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; }
.single-feature .icon { width: 80px; height: 80px; margin-bottom: 16px; display: flex;
  align-items: center; justify-content: center; }
.single-feature .icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.single-feature h3 { margin: 0 0 10px; font-size: 19px; }
.single-feature h3 a { color: var(--text); }
.single-feature p { margin: 0; color: var(--dim); font-size: 14.5px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Приклади формату номера */
.mark { background: var(--soft); border-radius: 9px; padding: 10px 12px; margin: 10px 0 0;
  font-family: var(--mono); font-size: 14px; }
.mark strong { font-family: Montserrat, sans-serif; font-size: 13px; color: var(--text); }
.mark .c1 { color: #2f7fd6; } .mark .c2 { color: #d64545; } .mark .c3 { color: #1e9e63; }

/* Кнопка-заклик */
.main-btn { display: inline-block; background: var(--accent-2); color: #fff; font-weight: 600;
  padding: 13px 30px; border-radius: 10px; }
.main-btn:hover { text-decoration: none; opacity: .92; }
.cta-btn { text-align: center; margin-top: 30px; }
.cta-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 26px;
  flex-wrap: wrap; background: var(--soft); border: 1px solid var(--border);
  border-radius: 18px; padding: 34px; }
.cta-wrapper h2 { text-align: left; margin-bottom: 8px; }
.cta-wrapper p { margin: 0; color: var(--dim); max-width: 640px; }

/* Приклади коду на головній */
.code { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; text-align: left; margin: 0 0 16px; }
.code code { font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: var(--text);
  white-space: pre; }
.section code { font-family: var(--mono); font-size: 13px; background: var(--soft);
  padding: 1px 6px; border-radius: 5px; }
.info-card h3 code { background: none; padding: 0; font-size: 14.5px; }
.main-btn.ghost { background: transparent; color: var(--accent-2); border: 1px solid var(--border); margin-left: 10px; }
.hero .cta-btn { margin-top: 26px; }

/* Підвал у чотири колонки */
.footer-cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  text-align: left; }
.footer-cols h3 { font-size: 15px; margin: 0 0 12px; color: var(--text); }
.footer-cols a, .footer-cols span { display: block; margin-bottom: 8px; font-size: 14px; }
.footer-cols .copyright { color: var(--dim); }
#talk-view:empty { display: none; }

/* Картка служби: логотип або ініціали + назва й сайт */
.courier-card { display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.courier-logo { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.courier-logo img { width: 100%; height: 100%; object-fit: contain; }
.courier-logo .initials { font-weight: 700; font-size: 15px; color: var(--dim); letter-spacing: .5px; }
.courier-body { min-width: 0; }
.courier-card h3 { margin: 0 0 2px; font-size: 16px; }
.courier-card p { margin: 0; font-size: 13.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-mark { margin-right: 4px; }

/* ── Підвал ── */
.footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: 40px; color: var(--dim); font-size: 14px; }
.footer { padding: 40px 0 30px; }

.wrap { max-width: 780px; margin: 0 auto; }
#root .wrap { padding: 28px 18px 80px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }

.search { display: flex; gap: 10px; margin-bottom: 12px; }
.search input { flex: 1; font: inherit; font-size: 17px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); color: var(--text); }
.search input:focus { outline: none; border-color: var(--accent); }
.search button { font: inherit; font-weight: 600; padding: 0 26px; border-radius: var(--radius);
  border: none; background: var(--accent); color: #fff; cursor: pointer; }
.search button:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) { .search { flex-direction: column; } .search button { padding: 14px; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.muted { color: var(--dim); }
.small { font-size: 13.5px; }
.mono { font-family: var(--mono); }

.extra { border-color: var(--accent); }
.extra label { display: block; margin-bottom: 10px; }
.extra .lbl { display: block; font-size: 13px; color: var(--dim); margin-bottom: 4px; }
.extra input, .extra select { width: 100%; font: inherit; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.extra .row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .extra .row { grid-template-columns: 1fr; } }
.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--dim);
  background: var(--bg); border-radius: 9px; padding: 10px 12px; margin-top: 4px; }

.headline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.headline h1 { font-size: 21px; margin: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.badge.delivered { background: rgba(30,158,99,.14); color: var(--ok); }
.badge.transit { background: rgba(79,140,255,.14); color: var(--accent); }
.badge.problem { background: rgba(214,69,69,.14); color: var(--err); }
.badge.pending { background: rgba(100,112,138,.15); color: var(--dim); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact .k { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.fact .v { font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 26px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--border); border: 2px solid var(--card); }
.timeline li.now::before { background: var(--accent); }
.timeline li.delivered::before { background: var(--ok); }
.timeline li.problem::before { background: var(--err); }
.timeline .st { font-weight: 600; }
.timeline .meta { color: var(--dim); font-size: 13.5px; }

.carriers { display: flex; gap: 8px; flex-wrap: wrap; }
.carriers a, .carriers span { font-size: 13px; padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 20px; text-decoration: none; color: var(--dim); }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(127,127,127,.3); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--dim); padding: 26px 12px; }

.actions { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.linklike { background: none; border: none; padding: 0; font: inherit; font-size: 13.5px;
  color: var(--accent); cursor: pointer; }
.linklike:hover { text-decoration: underline; }

.saved { list-style: none; margin: 0; padding: 0; }
.saved li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.saved li:last-child { border-bottom: none; }
.saved li a { flex: 1; display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: var(--text); }
.saved .nm { font-weight: 600; }

.flash { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; z-index: 40; }
