* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7; color: #1d1d1f; font-size: 15px; line-height: 1.5;
}
h1 { font-size: 26px; font-weight: 600; margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
a { color: #0071e3; text-decoration: none; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: #6e6e73; } .small { font-size: 13px; } .err { color: #d70015; }
.hidden { display: none !important; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; padding: 28px 16px; background: #fff; border-right: 1px solid #e8e8ed;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 19px; font-weight: 700; margin-bottom: 28px; padding-left: 12px; }
.brand span { color: #0071e3; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 9px 12px; border-radius: 10px; color: #1d1d1f; font-weight: 500;
}
.sidebar nav a:hover { background: #f5f5f7; }
.sidebar nav a.active { background: #e8f0fe; color: #0071e3; }
.logout { margin-top: auto; padding: 9px 12px; color: #6e6e73; }
.content { flex: 1; padding: 32px 40px; max-width: 1080px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.auth-card { width: 380px; }
.auth-card h1 { margin-bottom: 4px; }

.card {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.04);
  margin-bottom: 20px;
}
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.empty { text-align: center; padding: 40px; color: #6e6e73; }

label { display: block; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
input[type=text], input[type=password], input[type=url], input[name]:not([type]), input[type=datetime-local],
input[type=time], select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 12px;
  border: 1px solid #d2d2d7; border-radius: 10px; font: inherit; background: #fff; color: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #0071e3; outline-offset: -1px; border-color: #0071e3; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 12px; border: none;
  background: #e8e8ed; color: #1d1d1f; font: inherit; font-weight: 500; cursor: pointer;
}
.btn:hover { filter: brightness(.97); }
.btn.primary { background: #0071e3; color: #fff; }
.btn.ghost { background: transparent; color: #0071e3; padding: 6px 10px; }
.btn.danger { color: #d70015; }
.btn.full { width: 100%; margin-top: 14px; }

.toast {
  padding: 12px 18px; border-radius: 12px; margin-bottom: 14px; background: #e8f0fe;
  color: #1d1d1f; transition: opacity .4s;
}
.toast-success { background: #e3f5e9; } .toast-error { background: #fbe7e9; }
.toast.fade { opacity: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,.08), 0 12px 28px rgba(0,0,0,.1); }
.thumb { width: 100%; height: 150px; object-fit: cover; background: #eee; }
.post-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-title { font-weight: 600; }
.post-excerpt { font-size: 13.5px; color: #6e6e73; flex: 1; }
.post-meta { display: flex; align-items: center; gap: 8px; }
.share-btn { align-self: flex-start; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #e8e8ed; text-transform: capitalize;
}
.badge-green { background: #d8f2e2; color: #146b3a; }
.badge-red { background: #fbdde0; color: #a1131e; }
.badge-blue { background: #dceafd; color: #0057b8; }
.badge-gray { background: #ececee; color: #6e6e73; }
.badge-amber { background: #fdf0d3; color: #8a5b00; }
.qthumb { width: 56px; height: 32px; object-fit: cover; border-radius: 6px; }

/* posting schedule card */
.sched-card { padding: 18px 24px; }
.sched-card summary { cursor: pointer; font-weight: 600; }
.sched-acct { border-top: 1px solid #f0f0f2; padding: 14px 0; }
.sched-acct:last-of-type { padding-bottom: 0; }
.sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 10px 0 6px; }
.sched-day { background: #f5f5f7; border-radius: 10px; padding: 8px; min-height: 60px; display: flex; flex-direction: column; gap: 4px; }
.sched-day-name { font-size: 12px; font-weight: 600; color: #6e6e73; }
.day-chips { display: inline-flex; gap: 4px; }
.day-chip input { position: absolute; opacity: 0; }
.day-chip span {
  display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 12.5px;
  background: #f0f0f2; color: #6e6e73; cursor: pointer;
}
.day-chip input:checked + span { background: #0071e3; color: #fff; }
.sched-add { flex-wrap: wrap; margin-top: 6px; }
.sched-add input[type=time] { width: auto; margin: 0; padding: 5px 8px; }
.next-hint { margin-left: auto; }
.next-hint + .prov { margin-left: 8px; }
.tlog-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #f0f0f2; font-size: 13.5px; }
.tlog-row .prov { margin-left: 0; }
.tlog-msg { flex: 1; min-width: 0; }
.sec-sub { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.sec-sub:first-of-type { margin-top: 10px; }
.sec-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.sec-row label { margin-bottom: 0; }
.sec-sudo label, .sec-sudo { max-width: 200px; }
#sudoOverlay .panel { margin-top: 15vh; }

/* posts: share status */
.filter-chips { display: inline-flex; gap: 6px; }
.filter-chips .chip { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; color: #6e6e73; background: #fff; text-decoration: none; border: 1px solid rgba(0,0,0,.08); }
.filter-chips .chip.on { background: #0071e3; color: #fff; border-color: #0071e3; }
.status-bar { display: flex; border-top: 1px solid #f0f0f2; margin-top: auto; }
.status-seg { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 8px; font-size: 11.5px; font-weight: 500; }
.status-seg + .status-seg { border-left: 1px solid rgba(0,0,0,.05); }
.st-never { background: #f5f5f7; color: #8e8e93; }
.st-posted { background: #d8f5df; color: #0a6b2b; }
.st-scheduled { background: #fdf0d3; color: #8a5b00; }
.st-failed { background: #fbdde0; color: #a1131e; }

/* composer history */
.share-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f0f0f2; }
.share-history h3 { font-size: 14px; margin: 0; }
.hist-list { max-height: 220px; overflow-y: auto; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #f5f5f7; font-size: 13px; }
.hist-row:first-child { border-top: 0; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hist-ic { display: inline-flex; color: #6e6e73; }
.hist-acct { font-weight: 500; white-space: nowrap; }
.hist-msg { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #6e6e73; }
.hist-err { color: #a1131e; font-size: 12px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.small { padding: 2px 8px; font-size: 12px; }

/* month view */
.view-switch { width: 170px; }
.view-switch a { flex: 1; text-align: center; padding: 7px; border-radius: 9px; font-weight: 500; font-size: 13.5px; color: #6e6e73; }
.view-switch a.on { background: #fff; color: #1d1d1f; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.month-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.month-title { font-size: 17px; min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 12px; font-weight: 600; color: #6e6e73; padding: 0 4px 4px; }
.cal-cell { background: #fff; border-radius: 10px; padding: 6px; min-height: 110px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cal-cell.out { opacity: .45; }
.cal-cell.today .cal-num {
  background: #0071e3; color: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-num { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.cal-pill {
  font-size: 11.5px; padding: 2px 6px; margin-bottom: 2px; border-radius: 6px;
  border-left: 3px solid #0071e3; background: #f5f5f7; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.pill-wrap { min-width: 0; }
.cal-open { border: none; background: none; color: #8e8e93; font-size: 11px; cursor: pointer; padding: 2px 4px; display: block; border-bottom: 1px dashed #d1d1d6; width: 100%; text-align: left; }
.cal-openwrap { display: none; }
.cal-cell.open-slots .cal-openwrap { display: block; }
.cal-pill.st-sent { border-color: #34c759; }
.cal-pill.st-failed { border-color: #ff3b30; }
.cal-pill.st-cancelled { border-color: #c7c7cc; }
.cal-slot { border: 1px dashed #c7c7cc; border-left-width: 1px; background: transparent; color: #8e8e93; cursor: default; }
.tdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ffab00; margin: 0 3px; vertical-align: middle; }
.pglyph { font-weight: 700; margin-right: 3px; }
.cal-extra { display: none; }
.cal-cell.expanded .cal-extra { display: block; }
.cal-cell.expanded .cal-more { display: none; }
.cal-more { border: none; background: none; color: #0071e3; font-size: 11.5px; cursor: pointer; padding: 2px 6px; }
.pop-panel { width: 460px; }
@media (max-width: 800px) {
  .cal { display: block; }
  .cal-head { display: none; }
  .cal-cell { margin-bottom: 8px; min-height: 0; }
  .cal-cell.empty, .cal-cell.out { display: none; }
}

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.32); display: none;
  align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 4vh 16px;
}
.overlay.open { display: flex; }
.panel {
  background: #fff; width: 920px; max-width: 96vw; overflow-y: auto;
  padding: 24px; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.panel-cols { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .panel-cols { grid-template-columns: 1fr 1fr; } }
.preview-label { font-weight: 600; margin-bottom: 10px; }
.preview-label .small { font-weight: 400; display: block; }

/* live previews */
.pv { background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 14px; margin-bottom: 16px; }
.pv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pv-head .pv-long { margin-left: auto; }
.pv-name { font-weight: 700; font-size: 14px; }
.pv-text { white-space: pre-wrap; font-size: 14px; margin-bottom: 8px; }
.pv-link { display: block; color: #0071e3; font-size: 14px; margin-bottom: 8px; word-break: break-all; }
.pv-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #eee; max-height: 240px; }
.pv-xcard { border: 1px solid #e5e5ea; border-radius: 12px; overflow: hidden; }
.pv-xcard .pv-card-body { padding: 8px 12px; }
.pv-xcard.photo { border: none; }
.pv-xcard.photo .pv-img { border-radius: 12px; }
.pv-xcard.photo .pv-card-body { display: none; }
.pv-fbcard.photo .pv-img { aspect-ratio: 1.91/1; }
.pv-fbcard.photo .pv-fbstrip { display: none; }

/* iOS-style toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #e8e8ed; border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ''; position: absolute; width: 22px; height: 22px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: #34c759; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.pv-host { font-size: 12px; color: #6e6e73; }
.pv-title { font-size: 13.5px; color: #1d1d1f; }
.pv-fbcard { overflow: hidden; }
.pv-fbstrip { background: #f0f2f5; padding: 8px 12px; }
.pv-fbstrip .pv-host { text-transform: uppercase; font-size: 11px; }
.pv-fbstrip .pv-title { font-weight: 700; }
.pv-exc { font-size: 12.5px; color: #6e6e73; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-img img { width: 100%; border-radius: 12px; margin-bottom: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.counter.over { color: #d70015; font-weight: 600; }
#shLinkShow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acct-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.acct-chip {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px;
  border: 1px solid #e8e8ed; border-radius: 12px; cursor: pointer; font-weight: 500;
}
.acct-chip img, .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%; background: #e8e8ed; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #6e6e73;
}
.prov { margin-left: auto; font-weight: 700; }
.prov-x { color: #000; } .prov-facebook { color: #1877f2; }

.segmented { display: flex; background: #e8e8ed; border-radius: 12px; padding: 3px; gap: 3px; }
.segmented label { flex: 1; margin: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: block; text-align: center; padding: 7px; border-radius: 9px; cursor: pointer;
  font-weight: 500; font-size: 13.5px; color: #6e6e73;
}
.segmented input:checked + span { background: #fff; color: #1d1d1f; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
#pickWrap { margin-top: 12px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tab { padding: 7px 16px; border-radius: 999px; color: #6e6e73; font-weight: 500; }
.tab.active { background: #1d1d1f; color: #fff; }

.qrow { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.qbody { flex: 1; min-width: 0; }
.qmsg { font-weight: 500; }
.qactions { display: flex; gap: 4px; }

.acct-row { border-top: 1px solid #f0f0f2; padding: 14px 0; }
.acct-row:first-of-type { border-top: none; }
.acct-info { display: flex; align-items: center; gap: 10px; }
.acct-info form { margin-left: auto; }
.slots { margin: 8px 0 0 38px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; background: #f0f0f2; border-radius: 999px;
  padding: 4px 10px; font-size: 13px;
}
.chip form { display: inline; }
.chip-x { border: none; background: none; cursor: pointer; color: #6e6e73; padding: 0; font-size: 12px; }
.slot-add { display: inline-flex; gap: 6px; align-items: center; }
.slot-add select, .slot-add input { width: auto; margin: 0; padding: 5px 8px; }
.copy {
  background: #f5f5f7; border-radius: 10px; padding: 10px 14px; overflow-x: auto;
  user-select: all; white-space: nowrap;
}
form.inline { display: inline; }
details { margin-top: 12px; }
details summary { cursor: pointer; font-weight: 500; color: #0071e3; }
details ol { padding-left: 20px; }
.prov-linkedin { color: #0a66c2; }
.prov-google { color: #1a73e8; }
.pv-licard { border: 1px solid #e5e5ea; border-radius: 8px; overflow: hidden; }
.pv-licard .pv-li-body { padding: 8px 12px; background: #f3f2ef; }
.pv-licard.photo { border: none; }
.pv-licard.photo .pv-li-body { display: none; }
.pv-licard .pv-img { width: 100%; aspect-ratio: 1.91/1; object-fit: cover; display: block; }
.pv-gcard { border: 1px solid #e5e5ea; border-radius: 8px; overflow: hidden; }
.pv-gcard .pv-gimg { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.pv-gcard .pv-text { padding: 10px 12px 4px; }
.pv-gcta { padding: 8px 12px 12px; }
.pv-gbtn { display: inline-block; color: #1a73e8; border: 1px solid #dadce0; border-radius: 4px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
