:root{
  --gaac-bg:#fff;
  --gaac-border:#e5e7eb;
  --gaac-primary:#14532d; /* green 900 */
  --gaac-primary-weak:#d1fae5;
  --gaac-today:#1b2eb0;
  --gaac-muted:#6b7280;
  --gaac-radius:12px;
  --gaac-gap:8px;
  --gaac-cell-h:42px;
}
.gaac{ background:var(--gaac-bg); border:1px solid var(--gaac-border); border-radius:var(--gaac-radius); padding:14px; box-shadow:0 2px 10px rgba(0,0,0,.03); font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; }
.gaac__header{ display:flex; align-items:center; gap:10px; justify-content:center; margin-bottom:10px; }
.gaac__title{ font-weight:700; letter-spacing:.2px; min-width:220px; text-align:center; }
.gaac__nav{ width:34px; height:34px; border-radius:50%; border:1px solid var(--gaac-border); background:#fff; cursor:pointer; }
.gaac__today{ margin-left:auto; border:0; background:#f3f4f6; border-radius:10px; padding:6px 10px; cursor:pointer; color:#111; }

.gaac__grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:var(--gaac-gap); }
.gaac__wd{ text-align:center; color:var(--gaac-muted); font-size:12px; padding:4px 0 6px; }
.gaac__cell{ height:var(--gaac-cell-h); border-radius:10px; display:flex; align-items:center; justify-content:center; position:relative; background:#f9fafb; color:#111; }
.gaac__cell[data-other="1"]{ opacity:.45; }
.gaac__cell[data-weekend="1"]{ background:#f8fafc; }
.gaac__cell[data-today="1"]{ outline:2px solid var(--gaac-today); }
.gaac__cell[data-disabled="1"]{ pointer-events:none; opacity:.35; }

.gaac__num{ width:28px; height:28px; border-radius:10px; display:flex; align-items:center; justify-content:center; }
.gaac__cell[data-has="1"] .gaac__num{ background:var(--gaac-primary); color:#fff; }

/* Range selection */
.gaac__cell[data-inrange="1"] .gaac__num{ background:var(--gaac-primary-weak); }
.gaac__cell[data-start="1"] .gaac__num,
.gaac__cell[data-end="1"] .gaac__num{ background:var(--gaac-primary); color:#fff; }

.gaac__legend{ display:flex; gap:12px; margin-top:10px; align-items:center; }
.gaac__mark{ font-size:12px; color:var(--gaac-muted); display:flex; align-items:center; gap:6px; }
.gaac__mark:before{ content:''; width:12px; height:12px; border-radius:6px; background:#e5e7eb; display:inline-block; }
.gaac--has:before{ background:var(--gaac-primary); }
.gaac--today:before{ background:var(--gaac-today); }
.gaac--range:before{ background:var(--gaac-primary-weak); }

/* Modal */
.gaac-modal{ position:fixed; inset:0; display:none; z-index:99999; }
.gaac-modal.is-open{ display:block; }
.gaac-modal__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.4); }
.gaac-modal__dialog{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:min(640px,92vw); background:#fff; border-radius:16px; box-shadow:0 12px 40px rgba(0,0,0,.2); }
.gaac-modal__close{ position:absolute; right:10px; top:10px; width:32px; height:32px; border-radius:16px; border:1px solid var(--gaac-border); background:#fff; cursor:pointer; }
.gaac-modal__body{ padding:18px 18px 8px; max-height:70vh; overflow:auto; }
.gaac-modal__day{ font-weight:700; margin-bottom:6px; }
.gaac-event{ display:flex; gap:10px; padding:10px 6px; border-bottom:1px dashed #e5e7eb; }
.gaac-event__time{ font-size:12px; color:var(--gaac-muted); min-width:70px; }
.gaac-event__title a{ color:#111; text-decoration:none; }
.gaac-event__title a:hover{ text-decoration:underline; }

@media (max-width:640px){
  :root{ --gaac-cell-h:38px; }
  .gaac__title{ min-width:170px; }
}

/* === GA preset: narrow width + on-brand arrows (add class "gaac--ga" in shortcode) === */
.gaac.gaac--ga{
  max-width:420px;
  margin:0 auto;
  --gaac-gap:6px;
  --gaac-cell-h:36px;
  --gaac-radius:14px;
  --gaac-primary:#14532d;
  --gaac-today:#1b2eb0;
}
.gaac.gaac--ga .gaac__grid{ gap: var(--gaac-gap); }
.gaac.gaac--ga .gaac__num{ width:26px; height:26px; border-radius:8px; font-size:14px; }

/* neutralize theme button styles */
.gaac.gaac--ga .gaac__cell,
.gaac.gaac--ga .gaac__today,
.gaac.gaac--ga .gaac__nav{
  appearance:none; border:none; box-shadow:none; color:inherit;
}
.gaac.gaac--ga .gaac__cell{
  background:#f8fafb;
  border:1px solid transparent;
}

/* arrows */
.gaac.gaac--ga .gaac__nav{
  width:36px; height:36px; border-radius:50%;
  border:1px solid #d9dde2; background:#fff; position:relative;
  color:transparent;
}
.gaac.gaac--ga .gaac__nav:hover{ background:#14532d; border-color:#14532d; }
.gaac.gaac--ga .gaac__nav::after{
  content:""; position:absolute; inset:0; margin:auto; width:14px; height:14px;
  background-repeat:no-repeat; background-position:center; background-size:14px 14px;
}
.gaac.gaac--ga .gaac__prev::after{
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polyline points='15 18 9 12 15 6' fill='none' stroke='%2314532d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.gaac.gaac--ga .gaac__next::after{
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polyline points='9 18 15 12 9 6' fill='none' stroke='%2314532d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.gaac.gaac--ga .gaac__nav:hover.gaac__prev::after{
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polyline points='15 18 9 12 15 6' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.gaac.gaac--ga .gaac__nav:hover.gaac__next::after{
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polyline points='9 18 15 12 9 6' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* today-btn and title tweaks */
.gaac.gaac--ga .gaac__today{ padding:6px 12px; border-radius:999px; background:#f3f4f6; color:#111; }
.gaac.gaac--ga .gaac__today:hover{ background:#e9ecef; }
.gaac.gaac--ga .gaac__title{ font-size:16px; }

/* === Fit-to-block fixes (GA) === */
.gaac.gaac--ga{ width:100%; max-width:100%; box-sizing:border-box; }
.gaac.gaac--ga .gaac__header{ justify-content:space-between; gap:8px; }
.gaac.gaac--ga .gaac__title{ flex:1 1 auto; min-width:0; text-align:center; }
.gaac.gaac--ga .gaac__nav{ flex:0 0 36px; }
.gaac.gaac--ga .gaac__grid{ grid-template-columns:repeat(7, minmax(0,1fr)); }
.gaac.gaac--ga .gaac__legend{ flex-wrap:wrap; }

/* === 10px narrower variant === */
.gaac.gaac--ga{ width:calc(100% - 10px) !important; margin-left:auto; margin-right:auto; }

/* === v1.1.1 fix: keep only number pill green === */
.gaac .gaac__grid .gaac__cell,
.gaac.gaac--ga .gaac__grid .gaac__cell{
  -webkit-appearance:none; appearance:none;
  background:#f8fafb !important;
  color:#111 !important;
  border:1px solid transparent !important;
  box-shadow:none !important;
}
.gaac .gaac__grid .gaac__cell:hover,
.gaac .gaac__grid .gaac__cell:focus,
.gaac .gaac__grid .gaac__cell:active{
  background:#f1f5f9 !important;
  color:#111 !important;
  outline:none !important;
  box-shadow:none !important;
}
.gaac .gaac__cell[data-has="1"] .gaac__num{ background:var(--gaac-primary); color:#fff; }

/* === v1.1.2: green capsule on hover/active/focus === */
.gaac .gaac__cell:not([data-disabled="1"]):hover .gaac__num,
.gaac .gaac__cell:not([data-disabled="1"]):focus .gaac__num,
.gaac .gaac__cell:not([data-disabled="1"]):active .gaac__num{
  background: var(--gaac-primary) !important;
  color:#fff !important;
}

/* v1.1.3 — Жёсткий сброс чужих button-стилей в сетке календаря */
.gaac .gaac__grid button.gaac__cell,
.gaac.gaac--ga .gaac__grid button.gaac__cell {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--gaac-cell-h);
  width: 100%;
  border-radius: 10px;
  background: #f8fafb !important;
  color: #111 !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}
.gaac .gaac__grid .gaac__cell:focus { outline: none !important; }
