:root {
  color-scheme: light;
  --paper: #f5f3e9;
  --surface: #fffef9;
  --ink: #182d26;
  --muted: #526259;
  --line: #d9dfd3;
  --green: #155743;
  --dark: #12392e;
  --gold: #d7bb7b;
  font: 16px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
header { color: #fffdf2; background: var(--dark); border-bottom: 3px solid var(--gold); }
header .wrapper { padding-block: 1rem; }
.wrapper { max-width: 52rem; margin-inline: auto; padding-inline: 1rem; }
main { padding-block: 1rem 3rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.15; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.08rem; }
header p { margin-block-start: .25rem; color: #e2dec9; }
section, form.box { margin-block: 1rem; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; }
.stack { display: grid; gap: .8rem; }
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.split { justify-content: space-between; }
small, .muted { color: var(--muted); }
label { display: grid; gap: .3rem; font-weight: 650; }
label.check { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
input, select, textarea, button { font: inherit; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; border: 1px solid #acb8ac; border-radius: .55rem; padding: .55rem .65rem; background: #fff; color: var(--ink); }
input[type=checkbox] { accent-color: var(--green); min-height: 1.25rem; width: 1.25rem; }
textarea { resize: vertical; }
button { min-height: 44px; border: 1px solid transparent; border-radius: .55rem; padding: .45rem .85rem; font-weight: 700; color: #fff; background: var(--green); cursor: pointer; }
button.secondary { color: var(--green); background: #eff5ee; border-color: #c6d7cb; }
button.danger { color: #801f1f; background: #fff3f1; border-color: #e4c6c1; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #b58228; outline-offset: 2px; }
[hidden] { display: none !important; }
.notice { display: grid; gap: .45rem; padding: .85rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.notice p { white-space: pre-wrap; }
.notice img, #preview img { max-width: 100%; max-height: 11rem; object-fit: contain; border-radius: .45rem; }
#preview { background: #12392e; color: #fffdf2; border-radius: .8rem; padding: 1rem; overflow-wrap: anywhere; }
#preview[data-theme=light] { color: var(--ink); background: #eaeedf; }
#publish-bar { position: sticky; bottom: 0; padding: .7rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); z-index: 1; }
.feedback:not(:empty) { padding-block: .25rem; }
.feedback[data-error=true] { color: #8a2525; }
a { color: var(--green); }
.imam-page { background: linear-gradient(145deg, #f8f6ec, #eef4ec 42%, #f6f2e8); }
.imam-page header { background: linear-gradient(115deg, #12382e, #1b4d3e); border-bottom-width: 1px; }
.imam-identity img { border-radius: .8rem; border: 1px solid #ffffff33; }
.imam-nav {
  display: flex; justify-content: space-between; gap: .35rem; position: sticky; top: 0; z-index: 2;
  padding: .45rem; border: 1px solid #d8e2d7; border-radius: .9rem; background: #f8faf3;
  box-shadow: 0 .45rem 1.5rem #203e2912;
}
.imam-nav a { display: grid; place-items: center; flex: 1; padding: .4rem .15rem; min-height: 40px; border-radius: .6rem; font-weight: 700; text-decoration: none; }
.imam-nav a:hover, .imam-nav a:focus-visible { background: #e2eee3; }
.imam-page section { scroll-margin-top: 4.5rem; }
.imam-page .box { padding: clamp(.95rem, 3vw, 1.4rem); box-shadow: 0 .5rem 1.5rem #24442d0b; }
.imam-page .notice { border: 1px solid var(--line); padding: .9rem; border-radius: .8rem; background: #f9faf4; }
.imam-page .notice:first-child { margin-top: .2rem; }
.prayer-setting { grid-column: 1 / -1; padding: .85rem; border: 1px solid var(--line); border-radius: .85rem; background: #f5f9f1; }
.prayer-setting > h3 { color: var(--green); }
.imam-page #publish-bar { box-shadow: 0 -.4rem 1.25rem #213a261a; padding-bottom: calc(.7rem + env(safe-area-inset-bottom)); }
.imam-page #publish-bar .row { margin-left: auto; flex-wrap: nowrap; }
.access-fields { margin-top: .5rem; align-items: end; }
@media (max-width: 480px) {
  .imam-page .wrapper { padding-inline: .75rem; }
  .imam-page #publish-bar { justify-content: stretch; }
  .imam-page #publish-bar .row { width: 100%; }
  .imam-page #publish-bar button { flex: 1; padding-inline: .35rem; }
}
@font-face {
  font-family: 'Notice Script';
  src: url('/branding/notice-script.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
.format-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; }
.imam-page .notice-preview, .imam-page #preview[data-theme] { background: #234a3e; color: #fffdf2; padding: 1rem; border-radius: .8rem; overflow-wrap: anywhere; }
.notice-preview h4, .imam-page #preview h3 { color: #f8dc97; margin: 0 0 .5rem; font-size: 1.2rem; }
.notice-preview img:not([hidden]) { display: block; max-width: 100%; max-height: 13rem; object-fit: contain; margin: .5rem auto 0; }
.notice-preview p, #preview p { white-space: pre-wrap; }
.imam-page .font-serif { font-family: Georgia, serif; }
.imam-page .font-script { font-family: 'Notice Script', cursive; font-size: 1.3em; line-height: 1.4; }
.imam-page .text-italic { font-style: italic; }
.imam-page .text-underline { text-decoration: underline; }
.format-toolbar button[aria-pressed="true"] { background: var(--green); color: #fff; }
.format-toolbar button { min-height: 44px; }
.imam-page .text-bold { font-weight: 850; }
.imam-page .font-script .text-bold { font-weight: 700; }
.fullscreen-item { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; align-items: center; gap: .5rem; padding: .65rem; border: 1px solid var(--line); border-radius: .8rem; }
.fullscreen-item .check { overflow-wrap: anywhere; }
.fullscreen-item input[type="number"] { width: 100%; }
.imam-nav a { font-size: clamp(.73rem, 3vw, 1rem); }
