/* Thriftero global app styles
   Order matters: base -> layout -> components -> page-specific -> responsive overrides.
   Load this AFTER any reset/theme file and BEFORE very small page-only overrides. */

:root{
  --bg:#f7f7f5;
  --card:#ffffff;
  --line:#e7e7e2;
  --text:#161616;
  --ink:#161616;
  --muted:#666;
  --muted-2:#8a8a8a;
  --soft:#f2f2ee;
  --soft-2:#fafaf8;
  --success:#edf8ef;
  --success-line:#bdd9c2;
  --danger:#fff4f4;
  --danger-line:#efcaca;
  --warn:#fff8e8;
  --warn-line:#ecd9a8;
  --shadow:0 1px 0 rgba(0,0,0,.02);
  --radius:18px;
  --brand:#f24b47;
  --brand-dark:#d92d2d;
  --brand-soft:#fff1f1;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.45;
}
a{color:inherit}
img{max-width:100%}

/* Layout */
.wrap{
  max-width:1080px;
  margin:0 auto;
  padding:22px 18px 48px;
}
.narrow{
  max-width:700px;
  margin:0 auto;
  width:100%;
}
.shell,.login-card,.table-card,.note{
  max-width:940px;
  width:100%;
  margin:0 auto;
}

/* Top navigation */
.topbar{
  width:100%;
  margin-bottom:16px;
}
.topbar-inner{
  max-width:700px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:14px;
}
.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  color:#0f214d;
  text-decoration:none;
  margin-right:auto;
}
.brand img{
  width:34px;
  height:34px;
  border-radius:999px;
  display:block;
}
.header-links{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.top-bar-logo{
  width:40px;
  height:40px;
  flex:0 0 40px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid var(--line);
  background:#fff;
  display:block;
}
.top-bar-logo.placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--brand-soft);
  color:var(--brand);
  font-weight:700;
  font-size:18px;
}

/* Buttons */
.btn,.btn2,.btnDanger,.btnLink,.btnSmall{
  appearance:none;
  border:0;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:999px;
  font-size:14px;
  line-height:1;
  transition:.15s ease;
}
.btn{
  background:var(--brand);
  color:#fff;
}
.btn:hover{background:var(--brand-dark)}
.btn2{
  background:#fff;
  color:#111;
  border:1px solid var(--line);
}
.btn2:hover{background:var(--soft-2)}
.btnDanger{
  background:var(--danger);
  color:#b42318;
  border:1px solid var(--danger-line);
}
.btnDanger:hover{background:#ffeaea}
.btnLink{
  background:transparent;
  color:var(--muted);
  padding-inline:4px;
  min-height:auto;
  border-radius:0;
}
.btnLink:hover{
  color:var(--text);
  text-decoration:underline;
}
.btnSmall{
  min-height:34px;
  padding:7px 12px;
  font-size:13px;
  background:#fff;
  color:#111;
  border:1px solid var(--line);
}
.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.bottom-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-start;
}
.save-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid var(--line);
}

/* Cards and page titles */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
  margin-top:18px;
}
.page-head{margin-top:8px}
.page-title{
  margin:0;
  font-size:30px;
  line-height:1.08;
  letter-spacing:-.02em;
}
.page-copy{
  margin:8px 0 0;
  color:var(--muted);
  font-size:15px;
}
.section-title{
  margin:0 0 6px;
  font-size:22px;
  line-height:1.1;
  letter-spacing:-.01em;
}
.section-copy{
  color:var(--muted);
  font-size:14px;
  margin:0;
}
.muted{color:var(--muted)}
.small{font-size:13px}
.eyebrow{
  color:var(--muted);
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.sub{margin:8px 0 0;color:var(--muted)}

/* Alerts */
.notice,.flash,.err{
  margin-top:18px;
  padding:12px 14px;
  border-radius:14px;
  font-size:14px;
}
.notice{border:1px solid var(--line);background:#fff}
.notice.ok,
.flash.ok{
  background:var(--success);
  border-color:var(--success-line);
  color:#245b2d;
}
.notice.err,.err{
  background:var(--danger);
  border:1px solid var(--danger-line);
  color:#8b1e1e;
}
.notice.warn{
  background:var(--warn);
  border:1px solid var(--warn-line);
}
.flash{
  background:#f5f7ff;
  border:1px solid #d9e0ff;
  color:#2140a3;
}

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-size:12px;
  color:var(--text);
  white-space:nowrap;
}
.pill.active{
  background:var(--success);
  border-color:var(--success-line);
}

/* Forms */
label{font-weight:700;font-size:14px}
input,textarea,select{
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font:inherit;
  padding:12px 14px;
}
textarea{min-height:120px;resize:vertical}
.form-grid{display:grid;gap:14px}
.field,.field-group{margin-top:16px}
.hint,.field-help{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
}
.check{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin-top:10px;
}
.check input{
  width:auto;
  margin-top:4px;
}
.row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:16px 0;
  border-top:1px solid var(--line);
}
.row:first-child{border-top:0;padding-top:0}
.row-main{flex:1;min-width:0}
.row-title{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--brand);
  margin-bottom:6px;
  font-weight: 600;
}
.two-col,.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
/* Form base */
form{
  margin-top:10px;
}

label{
  display:block;
  font-size:14px;
  font-weight:600;
  margin:12px 0 6px;
      color: var(--brand);
}

input[type="text"],
input[type="url"],
input[type="file"],
input[type="date"],
select,
textarea{
  width:100%;
  min-height:42px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-size:14px;
  color:var(--text);
}

textarea{
  min-height:100px;
  resize:vertical;
}

input::placeholder,
textarea::placeholder{
  color:var(--muted-2);
}

input:focus,
select:focus,
textarea:focus{
  outline:none;
  border-color:var(--brand);
}

/* Helper text */
.field-help{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

/* Section spacing inside forms */
.form-section{
  margin-top:18px;
}

/* Two column grid (extra links) */
.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

/* Checkbox blocks */
.check-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-top:10px;
}

.check-row label{
  font-weight:500;
  margin:0;
}

/* File input tweak */
input[type="file"]{
  padding:8px;
}

/* Save row */
.save-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:18px;
}
/* Profile / dashboard hero */
.profile-hero,
.hero{
  text-align:center;
}
.profile-hero{
  padding:8px 0 6px;
  margin-bottom:10px;
}
.hero-head{margin-bottom:18px}
.hero-logo{
  width:72px;
  height:72px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid var(--line);
  background:#fff;
  display:block;
  margin:0 auto 14px;
}
.hero-logo.placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--brand-soft);
  color:var(--brand);
  font-weight:700;
  font-size:24px;
}
.hero-title{
  margin:0;
  font-size:28px;
  line-height:1.08;
  letter-spacing:-.02em;
}
.hero-handle{
  margin-top:6px;
  color:var(--muted);
  font-size:15px;
}
.hero-meta{
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:18px;
}
.hero-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:20px;
}

/* Dashboard share card */
.section{
  margin-top:18px;
}

.share-list{
  display:flex;
  flex-direction:column;
  gap:0;
  margin-top:10px;
}

.share-item{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:16px 0;
  border-top:1px solid var(--line);
}

.share-item:first-child{
  border-top:0;
  padding-top:0;
}

.share-main{
  min-width:0;
  flex:1;
}

.share-label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--brand);
  margin-bottom:6px;
  font-weight: 600;
}

.share-value{
  font-size:15px;
  line-height:1.35;
  color:var(--text);
  word-break:break-word;
}

.share-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  flex:0 0 auto;
}

.summary-box{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:16px 0 0;
  margin-top:10px;
  border-top:1px solid var(--line);
}

.summary-copy{
  min-width:0;
  flex:1;
}

.summary-title{
  margin:0 0 4px;
  font-size:16px;
  line-height:1.2;
}

.summary-text{
  margin:0;
  color:var(--muted);
  font-size:14px;
}
/* Share/account/footer links */
.legal-links,
.account-footer-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.account-footer-links{
  padding-top:16px;
  justify-content:center;
  align-items:center;
  color:var(--muted);
  font-size:14px;
}
.account-footer-links a{
  color:var(--muted);
  text-decoration:none;
}
.account-footer-links a:hover{
  color:var(--text);
  text-decoration:underline;
}
.account-footer-links span{color:var(--muted-2)}

/* Promotions list */
.promos-items{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:18px;
}
.promo-item{
  padding:16px;
  background:var(--soft-2);
  border:1px solid var(--line);
  border-radius:16px;
}
.promo-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:start;
}
.promo-main{min-width:0}
.promo-status{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:8px;
}
.promo-title{
  margin:0;
  font-size:22px;
  line-height:1.12;
  letter-spacing:-.01em;
  overflow-wrap:anywhere;
}
.promo-desc{
  margin-top:8px;
  color:var(--muted);
  font-size:15px;
  line-height:1.45;
  max-width:460px;
  overflow-wrap:anywhere;
  white-space:pre-line;
}
.promo-meta{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
}
.promo-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  max-width:320px;
  flex:0 0 auto;
}
.promo-actions form{
  margin:0;
  display:inline-flex;
}
.promo-actions .btn2,
.promo-actions .btnDanger,
.promo-actions button{
  min-height:36px;
  padding:9px 12px;
  font-size:13px;
}
.promo-reason{
  margin-top:10px;
  color:var(--muted);
  font-size:14px;
}
.promo-setup-inline{
  margin-top:10px;
  display:flex;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:13px;
}
.promo-setup-inline .arrow{color:var(--muted-2)}

/* Public promo/profile helpers */
.promo-list{display:grid;gap:14px;margin-top:14px}
.promo-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
}
.promo-gate,.promo-note{margin-top:12px;color:var(--muted);font-size:14px}
.promo-code-blur{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:8px 12px;
  border:1px dashed var(--line);
  border-radius:12px;
  background:#fff;
  filter:blur(3px);
  user-select:none;
}
.promo-reveal,.btn-secondary{
  appearance:none;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:999px;
  font-size:14px;
  line-height:1;
  border:1px solid var(--line);
  background:#fff;
  color:#111;
}
.promo-reveal:disabled{opacity:.55;cursor:not-allowed}
.btn-secondary:hover{background:var(--soft-2)}
.promo-report{margin-top:12px;font-size:13px;color:var(--muted)}
.promo-report a{color:var(--muted);text-decoration:none}
.promo-report a:hover{color:var(--text);text-decoration:underline}
.subsection-title{
  margin:0 0 14px;
  font-size:18px;
}

.hidden{
  display:none!important;
}

.toggle-card{
  padding:14px;
  background:var(--soft-2);
  border:1px solid var(--line);
  border-radius:14px;
  margin-top:20px;
}

.toggle-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
  padding:12px 0;
  border-top:1px solid var(--line);
}

.toggle-row:first-child{
  border-top:0;
  padding-top:0;
}

.inline-check{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
  font-weight:500;
}

.inline-check input{
  width:auto;
}


.code{
  display:inline-flex;
  align-items:center;
  padding:8px 11px;
  min-height:38px;
  border-radius:12px;
  border:1px dashed #bcbcbc;
  background:#fff;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  font-size:13px;
  line-height:1.2;
  word-break:break-all;
}
/* Promotions info box */
.info-box{
  background:#fff;
  border:1px solid var(--line);
  border-left:4px solid var(--brand-dark);
  border-radius:14px;
  padding:18px 20px;
  margin-bottom:24px;
  margin-top:24px;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
}

.info-box h3{
  margin:0 0 10px;
  font-size:18px;
  line-height:1.3;
  font-weight:700;
  color:#111;
}

.info-box p{
  margin:0;
  font-size:14px;
  line-height:1.65;
  color:#555;
}

.info-box p + p{
  margin-top:12px;
}

/* Promo edit */
.editor-card{
  margin-top:18px;
}

.editor-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.editor-title{
  margin:0;
  font-size:20px;
  line-height:1.08;
  letter-spacing:-.02em;
}

.editor-copy{
  margin-top:6px;
  color:var(--muted);
  font-size:14px;
}

.help{
  margin-top:7px;
  color:var(--muted);
  font-size:13px;
}

.code-preview{
  margin-top:14px;
  padding:16px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#fff;
}

.code-preview-label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--muted-2);
  margin-bottom:10px;
}

.code-preview-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.code-preview-copy{
  appearance:none;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  border-radius:999px;
  min-height:40px;
  padding:0 14px;
  font-size:14px;
  cursor:pointer;
}

.code-preview-copy:hover{
  background:var(--soft-2);
}

.code-preview-help{
  margin-top:10px;
  color:var(--muted);
  font-size:14px;
}
/* Empty state */
.empty{
  text-align:center;
  padding:10px 0 4px;
}

.empty h3{
  margin:0 0 6px;
  font-size:20px;
}

/* Staging banner */
.staging_flag{
  background:var(--brand-dark);
  color:white;
}

.staging_flag h3{
  margin:0;
  padding:8px 12px;
  font-size:16px;
}
/* Admin/table helpers */
.nav-links{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
table{width:100%;border-collapse:collapse}
th,td{padding:10px;border-top:1px solid var(--line);text-align:left;vertical-align:top}
th{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-2)}

/* Home/create/access compatibility */
.brand-mark{
  width:34px;
  height:34px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--brand);
  color:#fff;
  font-weight:800;
}
.support-head-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
}

.support-head-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:4px;
}

.support-list{
  display:grid;
  gap:16px;
  margin-top:18px;
}

.support-message{
  border:1px solid #eee8df;
  border-radius:18px;
  padding:18px;
  background:#fff;
}

.support-message-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
}

.support-message-title{
  margin:0 0 8px;
  font-size:20px;
  line-height:1.15;
  letter-spacing:-.02em;
}

.support-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}

.support-pill{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 10px;
  font-size:13px;
  font-weight:700;
  border:1px solid #e7dfd4;
  background:#faf7f1;
  color:#604b36;
  line-height:1.2;
}

.support-pill-replied{
  background:#edf9ef;
  border-color:#ccebd2;
  color:#226b31;
}

.support-pill-received{
  background:#eef4ff;
  border-color:#d7e5ff;
  color:#264f8f;
}

.support-pill-review{
  background:#fff7e6;
  border-color:#f3ddb0;
  color:#7a5312;
}

.support-pill-archived{
  background:#f2f2f2;
  border-color:#ddd;
  color:#666;
}

.support-body{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #f0ece5;
}

.support-label{
  margin:0 0 8px;
  font-weight:800;
  color:#111;
}

.support-text{
  white-space:pre-wrap;
  color:#444;
  margin:0;
}

.support-reply{
  margin-top:16px;
  padding:16px;
  border-radius:16px;
  background:#f7fbf7;
  border:1px solid #d9ecd9;
}

.support-reply .support-label{
  color:#226b31;
}

.support-waiting{
  margin-top:16px;
  padding:14px 16px;
  border-radius:16px;
  background:#faf7f1;
  border:1px solid #eadfce;
  color:#604b36;
}

.support-empty{
  margin-top:18px;
}


/* Responsive overrides */
@media (max-width:760px){
  .wrap{padding:16px 14px 34px}
  .row{flex-direction:column}
  .actions,.legal-links{flex-direction:column}
  .btn,.btn2,.btnDanger{width:100%}
  .two-col,.form-row{grid-template-columns:1fr}
}

@media (max-width:640px){
  .topbar-inner{
    display:grid;
    grid-template-columns:1fr auto;
    gap:16px 12px;
    align-items:center;
  }
  .brand{
    grid-column:1;
    margin-right:0;
  }
  .top-bar-logo{
    grid-column:2;
    grid-row:1;
    width:44px;
    height:44px;
    flex:0 0 44px;
  }
  .header-links{
    grid-column:1 / -1;
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
    gap:14px;
  }
  .header-links .btnLink{font-size:18px}
  .page-title{font-size:28px}
  .card{padding:16px}
  .hero-actions .btn,.hero-actions .btn2{width:100%}
  .promo-head{display:block}
  .promo-actions{
    width:100%;
    justify-content:flex-start;
    margin-top:14px;
    max-width:none;
  }
  .promo-actions .btn2,
  .promo-actions .btnDanger,
  .promo-actions button{
    width:auto;
    flex:1 1 130px;
  }
  .bottom-actions .btn2{width:100%}

  .grid-2{
    grid-template-columns:1fr;
  }

  .save-row{
    flex-direction:column;
  }

  .save-row .btn,
  .save-row .btn2{
    width:100%;
  }
  .toggle-row{
  grid-template-columns:1fr;
}
.support-head-row{
  display:block;
}

.support-head-actions{
  margin-top:14px;
}

.support-message{
  padding:16px;
}

.support-message-title{
  font-size:18px;
}
}
