/* Buttons ------------------------------------------------------------ */
.btn {
  height: 44px; padding: 0 20px; border: none; border-radius: 10px; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; text-decoration: none; background: var(--btn2); color: #000;
}
.btn:hover { background: var(--btn2-hover); color: #000; }
.btn-primary { background: var(--teal); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--teal-hover); color: #fff; }
.btn-black { background: #000; color: #fff; font-weight: 600; }
.btn-black:hover { background: var(--black-hover); color: #fff; }
.btn-gray { background: var(--btn2-hover); }
.btn-gray:hover { background: #DADADA; }
.btn-link {
  height: 36px; padding: 0 4px; background: none; border: none; font-weight: 500; text-decoration: underline;
  cursor: pointer; white-space: nowrap; color: #000;
}
.btn-link:hover { opacity: .7; }
.btn.is-dim, .btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border: none; border-radius: 8px; background: none; font-size: 20px;
  line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--btn2); }
.pill-btn {
  height: 28px; padding: 0 10px; border: none; border-radius: 14px; background: var(--chip); font-size: 14px;
  font-weight: 500; cursor: pointer; white-space: nowrap;
}
.pill-btn.emoji { background: var(--btn2); font-size: 15px; }

/* Inputs ------------------------------------------------------------- */
.input {
  height: 44px; width: 100%; border: 1px solid var(--input); border-radius: 10px; padding: 0 14px;
  background: #fff; outline: none; font-size: 14px; font-weight: 400;
}
.input:focus, .textarea:focus, .form-select:focus { border-color: var(--teal); outline: none; }
.textarea {
  width: 100%; border: 1px solid var(--input); border-radius: 10px; padding: 12px; resize: none; outline: none;
  font-size: 14px; font-weight: 400; line-height: 1.4; background: #fff;
}
.textarea.light { border-color: var(--light); border-radius: 8px; padding: 10px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.field .opt { font-weight: 400; color: var(--t3); }
.field .help { font-size: 15px; font-weight: 400; color: var(--t3); }
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); flex: none; margin: 0; cursor: pointer; }
.form-select {
  width: 100%; border: 1px solid var(--input); border-radius: 10px; padding: 0 40px 0 14px; background-color: #fff;
  font-size: 14px; color: #000; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
.error-text { font-size: 14px; font-weight: 600; color: #000; }
.error-text.red { color: var(--error); }

/* Chips and pills ------------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; font-size: 15px;
  font-weight: 500; white-space: nowrap; flex: none;
}
.chip.sm { height: 26px; padding: 0 10px; border-radius: 13px; font-size: 14px; }
.chip.xs { height: 24px; padding: 0 8px; border-radius: 12px; font-size: 14px; }
.pill-new {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; background: #000;
  color: var(--yellow); font-size: 14px; font-weight: 600; flex: none;
}
.pill-new.sm { height: 18px; padding: 0 7px; border-radius: 9px; }

/* Segmented control -------------------------------------------------- */
.seg { display: flex; background: var(--btn2); border-radius: 10px; padding: 4px; gap: 2px; flex: none; }
.seg button {
  height: 36px; padding: 0 16px; border: none; border-radius: 8px; background: transparent; font-size: 15px;
  font-weight: 500; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: #fff; }
.seg.sm button { height: 32px; font-size: 14px; }

/* Cards, avatars, misc ------------------------------------------------- */
.card { background: var(--card); border-radius: 16px; }
.ph { background: var(--placeholder); border-radius: 10px; overflow: hidden; position: relative; }
.ph > img, .ph > video { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.avatar {
  flex: none; border-radius: 50%; background: var(--light) center / cover no-repeat; color: #000; font-weight: 600;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.avatar.admin { background: #000; color: #fff; }
.tabs { display: flex; gap: 24px; flex-wrap: wrap; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 4px 0; cursor: pointer; font-weight: 500; }
.tabs button.on { border-bottom-color: #000; font-weight: 600; }
.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; color: var(--t3); }
.crumbs a { color: var(--t3); text-decoration: underline; }
.crumbs a:hover { color: #000; }
.crumbs .here { color: #000; font-weight: 600; }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.timeline .bar { height: 6px; border-radius: 3px; }
.rows > * { border-top: 1px solid var(--line); }
.rows.closed > *:last-child { border-bottom: 1px solid var(--line); }
.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; color: var(--t3); font-size: 15px; }

/* Popover menu --------------------------------------------------------- */
.pop {
  position: absolute; background: #fff; border-radius: 12px; box-shadow: var(--shadow-pop); z-index: 20;
}
.menu { right: 0; top: 56px; width: 240px; padding: 8px; display: flex; flex-direction: column; }
.menu button {
  height: 44px; padding: 0 12px; border: none; border-radius: 8px; background: none; font-size: 16px;
  font-weight: 500; text-align: left; cursor: pointer;
}
.menu button:hover { background: var(--card); }

/* Modal (shared) ------------------------------------------------------- */
.scrim {
  position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 40;
}
.modal {
  position: relative; width: 100%; max-height: 92vh; overflow: auto; background: #fff; border-radius: 16px;
  padding: 36px; display: flex; flex-direction: column; gap: 24px;
}
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 8px;
  background: none; font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: var(--btn2); }
.modal-title { font-size: 22px; font-weight: 600; color: var(--teal); padding-right: 32px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 32px; z-index: 50; background: #000; color: #fff;
  border-radius: 12px; padding: 14px 20px; display: flex; align-items: center; gap: 20px; font-size: 16px;
  max-width: calc(100vw - 32px);
}
.toast button { background: none; border: none; padding: 0; cursor: pointer; }
.toast .undo { color: var(--yellow); font-size: 16px; font-weight: 600; text-decoration: underline; }
.toast .x { color: #fff; font-size: 20px; line-height: 1; }

/* Review canvas --------------------------------------------------------- */
.stage {
  position: relative; width: 100%; max-width: 900px; background: #fff; border-radius: 6px; flex: none;
}
.stage .media { display: block; width: 100%; height: auto; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.stage canvas.media { background: #fff; }
.stage .media.pending { aspect-ratio: 4 / 3; background: #fff; }
.stage .empty { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--t3); font-size: 15px; }
.pin {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #000;
  color: var(--yellow); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pin); cursor: pointer; border: none; padding: 0; z-index: 2;
}
.pin.resolved { background: #D6D6D6; color: #000; }
.pin.on { outline: 2px solid #000; outline-offset: 0; }
.pin-dot {
  width: 22px; height: 22px; flex: none; border-radius: 50%; background: #000; color: var(--yellow); font-size: 14px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.pin-dot.resolved { background: #D6D6D6; color: #000; }
.navbar {
  display: flex; align-items: center; gap: 2px; background: #fff; border-radius: 10px; padding: 4px; flex: none;
}
.navbar button {
  height: 32px; min-width: 32px; padding: 0 10px; border: none; border-radius: 8px; background: none; font-size: 16px;
  cursor: pointer;
}
.navbar button:hover:not(:disabled) { background: var(--btn2); }
.navbar button:disabled { opacity: .35; cursor: default; }
.navbar .label { font-size: 14px; padding: 0 10px; white-space: nowrap; }

@media (max-width: 720px) {
  .modal { padding: 28px 20px; }
}

/* Comment mode (review canvas, client and admin) ----------------------------- */
.btn.cm-toggle.on { background: #000; color: #fff; }
.btn.cm-toggle.on:hover { background: var(--black-hover); color: #fff; }
.cm-hint {
  width: 100%; max-width: 900px; background: #000; color: #fff; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; font-weight: 500; text-align: center;
}
.cm-note { font-size: 14px; color: var(--t3); white-space: nowrap; }
