/* Shared trip page. Colors come from /css/style.css (light and dark). No inline styles: the page's
   content-security-policy only allows this file, so positions are set from script through the style object. */
#app { padding-top: 20px; }
#app h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: -.02em; }
#app h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 14px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols .card { margin: 0; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.btn { font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.danger { color: var(--red); }
.btn.on { background: var(--soft); border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.agent { background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.banner { background: var(--amber-bg); color: var(--amber); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.red { background: var(--red-bg); color: var(--red); }
.head-title { cursor: pointer; }
.totals { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 0; }
.totals div { font-size: 14px; color: var(--muted); }
.totals b { display: block; font-size: 20px; color: var(--ink); }

/* the hour grid */
.tg-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); max-height: 78vh; margin: 12px 0; }
.tg { display: flex; min-width: max-content; }
.tg-col { flex: 0 0 190px; border-left: 1px solid var(--line); }
.tg-clock { flex: 0 0 104px; position: sticky; left: 0; z-index: 3; background: var(--card); border-left: 0; border-right: 1px solid var(--line); }
.tg-head { height: 66px; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--card); overflow: hidden; }
.tg-clock .tg-head { z-index: 4; display: grid; grid-template-columns: 1fr 1fr; align-items: end; font-size: 12px; color: var(--muted); }
.tg-head .dl { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-head .dp { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.tg-head { display: block; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tg-body { position: relative; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour, 44px); }
.tg-body.can { cursor: copy; }
.tg-hour { height: var(--hour, 44px); display: grid; grid-template-columns: 1fr 1fr; font-size: 12px; padding: 2px 6px; color: var(--muted); border-top: 1px solid var(--line); }
.tg-hour b { color: var(--ink); font-weight: 600; }
.tg-foot { border-top: 1px solid var(--line); padding: 6px 8px; font-size: 12px; color: var(--muted); min-height: 58px; }
.tg-foot b { color: var(--ink); }
.chip { position: absolute; left: 2px; box-sizing: border-box; overflow: hidden; text-align: left; font: inherit; font-size: 12.5px; line-height: 1.25; padding: 2px 6px;
  border: 0; border-left: 3px solid var(--c, var(--brand)); border-radius: 6px; cursor: pointer; color: var(--ink);
  background: color-mix(in srgb, var(--c, var(--brand)) 15%, var(--card)); }
.chip:hover { outline: 2px solid var(--c, var(--brand)); z-index: 1; }
.chip .ct { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.chip .cs { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.fresh, .li.fresh { animation: fresh 6s ease-out; }
@keyframes fresh { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ty-flight { --c: #2563eb; } .ty-travel { --c: #64748b; } .ty-hotel { --c: #7c3aed; } .ty-food { --c: #c2410c; }
.ty-activity { --c: #0f766e; } .ty-sleep { --c: #94a3b8; } .ty-other { --c: #a16207; }

/* list view (the default on a phone) */
.day-card h3 { margin: 0; font-size: 16px; }
.li { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: start; padding: 7px 8px; border-left: 3px solid var(--c, var(--brand)); border-radius: 6px; margin: 5px 0;
  background: color-mix(in srgb, var(--c, var(--brand)) 9%, var(--card)); width: 100%; text-align: left; font: inherit; color: inherit; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.li .tm { font-size: 13px; color: var(--muted); }
.li .tm b { color: var(--ink); display: block; }
.li .ti { font-weight: 600; overflow-wrap: anywhere; }
.li .sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.li .co { font-size: 14px; white-space: nowrap; text-align: right; }

/* lists */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
ul.plain li:last-child { border-bottom: 0; }
ul.plain li .grow { flex: 1; overflow-wrap: anywhere; }
.done { text-decoration: line-through; color: var(--muted); }
.look-day { margin: 8px 0 2px; font-weight: 700; font-size: 14px; }

/* forms and dialogs */
input[type=text], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], select, textarea {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 70px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 3px; color: var(--ink); }
label.c { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .three { grid-template-columns: 1fr 1fr; } }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 18px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog h2 { margin: 0 0 6px; font-size: 20px; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.actions .gap { flex: 1; }
pre.copy { background: var(--soft); border-radius: 8px; padding: 10px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; margin: 8px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.sect { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px); font-size: 14px; }
label.c.small { margin: 0 8px 0 0; display: inline-flex; }
/* sign-in sits in the top right corner, where people look for it */
.acct { display: flex; gap: 10px; align-items: center; font-size: 14px; margin-left: 4px; white-space: nowrap; }
.acct a { color: var(--muted); text-decoration: none; }
.acct a:hover { color: var(--ink); }
.acct .who { color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .acct .who { display: none; } }
.hidden { display: none !important; }
@media print { header.top, footer.foot, .no-print, .toast { display: none !important; } .tg-wrap { max-height: none; overflow: visible; } }

/* a private block as other people see it: the time is taken, nothing more */
.chip.hid, .li.hid { --c: var(--muted); color: var(--muted); cursor: default;
  background: repeating-linear-gradient(135deg, var(--soft) 0 8px, var(--card) 8px 16px); }
