/* MemberTap canonical admin polish
   Shared visual rules intentionally load after page-level styles. */

:root{
  --mt-bg:#f5f7f5;
  --mt-surface:#ffffff;
  --mt-surface-soft:#f8faf8;
  --mt-surface-strong:#f1f6f2;
  --mt-line:#e1e7e2;
  --mt-line-strong:#d2dcd4;
  --mt-text:#142019;
  --mt-heading:#0f1712;
  --mt-muted:#647168;
  --mt-subtle:#879289;
  --mt-green:#157a52;
  --mt-green-2:#1d8e61;
  --mt-green-dark:#0f5f40;
  --mt-green-soft:#edf7f1;
  --mt-green-soft-strong:#dff0e6;
  --mt-warn:#9a5c0b;
  --mt-warn-soft:#fff6e8;
  --mt-red:#b42318;
  --mt-red-soft:#fff1f0;
  --mt-blue:#285fbd;
  --mt-blue-soft:#eef4ff;
  --mt-shadow-xs:0 1px 2px rgba(16,24,20,.04);
  --mt-shadow-sm:0 8px 24px rgba(16,35,24,.055);
  --mt-shadow-md:0 18px 44px rgba(16,35,24,.085);
  --mt-radius:20px;
  --mt-radius-lg:18px;
  --mt-radius-md:14px;
  --mt-radius-sm:11px;
  --mt-content-max:1240px;
}

html{
  background:var(--mt-bg);
  scroll-behavior:smooth;
}

body.mt-admin{
  background:
    radial-gradient(circle at 78% -10%,rgba(21,122,82,.055),transparent 28rem),
    var(--mt-bg);
  color:var(--mt-text);
  font-size:15px;
  line-height:1.5;
  letter-spacing:-.008em;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

body.mt-admin button,
body.mt-admin input,
body.mt-admin select,
body.mt-admin textarea{
  font:inherit;
}

body.mt-admin ::selection{
  background:var(--mt-green-soft-strong);
  color:var(--mt-green-dark);
}

body.mt-admin a,
body.mt-admin button,
body.mt-admin summary{
  -webkit-tap-highlight-color:transparent;
}

body.mt-admin a:focus-visible,
body.mt-admin button:focus-visible,
body.mt-admin input:focus-visible,
body.mt-admin select:focus-visible,
body.mt-admin textarea:focus-visible,
body.mt-admin summary:focus-visible{
  outline:3px solid rgba(21,122,82,.2);
  outline-offset:3px;
}

/* Shell */
.mt-shell{
  grid-template-columns:244px minmax(0,1fr);
}

.mt-sidebar{
  padding:24px 14px 18px;
  gap:20px;
  border-right:1px solid var(--mt-line);
  background:rgba(250,252,250,.9);
  backdrop-filter:blur(22px) saturate(120%);
}

.mt-brand{
  gap:11px;
  padding:0 10px 4px;
  color:var(--mt-heading);
  font-size:21px;
  font-weight:900;
  letter-spacing:-.035em;
}

.mt-brand-mark{
  width:34px;
  height:34px;
  border-radius:11px;
  background:linear-gradient(145deg,var(--mt-green-2),var(--mt-green-dark));
  box-shadow:0 8px 20px rgba(21,122,82,.2);
  color:#fff;
  font-size:12px;
}

.mt-nav{
  gap:5px;
}

.mt-nav a{
  min-height:46px;
  gap:13px;
  padding:10px 12px;
  border-radius:13px;
  color:#4e5c53;
  font-size:15px;
  font-weight:730;
  transition:background .16s ease,color .16s ease,box-shadow .16s ease;
}

.mt-nav a:hover{
  background:#f0f4f1;
  color:var(--mt-heading);
}

.mt-nav a.active{
  background:var(--mt-green-soft);
  color:var(--mt-green-dark);
  box-shadow:inset 3px 0 0 var(--mt-green);
  font-weight:900;
}

.mt-nav a.active .ico{
  color:var(--mt-green);
}

.mt-person,
.mt-help{
  border-color:var(--mt-line);
  border-radius:16px;
  padding:11px;
  background:rgba(255,255,255,.9);
  box-shadow:var(--mt-shadow-xs);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

.mt-person:hover,
.mt-help:hover{
  border-color:var(--mt-line-strong);
  background:#fff;
  box-shadow:var(--mt-shadow-sm);
}

.mt-person strong,
.mt-help strong{
  color:var(--mt-heading);
  font-size:13px;
}

.mt-person span,
.mt-help span{
  color:var(--mt-muted);
  font-size:12px;
}

.mt-avatar{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.5);
}

.mt-main{
  background:transparent;
}

.mt-topbar{
  height:78px;
  padding:0 clamp(18px,3vw,34px);
  border-bottom:1px solid rgba(210,220,212,.9);
  background:rgba(245,247,245,.84);
  backdrop-filter:blur(22px) saturate(125%);
}

.mt-church-picker,
.mt-date-picker{
  height:46px;
  border-color:var(--mt-line);
  border-radius:14px;
  padding:0 13px;
  background:rgba(255,255,255,.92);
  box-shadow:var(--mt-shadow-xs);
  font-size:14px;
}

.mt-action-center-button{
  width:46px !important;
  height:46px !important;
  border-color:#173b2b !important;
  background:var(--mt-heading) !important;
  box-shadow:0 10px 24px rgba(15,23,18,.15) !important;
}

.mt-content{
  width:min(100%,var(--mt-content-max));
  max-width:var(--mt-content-max);
  margin:0 auto;
  padding:30px clamp(18px,3vw,36px) 64px;
}

.mt-page-title{
  margin-bottom:20px;
}

.mt-page-title h1{
  color:var(--mt-heading);
  font-size:clamp(30px,3.7vw,42px);
  line-height:1.06;
  letter-spacing:-.052em;
}

.mt-page-title p{
  max-width:68ch;
  margin-top:7px;
  color:var(--mt-muted);
  font-size:16px;
  line-height:1.55;
}

/* Surface system */
.mt-card,
.soft-panel,
.mt-setting-detail,
.mt-more-accordion,
.mt-person-dialog,
.mt-follow-drawer{
  border-color:var(--mt-line);
  background:var(--mt-surface);
}

.mt-card{
  padding:20px;
  border-radius:var(--mt-radius);
  box-shadow:var(--mt-shadow-xs);
}

.mt-card.flush{
  overflow:hidden;
}

.mt-card-title{
  gap:16px;
  margin-bottom:14px;
}

.mt-card-title h2,
.mt-card-title h3{
  color:var(--mt-heading);
  font-size:19px;
  line-height:1.2;
  letter-spacing:-.028em;
}

.mt-card-title p{
  max-width:64ch;
  margin-top:6px;
  color:var(--mt-muted);
  line-height:1.5;
}

.mt-secondary-details{
  margin-top:14px;
  padding:0;
  overflow:hidden;
  border-color:var(--mt-line);
  border-radius:var(--mt-radius-lg);
  background:var(--mt-surface);
  box-shadow:var(--mt-shadow-xs);
}

.mt-secondary-details>summary{
  min-height:58px;
  padding:13px 16px;
  justify-content:space-between;
  list-style:none;
  color:var(--mt-heading);
}

.mt-secondary-details>summary::-webkit-details-marker{
  display:none;
}

.mt-secondary-details>summary small{
  display:block;
  margin-top:2px;
  color:var(--mt-muted);
  font-weight:600;
}

.mt-secondary-details>summary>b{
  color:var(--mt-subtle);
  transition:transform .18s ease;
}

.mt-secondary-details[open]>summary>b{
  transform:rotate(180deg);
}

.mt-secondary-body{
  border-top:1px solid var(--mt-line);
  padding:14px 16px 16px;
  background:var(--mt-surface-soft);
}

/* Typography and small UI */
.meta,
.person-line small{
  color:var(--mt-muted);
  line-height:1.45;
}

.mt-pill{
  min-height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 10px;
  border:1px solid transparent;
  border-radius:999px;
  background:var(--mt-green-soft);
  color:var(--mt-green-dark);
  font-size:12px;
  font-weight:850;
  line-height:1.2;
}

.mt-pill.gray{
  border-color:#e6e9ed;
  background:#f3f5f6;
  color:#53606b;
}

.mt-pill.warn{
  border-color:#f1d8ad;
  background:var(--mt-warn-soft);
  color:var(--mt-warn);
}

.mt-pill.red{
  border-color:#f2c7c3;
  background:var(--mt-red-soft);
  color:var(--mt-red);
}

.icon-bubble{
  width:40px;
  height:40px;
  border-radius:13px;
  background:var(--mt-green-soft);
  color:var(--mt-green);
}

.mt-stat .icon-bubble{
  width:46px;
  height:46px;
}

.mt-stat{
  min-height:132px;
  padding:19px;
}

.mt-stat span{
  color:var(--mt-muted);
}

.mt-stat strong{
  margin:8px 0 5px;
  color:var(--mt-heading);
  font-size:32px;
}

.mt-change{
  color:var(--mt-green) !important;
}

/* Buttons */
.mt-add,
.btn-primary,
button.btn-primary{
  min-height:44px;
  height:auto;
  padding:10px 17px;
  border:1px solid var(--mt-green);
  border-radius:13px;
  background:var(--mt-green);
  color:#fff;
  box-shadow:0 6px 16px rgba(21,122,82,.16);
  font-size:14px;
  font-weight:850;
  line-height:1.2;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}

.outline-btn,
.btn-light,
.btn-secondary{
  min-height:44px;
  padding:9px 15px;
  border:1px solid var(--mt-line-strong);
  border-radius:13px;
  background:#fff;
  color:var(--mt-heading);
  box-shadow:var(--mt-shadow-xs);
  font-size:14px;
  font-weight:820;
  line-height:1.2;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}

.mt-close-x{
  width:40px;
  height:40px;
  border:1px solid var(--mt-line);
  background:var(--mt-surface-soft);
  color:var(--mt-heading);
  cursor:pointer;
}

.mt-add:disabled,
.outline-btn:disabled,
button:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}

@media(hover:hover){
  .mt-add:hover,
  .btn-primary:hover{
    border-color:var(--mt-green-2);
    background:var(--mt-green-2);
    box-shadow:0 9px 22px rgba(21,122,82,.19);
    transform:translateY(-1px);
  }

  .outline-btn:hover,
  .btn-light:hover,
  .btn-secondary:hover{
    border-color:#c6d2c9;
    background:var(--mt-surface-soft);
    box-shadow:var(--mt-shadow-sm);
    transform:translateY(-1px);
  }
}

/* Form controls */
.search,
.mt-field input,
.mt-field select,
.mt-field textarea,
.mt-person-dialog input,
.mt-person-dialog select,
.mt-person-dialog textarea,
.mt-care-grid input,
.mt-care-grid select,
.mt-care-grid textarea,
.mt-settings-panel input,
.mt-settings-panel select,
.mt-settings-panel textarea,
.mt-share-hub input,
.mt-insight-range input{
  min-height:46px;
  border:1px solid var(--mt-line-strong);
  border-radius:13px;
  background:#fff;
  color:var(--mt-text);
  padding:10px 12px;
  box-shadow:inset 0 1px 0 rgba(16,24,20,.015);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

textarea{
  resize:vertical;
}

.search::placeholder,
input::placeholder,
textarea::placeholder{
  color:#98a39b;
}

.search:focus,
.mt-field input:focus,
.mt-field select:focus,
.mt-field textarea:focus,
.mt-person-dialog input:focus,
.mt-person-dialog select:focus,
.mt-person-dialog textarea:focus,
.mt-care-grid input:focus,
.mt-care-grid select:focus,
.mt-care-grid textarea:focus,
.mt-settings-panel input:focus,
.mt-settings-panel select:focus,
.mt-settings-panel textarea:focus,
.mt-share-hub input:focus,
.mt-insight-range input:focus{
  outline:0;
  border-color:rgba(21,122,82,.72);
  box-shadow:0 0 0 4px rgba(21,122,82,.1);
}

.mt-field label,
.mt-people-field,
.mt-care-grid label,
.mt-settings-panel label,
.mt-share-hub label{
  color:#34453a;
  font-size:13px;
  font-weight:800;
}

/* Shared list and card interactions */
.action-list,
.queue-list,
.activity-list,
.mt-people-list,
.mt-follow-list,
.mt-review-list,
.mt-care-components,
.mt-admin-list,
.mt-integration-list{
  gap:9px;
}

.action-item,
.queue-item,
.mt-person-card,
.mt-follow-row,
.mt-next-actions>a,
.mt-day-grid>a,
.mt-sunday-metrics>a,
.mt-review-list a,
.mt-insight-bar,
.mt-connect-summary article,
.mt-onboarding-mini a,
.mt-onboarding-mini>div,
.mt-setup-items>a{
  border-color:var(--mt-line);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--mt-shadow-xs);
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease,transform .16s ease;
}

.action-item,
.mt-person-card,
.mt-next-actions>a,
.mt-day-grid>a,
.mt-sunday-metrics>a,
.mt-review-list a,
.mt-setup-items>a{
  color:var(--mt-text);
}

@media(hover:hover){
  .action-item:hover,
  .queue-item:hover,
  .mt-person-card:hover,
  .mt-follow-row:hover,
  .mt-next-actions>a:hover,
  .mt-day-grid>a:hover,
  .mt-sunday-metrics>a:hover,
  .mt-review-list a:hover,
  .mt-connect-summary article:hover,
  .mt-onboarding-mini a:hover,
  .mt-setup-items>a:hover{
    border-color:#cdd9d0;
    background:#fcfefd;
    box-shadow:var(--mt-shadow-sm);
    transform:translateY(-1px);
  }
}

.action-item{
  min-height:66px;
  padding:12px 13px;
}

.activity-item,
.milestone-item{
  border-color:var(--mt-line);
  padding:12px 0;
}

.activity-item strong,
.action-item strong,
.person-line strong{
  color:var(--mt-heading);
}

/* Sticky list controls */
.mt-list-controls{
  top:92px;
  z-index:18;
  margin-bottom:14px;
  padding:16px;
  border-color:rgba(210,220,212,.95);
  border-radius:18px;
  background:rgba(255,255,255,.94);
  box-shadow:0 12px 34px rgba(16,35,24,.06);
  backdrop-filter:blur(18px) saturate(125%);
}

.mt-control-head{
  margin-bottom:11px;
}

.mt-control-head strong{
  color:var(--mt-heading);
  font-size:15px;
}

.mt-control-head small{
  color:var(--mt-muted);
  line-height:1.45;
}

.mt-filter-chips{
  gap:7px;
}

.mt-filter-chip{
  min-height:38px;
  padding:0 12px;
  border-color:var(--mt-line-strong);
  background:#fff;
  color:#536158;
  font-size:13px;
  font-weight:800;
}

.mt-filter-chip strong{
  background:#eef2ef;
  color:#536158;
}

.mt-filter-chip.active{
  border-color:var(--mt-green);
  background:var(--mt-green);
  color:#fff;
  box-shadow:0 6px 14px rgba(21,122,82,.15);
}

.mt-filter-chip.active strong{
  background:rgba(255,255,255,.18);
  color:#fff;
}

/* Today */
.mt-today-head{
  margin:-3px 0 18px;
  gap:16px;
}

.mt-today-head>p{
  color:var(--mt-muted);
  font-size:14px;
  font-weight:750;
}

.mt-care-header-gauge{
  min-width:222px;
  padding:8px 10px;
  border-color:#d7e7dc;
  border-radius:16px;
  background:rgba(255,255,255,.9);
  box-shadow:var(--mt-shadow-xs);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}

@media(hover:hover){
  .mt-care-header-gauge:hover{
    border-color:#bfd8c7;
    box-shadow:var(--mt-shadow-sm);
    transform:translateY(-1px);
  }
}

.mt-care-gauge-ring{
  width:54px;
  height:54px;
  background:conic-gradient(var(--mt-green) calc(var(--care-score)*1%),#e3e9e4 0);
}

.mt-care-gauge-copy strong{
  color:var(--mt-heading);
}

.mt-care-gauge-copy span{
  color:var(--mt-muted);
}

.mt-command-center{
  margin-bottom:16px;
  padding:23px;
  border-color:#cfe2d5;
  background:linear-gradient(135deg,#f1f9f4 0,#fff 70%);
  box-shadow:0 12px 34px rgba(21,122,82,.075);
}

.mt-command-center h2{
  max-width:24ch;
  margin:8px 0 6px;
  color:var(--mt-heading);
  font-size:clamp(24px,3vw,34px);
  line-height:1.08;
}

.mt-command-center p{
  color:#536158;
  font-size:15px;
  line-height:1.5;
}

.mt-next-actions{
  margin-top:14px;
}

.mt-next-actions>a{
  padding:11px 12px;
}

.mt-next-actions>a>span{
  border-radius:12px;
  background:var(--mt-green-soft);
  color:var(--mt-green-dark);
}

.mt-next-actions small,
.mt-day-grid small,
.mt-sunday-metrics small{
  color:var(--mt-muted);
  line-height:1.4;
}

.mt-day-brief,
.mt-sunday-recap{
  margin-top:16px;
}

.mt-day-grid,
.mt-sunday-metrics{
  gap:9px;
}

.mt-day-grid>a{
  min-height:132px;
  padding:13px;
}

.mt-sunday-metrics>a{
  padding:11px;
}

.mt-sunday-metrics strong{
  color:var(--mt-heading);
  font-size:20px;
}

.mt-sunday-metrics b{
  color:var(--mt-muted);
}

/* People */
.mt-people-primary-controls{
  gap:9px;
}

.mt-people-total{
  padding:6px 10px;
  border:1px solid var(--mt-line);
  border-radius:12px;
  background:var(--mt-surface-soft);
}

.mt-people-total strong{
  color:var(--mt-heading);
  font-size:21px;
}

.mt-people-total span{
  color:var(--mt-muted);
  font-size:12px;
}

.mt-person-card{
  min-height:86px;
  padding:13px 14px;
  cursor:pointer;
}

.mt-person-card-context{
  min-width:0;
}

.mt-person-card-context strong{
  color:#334139;
  font-size:13px;
  line-height:1.35;
}

.mt-person-card-context small{
  color:var(--mt-muted);
  line-height:1.4;
}

.mt-person-card-arrow{
  color:#97a39a;
  transition:transform .16s ease,color .16s ease;
}

@media(hover:hover){
  .mt-person-card:hover .mt-person-card-arrow{
    color:var(--mt-green);
    transform:translateX(2px);
  }
}

.mt-tag-list{
  gap:5px;
}

.mt-tag-pill{
  border:1px solid #e5e9e6;
  background:#f4f6f5;
  color:#59655e;
  font-weight:780;
}

/* Follow-Up */
.mt-follow-row{
  min-height:78px;
  padding:13px 14px;
}

.mt-follow-row.overdue,
.mt-follow-row.slipping{
  border-color:#efcbc8;
  background:#fffafa;
  box-shadow:inset 4px 0 0 var(--mt-red);
}

.mt-follow-row.today,
.mt-follow-row.due_soon,
.mt-follow-row.soon{
  border-color:#efd8b5;
  background:#fffdf8;
  box-shadow:inset 4px 0 0 #c87a16;
}

.mt-follow-row .mt-add{
  min-width:74px;
}

.mt-follow-modal{
  background:rgba(8,18,12,.58);
  backdrop-filter:blur(4px);
}

.mt-follow-drawer{
  border:1px solid rgba(255,255,255,.55);
  border-radius:24px;
  padding:22px;
  box-shadow:0 30px 90px rgba(7,18,11,.28);
}

.mt-follow-head{
  top:-22px;
  padding:20px 0 12px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(12px);
}

.mt-follow-head h2{
  color:var(--mt-heading);
}

.mt-contact-actions{
  gap:7px;
}

.mt-care-section{
  margin-top:12px;
  padding:14px;
  border-color:var(--mt-line);
  border-radius:16px;
  background:var(--mt-surface-soft);
}

.mt-care-section h3{
  color:var(--mt-heading);
}

.mt-care-section details>summary{
  min-height:42px;
  display:flex;
  align-items:center;
  color:var(--mt-green-dark);
  font-weight:820;
  cursor:pointer;
}

.mt-outcome-grid{
  gap:7px;
}

.mt-outcome-grid button{
  min-height:44px;
  border-color:var(--mt-line-strong);
  border-radius:12px;
  background:#fff;
  color:#425047;
  font-size:13px;
  cursor:pointer;
}

.mt-outcome-grid button.active{
  border-color:var(--mt-green);
  background:var(--mt-green-soft);
  color:var(--mt-green-dark);
  box-shadow:0 0 0 3px rgba(21,122,82,.08);
}

.mt-follow-save{
  background:linear-gradient(to top,#fff 78%,rgba(255,255,255,.82));
  border-top-color:var(--mt-line);
}

/* Connect */
.mt-connect-tabs{
  top:88px;
  gap:4px;
  padding:5px;
  border-color:var(--mt-line);
  border-radius:15px;
  background:rgba(241,245,242,.94);
  box-shadow:var(--mt-shadow-xs);
  backdrop-filter:blur(16px);
}

.mt-connect-tabs button{
  min-height:42px;
  border-radius:11px;
  color:#66736a;
  font-size:13px;
  cursor:pointer;
}

.mt-connect-tabs button.active{
  background:#fff;
  color:var(--mt-green-dark);
  box-shadow:0 3px 12px rgba(16,35,24,.08);
}

.mt-connect-panel{
  gap:14px;
}

.mt-connect-intro{
  padding:22px;
  border-color:#d4e4d9;
  background:linear-gradient(135deg,#f4faf6,#fff 74%);
}

.mt-connect-intro h2{
  color:var(--mt-heading);
  font-size:clamp(23px,3vw,31px);
  line-height:1.1;
}

.mt-connect-summary{
  gap:10px;
}

.mt-connect-summary article{
  min-height:180px;
  padding:14px;
}

.mt-connect-summary article strong{
  color:var(--mt-heading);
  font-size:16px;
}

.mt-share-hub>img{
  border-color:var(--mt-line);
  border-radius:20px;
  background:#fff;
  box-shadow:0 10px 28px rgba(16,35,24,.08);
}

.mt-destination-note{
  border-top-color:var(--mt-line);
}

/* Insights */
.mt-insight-hero{
  padding:22px;
  border-color:#d4e4d9;
  background:linear-gradient(135deg,#f3faf5,#fff 72%);
}

.mt-insight-hero h2{
  color:var(--mt-heading);
  font-size:clamp(23px,3vw,31px);
  line-height:1.1;
}

.mt-insight-metrics{
  gap:10px;
  margin:16px 0;
}

.mt-insight-metrics article{
  min-height:126px;
  padding:15px;
  border-color:var(--mt-line);
  border-radius:16px;
  box-shadow:var(--mt-shadow-xs);
}

.mt-insight-metrics small{
  color:var(--mt-muted);
  font-size:12px;
}

.mt-insight-metrics strong{
  color:var(--mt-heading);
  font-size:28px;
  letter-spacing:-.04em;
}

.mt-insight-metrics span{
  color:var(--mt-muted);
}

.mt-pastoral-brief{
  border-color:#cfe2d5;
  background:linear-gradient(135deg,#f3faf5,#fff 76%);
}

.mt-pastoral-brief>p{
  color:#536158;
  line-height:1.55;
}

.mt-pastoral-brief article>span{
  background:var(--mt-green-soft-strong);
  color:var(--mt-green-dark);
}

.mt-care-components article{
  border-top-color:var(--mt-line);
}

.mt-care-components article>div:last-child{
  background:#e8ede9;
}

.mt-care-components article>div:last-child span{
  background:linear-gradient(90deg,var(--mt-green),var(--mt-green-2));
}

/* More, Settings, Help, Onboarding */
.mt-more-sections{
  gap:14px;
}

.mt-more-sections>.mt-card{
  padding:18px;
}

.mt-more-sections .action-item{
  padding:12px;
}

.mt-setting-detail{
  border-radius:18px;
  box-shadow:var(--mt-shadow-xs);
}

.mt-setting-detail>summary{
  min-height:72px;
  padding:15px 17px;
}

.mt-setting-detail>summary h2{
  color:var(--mt-heading);
  font-size:17px;
}

.mt-setting-detail>summary p{
  color:var(--mt-muted);
  line-height:1.45;
}

.mt-setting-body{
  border-top-color:var(--mt-line);
  background:var(--mt-surface-soft);
}

.mt-settings-panel{
  gap:12px;
}

.mt-settings-panel h3{
  color:var(--mt-heading);
}

.mt-admin-list article,
.mt-integration-list article,
.mt-plan-grid article,
.mt-api-detail{
  border-color:var(--mt-line);
  border-radius:15px;
  background:#fff;
}

.mt-plan-grid article{
  padding:14px;
}

.mt-help-tabs,
.mt-support-tabs{
  border-color:var(--mt-line);
  background:var(--mt-surface-soft);
}

.mt-onboarding-flow,
.mt-onboarding-callout,
.mt-onboarding-hero,
.mt-finish-card{
  border-color:#cfe2d5;
  background:linear-gradient(135deg,#f3faf5,#fff 72%);
  box-shadow:0 12px 34px rgba(21,122,82,.065);
}

.mt-onboarding-step,
.mt-setup-card{
  border-color:var(--mt-line);
  box-shadow:var(--mt-shadow-xs);
}

/* Tables */
.mt-table-wrap,
.table-wrap{
  border-color:var(--mt-line);
  border-radius:17px;
  box-shadow:var(--mt-shadow-xs);
}

.mt-table th,
table th{
  color:#66736a;
  background:#f8faf8;
  font-size:11px;
  letter-spacing:.035em;
}

.mt-table td,
table td{
  border-color:#edf1ee;
}

.mt-table tbody tr,
table tbody tr{
  transition:background .14s ease;
}

@media(hover:hover){
  .mt-table tbody tr:hover,
  table tbody tr:hover{
    background:#fbfdfb;
  }
}

/* Empty and error states */
.mt-empty-guide,
.mt-no-results{
  border-color:var(--mt-line);
  border-radius:18px;
  background:var(--mt-surface-soft);
  box-shadow:none;
}

.mt-empty-guide h2,
.mt-no-results strong{
  color:var(--mt-heading);
}

.mt-muted-warning{
  border:1px solid #eedab8;
  border-radius:13px;
  background:var(--mt-warn-soft);
  color:#7b4c12;
  padding:10px 12px;
}

/* Toast */
.mt-toast{
  bottom:88px;
  border:1px solid rgba(255,255,255,.13);
  background:var(--mt-heading);
  box-shadow:0 20px 60px rgba(8,18,12,.25);
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
  }
}

/* Tablet and mobile */
@media(max-width:1100px){
  .mt-shell{
    grid-template-columns:220px minmax(0,1fr);
  }

  .mt-content{
    padding-left:24px;
    padding-right:24px;
  }

  .mt-command-center h2{
    max-width:none;
  }
}

@media(max-width:860px){
  body.mt-admin{
    background:var(--mt-bg);
  }

  .mt-sidebar{
    width:min(86vw,320px);
    padding:22px 14px calc(18px + env(safe-area-inset-bottom));
    box-shadow:0 24px 80px rgba(7,18,11,.22);
  }

  body.sidebar-open::after{
    content:"";
    position:fixed;
    inset:0;
    z-index:55;
    background:rgba(8,18,12,.42);
    backdrop-filter:blur(2px);
  }

  body.sidebar-open .mt-sidebar{
    z-index:60;
  }

  .mt-topbar{
    min-height:68px;
    padding:10px 14px;
  }

  .mt-mobile-menu{
    width:44px;
    height:44px;
    border-color:var(--mt-line);
    border-radius:13px;
    background:#fff;
    color:var(--mt-heading);
  }

  .mt-church-picker{
    height:44px;
    max-width:min(58vw,270px);
  }

  .mt-content{
    width:100%;
    padding:22px 14px calc(104px + env(safe-area-inset-bottom));
  }

  .mt-page-title{
    margin-bottom:17px;
  }

  .mt-page-title h1{
    font-size:clamp(29px,8vw,36px);
  }

  .mt-page-title p{
    font-size:15px;
  }

  .mt-card{
    padding:17px;
    border-radius:18px;
  }

  .mt-list-controls{
    position:relative;
    top:auto;
    padding:15px;
  }

  .mt-connect-tabs{
    top:68px;
  }

  .mt-command-center,
  .mt-connect-intro,
  .mt-insight-hero{
    padding:18px;
  }

  .mt-command-center h2,
  .mt-connect-intro h2,
  .mt-insight-hero h2{
    font-size:25px;
  }

  .mt-day-grid>a{
    min-height:unset;
  }

  .mobile-bottom{
    left:8px;
    right:8px;
    bottom:8px;
    border:1px solid var(--mt-line);
    border-radius:20px;
    padding:6px 6px max(6px,env(safe-area-inset-bottom));
    background:rgba(255,255,255,.96);
    box-shadow:0 16px 44px rgba(7,18,11,.16);
    backdrop-filter:blur(18px);
  }

  .mobile-bottom a{
    min-height:52px;
    border-radius:14px;
    color:#6b776f;
    font-size:11px;
    font-weight:780;
  }

  .mobile-bottom a.active{
    background:var(--mt-green-soft);
    color:var(--mt-green-dark);
  }

  .mt-follow-drawer{
    width:100%;
    max-height:94dvh;
    border-radius:24px 24px 0 0;
    padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .mt-follow-save{
    grid-template-columns:1fr;
  }

  .mt-follow-status{
    grid-column:auto;
  }
}

@media(max-width:620px){
  .mt-top-actions{
    gap:8px;
  }

  .mt-action-center-button{
    width:44px !important;
    height:44px !important;
  }

  .mt-content{
    padding-left:12px;
    padding-right:12px;
  }

  .mt-card-title{
    display:grid;
    grid-template-columns:1fr;
  }

  .mt-card-title>.outline-btn,
  .mt-card-title>.mt-add{
    width:100%;
    justify-content:center;
  }

  .mt-today-head{
    grid-template-columns:1fr;
  }

  .mt-care-header-gauge{
    width:100%;
    min-width:0;
  }

  .mt-next-actions>a{
    grid-template-columns:36px minmax(0,1fr);
  }

  .mt-next-actions>a>b{
    grid-column:2;
    justify-self:start;
    color:var(--mt-green-dark);
    font-size:12px;
  }

  .mt-day-grid,
  .mt-sunday-metrics,
  .mt-setup-items,
  .mt-insight-metrics,
  .mt-plan-grid,
  .mt-profile-grid,
  .mt-check-grid,
  .mt-inline-form{
    grid-template-columns:1fr;
  }

  .mt-person-card{
    grid-template-columns:1fr 20px;
    align-items:start;
  }

  .mt-person-card-context{
    grid-column:1/-1;
    padding-top:10px;
    border-top:1px solid var(--mt-line);
  }

  .mt-person-card-context .mt-pill{
    width:max-content;
  }

  .mt-follow-row{
    grid-template-columns:1fr;
    gap:10px;
  }

  .mt-follow-row .mt-add{
    width:100%;
  }

  .mt-filter-chips{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .mt-filter-chip{
    width:100%;
    justify-content:space-between;
  }

  .mt-connect-tabs{
    top:64px;
  }

  .mt-connect-tabs button{
    padding:8px 7px;
  }

  .mt-connect-status{
    display:grid;
    grid-template-columns:1fr;
  }

  .mt-insight-metrics article{
    min-height:auto;
  }

  .mt-review-list a{
    align-items:flex-start;
  }

  .mt-setting-detail>summary{
    min-height:66px;
    padding:14px;
  }

  .mt-dialog-actions,
  .mt-settings-actions,
  .mt-contact-actions{
    display:grid;
    grid-template-columns:1fr;
  }

  .mt-dialog-actions>*,
  .mt-settings-actions>*,
  .mt-contact-actions>*{
    width:100%;
    justify-content:center;
  }

  .mt-toast{
    width:calc(100vw - 24px);
    bottom:82px;
    border-radius:16px;
  }
}

@media(max-width:420px){
  .mt-filter-chips{
    grid-template-columns:1fr;
  }

  .mt-church-picker span:nth-child(2){
    max-width:120px;
  }

  .mobile-bottom a{
    font-size:10px;
  }
}
