:root {
  color-scheme: light;
  --brand: #176B67;
  --brand-dark: #104D4A;
  --ink: #1C2B2A;
  --muted: #667674;
  --line: #DCE5E3;
  --surface: #FFFFFF;
  --canvas: #F5F8F7;
  --soft: #E9F3F1;
  --danger: #B42318;
  --warning: #986A09;
  --success: #20744B;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #7BBDB8; outline-offset: 2px; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--brand); }
.loading-screen, .login-wrap, .password-wrap { min-height: 100dvh; display: grid; place-content: center; justify-items: center; padding: 24px; }
.loading-screen p { color: var(--muted); }
.brand-mark { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 25px; box-shadow: 0 8px 22px #176b6730; }
.login-card, .password-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 12px 36px #1836330a; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand h1 { font-size: 23px; margin: 0; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 16px; }
.subtitle { color: var(--muted); font-size: 14px; line-height: 1.55; }
.form-stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label, .field-label { font-size: 13px; font-weight: 700; color: #334442; }
.field input, .field select, .field textarea, .toolbar select, .inline-control {
  width: 100%; min-width: 0; border: 1px solid #CDD9D7; border-radius: 11px; background: #fff; color: var(--ink); padding: 11px 12px;
}
.field input[type="file"] { padding: 9px; font-size: 13px; }
.field textarea { resize: vertical; min-height: 105px; line-height: 1.5; }
.help { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; }
.btn { border: 1px solid transparent; border-radius: 11px; min-height: 42px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { color: #fff; background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #F1F6F5; }
.btn-danger { background: #FFF1F0; color: var(--danger); border-color: #F4CDCA; }
.btn-success { background: #E9F7EF; color: var(--success); border-color: #B8E0C8; }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.error-text { color: var(--danger); font-size: 13px; line-height: 1.45; margin: 0; }
.app-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1240px; margin: auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-brand .brand-mark { flex: 0 0 39px; width: 39px; height: 39px; border-radius: 12px; font-size: 19px; }
.brand-logo { width: 39px; height: 39px; border-radius: 12px; object-fit: cover; background: #f3f6f5; }
.header-brand h1 { font-size: 17px; margin: 0; letter-spacing: -.02em; }
.header-brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.header-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--brand-dark); font-weight: 800; }
.app-main { width: min(100% - 32px, 1190px); margin: 24px auto 56px; }
.page-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-top p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); padding: 4px; gap: 4px; background: #EDF2F1; border-radius: 13px; margin-bottom: 18px; }
.tab { padding: 9px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 4px #153a3512; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar select { width: min(100%, 310px); }
.month-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.month-switch strong { min-width: 140px; text-align: center; text-transform: capitalize; font-size: 15px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--ink); font-size: 18px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 16px; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 17px; box-shadow: 0 3px 14px #18363305; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.panel-heading p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekday { text-align: center; padding: 6px 0 9px; font-size: 10px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.day-cell { position: relative; min-width: 0; min-height: 68px; border: 1px solid transparent; border-radius: 11px; background: #F7FAF9; color: var(--ink); padding: 8px 5px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-cell:hover { border-color: #B9D4D1; }
.day-cell.outside { color: #9AA6A4; background: #FCFDFD; }
.day-cell.selected { background: var(--soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.day-cell.today .day-number { border-bottom: 2px solid var(--brand); }
.day-number { font-size: 13px; font-weight: 800; line-height: 1.4; }
.day-markers { display: flex; align-items: center; gap: 3px; justify-content: center; flex-wrap: wrap; }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #91A3A0; }
.status-dot.in-review { background: #D69B20; }
.status-dot.approved { background: #2D9661; }
.status-dot.changes-requested { background: #C44D43; }
.status-dot.published { background: #4577C5; }
.day-count { color: var(--muted); font-size: 9px; }
.selected-date-title { text-transform: capitalize; }
.post-list { display: grid; gap: 10px; }
.post-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; text-align: left; color: inherit; width: 100%; }
.post-card:hover { border-color: #A8CBC6; background: #FBFDFD; }
.post-thumb { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; overflow: hidden; color: var(--brand); font-size: 21px; }
.post-thumb img, .post-thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-content { flex: 1; min-width: 0; }
.post-card-title { font-weight: 800; font-size: 13px; margin-bottom: 5px; }
.post-card-meta { color: var(--muted); font-size: 11px; display: flex; flex-wrap: wrap; gap: 5px 8px; margin-bottom: 7px; }
.post-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 100px; background: #F0F3F2; color: #4A5D5A; font-size: 10px; font-weight: 800; padding: 5px 8px; white-space: nowrap; }
.status-pill.in-review { background: #FFF5D9; color: #835B00; }
.status-pill.changes-requested { background: #FFF0EF; color: #9F3028; }
.status-pill.approved { background: #E8F7EE; color: #1E6D44; }
.status-pill.published { background: #ECF3FF; color: #2F5E9C; }
.status-pill.cancelled { background: #ECEFEE; color: #596764; }
.comment-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.empty-state { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty-icon { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--soft); color: var(--brand); font-size: 21px; }
.empty-state strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 5px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.5; }
.client-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.client-card { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 16px; min-width: 0; }
.client-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client-card-logo { width: 48px; height: 48px; border-radius: 13px; object-fit: cover; display: grid; place-items: center; flex: 0 0 48px; background: var(--soft); color: var(--brand); font-size: 20px; font-weight: 800; overflow: hidden; }
.client-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.client-card-info { min-width: 0; flex: 1; }
.client-card-info h3 { overflow-wrap: anywhere; }
.client-card-info p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.client-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.modal { width: min(760px, calc(100vw - 24px)); max-width: none; max-height: min(90dvh, 900px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px #102c2860; }
.modal::backdrop { background: #142b29a3; backdrop-filter: blur(3px); }
.modal-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-header-text { min-width: 0; flex: 1; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 18px 20px 22px; }
.modal-close { border: 1px solid var(--line); background: white; border-radius: 10px; width: 35px; height: 35px; font-size: 21px; flex: 0 0 35px; }
.detail-caption { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; margin: 12px 0; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.media-item { min-width: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #F7F9F8; }
.media-item img, .media-item video { width: 100%; max-height: 320px; object-fit: contain; background: #101817; display: block; }
.media-item audio { width: calc(100% - 16px); margin: 8px; }
.media-label { padding: 8px 10px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.comments-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.comments-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.comment-list { display: grid; gap: 10px; margin-bottom: 15px; }
.comment { border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; background: #F9FBFA; }
.comment-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.comment-author { font-size: 12px; font-weight: 800; }
.comment-date { font-size: 10px; color: var(--muted); }
.comment-body { font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment audio { width: 100%; margin-top: 8px; }
.comment-composer { display: grid; gap: 9px; }
.composer-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.record-indicator { font-size: 12px; color: var(--danger); }
.record-indicator::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.modal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions .push-left { margin-right: auto; }
.notice { padding: 11px 12px; border-radius: 11px; background: #EEF6F5; color: #275E59; font-size: 12px; line-height: 1.5; }
.toast { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 20px); background: #183B37; color: white; border-radius: 12px; padding: 12px 16px; font-size: 13px; box-shadow: 0 8px 32px #0003; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8F211A; }
.hidden { display: none !important; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .client-list { grid-template-columns: 1fr; }
  .header-inner { padding: 10px 14px; }
  .user-chip .user-name { display: none; }
  .app-main { width: calc(100% - 24px); margin-top: 18px; }
}
@media (max-width: 560px) {
  .page-top { flex-direction: column; align-items: stretch; }
  .top-actions .btn { flex: 1; }
  .toolbar { align-items: stretch; }
  .toolbar select { width: 100%; }
  .month-switch { margin-left: 0; justify-content: space-between; width: 100%; }
  .month-switch strong { flex: 1; }
  .panel { padding: 12px; border-radius: 15px; }
  .calendar-grid { gap: 3px; }
  .weekday { font-size: 9px; }
  .day-cell { min-height: 54px; padding: 6px 1px 4px; border-radius: 8px; gap: 4px; }
  .day-number { font-size: 12px; }
  .day-count { font-size: 8px; }
  .status-dot { width: 5px; height: 5px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .modal { width: calc(100vw - 12px); max-height: 94dvh; border-radius: 17px; }
  .modal-header { padding: 15px 14px 12px; }
  .modal-body { padding: 14px; }
  .media-grid { grid-template-columns: 1fr; }
  .login-card, .password-card { padding: 22px; }
  .day-cell.outside { opacity: .7; }
}
