:root {
  font-family: "DM Sans", system-ui, sans-serif;
  background: #f5f5f2;
  color: #1f2822;
  --subtle: #526058;
  --line: #d8ded8;
  --green: #244737;
  --paper: #fff;
  line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(100% - 2rem, 1140px); margin: auto; }
.masthead { background: #192e25; color: #fff; }
.line, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.line { justify-content: space-between; }
.masthead .line { justify-content: flex-start; min-height: 64px; }
.wordmark { font-size: 1.45rem; font-weight: 800; letter-spacing: -.07em; margin-right: .45rem; }
.wordmark span { color: #a8c5ad; }
#mode { font-size: .875rem; color: #dce7df; }
#signout { margin-left: auto; color: #fff; border-color: #a3b5a9; }
main { padding-bottom: 3rem; }
.intro { margin: 2.25rem 0 1.3rem; }
h1, h2, h3, p { margin: 0 0 .55rem; }
h1, .card h3 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.035em; }
h1 { font-size: clamp(2.25rem, 5.5vw, 4.1rem); line-height: 1.08; }
h2 { font-size: 1.35rem; }
p, small { color: var(--subtle); }
small { font-size: .875rem; }
#notice, #edit-notice { color: var(--green); font-weight: 650; }
#notice:empty, #edit-notice:empty { display: none; }
[data-error="true"] { color: #932e22 !important; }
.panel, .card { background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; }
.panel { padding: clamp(.9rem, 2.2vw, 1.4rem); }
.narrow { max-width: 27rem; display: grid; gap: .8rem; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: 1.05rem 0; }
.metric { padding: .8rem 1rem; border-top: 2px solid #70917c; background: #e9eee8; }
.metric strong { display: block; font-size: 1.65rem; }
.metric span { font-size: .875rem; }
button, input, select, textarea { font: inherit; color: inherit; background: #fff; border: 1px solid #aebbb1; border-radius: .45rem; max-width: 100%; }
button { padding: .55rem .85rem; cursor: pointer; font-weight: 650; }
button:hover { background: #e9f0ea; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--green); border-color: var(--green); color: #fff; }
.primary:hover { background: #16382a; }
.quiet { background: transparent; }
input, select, textarea { width: 100%; padding: .55rem .65rem; }
select { appearance: none; padding-right: 1.8rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23244737' stroke-width='2'/%3E%3C/svg%3E") right .6rem center / .8rem auto no-repeat; }
textarea { margin: .35rem 0 .7rem; resize: vertical; }
label { display: grid; gap: .25rem; font-size: .875rem; font-weight: 650; }
label input, label select { font-size: 1rem; font-weight: 400; }
:focus-visible { outline: 3px solid #447d58; outline-offset: 2px; }
.board { margin-top: 2rem; }
.board-head { margin-bottom: .65rem; }
.filters, .field-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); align-items: end; }
.field-grid .wide { grid-column: 1 / -1; }
#result-count { margin: .8rem 0; font-size: .875rem; }
.brand-heading { margin: 1.1rem 0 .75rem; border-bottom: 1px solid var(--line); padding-bottom: .35rem; }
.grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); align-items: start; }
.card { overflow: hidden; }
.photo { height: 13rem; position: relative; display: grid; place-items: center; background: #e9eee9; color: var(--subtle); font-size: .9rem; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.photo-source {
  position: absolute;
  bottom: .65rem;
  left: .65rem;
  padding: .22rem .5rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--paper);
  font-size: .8rem;
  font-weight: 650;
  text-decoration: none;
}
.photo-source:hover { text-decoration: underline; }
.card-body { padding: 1rem; }
.card h3 { font-size: 1.55rem; line-height: 1.15; }
.card .budget { font-weight: 750; display: block; margin: .5rem 0; }
.count { border-radius: 2rem; padding: .2rem .55rem; background: #e3ede5; font-size: .875rem; }
details { margin-top: .9rem; }
summary { color: var(--green); font-weight: 700; cursor: pointer; }
.request { border-top: 1px solid var(--line); padding-top: .65rem; margin-top: .65rem; overflow-wrap: anywhere; }
a { color: var(--green); text-underline-offset: .15em; }
fieldset { border: 1px solid var(--line); border-radius: .5rem; margin: .75rem 0; padding: .75rem; min-width: 0; }
legend { font-weight: 700; padding: 0 .25rem; }
.file-status { min-height: 1.5em; }
dialog { border: 1px solid var(--line); border-radius: .8rem; width: min(720px, calc(100% - 2rem)); max-height: 90vh; padding: 1.25rem; }
dialog::backdrop { background: #111a15a8; }
dialog .actions { margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 520px) {
  .metric { padding: .5rem; }
  .metric strong { font-size: 1.35rem; }
}

#telegram-photo-preview { display: block; max-width: 100%; max-height: 12rem; border-radius: .45rem; }

.telegram-status { color: var(--green); font-weight: 650; }
.telegram-status:empty { display: none; }

.danger { color: #a62820; border-color: #dca6a1; }
.danger:hover { background: #fcebe9; }
.delete-confirmation { margin-top: 1rem; border: 1px solid #dca6a1; border-radius: .6rem; padding: 1rem; background: #fff7f6; }

#priority-fields { padding: .8rem; }
#priority-preview { margin: .65rem 0 0; }

.frequent-demand { display: inline-block; margin: .32rem 0 .15rem .4rem; color: var(--green); font-size: .875rem; font-weight: 700; }

.variant-demand { list-style: none; padding: 0; margin: .7rem 0 0; font-size: .875rem; }
.variant-demand li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .65rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.variant-demand strong { white-space: nowrap; }
