/* {{PRODUCT_NAME}}: the parts added for the paid service (Advanced per calendar, the trial line, Billing, the audit
   log). Colours are the theme's own variables only, so the light and the dark theme both hold without a dark
   layer of their own; layout follows style.css. */

/* Advanced: a calendar's filters and the look of its copies (Calendars editor, guide step 3) */
details.adv { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 6px; min-width: 0; }
.acc > details.adv { margin-top: -10px; border-top: 0; }
details.adv > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; font-weight: 500; color: var(--body); }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: "+"; width: 16px; text-align: center; color: var(--faint); }
details.adv[open] > summary::before { content: "-"; }
details.adv[open] { padding: 6px 24px 18px; background: var(--status-bg); border-radius: 14px; border-top: 0; }
.adv-sec { padding: 6px 0 4px; }
.adv-sec + .adv-sec { border-top: 1px solid var(--panel-rule); margin-top: 8px; padding-top: 12px; }
.adv-h { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin: 6px 0 2px; }
details.adv .opt-row { border-bottom-color: var(--panel-rule); }
.adv-words { margin: 14px 0 6px; max-width: 520px; }
.adv-hours { padding: 4px 0 10px; }
.adv-times { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0 12px; }
.adv-times label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); }
.adv-times input[type=time] { width: auto; }
.adv-days { display: flex; flex-wrap: wrap; gap: 6px; }
.adv-days label { position: relative; cursor: pointer; }
.adv-days input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.adv-days span { display: inline-block; min-width: 46px; padding: 6px 10px; text-align: center; border: 1px solid var(--input); border-radius: 6px; font-size: 13.5px; color: var(--body); background: var(--page); }
.adv-days input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--page); font-weight: 500; }
.adv-days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.adv-col label.own { background: var(--page); border: 1px dashed var(--slate); }
.adv-n { margin: -6px 0 6px; }
.adv-pv { font-size: 14px; color: var(--body); line-height: 1.55; margin: 12px 0 0; min-height: 1.55em; }
details.adv .actions { margin-top: 10px; }
.ob-cal > details.adv { margin-top: 2px; }
.adv-col label.src { border: 1px solid var(--line); }
.adv-cf { margin: 14px 0 0; }
.adv-work { margin: 12px 0 4px; }
.adv-cols { padding: 4px 0 8px; }
.adv-cols .adv-days + .adv-days { margin-top: 8px; }
.adv-colk span { display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize; }
/* the preview picture: your entry, an arrow, the copies; paper cards in the theme's own colours */
.adv-pic:empty { display: none; }
.adv-pic { display: grid; gap: 12px; margin: 14px 0 0; }
.cp-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.cp-r { display: grid; gap: 8px; min-width: 0; }
.cp-arrow { color: var(--faint); font-size: 18px; }
.cp-card { background: var(--page); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.cp-card.cp-off { border-style: dashed; }
.cp-k { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-t { display: flex; align-items: center; gap: 7px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.cp-w { font-size: 13px; color: var(--body); }
.cp-m { display: flex; gap: 6px; margin-top: 4px; }
.cp-m:empty { display: none; }
.cp-mk { width: 15px; height: 15px; fill: none; stroke: var(--faint); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.cp-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cp-dot.own { background: transparent; border: 1px dashed var(--slate); }
@media (max-width: 767px) {
  details.adv[open] { padding: 4px 14px 14px; }
  .adv-days span { min-width: 40px; padding: 6px 7px; }
  .cp-pair { grid-template-columns: minmax(0, 1fr); }
  .cp-arrow, [dir="rtl"] .cp-arrow.dir-flip { transform: rotate(90deg); justify-self: center; }
}

/* the trial, in the top bar: one quiet line */
.trial { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--faint); white-space: nowrap; margin-inline-end: 6px; }
.trial a { color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--rule); }
.trial a:hover { border-bottom-color: var(--ink); }
.trial { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1199px) {                    /* the top bar is full: the link alone, the days in its title, */
  .trial .tl { display: none; }                /* and Add calendar as its icon, as on a phone */
  body.has-trial .addcal { padding: 8px; border-radius: 50%; }
  body.has-trial .addcal span { display: none; }
}
/* the account's billing banner (trial ended, payment failed) */
.banner.bill { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; border-inline-start-color: var(--warn); }
.banner.bill .grow { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.banner.bill .btn { flex: none; }
.banner.bill.quiet { border-inline-start-color: var(--line); font-size: 13.5px; color: var(--faint); padding-top: 7px; padding-bottom: 7px; }
.banner.bill.quiet a { color: var(--ink); font-weight: 500; }
@media (max-width: 767px) {
  .trial { display: none; }                   /* on a phone the trial is one quiet line under the bar */
}

/* Account: Billing */
.bill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; margin: 6px 0 16px; }
.bill-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.bill-card .k { font-size: 13px; color: var(--faint); }
.bill-card .v { font-size: 17px; font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.bill-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Admin: the audit log */
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 4px 0 14px; }
.audit-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--faint); flex: 1 1 160px; min-width: 0; }
.audit-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.audit-tbl th { text-align: start; font-weight: 500; color: var(--faint); padding-block: 8px; padding-inline: 0 8px; border-bottom: 1px solid var(--line); }
.audit-tbl td { padding-block: 8px; padding-inline: 0 8px; border-bottom: 1px solid var(--line); color: var(--body); overflow-wrap: anywhere; vertical-align: top; }
.audit-tbl code { font-size: 12.5px; }
.audit-more { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
@media (max-width: 767px) {
  .audit-tbl .ip { display: none; }
}

/* Continue with Google or Microsoft: the main way in (sign-in, sign-up, landing); email and password fold away */
.pv-list { display: grid; gap: 10px; margin: 0 0 18px; }
.pv-list form { margin: 0; }
.btn.pv { background: var(--page); border: 1px solid var(--input); color: var(--ink); gap: 12px; font-size: 16px; padding: 13px 18px; border-radius: 10px; }
.btn.pv:hover { border-color: var(--slate); background: var(--hover-soft); }
.btn.pv .pv-ic svg { width: 20px; height: 20px; display: block; }
.pv-terms { font-size: 12.5px; color: var(--faint); margin: 2px 0 0; line-height: 1.5; }
.pv-terms a { color: var(--body); }
.ld-in { max-width: 380px; margin: 26px 0 6px; }
.ld-in .pv-list { margin: 0; }
.ld-or { gap: 18px; font-size: 14px; margin-top: 8px; }
.ld-or a { color: var(--body); text-underline-offset: 3px; }
details.pw-alt { margin: 4px 0 0; }
details.pw-alt > summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--body); padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
details.pw-alt > summary::-webkit-details-marker { display: none; }
details.pw-alt[open] > summary { color: var(--faint); text-decoration: none; }
details.pw-alt .login-form { margin-top: 10px; }
.err.top:empty { display: none; }
.err.top { margin: 0 0 16px; }

/* the guide: one screen */
.ob-rows { border-top: 1px solid var(--line); margin: 6px 0 22px; }
.ob-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.ob-row .grow { flex: 1; min-width: 0; }
.ob-row .nm { font-weight: 500; overflow-wrap: anywhere; }
.ob-row .sub { font-size: 13px; color: var(--faint); }
.ob-st { font-size: 14px; color: var(--faint); white-space: nowrap; }
.ob-st.ok { color: var(--ok); }
.ob-st.ok b { font-weight: 700; }
.ob-st.bad { color: var(--bad); }
.ob-adds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 10px; margin: 0 0 8px; }
.pvd.ob-add { min-height: 72px; font-size: 16px; }
.ob-code { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 26px; }
.ob-code .field { margin: 0; flex: 1 1 220px; }
.ob-code input { font-size: 22px; letter-spacing: .2em; max-width: 220px; }
.ob-write { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--status-bg); border-radius: 12px; margin: 0 0 22px; color: var(--body); }
.ob-write .grow { flex: 1; }

/* Today, at the top of the week list (today.js): three quiet lines, the theme's own colours */
.wk-today:empty { display: none; }
.wk-today { margin: 14px 26px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--body); display: grid; gap: 6px; }
.wk-today .td-h { display: flex; align-items: baseline; gap: 8px; }
.wk-today .td-h b { color: var(--ink); font-size: 14px; }
.wk-today .td-h span { color: var(--faint); }
.wk-today .td-next, .wk-today .td-free { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wk-today .td-k { flex: none; width: 38px; color: var(--faint); font-size: 12.5px; }
.wk-today .td-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.wk-today .td-free span:last-child { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.wk-today .td-join { flex: none; color: var(--accent); font-weight: 500; text-decoration: none; }
.wk-today .td-join:hover { text-decoration: underline; }

/* Account: Notifications (alerts.js) */
.al-dev { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.al-hint { font-size: 14px; color: var(--faint); line-height: 1.55; margin: 6px 0 12px; max-width: 620px; }
.al-hint b { color: var(--body); }
.al-list { margin: 8px 0 18px; }
.al-list .sub { font-size: 13px; color: var(--faint); }
.al-prefs { display: grid; gap: 12px; margin: 16px 0 6px; max-width: 620px; }
.al-sw { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.al-note { font-size: 13px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.al-prefs input.al-num { width: 72px; padding: 4px 8px; }
.al-prefs input.al-time { width: auto; padding: 4px 8px; }
.al-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--body); padding-top: 4px; }
.al-hours > span:first-child { flex: 0 0 auto; margin-inline-end: 4px; }
.al-cals { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 620px; }
.al-h { flex: 1 0 100%; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 767px) {
  .wk-today { margin: 12px 16px 0; }
  .al-dev .btn { flex: 1 1 auto; }
}
.bill-tier { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1 1 100%; }
.bill-tier .k { min-width: 110px; font-weight: 500; }
