:root {
  --ink: #0f1b2d;
  --text: #344256;
  --muted: #64748b;
  --line: #e4e8ee;
  --bg: #f4f6f9;
  --card: #ffffff;
  --accent: #1f5f8b;
  --accent-dark: #174a6d;
  --accent-soft: #e8f1f8;
  --gold: #c6a66b;
  --good: #1f7a4d;
  --good-bg: #e7f4ec;
  --bad: #b3261e;
  --bad-bg: #fbeaea;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .05);
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { color: var(--ink); margin: 0 0 12px; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; margin-top: 18px; }

/* Header */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(15, 27, 45, .02); }
.bar { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand span { color: var(--ink); }
.site-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.site-nav a:hover { background: var(--bg); color: var(--ink); }
.site-nav a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); font-size: 14px; line-height: 1.2; }
.who .sub { font-weight: 400; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.acting { background: #fff7e6; border-top: 1px solid #f3e1b8; color: #6b4e10; font-size: 14px; display: flex; gap: 12px; justify-content: center; align-items: center; padding: 6px 16px; flex-wrap: wrap; }
.tabs { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs[hidden] { display: none; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 11px 14px; border-bottom: 2px solid transparent; border-radius: 0; font-weight: 600; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card.soft { background: #f9fbfd; box-shadow: none; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #d1d7e0; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 95, 139, .15); }
button, .btn { font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; transition: background .15s, border-color .15s; }
button:hover, .btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button:disabled { opacity: .6; cursor: progress; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(31, 95, 139, .35); outline-offset: 2px; }
button.secondary { background: #fff; color: var(--accent); border-color: #c9d6e2; }
button.secondary:hover { background: var(--accent-soft); }
button.danger { background: #fff; color: var(--bad); border-color: #e3b4b0; }
button.danger:hover { background: var(--bad-bg); }
button.link { background: none; border: 0; color: var(--accent); padding: 4px 6px; }
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { color: var(--bad); }
button.link.light { color: #6b4e10; text-decoration: underline; }
button.small, .btn.small { padding: 6px 12px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.search-grid .wide { grid-column: span 2; }
@media (max-width: 420px) { .search-grid .wide { grid-column: auto; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.req { color: var(--bad); }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
.mb { margin-bottom: 12px; }
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.sources label { font-weight: 600; }
.sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.toolbar { flex-wrap: wrap; }
.toolbar label:nth-of-type(n+2) { min-width: 200px; }
td.narrow, th.narrow { width: 90px; }
.competitor {border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 14px; background: #fafbfc; }
.competitor > label { margin-bottom: 8px; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 12px 0; background: var(--bg); }
.toolbar { display: flex; align-items: end; gap: 16px; margin-bottom: 20px; }
.toolbar label { min-width: 280px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eee; }
.badge.pending { background: #fff4dc; color: #8a5a00; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .badge.pending { animation: none; } }
.badge.done { background: var(--good-bg); color: var(--good); }
.mine-row td { background: #f1f5f9; font-weight: 600; }
.cheaper { color: var(--good); }
.dearer { color: var(--bad); }
.best { background: var(--good-bg); }
td.cheapest { background: var(--good-bg); }
a.shot { display: block; margin: 6px 0 0 auto; width: 170px; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
a.shot img { display: block; width: 100%; height: auto; max-height: 140px; object-fit: contain; }
a.shot:hover { border-color: var(--accent); }
.f-channels-wrap { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 12px 10px; margin: 12px 0 0; }
.f-channels-wrap legend { font-size: 14px; padding: 0 4px; }
.f-channels { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.f-channels label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; white-space: nowrap; }
.f-channels label.all { font-weight: 600; flex-basis: 100%; }
.f-channels input { width: 16px; height: 16px; margin: 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.info-grid .wide { grid-column: span 2; }
@media (max-width: 460px) { .info-grid .wide { grid-column: auto; } }
.ch-group h3 { margin: 18px 0 6px; }
.ch-row .ch-member { margin: 0; }
.ch-row .ch-member:disabled { background: #f3f4f6; }
.member { color: #7a5a12; }
.ch-row .ch-comm-wrap { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; white-space: nowrap; }
.ch-row .ch-comm { width: 70px; margin: 0; }
.ch-row .ch-comm:disabled { background: #f3f4f6; }
.net { color: var(--ink); font-weight: 600; }
.ch-row { display: grid; grid-template-columns: 24px minmax(160px, 1fr) minmax(180px, 2fr) 170px 170px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eef0f3; }
.ch-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.ch-row .ch-url { margin: 0; }
.ch-row .ch-url:disabled { background: #f3f4f6; }
.ch-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 6px; background: #eef0f3; color: #555; white-space: nowrap; }
.ch-tag.ok { background: #e3f1e6; color: #1f6b35; }
.add-channel { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; margin-top: 16px; }
@media (max-width: 600px) { .ch-row { grid-template-columns: 24px 1fr; } .ch-row .ch-url, .ch-row .ch-member, .ch-row .ch-comm-wrap { grid-column: 2; } .add-channel { grid-template-columns: 1fr; } }
.alerts { border: 1px solid #e3b4b0; background: #fdf6f5; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.alerts.ok { border-color: #bfe0cb; background: var(--good-bg); color: var(--good); font-weight: 600; font-size: 14px; }
.alerts h2 { font-size: 16px; color: var(--bad); margin-bottom: 6px; }
.alerts ul { margin: 0; padding: 0; list-style: none; }
.alerts li { padding: 6px 0; border-bottom: 1px solid #f0dcd9; color: var(--ink); font-weight: 600; font-size: 14px; }
.alerts li:last-child { border-bottom: 0; }
.alerts li .sub { margin-top: 2px; }
.alert-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; margin-right: 4px; vertical-align: 1px; }
.alerts li.bad .alert-tag { background: var(--bad); color: #fff; }
.alerts li.warn .alert-tag { background: #fbf0d9; color: #7a5a12; }
.alerts li.info .alert-tag { background: #eef0f3; color: #555; }
#tab-periodic h3 { margin-top: 20px; }
#periodic-form .end { margin-top: 4px; }
.suggestions { border-left: 4px solid #C6A66B; }
div.suggestions:not(.card) { margin-bottom: 16px; padding-left: 12px; }
.suggestions p { margin: 6px 0 10px; }
.action { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.action.up { background: #e3f1e6; color: #1f6b35; }
.action.down { background: #f7e1df; color: #9b2c22; }
.action.keep { background: #eef0f3; color: #555; }
.action.check { background: #fbf0d9; color: #7a5a12; }
.summary { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.summary div { font-size: 13px; }
.summary strong { display: block; font-size: 18px; color: var(--ink); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
@media (max-width: 700px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .card { padding: 14px; overflow-x: auto; }
}

/* ---------- Accounts and public pages ---------- */
.view[hidden] { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; margin-bottom: 4px; }
.page-head p { margin: 0; }
.stack { display: grid; gap: 14px; }
.wide-btn { width: 100%; padding: 11px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-msg { margin: 0; font-size: 14px; font-weight: 500; }
.form-msg:empty { display: none; }
.form-msg.bad { color: var(--bad); background: var(--bad-bg); padding: 8px 12px; border-radius: 8px; }
.form-msg.ok { color: var(--good); background: var(--good-bg); padding: 8px 12px; border-radius: 8px; }
.bad { color: var(--bad); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.auth { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 48px; align-items: center; max-width: 980px; margin: 4vh auto 0; }
#view-forgot, #view-reset { grid-template-columns: minmax(300px, 420px); justify-content: center; }
.auth-card { padding: 32px; margin: 0; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card > .muted { margin: 0 0 20px; }
.auth-links { text-align: center; margin: 18px 0 0; font-size: 14px; }
.auth-side h2 { font-size: 30px; line-height: 1.2; margin-bottom: 18px; }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' fill='none' stroke='%231f5f8b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat; }

fieldset.plain { border: 0; padding: 0; margin: 0 0 18px; }
fieldset.plain legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; padding: 0; }
fieldset.plain[hidden] { display: none; }
.lookup-msg { margin: 4px 0 0; }
.lookup-msg .badge { margin-right: 6px; }
table.users td.actions { text-align: right; white-space: nowrap; }
table.users tr.current td { background: #fff7e6; }
table.users td .sub { margin-top: 2px; }
table.users tbody tr:hover td { background: #f9fbfd; }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
.prose .card { max-width: 820px; }
.prose p, .prose li { max-width: 72ch; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.faq { padding: 6px 22px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 2px; }
.message p { margin: 4px 0; }
.pre { white-space: pre-wrap; color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 18px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.foot-in nav { display: flex; gap: 18px; }
.foot-in a { color: var(--muted); text-decoration: none; }
.foot-in a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .auth, .two-col { grid-template-columns: 1fr; gap: 24px; margin-top: 0; }

  .auth-side h2 { font-size: 24px; }
}
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; gap: 8px 12px; }
  .site-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .who > span:last-child { display: none; }
  .auth-card { padding: 22px; }
  table.users td.actions { white-space: normal; }
}

/* Inbox */
.site-nav .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.inbox-msg { padding: 14px 20px; margin-bottom: 10px; }
.inbox-msg summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.inbox-msg summary::-webkit-details-marker { display: none; }
.inbox-msg summary .muted { margin-left: auto; }
.inbox-msg .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.inbox-msg.unread .dot { background: var(--accent); }
.inbox-msg:not(.unread) summary strong { font-weight: 500; }
.inbox-msg[open] summary { margin-bottom: 8px; }
.section-title { margin: 28px 0 12px; font-size: 16px; }

/* Hotels to compare: suggestions, automatic set-up and details */
.c-head { display: flex; gap: 12px; align-items: flex-end; }
.c-head label { flex: 1; margin-bottom: 8px; }
.c-head .c-more { margin-bottom: 8px; white-space: nowrap; }
#find-hotels { white-space: nowrap; flex-shrink: 0; }
.c-more .caret { display: inline-block; transition: transform .15s; }
.c-more[aria-expanded="true"] .caret { transform: rotate(180deg); }
.c-setup:empty { display: none; }
.c-setup { margin: 0 0 10px; }
.c-details { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 14px 16px; margin-bottom: 14px; }
.c-details h3 { font-size: 14px; margin: 0 0 8px; }
.c-details h3 + p { margin-top: 0; }
.c-details .ch-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.c-details .ch-list li { border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 13px; background: var(--bg); }
.c-details .ch-list li.off { color: var(--muted); }
.c-details table { font-size: 13px; }
.c-details td.none { color: var(--muted); }
.sugg-list { display: grid; gap: 10px; margin-top: 14px; }
.sugg { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fafbfc; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.sugg h3 { font-size: 15px; margin: 0 0 2px; }
.sugg p { margin: 4px 0 0; font-size: 13px; }
.sugg .links { font-size: 13px; margin-top: 4px; }
.sugg .links a { margin-right: 10px; }
.sugg .actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
#suggest-status:empty { display: none; }
#suggest-status { margin-top: 12px; }
@media (max-width: 640px) { .sugg { flex-direction: column; } .sugg .actions { flex-direction: row; } .c-head { flex-direction: column; align-items: stretch; } }
.c-details .table-wrap { overflow-x: auto; }
.competitor .c-name[readonly] { background: var(--bg); color: var(--ink); cursor: default; box-shadow: none; border-color: var(--line); }
/* Short list of compared hotels: name + summary; More opens details; Edit hotel opens the form */
.competitor { padding: 12px 16px; margin-bottom: 10px; }
.competitor .c-head label { margin-bottom: 2px; }
.competitor .c-name[readonly] { border-color: transparent; background: transparent; font-weight: 600; font-size: 16px; padding-left: 0; }
.c-summary { margin: 0 0 4px; }
.c-body { margin-top: 10px; }
.c-details { margin-bottom: 12px; }
.c-details h3 { margin-top: 14px; }
.det-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.det-ch { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); font-size: 13px; }
.det-ch.off { color: var(--muted); }
.det-label { display: block; font-weight: 600; color: var(--ink); }
.det-ch.off .det-label { color: var(--muted); }
.det-actions { margin-top: 14px; flex-wrap: wrap; }
.det-actions button { margin-left: 6px; }
.c-edit { border-top: 1px solid var(--line); padding-top: 12px; }
.competitor.saved .c-name-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.c-head-actions { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; white-space: nowrap; }
.c-head-actions .c-more { margin-bottom: 0; }
.c-confirm { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; padding: 10px 12px; border: 1px solid #f1c4c4; border-radius: 8px; background: var(--bad-bg); color: var(--ink); font-size: 14px; }
.c-confirm button { margin-left: 6px; }
