/* SHOWFORM workspace: compact desktop ledger, clear touch-first mobile cards. */
:root {
  color-scheme: light;
  --ink: #24324b;
  --muted: #6a7488;
  --navy: #263650;
  --navy-deep: #202d44;
  --purple: #7256a4;
  --purple-dark: #5c427f;
  --purple-soft: #f0ebf7;
  --line: #cdd4e1;
  --line-purple: #cfc0df;
  --surface: #ffffff;
  --bg: #f4f5fa;
  --green: #276e59;
  --green-soft: #e8f3ed;
  --amber: #935f1f;
  --amber-soft: #fff3dc;
  --red: #a84659;
  --shadow: 0 6px 24px #27365005;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover { background: #f6f4fa; border-color: #c7bbd8; }
button:active { background: #ede7f5; }
button:disabled { opacity: .48; cursor: default; }
button:disabled:hover { background: inherit; border-color: var(--line); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #9a7cc4;
  outline-offset: 3px;
}
a { color: var(--purple-dark); text-underline-offset: 3px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #d5d9e5;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: #8990a0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--purple); }
.primary { border-color: var(--purple); background: var(--purple); color: white; }
.primary:hover { border-color: var(--purple-dark); background: var(--purple-dark); }
.danger { color: var(--red); }
.danger:hover { background: #fff2f4; border-color: #e7bcc5; }
.hidden, [hidden] { display: none !important; }
.shell { max-width: 1440px; margin: 0 auto; padding: 24px 28px 30px; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 17px 24px;
  border: 1px solid #263650;
  border-radius: 18px;
  background: var(--navy);
  color: white;
  box-shadow: 0 8px 28px #2636500c;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { width: 48px; height: 48px; flex: none; border-radius: 13px; box-shadow: 0 3px 10px #111a2c25; }
.brand b { font-size: 10px; font-weight: 600; letter-spacing: 2.5px; color: #c5c7df; }
h1 { margin: 5px 0 0; font-size: 26px; line-height: 1.35; font-weight: 730; letter-spacing: -.8px; }
.top h1 { color: white; }
.top p { margin: 7px 0 0; font-size: 12px; color: #d0d7e5; }
.header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 7px; color: #cdd4e3; font-size: 11px; }
.header-meta #tenant { color: #e4e7f0; font-size: 11px; padding: 0; }
.env-tag { display: inline-flex; border: 1px solid #ffffff29; background: #ffffff0c; padding: 2px 7px; border-radius: 5px; font-size: 9px; font-weight: 650; color: #ded4ee; letter-spacing: .1px; }
.more { position: relative; }
.more > summary { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid #ffffff2e; border-radius: 10px; background: #ffffff0c; color: #eef0f7; font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "⌄"; font-size: 13px; margin-left: 8px; color: #b9c2d5; }
.more[open] > summary { background: #ffffff1c; }
.more-menu { position: absolute; right: 0; top: calc(100% + 7px); z-index: 12; min-width: 210px; border: 1px solid #dedbe7; border-radius: 12px; background: white; padding: 6px; box-shadow: 0 12px 40px #17233c25; }
.top .more-menu button { display: block; width: 100%; text-align: left; color: var(--ink); background: white; border: 0; border-radius: 7px; min-height: 41px; padding: 9px 10px; font-size: 12px; }
.top .more-menu button:hover { color: var(--purple-dark); background: #f0eaf7; }
.period-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-nav button { min-width: 40px; min-height: 42px; padding: 7px 11px; background: white; font-size: 15px; }
.period-nav label { font-size: 11px; color: var(--muted); }
.period-nav select { min-width: 87px; min-height: 43px; padding: 8px 10px; background: #ffffff; color: #56416f; font-size: 14px; font-weight: 650; }
.period-nav #mode { min-width: 83px; font-size: 12px; font-weight: 500; margin-left: 3px; }
.last-sync { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 12px; margin-left: auto; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.8; }
.last-sync > button { grid-column: 2; grid-row: 1 / 3; }
.last-sync strong, .last-sync #lastSync { display: block; font-size: 12px; font-weight: 650; color: #53617a; font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.top .tools { justify-content: flex-end; }
.top .tools button { border-color: #ffffff2e; color: #f4f4fa; background: #ffffff0c; font-size: 12px; white-space: nowrap; }
.top .tools button:hover { background: #ffffff19; border-color: #ffffff65; }
.top .tools .primary { background: #a991cf; border-color: #a991cf; color: #1e2940; box-shadow: 0 3px 12px #10182c12; }
.top .tools .primary:hover { background: #c0a9e0; border-color: #c0a9e0; }
.test { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; border: 1px solid #e2dced; border-radius: 10px; padding: 9px 13px; background: #efebf7; color: #68577b; font-size: 11px; line-height: 1.65; }
.test b { font-weight: 700; color: #5e487a; }
.test br { display: none; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0 12px; }
.bar > b, #tenant { padding-right: 8px; font-size: 13px; font-weight: 700; color: var(--navy); }
.bar label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar select { min-width: 90px; background-color: white; }
.bar input[type="search"], .bar input:not([type]) { min-width: 180px; flex: 1; }
.bar button { font-size: 12px; }
.status-line, #syncstate { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; min-height: 24px; margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.status-line strong { color: var(--ink); font-size: 11px; }
.save-dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--green); }
.save-dot.pending { background: #8b69bc; }
.save-dot.error { background: var(--red); }
.save-dot.saved { background: #3a896d; }
.status-line .status-actions { margin-left: auto; display: flex; gap: 6px; }
.queue-actions { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.queue-actions button { min-height: 33px; padding: 5px 9px; font-size: 10px; }
.status-line button { min-height: 34px; padding: 5px 10px; font-size: 11px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 0 0 13px; }
.card { position: relative; min-height: 136px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 17px 21px; box-shadow: var(--shadow); overflow: hidden; }
.card small, .card h2 { display: block; margin: 0; color: #52617b; font-size: 12px; font-weight: 650; letter-spacing: -.2px; line-height: 1.5; }
.card strong { display: block; margin: 9px 0 6px; font-size: 32px; line-height: 1.25; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -1.15px; color: var(--navy); }
.card p { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 0; }
.card.featured { border-color: #685080; background: linear-gradient(120deg, #514268 0%, #735a93 100%); color: white; box-shadow: 0 6px 20px #58417612; }
.card.featured small, .card.featured h2 { color: #ece5f5; }
.card.featured strong { color: white; }
.card.featured p { color: #e2d8ed; }
.card .profit-note { display: block; margin-top: 4px; color: #e2d8ed; font-size: 10px; }
.tax { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 14px; }
.tax > span, .tax > div { border: 1px solid #e1d9ec; border-radius: 10px; padding: 10px 14px; background: #eeebf5; color: #67577e; font-size: 11px; line-height: 1.65; }
.tax b { color: #51416e; font-size: 15px; font-weight: 750; margin-left: 5px; font-variant-numeric: tabular-nums; }
.tax br { display: none; }
.tax .sync-caption { color: var(--muted); }
.tabs { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); margin: 14px 0 0; }
.tabs button { border: 1px solid transparent; border-radius: 8px 8px 0 0; color: var(--muted); background: transparent; padding: 11px 17px; min-height: 45px; font-size: 13px; font-weight: 650; position: relative; }
.tabs button:hover { background: #efedf5; }
.tabs button.active { color: var(--purple-dark); background: #ece6f5; }
.tabs button[aria-selected="true"] { color: var(--purple-dark); background: #ece6f5; }
.tabs button.active::after { content: ""; position: absolute; height: 3px; left: 12px; right: 12px; bottom: -1px; border-radius: 2px; background: var(--purple); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; height: 3px; left: 12px; right: 12px; bottom: -1px; border-radius: 2px; background: var(--purple); }
.tabs .tab-spacer { margin-left: auto; }
.listhead { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 12px 0 10px; }
h2 { font-size: 17px; line-height: 1.4; letter-spacing: -.4px; margin: 0; color: var(--navy); }
.listhead .muted, #count { font-size: 11px; color: var(--muted); }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 12px; }
.filters input[type="search"] { flex: 1; min-width: 200px; }
.filters select { max-width: 220px; font-size: 12px; }
.tablewrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.events-table, .history { border-collapse: separate; border-spacing: 0; width: 100%; background: white; }
.events-table { min-width: 1070px; }
.events-table th { position: sticky; top: 0; z-index: 1; background: var(--navy); color: #f2f3f8; border-right: 1px solid #ffffff14; padding: 13px 9px; font-size: 11px; font-weight: 600; text-align: center; line-height: 1.5; white-space: nowrap; }
.events-table th:first-child { min-width: 86px; }
.events-table td { padding: 11px 10px; border-right: 1px solid #ececf2; border-bottom: 1px solid #e7e8ee; text-align: center; vertical-align: middle; font-size: 12px; line-height: 1.6; }
.events-table td:last-child, .events-table th:last-child { border-right: 0; }
.events-table tr:last-child td { border-bottom: 0; }
.events-table tbody tr { background: white; }
.events-table tbody tr:nth-child(even) { background: #fbfaff; }
.events-table tbody tr:hover { background: #f5f1fb; }
.events-table tbody tr.carry { background: #f5f0fb; }
.events-table tbody tr.is-pending { background: #f3ecfc; }
.events-table .event-title { min-width: 218px; max-width: 340px; text-align: left; }
.event-title button, .eventname, button.event-title { min-height: 44px; border: 0; border-radius: 6px; padding: 4px 0; background: transparent; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
.event-title button:hover, .eventname:hover, button.event-title:hover { background: transparent; color: var(--purple-dark); text-decoration: underline; text-underline-offset: 3px; }
.event-meta, .date-range { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.55; }
.date-range { margin: 0; white-space: nowrap; color: #55657e; font-size: 11px; font-variant-numeric: tabular-nums; }
.money-edit, .editmoney { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 119px; min-height: 49px; border: 1px solid #ded3eb; border-radius: 9px; padding: 7px 10px; background: #f6f2fb; color: #584272; font-size: 14px; font-weight: 730; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-edit:hover, .editmoney:hover { border-color: #b9a3d2; background: #eee5f7; }
.money-edit small, .editmoney small { display: block; margin-top: 4px; font-size: 9px; font-weight: 400; line-height: 1.4; color: #7d6c90; white-space: normal; }
.money-edit.is-done, .money-edit.done { border-color: #d7e8df; background: #f0f7f3; color: var(--green); }
.money-edit.is-done small, .money-edit.done small { color: #689281; }
.complete-check { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; gap: 7px; cursor: pointer; border-radius: 8px; color: #66748a; font-size: 11px; white-space: nowrap; position: relative; }
.complete-check:hover { background: #ebe5f3; }
.complete-check input[type="checkbox"] { width: 23px; height: 23px; margin: 0; cursor: pointer; }
.complete-check:has(.check-box) input[type="checkbox"] { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.complete-check .check-box { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: none; border: 1.5px solid #aeb4c5; border-radius: 6px; background: white; color: white; box-shadow: inset 0 1px 2px #26365004; }
.complete-check .check-box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid white; border-bottom: 2px solid white; transform: translateY(-1px) rotate(-45deg); opacity: 0; }
.complete-check:has(input:checked) .check-box { border-color: var(--purple); background: var(--purple); box-shadow: 0 2px 7px #70509b22; }
.complete-check:has(input:checked) .check-box::after { opacity: 1; }
.complete-check:has(input:checked) { color: var(--purple-dark); }
.complete-check:has(input:focus-visible) { outline: 3px solid #a88acc; outline-offset: 2px; }
.complete-check:has(input:disabled) { opacity: .45; cursor: default; }
.complete-check.pending .check-box { box-shadow: 0 0 0 3px #e7dcf2; }
.check-label { display: inline-flex; position: relative; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 44px; border-radius: 8px; color: #66748a; font-size: 11px; white-space: nowrap; cursor: pointer; }
.check-label:hover { background: #ebe5f3; }
.check-label input[type="checkbox"] { width: 23px; height: 23px; margin: 0; accent-color: var(--purple); cursor: pointer; }
.check-label:has(.check-visual) input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-visual { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: none; border: 1.5px solid #aeb4c5; border-radius: 6px; background: white; }
.check-visual::after { content: ""; width: 9px; height: 5px; border-left: 2px solid white; border-bottom: 2px solid white; transform: translateY(-1px) rotate(-45deg); opacity: 0; }
.check-label:has(input:checked) .check-visual { background: var(--purple); border-color: var(--purple); box-shadow: 0 2px 7px #70509b22; }
.check-label:has(input:checked) .check-visual::after { opacity: 1; }
.check-label:has(input:checked) { color: var(--purple-dark); }
.check-label:has(input:focus-visible) { outline: 3px solid #a88acc; outline-offset: 2px; }
.check-label:has(input:disabled) { cursor: default; opacity: .45; }
.check-label.pending .check-visual { box-shadow: 0 0 0 3px #e7dcf2; }
.partial-btn, .partbtn { min-height: 40px; padding: 7px 10px; border-color: #ded5e9; background: #f1ebf8; color: #6b508c; border-radius: 8px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.partial-btn:hover, .partbtn:hover { background: #e9dff4; border-color: #bfaad7; }
.reset-link, .dangerlink, .rowreset { display: block; margin: 4px auto 0; min-height: 32px; border: 0; padding: 3px 7px; background: transparent; color: #9c6c7b; font-size: 10px; font-weight: 450; text-decoration: underline; text-underline-offset: 3px; }
.reset-link:hover, .dangerlink:hover, .rowreset:hover { background: #f9eaef; color: var(--red); }
.state-badge, .badge { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 4px 7px; font-size: 10px; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.state-badge.waiting { background: #edf0f6; color: #64738c; }
.state-badge.partial { background: #eee5f7; color: #765699; }
.state-badge.done, .status-done { background: var(--green-soft); color: var(--green); }
.state-badge.review { background: var(--amber-soft); color: var(--amber); }
.carry-heading, .events-table .carry-heading td { background: #e8e0f2 !important; color: #64517d; border-bottom: 1px solid #d8cce6; font-size: 11px; font-weight: 700; padding: 10px 17px; text-align: left; }
.carry-heading small { margin-left: 9px; font-weight: 400; color: #88759e; }
.mobile-events { display: none; }
.empty { padding: 44px 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }
.history { min-width: 660px; }
.history th { padding: 13px 12px; border-right: 1px solid #ffffff1a; background: var(--navy); color: white; font-size: 11px; font-weight: 600; text-align: center; }
.history td { padding: 13px 12px; border-right: 1px solid #ececf2; border-bottom: 1px solid #e7e8ee; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.history tr:nth-child(even) td { background: #fbfaff; }
.history .history-title { text-align: left; max-width: 320px; }
.history th:last-child, .history td:last-child { border-right: 0; }
.scroll { overflow: auto; }
.notice { border: 1px solid #e9d7b4; border-radius: 12px; padding: 13px 16px; margin: 11px 0; background: #fff7e8; color: #835e2a; font-size: 12px; line-height: 1.75; }
.notice b { font-weight: 700; }
.notice small { color: #9d825b; font-size: 10px; }
.notice button { min-height: 36px; margin: 7px 4px 0 0; border-color: #dfca9f; background: #fffdf8; color: #826332; padding: 6px 10px; font-size: 11px; }
.notice button:hover { background: #fff0d0; border-color: #c1a16d; }
#reminders > details { margin: 10px 0; border: 1px solid #e9d7b4; border-radius: 11px; background: #fff8ec; padding: 0 13px; }
#reminders > details > summary { cursor: pointer; color: #8b6939; font-size: 11px; font-weight: 650; min-height: 42px; padding: 11px 1px; }
#reminders > details .notice { background: #fffbf4; padding: 12px; margin-top: 0; }
#utilities { margin: 16px 0; font-size: 12px; color: var(--muted); }
#utilities > details, #utilities .utility-panel { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 13px 15px; }
#utilities summary { cursor: pointer; font-weight: 650; color: #65728a; padding: 3px 0; }
#utilities .tools { margin-top: 11px; }
#utilities button { font-size: 11px; min-height: 40px; }
#utilities ul { padding-left: 20px; line-height: 1.85; }
.login { max-width: 440px; margin: 45px auto 55px; padding: 30px; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: 0 14px 45px #26365008; }
.login h2 { font-size: 22px; margin-bottom: 12px; }
.login label { display: block; margin: 18px 0 10px; font-size: 12px; color: var(--muted); }
.login input { display: block; margin: 7px 0 13px; width: 100%; }
.login button { width: 100%; margin: 6px 0; }
dialog { width: min(560px, calc(100% - 32px)); max-height: 90dvh; margin: auto; padding: 25px; border: 1px solid #dfd8e9; border-radius: 20px; background: white; color: var(--ink); box-shadow: 0 25px 90px #16213e30; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
dialog.wide, dialog:has(.partybox), dialog:has(.choice) { width: min(650px, calc(100% - 32px)); }
dialog::backdrop { background: #1f2b485e; backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.dialog-head h2, #dialogtitle { font-size: 21px; line-height: 1.4; margin: 0 0 13px; }
.dialog-head button { min-height: 34px; width: 34px; padding: 0; border-radius: 50%; background: #f3eff8; color: #6d5389; border: 0; font-size: 20px; flex: none; }
dialog p { font-size: 13px; line-height: 1.75; }
dialog .muted { font-size: 12px; }
dialog label { display: block; font-size: 12px; font-weight: 600; color: #5a6880; margin: 16px 0 6px; }
dialog input:not([type="checkbox"]):not([type="radio"]), dialog select, dialog textarea { display: block; width: 100%; min-height: 45px; padding: 11px 12px; }
dialog textarea { min-height: 150px; resize: vertical; line-height: 1.75; }
.dialogtools { display: flex; justify-content: space-between; gap: 12px; position: sticky; bottom: -25px; padding: 15px 0 2px; margin-top: 20px; background: white; border-top: 1px solid #eeeaf3; box-shadow: 0 -10px 15px #ffffffd9; z-index: 2; }
.dialogtools button { min-width: 86px; }
.dialogtools .primary { flex: 1; max-width: 310px; }
.dialog-error, #dialogerror { font-size: 12px; line-height: 1.65; color: var(--red); white-space: pre-wrap; margin-top: 10px; }
.dialog-error:empty, #dialogerror:empty { margin: 0; }
.preview { padding: 13px 14px; margin: 15px 0; border: 1px solid #e7dfef; border-radius: 10px; background: #f5f1fa; color: #69547f; font-size: 12px; line-height: 1.85; white-space: pre-line; }
.partybox { border: 1px solid #ded7e9; padding: 15px; margin: 12px 0; border-radius: 13px; background: #fdfcfe; }
.partybox label:first-child { margin-top: 0; }
.partybox .preview { margin: 12px 0 4px; background: #efebf5; }
.partybox .danger { min-height: 37px; margin-top: 7px; border: 0; background: transparent; padding: 5px 0; color: #a76679; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
#addParty { width: 100%; border-style: dashed; border-color: #c4b3d8; color: var(--purple-dark); background: #faf7fd; font-size: 12px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 13px 2px; border-bottom: 1px solid #e8e4ee; }
.choice input { width: 23px; height: 23px; margin: 0; flex: none; cursor: pointer; }
.choice label { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.65; font-weight: 500; cursor: pointer; }
.choice small { color: var(--muted); font-size: 11px; font-weight: 400; }
dialog .amountinput, dialog input#amount { min-height: 70px; margin: 8px 0; padding: 14px 15px; border-color: #dbcee9; background: #f6f1fc; color: #563b77; border-radius: 12px; font-size: 32px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 15px 0 5px; }
.keypad button { min-height: 51px; border-color: #e1d8ec; border-radius: 10px; background: white; font-size: 23px; font-weight: 500; color: #56416d; }
.keypad button:hover { border-color: #bfa9d6; background: #f2eaf9; }
.keypad button:nth-last-child(-n+2) { min-height: 41px; font-size: 12px; background: #f6f3fa; color: #7d6a90; }
.memoview { max-height: 32dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; padding: 14px; border: 1px solid #e7e2ee; background: #f8f6fb; border-radius: 11px; font-size: 13px; }
.memoview a, .memoview button { display: inline-block; min-height: 35px; margin: 2px 0; padding: 5px 7px; border: 0; border-radius: 6px; background: #eae1f5; color: #614482; font-size: 12px; line-height: 1.8; text-decoration: underline; text-underline-offset: 3px; }
#copyStatus { color: var(--green); font-size: 11px; line-height: 1.65; margin-top: 5px; }
.toast, #message { position: fixed; z-index: 100; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: min(540px, calc(100% - 30px)); border: 1px solid #ffffff18; border-radius: 11px; background: var(--navy); color: white; padding: 12px 18px; box-shadow: 0 8px 30px #1d294c20; font-size: 12px; line-height: 1.6; white-space: pre-line; }
footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px 18px; margin: 23px 2px 0; padding-top: 14px; border-top: 1px solid #e3e4ed; color: #81899b; font-size: 10px; line-height: 1.8; }
.lab-tools { margin-top: 16px; color: #7b8193; font-size: 11px; }
.lab-tools summary { cursor: pointer; padding: 8px 0; }
.lab-tools .tools button { min-height: 36px; font-size: 11px; }
.brand small { font-size:10px; font-weight:600; letter-spacing:2.5px; color:#c5c7df; }
.card .metric-label { display:block; color:#52617b; font-size:12px; font-weight:650; line-height:1.5; }
.card.featured .metric-label { color:#ece5f5; }
.events-table td.date-range { display:table-cell; }
.events-table .event-cell-name { min-width:218px; max-width:340px; text-align:left; }
.event-cell-name .event-meta { text-align:left; }
.money-edit.is-complete { border-color:#d7e8df; background:#f0f7f3; color:var(--green); }
.money-edit.is-complete small { color:#689281; }
.check-label.is-pending .check-visual { box-shadow:0 0 0 3px #e7dcf2; }
.event-top-meta { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.alert-summary { margin:10px 0; border:1px solid #e9d7b4; border-radius:11px; background:#fff8ec; padding:0 13px; }
.alert-summary > summary { cursor:pointer; color:#8b6939; font-size:11px; font-weight:650; min-height:42px; padding:11px 1px; }
.alert-summary .notice { margin-top:0; background:#fffbf4; }
.connection-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 15px; padding:12px 0; border-bottom:1px solid var(--line); font-size:12px; }
.utility-panel + .utility-panel { margin-top:14px; }
.archive-item { display:inline-flex; gap:10px; align-items:center; margin:8px 8px 0 0; font-size:12px; }
.archive-item small { color:var(--muted); }
.no-payment { font-size:10px; color:#929aac; }
.login-mark { font-size:10px; letter-spacing:3px; color:var(--purple); margin-bottom:14px; }
.test-dot { width:6px; height:6px; border-radius:50%; background:#9675b9; }
.tax .tax-note { border:0; background:transparent; padding:6px 0; color:var(--muted); font-size:10px; align-self:center; }
@media (max-width: 1100px) {
  .top { gap: 20px; padding: 22px; }
  .top .tools { max-width: 460px; }
  .top .tools button { padding: 9px 11px; font-size: 11px; }
  h1 { font-size: 23px; }
  .brand img { width: 43px; height: 43px; }
  .card { padding: 18px 19px; }
  .card strong { font-size: 29px; }
}
@media (max-width: 800px) {
  .shell { padding: 13px 13px 24px; }
  .top { border-radius: 14px; padding: 19px 17px 17px; align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 11px; }
  .brand { gap: 11px; }
  .brand img { width: 40px; height: 40px; border-radius: 11px; }
  .brand b { font-size: 9px; letter-spacing: 2px; }
  .brand small { font-size:9px; letter-spacing:2px; }
  .card .metric-label { font-size:11px; min-height:31px; }
  .card.featured .metric-label { min-height:0; }
  .last-sync { flex-wrap:wrap; }
  .last-sync button { margin-left:auto; font-size:10px; }
  .tax .tax-note { flex-basis:100%; min-width:100%; padding:0; }
  .event-top-meta .date-range { white-space:normal; }
  .connection-row > span { overflow-wrap:anywhere; }
  h1 { font-size: 23px; margin-top: 4px; letter-spacing: -.7px; }
  .top .tools { max-width: none; width: 100%; justify-content: flex-start; gap: 7px; }
  .top .tools button { min-height: 42px; padding: 9px 10px; font-size: 11px; }
  .top .tools .primary { flex: 1; }
  .top .tools #account { margin-left: auto; }
  .more > summary { min-height: 42px; font-size: 11px; padding: 9px 10px; }
  .more-menu { min-width: 205px; }
  .period-nav { gap: 6px; }
  .period-nav button { min-width: 36px; min-height: 42px; padding: 7px 9px; }
  .period-nav select { min-width: 72px; padding: 8px; font-size: 12px; }
  .period-nav #mode { min-width: 73px; margin-left: 0; font-size: 11px; }
  .last-sync { width: 100%; margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 9px; }
  .last-sync strong, .last-sync #lastSync { font-size: 10px; }
  .test { padding: 8px 10px; border-radius: 8px; gap: 2px 6px; font-size: 10px; line-height: 1.65; }
  .bar { gap: 8px; margin: 18px 0 10px; }
  .bar > b, #tenant { padding-right: 2px; font-size: 12px; }
  .bar label { gap: 5px; font-size: 11px; }
  .bar select { min-width: 75px; padding: 9px; font-size: 12px; }
  .bar input { min-width: 150px; font-size: 13px; }
  .bar button { font-size: 11px; }
  .status-line, #syncstate { min-height: 21px; margin-bottom: 9px; font-size: 10px; gap: 4px 6px; }
  .status-line .status-actions { margin-left: 0; }
  .queue-actions { margin-left: 0; gap: 5px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
  .card { border-radius: 12px; min-height: 137px; padding: 16px 14px 15px; box-shadow: none; }
  .card small, .card h2 { font-size: 11px; min-height: 31px; }
  .card strong { margin: 9px 0 7px; font-size: 25px; letter-spacing: -.95px; white-space: nowrap; }
  .card p { font-size: 10px; line-height: 1.6; }
  .card.featured { grid-column: span 2; min-height: 145px; padding: 18px; }
  .card.featured small { min-height: 0; }
  .card.featured strong { font-size: 35px; margin: 10px 0 7px; }
  .card.featured p { font-size: 10px; }
  .tax { gap: 7px; margin-bottom: 19px; }
  .tax > span, .tax > div { flex: 1; min-width: 42%; border-radius: 9px; font-size: 10px; padding: 9px 11px; }
  .tax b { display: block; font-size: 16px; margin: 4px 0 0; }
  .tax br { display: block; }
  .tabs { margin-top: 17px; gap: 4px; }
  .tabs button { flex:1; min-width:0; white-space:nowrap; padding: 10px 7px; min-height: 45px; font-size: 12px; }
  .listhead { margin-top: 18px; margin-bottom: 11px; gap: 10px; }
  h2 { font-size: 16px; }
  .filters { gap: 7px; }
  .filters input[type="search"] { flex-basis: 100%; min-width: 0; }
  .filters select { flex: 1; max-width: none; min-width: 0; padding: 10px; font-size: 12px; }
  .tablewrap.events { display: none; }
  .mobile-events { display: block; }
  .mobile-events > .carry-heading { margin-top: 20px; padding: 10px 12px; border: 1px solid #dacee8; border-radius: 9px; font-size: 11px; line-height: 1.65; }
  .mobile-events > .carry-heading small { display: block; margin: 3px 0 0; }
  .event-card { border: 1px solid #dddfe9; border-radius: 14px; margin: 10px 0; background: white; overflow: hidden; box-shadow: 0 3px 12px #26365003; }
  .event-card.carry { border-color: #dacee7; background: #fbf8ff; }
  .event-card.is-pending { border-color: #b89bcf; box-shadow: 0 0 0 2px #eee5f7; }
  .event-top { padding: 13px 14px 11px; border-bottom: 1px solid #e6e3ed; }
  .event-top .date-range { font-size: 10px; color: #7a6c8c; }
  .event-top .event-title, .event-top .eventname { display: block; width: 100%; min-height: 43px; margin: 2px 0 3px; font-size: 14px; font-weight: 700; line-height: 1.55; }
  .event-top .event-meta { margin-top: 5px; font-size: 10px; }
  .event-top .state-badge { padding: 3px 7px; font-size: 10px; }
  .event-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .event-cell { padding: 13px 10px 11px; border-right: 1px solid #e5e0ec; min-width: 0; text-align: center; }
  .event-cell:nth-child(even) { border-right: 0; }
  .event-cell .sectionlabel, .event-cell .cell-label { display: block; color: var(--muted); font-size: 10px; margin: 0 0 7px; text-align: left; }
  .event-cell .money-edit, .event-cell .editmoney { display: flex; width: 100%; min-width: 0; min-height: 55px; border-radius: 9px; padding: 9px 5px; font-size: 17px; letter-spacing: -.4px; }
  .event-cell .money-edit small, .event-cell .editmoney small { font-size: 9px; }
  .event-cell .complete-check { width: 100%; margin-top: 8px; min-height: 44px; font-size: 11px; }
  .event-cell .check-label { width: 100%; margin-top: 8px; min-height: 44px; font-size: 11px; }
  .event-cell .complete-check .check-box { width: 22px; height: 22px; }
  .event-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid #e5e0ec; background: #faf9fc; }
  .event-foot .partial-btn { min-height: 42px; padding: 8px 10px; font-size: 11px; }
  .event-foot .event-meta { flex-basis: 100%; margin: 0; text-align: left; font-size: 10px; }
  .event-foot .reset-link { margin: 0; }
  .state-badge { font-size: 10px; }
  .notice { padding: 12px; margin: 9px 0; font-size: 11px; }
  .notice button { min-height: 40px; padding: 8px 10px; font-size: 11px; }
  .empty { padding: 35px 12px; font-size: 12px; }
  .login { margin: 28px auto 38px; padding: 24px 20px; border-radius: 15px; }
  dialog, dialog.wide, dialog:has(.partybox), dialog:has(.choice) { max-height: 92dvh; width: calc(100% - 24px); padding: 20px; border-radius: 17px; }
  .dialog-head h2, #dialogtitle { font-size: 19px; }
  dialog p { font-size: 12px; }
  dialog input:not([type="checkbox"]):not([type="radio"]), dialog select, dialog textarea { font-size: 16px; }
  dialog .amountinput, dialog input#amount { font-size: 30px; min-height: 68px; }
  .dialogtools { bottom: -20px; padding-top: 12px; margin-top: 18px; }
  .keypad { gap: 8px; }
  .keypad button { min-height: 49px; font-size: 22px; }
  .partybox { padding: 13px; }
  .preview { font-size: 11px; padding: 11px 12px; }
  .memoview { max-height: 30dvh; font-size: 12px; }
  .memoview a, .memoview button { min-height: 40px; font-size: 12px; padding: 6px; }
  .toast, #message { bottom: 12px; padding: 11px 14px; font-size: 11px; border-radius: 10px; max-width: calc(100% - 26px); }
  footer { margin-top: 20px; font-size: 9px; }
  button, .top .tools button, .period-nav button, .bar button, .partial-btn, .event-foot .partial-btn, .notice button, .memoview a, .memoview button, .more > summary { min-height:44px; }
  .period-nav select { min-height:44px; }
  .dialog-head button { width:44px; min-height:44px; }
}
@media (max-width: 360px) {
  .shell { padding-left: 10px; padding-right: 10px; }
  .top { padding: 16px 13px; }
  h1 { font-size: 20px; }
  .top .tools { gap: 6px; }
  .top .tools button { padding: 8px; font-size: 10px; }
  .card { padding-left: 12px; padding-right: 12px; }
  .card strong { font-size: 22px; }
  .event-cell .money-edit { font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a, .check-box { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease; }
  button:active:not(:disabled) { transform: translateY(1px); }
  dialog[open] { animation: dialog-appear 150ms ease-out; }
  .toast:not([hidden]), #message:not([hidden]) { animation: toast-appear 140ms ease-out; }
  .save-dot.pending { animation: quiet-pulse 1.3s ease-in-out infinite; }
  .card.value-updated strong { animation: value-settle 230ms ease-out; }
  @keyframes dialog-appear { from { opacity: 0; transform: translateY(6px) scale(.992); } to { opacity: 1; transform: none; } }
  @keyframes toast-appear { from { opacity: 0; margin-bottom: -5px; } to { opacity: 1; margin-bottom: 0; } }
  @keyframes quiet-pulse { 50% { opacity: .4; } }
  @keyframes value-settle { from { opacity: .6; transform: translateY(2px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
/* Readability and schedule workspace additions. No remote font dependency. */
.shell { margin: 18px auto; border: 1px solid #cbd2df; border-radius: 22px; background: #f8f9fc; }
button { font-size: 14px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { border-color: #b8c2d4; font-size: 15px; }
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover, textarea:hover { border-color: #9c8bb9; }
.top { border-color: #1e2d46; }
.top .tools button, .more > summary { font-size: 13px; }
.top .tools .more-menu { border: 1px solid #aeb9ce; background: #fff; box-shadow: 0 14px 38px #15213b30; }
.top .tools .more-menu button {
  color: #273650;
  background: #fff;
  border: 0;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 12px;
  white-space: normal;
}
.top .tools .more-menu button:hover { color: #563c79; background: #eee7f6; border: 0; }
.top .tools .more-menu button:active { color: #493063; background: #e3d7f1; }
.top .tools .more-menu button:focus-visible { color: #493063; background: #eee7f6; outline: 3px solid #a88acc; outline-offset: -2px; }
.top .tools .more-menu button:disabled { color: #7c8596; background: #f4f5f8; opacity: .65; }
.top .tools .more-menu button:disabled:hover { color: #7c8596; background: #f4f5f8; }
.brand #companyLogo { width: 54px; height: 54px; object-fit: contain; background: #fff; border: 1px solid #ffffff60; border-radius: 13px; }
.brand #companyAvatar { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; flex: none; border: 1px solid #ffffff45; border-radius: 13px; background: #74618f; color: #fff; font-size: 23px; font-weight: 750; letter-spacing: -1px; }
.brand #companyName { display: block; color: #e0d6ef; font-size: 14px; font-weight: 650; letter-spacing: .25px; line-height: 1.5; }
.header-meta, .header-meta #tenant { font-size: 12px; }
.env-tag { font-size: 10px; }
.test { border-color: #cfc0e2; font-size: 12px; }
.muted { color: #63718a; font-size: 13px; }
.bar label { font-size: 13px; }
.bar button { font-size: 13px; }
.last-sync { font-size: 12px; }
.last-sync #lastSync { font-size: 13px; }
.status-line, #syncstate { font-size: 12px; }
.card { border: 1px solid #c5cddd; box-shadow: 0 3px 13px #26365006; }
.card .metric-label, .card small, .card h2 { font-size: 14px; color: #4d5d79; }
.card.featured { border-color: #5f467e; }
.card.featured .metric-label, .card.featured small, .card.featured h2 { color: #f0e8f8; }
.card p { font-size: 12px; color: #65718a; }
.card.featured p { color: #e8dff1; }
.tax > span, .tax > div { border-color: #cfc1df; font-size: 12px; color: #665079; }
.tax b { font-size: 16px; }
.tabs { border-bottom-color: #bdc6d7; }
.tabs button { font-size: 14px; }
.listhead .muted, #count { font-size: 12px; }
.filters select { font-size: 13px; }
.tablewrap { border: 1px solid #aebbd0; box-shadow: 0 3px 12px #27365005; }
.events-table th { font-size: 13px; border-right-color: #ffffff2b; }
.events-table td { border-right-color: #d7deea; border-bottom-color: #d1d9e7; font-size: 14px; padding: 12px 10px; }
.events-table .event-cell-name { border-right-color: #c9d1e0; }
.event-title button, .eventname, button.event-title { font-size: 14px; }
.event-meta { color: #69758d; font-size: 12px; }
.date-range { color: #50617e; font-size: 13px; }
.money-edit, .editmoney { min-width: 122px; font-size: 16px; border-color: #c9b8dd; background: #f5f0fb; }
.money-edit small, .editmoney small { color: #77618e; font-size: 11px; }
.money-edit.is-complete { border-color: #b6d4c6; color: #276e59; }
.money-edit.is-complete small { color: #4e806a; }
.check-label, .complete-check { font-size: 12px; }
.check-visual, .complete-check .check-box { border-color: #8996ad; }
.partial-btn, .partbtn { min-height: 44px; font-size: 12px; border-color: #c9b8dd; }
.state-badge, .badge { font-size: 12px; }
.state-badge.waiting { border-color: #d4dce8; color: #536782; }
.state-badge.partial { border-color: #d5c3e8; color: #6f4d94; }
.state-badge.done { border-color: #c0dece; }
.state-badge.review { border-color: #ead0a7; }
.no-payment { font-size: 12px; color: #7b8699; }
.carry-heading, .events-table .carry-heading td { border-color: #c8b7dd; font-size: 13px; }
.carry-heading small { color: #7c6694; font-size: 12px; }
.history th { font-size: 13px; }
.history td { border-color: #d1d9e7; font-size: 14px; }
.notice { border-color: #dabc87; font-size: 13px; }
.notice small { font-size: 12px; }
.notice button { font-size: 12px; min-height: 44px; }
.alert-summary { border-color: #dabc87; }
.alert-summary > summary { font-size: 13px; }
#utilities { font-size: 14px; }
#utilities > details, #utilities .utility-panel { border-color: #c2ccdd; }
#utilities button { font-size: 13px; }
.connection-row { font-size: 14px; border-color: #d3dbe8; }
.archive-item { font-size: 14px; }
.login { border-color: #bfc9da; }
.login label { font-size: 13px; }
dialog { border-color: #aebbd1; }
dialog p, dialog .muted, dialog label { font-size: 14px; }
.partybox { border-color: #c1b1d5; }
.preview { border-color: #cfc0e0; font-size: 14px; }
.choice { border-color: #d4ccdf; }
.choice label { font-size: 14px; }
.choice small { font-size: 12px; }
.memoview { border-color: #c7cddc; font-size: 14px; }
.memoview a, .memoview button { font-size: 13px; }
.dialog-error, #dialogerror { font-size: 13px; }
.toast, #message { font-size: 13px; }
footer { font-size: 12px; color: #707c91; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; margin: 0 0 17px; }
.overview-main { min-width: 0; }
.overview-main .cards { gap: 12px; }
.overview-main .card { min-height: 144px; padding: 17px 18px; }
.overview-main .card strong { font-size: clamp(24px, 2.25vw, 32px); }
.overview-main .tax { margin-bottom: 0; }
.quick-agenda { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.agenda-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 0 1px; line-height: 1.6; }
.agenda-heading b { color: #55657e; font-size: 12px; font-weight: 650; }
.agenda-heading span { color: #7b869b; font-size: 11px; }
.agenda-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; min-width: 0; }
.agenda-items > .muted { grid-column: 1 / -1; margin: 0; padding: 13px; border: 1px dashed #ced4e1; border-radius: 9px; background: #fafaff; font-size: 12px; }
.agenda-item { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; gap: 3px; min-width: 0; min-height: 64px; padding: 10px 12px; border: 1px solid #c9d1df; border-left: 3px solid #a18abf; border-radius: 9px; background: #fff; text-align: left; color: #4c5c77; font-size: 12px; font-weight: 500; line-height: 1.55; }
.agenda-item:hover { background: #f2ecf9; border-color: #bba7d1; border-left-color: #81609f; }
.agenda-item strong, .agenda-item b { display: block; font-size: 13px; font-weight: 700; color: #4e3b68; }
.agenda-item small, .agenda-item .event-meta { color: #75819a; font-size: 11px; }
.agenda-item > span { color: #7a668f; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-item > b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; max-height: 3.2em; }
.mini-calendar { min-width: 0; border: 1px solid #b9c3d7; border-radius: 14px; background: #fff; padding: 14px 13px 12px; box-shadow: 0 3px 13px #26365006; }
.mini-calendar-head { display: flex; gap: 7px; align-items: center; justify-content: space-between; padding: 0 0 10px; border-bottom: 1px solid #d9dfeb; }
.mini-calendar-head h2, #miniCalendarTitle { font-size: 14px; font-weight: 700; color: #3f4c68; line-height: 1.5; }
.mini-calendar-head button { width: 32px; min-width: 32px; min-height: 32px; padding: 3px 6px; border-color: #d7dce7; border-radius: 7px; color: #6c568a; font-size: 17px; line-height: 1.4; }
.calendar-body { margin-top: 8px; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-weekdays { margin: 8px 0 5px; }
.calendar-weekdays span { display: block; color: #73809a; text-align: center; font-size: 11px; font-weight: 600; padding: 3px 0; }
.calendar-weekdays span:first-child { color: #b16b7a; }
.calendar-weekdays span:last-child { color: #677caa; }
.calendar-day { min-width: 0; position: relative; text-align: center; }
button.calendar-day, .calendar-day > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 33px; border: 1px solid transparent; padding: 3px 0; border-radius: 7px; color: #495976; font-size: 12px; font-weight: 500; line-height: 1.5; background: transparent; }
button.calendar-day:hover, .calendar-day > button:hover { background: #f0e9f8; border-color: #d8c8e9; color: #634683; }
.calendar-day.outside, .calendar-day.outside > button { color: #b7becc; }
.calendar-day.today, .calendar-day.today > button { border-color: #aa91c7; background: #faf6ff; color: #6f4a96; font-weight: 750; }
.calendar-day.selected, .calendar-day.selected > button { border-color: #755899; background: #755899; color: #fff; font-weight: 750; }
.calendar-day .calendar-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: #916bb9; visibility: hidden; }
.calendar-day.has-events .calendar-dot { visibility: visible; }
.calendar-day.selected .calendar-dot { background: #fff; }
.calendar-day .calendar-count { font-size: 8px; line-height: 1; color: #9274b3; }
.calendar-day.selected .calendar-count { color: #f1e7fc; }
.calendar-footer { display: flex; flex-direction: row; flex-wrap: wrap; gap: 7px; border-top: 1px solid #d9dfeb; padding-top: 11px; margin-top: 10px; }
.calendar-footer button { flex: 1 1 0; width: auto; min-width: 0; min-height: 43px; padding: 9px 7px; color: #60427e; background: #f0e9f8; border-color: #c6b1db; font-size: 13px; white-space: nowrap; }
.calendar-footer button:hover { background: #e5d9f2; border-color: #a68bbf; }
.calendar-footer #showSchedule { background: #fff; color: #6c7890; border-color: #d2d9e5; font-weight: 500; font-size: 12px; }
.calendar-footer #showSchedule:hover { background: #f4f1f9; color: #664e82; }
.calendar-footer .muted { display: block; flex-basis: 100%; margin-top: 6px; font-size: 11px; text-align: center; }
.calendar-mobile-toggle { display: none; }
.mini-calendar > details > summary { list-style: none; }
.mini-calendar > details > summary::-webkit-details-marker { display: none; }

.schedule-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 15px 0 12px; }
.schedule-toolbar .filters { flex: 1; margin: 0; }
.schedule-toolbar h2 { font-size: 18px; }
.schedule-table { width: 100%; min-width: 760px; border-spacing: 0; border-collapse: separate; background: #fff; }
.schedule-table th { padding: 13px 12px; border-right: 1px solid #ffffff2b; background: var(--navy); color: #f4f5f9; text-align: center; font-size: 13px; font-weight: 600; white-space: nowrap; }
.schedule-table td { padding: 12px; border-bottom: 1px solid #d0d9e7; border-right: 1px solid #d7deea; text-align: center; vertical-align: middle; color: #384967; font-size: 14px; line-height: 1.65; }
.schedule-table th:last-child, .schedule-table td:last-child { border-right: 0; }
.schedule-table tbody tr:last-child td { border-bottom: 0; }
.schedule-table tbody tr:nth-child(even) { background: #f8f6fc; }
.schedule-table tbody tr:hover { background: #f0eaf8; }
.schedule-table .schedule-title, .schedule-table .event-cell-name { min-width: 220px; max-width: 350px; text-align: left; }
.schedule-table .schedule-title button { border: 0; background: transparent; padding: 4px 0; font-size: 14px; text-align: left; font-weight: 700; }
.schedule-table .schedule-title small, .schedule-table .schedule-address { display: block; color: #758099; font-size: 12px; }
.schedule-actions, .event-edit-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px; }
.schedule-actions button, .event-edit-actions button { min-height: 39px; padding: 7px 10px; border-color: #c7bcda; border-radius: 8px; font-size: 12px; }
.schedule-actions .danger, .event-edit-actions .danger { border-color: #dfc2cb; }
.event-edit-actions { justify-content: flex-start; border-top: 1px solid #dce1ea; padding-top: 13px; margin-top: 15px; }
.scheduleDeletedToggle, label:has(#scheduleDeletedToggle) { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; color: #6a758c; font-size: 13px; cursor: pointer; }
.scheduleDeletedToggle input, #scheduleDeletedToggle { width: 20px; height: 20px; margin: 0; accent-color: var(--purple); }
.schedule-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.schedule-card { min-width: 0; margin: 0; padding: 17px 19px; border: 1px solid #bdc8da; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px #26365004; }
.schedule-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 12px; color: #60718b; font-size: 13px; font-variant-numeric: tabular-nums; }
.schedule-card h3 { margin: 6px 0 0; font-size: 16px; line-height: 1.55; }
.schedule-card h3 button, .schedule-card button[data-open-event] { border: 0; min-height: 43px; padding: 3px 0; background: transparent; color: #293954; font-size: 16px; font-weight: 700; text-align: left; line-height: 1.55; }
.schedule-card h3 button:hover, .schedule-card button[data-open-event]:hover { color: #70518e; text-decoration: underline; text-underline-offset: 4px; }
.schedule-card .address { margin: 7px 0 12px; color: #6c7990; font-size: 13px; line-height: 1.7; }
.schedule-card .schedule-memo { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-height: 3.4em; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; color: #758198; font-size: 13px; line-height: 1.7; margin: 0 0 12px; }
.schedule-card .schedule-actions { justify-content: flex-end; padding-top: 10px; border-top: 1px solid #dde3ed; }
.schedule-actions > span:first-child { margin-right: auto; color: #5f6b84; font-size: 13px; line-height: 1.7; }
.schedule-actions > span.muted { color: #7b879b; font-size: 12px; }
.schedule-card.is-deleted, .schedule-card.deleted { border-color: #d6c6cf; background: #faf6f8; box-shadow: none; }
.schedule-card.is-deleted h3 button, .schedule-card.deleted h3 button { color: #887483; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 15px; margin: 15px 0; }
.field-group { min-width: 0; }
.field-group label { display: block; margin: 0 0 6px; color: #52627c; font-size: 13px; font-weight: 650; }
.field-group input:not([type="checkbox"]):not([type="radio"]), .field-group select, .field-group textarea { width: 100%; }
.field-group.full, .field-group.full-width, .form-grid > .full-width { grid-column: 1 / -1; }
.field-group small { display: block; margin-top: 5px; color: #75819a; font-size: 12px; line-height: 1.6; }
.field-help { margin: 6px 0 13px; color: #79859a; font-size: 12px; line-height: 1.7; }
.field-group .check-label { justify-content: flex-start; }
.profile-preview { display: flex; align-items: center; gap: 14px; padding: 14px; margin: 14px 0; border: 1px solid #c6cddd; border-radius: 12px; background: #f8f6fc; }
.profile-preview img, .profile-preview .company-avatar { width: 64px; height: 64px; flex: none; object-fit: contain; border: 1px solid #d1c6e0; border-radius: 13px; background: #fff; }
.profile-preview .company-avatar { display: flex; align-items: center; justify-content: center; color: #fff; background: #75618f; font-size: 25px; font-weight: 750; }
.company-logo-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; border: 1px solid #c9c1d6; border-radius: 12px; background: #f8f6fb; padding: 14px; margin: 14px 0; }
.company-logo-preview img, #companyLogoPreview { display: block; width: 96px; height: 96px; max-width: 96px; max-height: 96px; flex: none; object-fit: contain; border: 1px solid #c9c1d6; border-radius: 12px; background: white; padding: 5px; }
.company-logo-preview #companyLogoHint { flex: 1; min-width: 150px; margin: 0; font-size: 12px; }
.company-logo-preview #removeCompanyLogo { min-height: 40px; color: #a05f72; background: #fff; font-size: 12px; }

@media (max-width: 1100px) and (min-width: 801px) {
  .overview-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
  .overview-main .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-main .card.featured { grid-column: 1 / -1; }
  .overview-main .card strong { font-size: 27px; }
  .overview-main .card.featured strong { font-size: 32px; }
  .overview-main .card { min-height: 132px; }
}
@media (max-width: 800px) {
  .shell { margin: 0; border: 0; border-radius: 0; }
  .top .tools button, .more > summary { font-size: 12px; }
  .top .tools .more-menu button { min-height: 46px; font-size: 14px; }
  .brand #companyLogo, .brand #companyAvatar { width: 45px; height: 45px; border-radius: 11px; }
  .brand #companyAvatar { font-size: 21px; }
  .brand #companyName { font-size: 14px; letter-spacing: .1px; }
  .header-meta, .header-meta #tenant { font-size: 11px; }
  .test { font-size: 11px; }
  .muted { font-size: 12px; }
  .period-nav select { font-size: 14px; }
  .period-nav #mode { font-size: 12px; }
  .last-sync { font-size: 11px; }
  .last-sync #lastSync { font-size: 12px; }
  .last-sync button { font-size: 12px; }
  .status-line, #syncstate { font-size: 11px; }
  .overview-layout { grid-template-columns: minmax(0, 1fr); gap: 11px; margin-bottom: 14px; }
  .overview-main .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .overview-main .card { min-height: 142px; padding: 15px 13px; }
  .card .metric-label, .card small, .card h2 { font-size: 12px; min-height: 35px; }
  .card p { font-size: 11px; }
  .overview-main .card strong { font-size: clamp(22px, 6.4vw, 27px); }
  .overview-main .card.featured { grid-column: 1 / -1; min-height: 148px; padding: 18px; }
  .overview-main .card.featured strong { font-size: 35px; }
  .overview-main .card.featured .metric-label { min-height: 0; }
  .overview-main .tax { margin-bottom: 0; }
  .tax > span, .tax > div { font-size: 11px; border-color: #cfc1df; }
  .tax b { font-size: 16px; }
  .tabs { gap: 4px; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: thin; scroll-snap-type: x proximity; }
  .tabs button { flex: 0 0 auto; min-width: auto; padding: 11px 14px; font-size: 13px; white-space: nowrap; scroll-snap-align: start; }
  .filters select { font-size: 13px; }
  .event-card { border-color: #bac5d7; }
  .event-card.carry { border-color: #c7b4dc; }
  .event-top { border-bottom-color: #cbd3e0; }
  .event-top .event-title, .event-top .eventname { font-size: 15px; }
  .event-top .date-range { font-size: 12px; }
  .event-top .event-meta { font-size: 12px; }
  .event-top .state-badge { font-size: 11px; }
  .event-cell { border-color: #cbd3e0; }
  .event-cell .sectionlabel, .event-cell .cell-label { font-size: 12px; }
  .event-cell .money-edit, .event-cell .editmoney { border-color: #c9b8dd; font-size: 18px; }
  .event-cell .money-edit small, .event-cell .editmoney small { font-size: 11px; }
  .event-cell .check-label, .event-cell .complete-check { font-size: 12px; }
  .event-foot { border-color: #cbd3e0; }
  .event-foot .partial-btn { font-size: 12px; }
  .notice, .alert-summary > summary { font-size: 12px; }
  .notice small { font-size: 11px; }
  .notice button { font-size: 12px; }
  .preview { font-size: 13px; }
  dialog p, dialog .muted, dialog label { font-size: 13px; }
  .memoview { font-size: 14px; }
  .toast, #message { font-size: 12px; }
  footer { font-size: 11px; }
  .mini-calendar { padding: 12px; border-color: #bbc6d9; border-radius: 12px; }
  .mini-calendar-head { padding-bottom: 0; border-bottom: 0; }
  .mini-calendar-head h2, #miniCalendarTitle { font-size: 14px; }
  .mini-calendar-head button { width: 38px; min-width: 38px; min-height: 38px; }
  .calendar-mobile-toggle { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; border: 0; padding: 8px 1px; border-radius: 5px; background: transparent; color: #705489; font-size: 12px; font-weight: 600; cursor: pointer; }
  .calendar-mobile-toggle::after { content: "⌄"; font-size: 16px; color: #806799; }
  .calendar-mobile-toggle[aria-expanded="true"]::after, .mini-calendar details[open] > .calendar-mobile-toggle::after { content: "⌃"; }
  .mini-calendar.is-collapsed .calendar-body { display: none; }
  .calendar-weekdays { margin-top: 5px; }
  .calendar-weekdays span { font-size: 12px; }
  button.calendar-day, .calendar-day > button { min-height: 44px; font-size: 14px; padding: 5px 0; }
  .calendar-footer { margin-top: 7px; padding-top: 10px; }
  .calendar-footer button { min-height: 45px; font-size: 14px; }
  .calendar-footer .muted { font-size: 11px; }
  .quick-agenda { gap: 7px; margin-top: 10px; }
  .agenda-items { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .agenda-heading { align-items: flex-start; }
  .agenda-heading span { font-size: 10px; }
  .agenda-item { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; min-height: 53px; padding: 10px 12px; font-size: 12px; }
  .agenda-item strong, .agenda-item b { font-size: 13px; }
  .agenda-item small { font-size: 11px; }
  .schedule-toolbar { gap: 9px; align-items: stretch; }
  .schedule-toolbar > button, .schedule-toolbar .primary { flex: 1; }
  .schedule-table { min-width: 690px; }
  .schedule-table th { font-size: 12px; }
  .schedule-table td { font-size: 13px; padding: 11px 10px; }
  .schedule-actions button, .event-edit-actions button { min-height: 44px; font-size: 12px; }
  .schedule-toolbar { align-items: center; }
  .schedule-list { gap: 10px; }
  .schedule-card { padding: 14px; border-radius: 12px; }
  .schedule-card-head { font-size: 12px; }
  .schedule-card h3 button, .schedule-card button[data-open-event] { font-size: 15px; }
  .schedule-card .address { font-size: 13px; }
  .schedule-card .schedule-actions { justify-content: flex-end; }
  .schedule-card .schedule-actions button { flex: 0 0 auto; }
  .schedule-actions > span:first-child { flex: 1 1 130px; font-size: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .field-group.full, .field-group.full-width, .form-grid > .full-width { grid-column: auto; }
  .field-group label { font-size: 13px; }
  .field-group input:not([type="checkbox"]):not([type="radio"]), .field-group select, .field-group textarea { font-size: 16px; }
}
.header-add-event { display:none; }
.google-link { display:inline-flex; align-items:center; justify-content:center; min-height:46px; padding:10px 16px; border:1px solid #c3b2d7; border-radius:10px; background:#f1ebf8; color:#563875; font-size:16px; font-weight:600; line-height:1.5; text-decoration:none; text-align:center; }
.google-link.primary { background:#6b4d91; border-color:#6b4d91; color:#fff; }
.google-link:hover { background:#e7def2; color:#4c326a; }
.google-link.primary:hover { background:#573c78; border-color:#573c78; color:#fff; }
.google-link:focus-visible, .demo-login > summary:focus-visible { outline:3px solid #b49bd2; outline-offset:3px; }
#googleLoginPanel > .google-link { display:flex; width:100%; margin:16px 0 12px; }
.demo-login { border-top:1px solid #cdd4e1; padding-top:16px; margin-top:23px; }
.demo-login > summary { min-height:46px; cursor:pointer; color:#5e487b; font-size:16px; font-weight:600; padding:9px 0; }
.demo-login p { font-size:14px; line-height:1.7; }
.google-setup { display:flex; flex-direction:column; gap:8px; margin:18px 0 0; padding-top:16px; border-top:1px solid #cdd4e1; }
.google-setup h3 { font-size:18px; line-height:1.5; margin:0 0 6px; }
.google-setup p { margin:0 0 6px; overflow-wrap:anywhere; }
.google-setup label { font-size:15px; font-weight:600; margin:8px 0 0; }
.google-setup input { display:block; width:100%; margin:0; font-size:16px; }
.google-setup button { margin-top:9px; }
.google-form-status { color:#934253; font-size:14px; line-height:1.65; overflow-wrap:anywhere; }
.google-profile { display:flex; flex-direction:column; gap:4px; font-size:17px; font-weight:600; color:#293a54; }
.google-profile span { font-size:14px; font-weight:500; color:#536178; overflow-wrap:anywhere; }
.connection-notice { border:1px solid #c9b5df; border-radius:12px; padding:15px 17px; margin:15px 0; background:#f8f4fd; font-size:15px; line-height:1.65; }
.connection-notice b { color:#553b74; }
.connection-notice p { margin:6px 0; overflow-wrap:anywhere; }
.connection-notice.error { border-color:#dfb9c3; background:#fff6f8; }
.connection-notice.error b { color:#8d3c53; }
.google-calendar-picker { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; margin:20px 0; }
.google-calendar-picker label { grid-column:1/-1; font-size:16px; font-weight:600; }
.google-calendar-picker select { min-width:0; width:100%; font-size:16px; }
.google-connection-actions { gap:10px; margin:15px 0; }
.google-sync-guide { border-top:1px solid #cdd4e1; margin-top:22px; padding-top:19px; font-size:16px; line-height:1.8; }
.google-sync-guide h3 { font-size:19px; margin:0 0 10px; }
.google-sync-guide ol { padding-left:23px; }
.google-sync-guide li { margin-bottom:9px; }
.google-change-list { border:1px solid #c6bfd5; border-radius:11px; max-height:42vh; overflow:auto; margin:17px 0; }
.google-change-list .connection-row { margin:0; border:0; border-bottom:1px solid #d6d9e5; padding:12px 14px; gap:12px; }
.google-change-list .connection-row:last-child { border-bottom:0; }
.google-change-list .connection-row span { overflow-wrap:anywhere; }
.google-change-list .connection-row b { flex:none; color:#624282; }
.google-conflicts { border-top:1px solid #d2c3e1; margin-top:20px; padding-top:15px; }
.google-conflicts h3 { font-size:18px; color:#603e80; }
dialog:has(.google-conflict-columns) { width:min(860px,calc(100% - 32px)); }
.google-conflict-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:18px 0; }
.google-conflict-columns > section { min-width:0; border:1px solid #c8c1d5; border-radius:11px; padding:14px; background:#faf8fd; }
.google-conflict-columns h3 { font-size:17px; margin:0 0 12px; }
.google-snapshot { margin:0; font-size:15px; line-height:1.65; }
.google-snapshot dt { font-weight:600; color:#5d457b; margin-top:12px; }
.google-snapshot dd { margin:4px 0 0; color:#273950; overflow-wrap:anywhere; }
.google-snapshot .google-snapshot-memo { white-space:pre-wrap; }
#dialogSaveHint { max-width:310px; }
@media(max-width:800px) {
  .google-calendar-picker { grid-template-columns:minmax(0,1fr); }
  .google-calendar-picker button { width:100%; }
  .google-connection-actions > * { flex:1 1 160px; }
  .connection-notice { padding:13px 14px; }
  .google-sync-guide { font-size:16px; }
  .google-conflict-columns { grid-template-columns:minmax(0,1fr); }
  #dialogSaveHint { max-width:none; }
}
@media (max-width:800px) {
  .top .tools .header-add-event { display:inline-flex; justify-content:center; align-items:center; flex:1; }
}
@media print {
  body { background: white; }
  .shell { max-width: none; padding: 0; }
  .top { background: white; color: var(--ink); border-color: var(--line); }
  .top h1, .brand b { color: var(--ink); }
  .tools, .test, .partial-btn, .reset-link, .toast, footer, .lab-tools { display: none !important; }
  .tablewrap { overflow: visible; }
  .events-table { min-width: 0; }
  .events-table th, .events-table td { padding: 8px 5px; font-size: 9px; }
  .events-table .event-title { min-width: 0; }
}

.cloud-empty-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:18px;}
.import-approval {display:flex;align-items:flex-start;gap:10px;border:1px solid #c8b7da;border-radius:10px;padding:14px;line-height:1.7;font-size:15px;}
.import-approval input {width:23px;height:23px;flex:none;margin:3px 0 0;accent-color:#6b4d91;}
.import-approval span {flex:1;}
#backupPreview {overflow-wrap:anywhere;}
#backupPreview small {font-size:14px;}

/* The sales operator uses an isolated setup view. */
.sales-operator { max-width: 1100px; margin: 22px auto; }
.sales-operator-head, .sales-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.sales-operator-head { margin-bottom: 16px; }
.sales-operator-head h2 { margin: 8px 0 2px; }
.sales-operator-head p { margin: 0; }
.sales-operator-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sales-panel { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sales-panel h3 { margin: 0 0 8px; }
.sales-panel button { min-height: 44px; }
.sales-panel fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.sales-panel label { display: block; margin: 12px 0 4px; font-weight: 700; }
.sales-panel label span { font-size: 13px; margin-left: 6px; }
.sales-panel input { width: 100%; min-height: 44px; }
.sales-panel fieldset p { font-size: 13px; margin: 5px 0 15px; }
.sales-id, .sales-company-list li { overflow-wrap: anywhere; }
.sales-feedback { font-size: 14px; color: var(--green); margin: 10px 0 0; }
.sales-feedback-error { color: var(--red); }
.sales-company-list { list-style: none; margin: 0; padding: 0; }
.sales-company-list li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sales-company-list li:first-child { margin-top: 10px; }
.sales-company-list strong { font-size: 16px; }
.sales-company-list time { color: var(--muted); font-size: 13px; }
@media (max-width: 800px) {
  .sales-operator-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sales-operator-head { flex-wrap: wrap; }
  .sales-operator-head button { min-height: 44px; }
  .sales-panel { padding: 16px; }
}

.sales-assignment { margin-top: 8px; }
.sales-assignment summary { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 10px; border: 1px solid var(--line-purple); border-radius: 8px; color: var(--purple-dark); font-weight: 700; cursor: pointer; }
.sales-assignment form { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.sales-assignment label { margin-top: 0; }
.sales-assignment p.muted { font-size: 13px; margin: 5px 0 12px; }
.sales-setup-body { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf9ff; }
.sales-setup-body form, .sales-setup-body label { display: grid; gap: 8px; }
.sales-setup-body form { gap: 14px; }
.sales-setup-body input[type="checkbox"] { width: 24px; min-height: 24px; accent-color: #6f539d; }
.sales-setup-progress { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 10px; list-style: none; padding: 0; }
.sales-setup-progress li { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.sales-setup-body label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.sales-setup-body input, .sales-setup-body select, .sales-setup-body textarea { min-width: 0; max-width: 100%; }
.sales-personal-audit { margin-top: 20px; }
.sales-personal-audit > summary { cursor: pointer; font-size: 20px; font-weight: 800; min-height: 44px; padding: 8px 0; }
.sales-audit-body { padding-top: 10px; }
.sales-audit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.sales-audit-preview { padding: 14px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #faf9ff; overflow-wrap: anywhere; }
.sales-audit-preview h4, .sales-audit-preview p { margin: 5px 0; }
.sales-audit-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.sales-audit-totals > div { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.sales-audit-totals span { font-size: 13px; color: var(--muted); }
.sales-audit-totals strong { font-size: 20px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sales-audit-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; }
.sales-audit-filters label { flex: 1 1 180px; }
.sales-audit-filters label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sales-audit-filters input[type="checkbox"] { width: 22px; min-height: 22px; margin: 0; accent-color: #6f539d; }
.sales-personal-audit table { width: 100%; min-width: 850px; }
.sales-personal-audit td { vertical-align: top; }
.sales-personal-audit td:first-child { min-width: 190px; }
.sales-personal-audit td:last-child { min-width: 200px; }
.sales-personal-audit td p { margin: 0 0 8px; }
.sales-audit-money { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.sales-audit-original { margin-top: 8px; }
.sales-audit-original summary, .sales-personal-audit td details summary { cursor: pointer; min-height: 36px; color: var(--purple-dark); }
.sales-audit-original .memoview { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 550px; }
.sales-audit-excluded { border-top: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .sales-audit-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sales-audit-totals strong { font-size: 17px; }
  .sales-audit-actions button { flex: 1 1 200px; }
}
/* Inline, touch-friendly calendar-copy editor. */
.sales-audit-editor { border:2px solid #b4a1d0; border-radius:14px; padding:22px; margin:8px 0; background:#f8f6fc; color:#25344d; text-align:left; white-space:normal; }
.sales-audit-editor h4 { font-size:22px; margin:0 0 10px; }
.sales-audit-editor h5 { font-size:19px; margin:0 0 12px; }
.sales-audit-editor p { line-height:1.65; }
.sales-audit-editor fieldset { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.sales-audit-edit-section { padding:18px; border:1px solid #d7cce6; border-radius:12px; background:white; min-width:0; }
.sales-audit-editor label { font-size:16px; line-height:1.5; }
.sales-audit-editor input,.sales-audit-editor select { display:block; width:100%; min-height:48px; padding:10px 12px; font:inherit; color:#25344d; background:white; border:1px solid #9fabc1; border-radius:8px; box-sizing:border-box; }
.sales-audit-editor select { white-space:normal; }
.sales-audit-editor input:focus,.sales-audit-editor select:focus,.sales-audit-editor button:focus-visible { outline:3px solid #8d71b9; outline-offset:2px; }
.sales-audit-editor button { font-size:16px; min-height:46px; }
.sales-audit-party-list { display:grid; gap:14px; }
.sales-audit-party-card { padding:14px; border:1px solid #d7cce6; border-radius:10px; background:#fcfbff; }
.sales-audit-party-card > strong { font-size:17px; }
.sales-audit-tax-help { padding:12px; border-left:4px solid #9c82be; background:#f0ebf8; font-size:15px; line-height:1.6; margin-top:12px!important; }
.sales-audit-confirm { display:flex!important; align-items:flex-start; gap:10px; padding:12px; border:1px solid #b6a5cf; border-radius:9px; }
.sales-audit-confirm input { width:24px; min-height:24px; flex:none; margin:0; accent-color:#6e4c94; }
.sales-audit-confirm span { font-size:15px!important; margin:0!important; }
.sales-audit-live { padding:18px; background:#fff; border:1px solid #b6a5cf; border-radius:12px; margin-top:18px; }
.sales-audit-live-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.sales-audit-live-grid > div { display:grid; padding:12px; border:1px solid #d7cce6; border-radius:8px; gap:6px; }
.sales-audit-live-grid > div:last-child { grid-column:1/-1; background:#ede7f6; }
.sales-audit-live-grid span { font-size:15px; }
.sales-audit-live-grid strong { font-size:23px; color:#4f3675; font-variant-numeric:tabular-nums; }
.sales-personal-audit td button { margin-top:10px; white-space:normal; }
@media(max-width:700px){
 .sales-audit-editor { padding:14px; }
 .sales-audit-editor fieldset { grid-template-columns:minmax(0,1fr); gap:14px; }
 .sales-audit-edit-section { padding:14px; }
 .sales-audit-live-grid strong { font-size:20px; }
 .sales-audit-table-wrap { overflow:visible; }
 .sales-audit-table-wrap table,.sales-audit-table-wrap tbody { display:block; min-width:0; width:100%; }
 .sales-audit-table-wrap thead { display:none; }
 .sales-audit-table-wrap tr { display:grid; grid-template-columns:1fr 1fr; border:1px solid #c9bddb; border-radius:12px; margin:12px 0; overflow:hidden; background:white; }
 .sales-audit-table-wrap td { display:block; min-width:0!important; padding:12px; border-bottom:1px solid #e1dbe9; text-align:left; white-space:normal; }
 .sales-audit-table-wrap td:first-child,.sales-audit-table-wrap td:last-child { grid-column:1/-1; }
 .sales-audit-table-wrap td[data-label]::before { content:attr(data-label); display:block; font-size:13px; color:#5a6374; margin-bottom:4px; }
 .sales-audit-table-wrap .sales-audit-edit-row { display:block; border:0; }
 .sales-audit-table-wrap .sales-audit-edit-row > td { padding:0; }
}

.calendar-footer .calendar-external-link{flex:1 0 100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;min-height:44px;padding:10px 12px;border:1px solid #cec3df;border-radius:12px;background:#f5f1fa;color:#533b77;font-size:15px;font-weight:700;text-decoration:none}.calendar-external-link:hover{background:#ece4f6}.calendar-external-link:focus-visible{outline:3px solid #70529a;outline-offset:3px}
