/* ---------- Merfinity – Roadmap & Community (login, tickets, comments, workshop) ---------- */
:root { --line: #dfe7eb; --soft: #f4f8fa; --up: #e8664a; --down: #5b7cfa; --ok: #2f9e6b; --warn: #d79a1e; --danger: #c8443a; }

/* account button in the menu */
.account {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  color: inherit; cursor: pointer; padding: 6px 14px;
  font: 700 13px/1 var(--head); letter-spacing: .08em; text-transform: uppercase;
  transition: background .2s;
}
.account:hover { background: rgba(255,255,255,.26); }
.account.is-in { padding: 3px 12px 3px 3px; text-transform: none; letter-spacing: .02em; }
.account__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  --s: 32px; width: var(--s); height: var(--s); flex: none;
  display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: linear-gradient(135deg, #3bb6c9, #1d6f8f); color: #fff;
  font: 700 calc(var(--s) * .45)/1 var(--head); text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); vertical-align: middle; }
.badge { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: var(--sea); color: #fff; font: 700 11px/1.6 var(--head); letter-spacing: .1em; text-transform: uppercase; }

[hidden] { display: none !important; }

/* admin-only things are only visible when hello@merfinity.com is logged in */
html:not(.is-admin) .admin-only { display: none !important; }
html.is-user .guest-only { display: none !important; }

/* ---------- small helpers ---------- */
.muted { color: #8696a0; }
.small { font-size: 14px; }
.notice { padding: 12px 16px; border-radius: 10px; background: #fff6dc; color: #7a5a12; font-size: 15px; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font: 600 14px/1.4 var(--body); color: var(--sea); }
.link:hover { text-decoration: underline; }
.link--danger { color: var(--danger); }
.btn { background: none; cursor: pointer; border-radius: 0; }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn--small { padding: 10px 18px; font-size: 13px; }
.btn--primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn--primary:hover { background: var(--deep); border-color: var(--deep); }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border-color: var(--line); text-transform: none; letter-spacing: .02em; font-weight: 600; }
.btn--google:hover { background: var(--soft); color: var(--ink); }

/* ---------- app page layout ---------- */
.app-page { padding: 50px 0 110px; }
.app-page__intro { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.app-page__intro h2 { font: 700 clamp(22px, 3vw, 30px)/1.25 var(--head); color: var(--ink); margin: 0 0 .4em; }
[data-app] { min-height: 300px; font-size: 16px; line-height: 1.6; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tabs button, .tabs a, .chips button {
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
  border-radius: 999px; padding: 8px 16px; font: 600 14px/1.2 var(--body); transition: background .2s, border-color .2s;
}
.tabs button:hover, .tabs a:hover, .chips button:hover { border-color: var(--sea); }
.tabs .is-active, .chips .is-active { background: var(--sea); border-color: var(--sea); color: #fff; }
.tabs--big { justify-content: center; margin-bottom: 30px; }
.tabs--big a { padding: 12px 24px; font: 700 15px/1.2 var(--head); letter-spacing: .06em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 13px; font-size: 13px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; padding: 12px; border: 1px dashed var(--sea); border-radius: 12px; background: var(--foam); }
.hub__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }

/* ---------- roadmap board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.board__col { background: var(--soft); border-radius: 14px; padding: 14px; }
.board__head { display: flex; align-items: center; gap: 10px; margin: 2px 4px 14px; font: 700 15px/1.2 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.board__head::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #9aa9b2); }
.board__col[data-status="progress"] { --c: var(--warn); }
.board__col[data-status="done"] { --c: var(--ok); }
.board__count { margin-left: auto; font-size: 13px; color: #8696a0; }
.board__cards { display: grid; gap: 10px; }
.ticket {
  display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: #fff; text-decoration: none;
  box-shadow: 0 1px 2px rgba(11,29,42,.08), 0 0 0 1px rgba(11,29,42,.04); transition: box-shadow .2s, transform .2s;
}
.ticket:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11,29,42,.12); }
.ticket__img { width: calc(100% + 28px); max-width: none; margin: -12px -14px 4px; aspect-ratio: 16/8; object-fit: cover; border-radius: 10px 10px 0 0; }
.ticket__sec { font-size: 12px; color: #8696a0; }
.ticket__title { font-size: 15px; line-height: 1.35; }
.ticket__meta, .post-card__meta, .wcard__meta { display: flex; gap: 14px; font-size: 13px; color: #8696a0; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; background: var(--soft); color: var(--ink); font: 600 13px/1.5 var(--body); }
.pill--small { padding: 1px 8px; font-size: 12px; }
.pill--planned { background: #e9eef1; }
.pill--progress { background: #fdf0d2; color: #7a5a12; }
.pill--done { background: #d9f2e5; color: #1d6b47; }

/* ---------- modal ---------- */
body.has-modal { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 6vh 16px; background: rgba(3, 14, 22, .6); animation: fade .2s; }
.modal__box { position: relative; width: min(460px, 100%); padding: 34px 32px 30px; border-radius: 16px; background: #fff; color: var(--text); font-size: 16px; line-height: 1.6; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: rise .25s; }
.modal__box--wide { width: min(860px, 100%); }
.modal__close { position: absolute; top: 8px; right: 12px; background: none; border: 0; cursor: pointer; font: 300 34px/1 var(--body); color: #8696a0; }
.modal__close:hover { color: var(--ink); }
.modal h2 { font: 700 24px/1.25 var(--head); color: var(--ink); margin: 0 0 .7em; }
.modal h3 { font: 700 18px/1.3 var(--head); color: var(--ink); margin: 1.6em 0 .6em; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.lightbox { z-index: 60; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; transition: transform .3s, opacity .3s;
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 10px; background: var(--deep); color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--danger); }
.confirm p { margin-top: 0; color: var(--ink); font-weight: 600; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form label, .form .label { display: grid; gap: 5px; font: 600 14px/1.3 var(--body); color: var(--ink); }
.form label[hidden], .form [hidden] { display: none; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea, .comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd6dc; border-radius: 8px; background: #fff; color: var(--ink);
  font: 400 15px/1.5 var(--body);
}
.form input:focus, .form select:focus, .form textarea:focus, .comment-form textarea:focus { outline: 2px solid rgba(29,111,143,.35); border-color: var(--sea); }
.form textarea, .comment-form textarea { resize: vertical; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.form__actions--left { justify-content: flex-start; margin: 18px 0 6px; }
.form__actions--split { justify-content: space-between; }
.form__error { margin: 0; padding: 8px 12px; border-radius: 8px; background: #fde8e6; color: var(--danger); font-size: 14px; }
.form .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--text); }
.form .check input { margin-top: 4px; }

.auth { display: grid; gap: 16px; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-top: -6px; }
.auth__tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px; cursor: pointer; font: 700 14px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; color: #8696a0; }
.auth__tabs .is-active { color: var(--ink); border-color: var(--sea); }
.auth__or { display: flex; align-items: center; gap: 12px; color: #8696a0; font-size: 13px; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth .btn--primary { width: 100%; }
.auth .link { justify-self: center; }

.account-panel { display: grid; gap: 18px; }
.account-panel__head { display: flex; align-items: center; gap: 14px; }
.account-panel__head small { color: #8696a0; }

/* history rows in the ticket editor */
.history-edit { display: grid; gap: 8px; }
.history-edit__row { display: grid; grid-template-columns: 160px 1fr 34px; gap: 8px; align-items: start; }
.history-edit__row button, .picker__item button { width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer; background: var(--soft); color: var(--ink); font-size: 18px; line-height: 1; }

/* picture picker */
.picker { display: grid; gap: 10px; }
.picker__list { display: flex; flex-wrap: wrap; gap: 8px; }
.picker__list:empty { display: none; }
.picker__item { position: relative; }
.picker__item img { width: 110px; height: 76px; object-fit: cover; border-radius: 8px; }
.picker__item button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; font-size: 15px; background: rgba(255,255,255,.9); }
.picker__add { display: inline-flex !important; justify-self: start; align-items: center; padding: 9px 14px; border: 1px dashed var(--sea); border-radius: 8px; cursor: pointer; color: var(--sea) !important; }
.picker__add[hidden] { display: none !important; }
.picker__progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.picker__progress > div { width: 0; height: 100%; background: var(--sea); transition: width .2s; }
.picker__progress[hidden] { display: none; }

/* ---------- detail view (ticket, post, topic, upload) ---------- */
.detail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding-right: 30px; }
.detail__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.detail__head p { margin: 0; font-size: 14px; }
.modal h2.detail__title { margin: 0 0 .2em; font-size: clamp(21px, 3vw, 28px); overflow-wrap: anywhere; }
.detail__text { color: var(--ink); overflow-wrap: anywhere; }
.detail__text p:first-child { margin-top: 0; }
.detail__bar { display: flex; gap: 12px; margin: 10px 0; }
.detail__comments { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.gallery-strip { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0; padding-bottom: 4px; }
.gallery-strip .shot { flex: none; width: auto; aspect-ratio: auto; border-radius: 8px; background: none; }
.gallery-strip img { height: 150px; width: auto; max-width: 300px; object-fit: cover; }
.gallery-strip:has(.shot:only-child) .shot { flex: 1; }
.gallery-strip:has(.shot:only-child) img { width: 100%; height: auto; max-width: 100%; max-height: 460px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 12px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--sea); border: 2px solid #fff; }
.timeline time { font: 600 12px/1.4 var(--head); letter-spacing: .12em; text-transform: uppercase; color: #93a3ad; }
.timeline div p { margin: 2px 0 0; color: var(--ink); }

.download { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px 0; padding: 14px; border-radius: 12px; background: var(--foam); font-size: 14px; }

/* ---------- votes ---------- */
.vote { display: inline-flex; flex-direction: column; align-items: center; gap: 0; min-width: 36px; }
.vote__btn { background: none; border: 0; cursor: pointer; padding: 2px 6px; color: #a7b4bb; font-size: 15px; line-height: 1; border-radius: 6px; transition: color .15s, background .15s; }
.vote__btn:hover { background: var(--soft); color: var(--ink); }
.vote__btn[data-v="1"].is-on { color: var(--up); }
.vote__btn[data-v="-1"].is-on { color: var(--down); }
.vote__score { font: 700 15px/1.4 var(--head); color: var(--ink); }
.vote--like { flex-direction: row; gap: 4px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 999px; }
.vote--like .vote__btn { font-size: 18px; }
.comment__bar .vote { flex-direction: row; gap: 2px; }
.comment__bar .vote__score { font-size: 13px; min-width: 14px; text-align: center; }

/* ---------- comments ---------- */
.comments__title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px !important; font: 700 18px/1.3 var(--head); color: var(--ink); }
.comments__count { font-size: 14px; color: #8696a0; }
.comment-form { display: grid; gap: 8px; margin-bottom: 18px; }
.comment-form textarea { font-size: 15px; }
.comment { padding-top: 12px; }
.comment__head { font-size: 13px; color: #8696a0; }
.comment__body { margin: 4px 0 0 33px; color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.comment__body p { margin: 0 0 .5em; }
.comment__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-left: 27px; }
.comment__bar .link { font-size: 13px; color: #8696a0; }
.comment__bar .link:hover { color: var(--sea); }
.comment__reply { margin: 6px 0 0 33px; }
.comment__kids { margin-left: 12px; padding-left: 20px; border-left: 2px solid var(--line); }
.comment__kids:empty { display: none; }
.comment:target > .comment__body { background: #fff6dc; border-radius: 6px; }
.comment.is-deleted > .comment__head { opacity: .6; }

/* ---------- community: news feed ---------- */
.feed { display: grid; gap: 18px; max-width: 860px; margin: 0 auto; }
.post-card { display: grid; grid-template-columns: 260px 1fr; gap: 22px; padding: 16px; border-radius: 14px; background: #fff; text-decoration: none;
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.post-card:not(:has(img)) { grid-template-columns: 1fr; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(11,29,42,.1); }
.post-card img { width: 100%; height: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; }
.post-card h3 { margin: 0 0 6px; font: 700 21px/1.3 var(--head); color: var(--ink); }
.post-card__text { font-size: 15px; max-height: 4.8em; overflow: hidden; }
.post-card__text p { margin: 0 0 .4em; }
.post-card__meta { margin: 8px 0 0; }

/* discussions */
.threads { display: grid; border-top: 1px solid var(--line); }
.thread { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.thread:hover { background: var(--soft); }
div.thread { grid-template-columns: 1fr auto; }
.thread__score { font: 700 14px/1 var(--head); color: var(--ink); text-align: center; }
.thread__main { display: grid; gap: 4px; min-width: 0; }
.thread__main strong { overflow-wrap: anywhere; }
.thread__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: #8696a0; }
.thread__meta .byline { font-weight: 500; }
.thread__stats { display: grid; justify-items: end; font-size: 14px; color: var(--ink); white-space: nowrap; }
.thread__stats small { font-size: 12px; color: #8696a0; }

/* workshop */
.workshop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 16px; }
.wcard { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 14px; background: #fff; text-decoration: none; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.wcard:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(11,29,42,.12); }
.wcard__img { display: grid; place-items: center; aspect-ratio: 16/10; background: linear-gradient(135deg, #0f3a52, #1d6f8f); font-size: 48px; }
.wcard__img img { width: 100%; height: 100%; object-fit: cover; }
.wcard__body { display: grid; gap: 6px; align-content: start; padding: 12px 14px 14px; font-size: 14px; }
.wcard__body .pill { justify-self: start; }
.wcard__body strong { font-size: 16px; line-height: 1.3; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card img { max-height: 220px; }
}
@media (max-width: 560px) {
  .modal { padding: 0; }
  .modal__box { min-height: 100%; border-radius: 0; padding: 30px 18px 24px; }
  .history-edit__row { grid-template-columns: 1fr 34px; }
  .history-edit__row textarea { grid-column: 1; }
  .thread { grid-template-columns: 40px 1fr; }
  .thread__stats { grid-column: 2; justify-items: start; }
  .thread__stats small { display: none; }
  .comment__kids { margin-left: 4px; padding-left: 12px; }
  .tabs--big a { padding: 10px 14px; font-size: 13px; }
  .gallery-strip img { height: 110px; }
}
