/* Meeting Notes on the app shell: the notes are the page, and the recorder
   and the speakers' names are a column beside them. On a phone the recorder
   is a dock under the thumb and the names sit above the notes. */

.mn-work { --rec: #d4513a; }

.mn-work * { box-sizing: border-box; }
.mn-work button,
.mn-work select,
.mn-work input { font: inherit; }
/* :where, so a button's own class can still set its colour. */
:where(.mn-work) button { color: inherit; }

/* ---------- Side column: recorder, then speakers ---------- */

/* The tint is the column's, as in Dictation: on the recorder, which is
   centred and only as tall as itself, it began at a hard edge halfway down. */
.qp-side.mn-side {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--ab-accent) 8%, transparent), transparent 70%);
}

.mn-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-block: auto;
  padding: 30px 24px 26px;
}

.mn-side:has(.mn-people:not([hidden])) .mn-recorder { margin-block: 0; }

.recorder-copy { text-align: center; }
.status-label { margin: 0 0 7px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.timer { font: 700 2.5rem/1 "Manrope", "Inter", sans-serif; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }

.waveform { display: flex; height: 30px; margin-top: 16px; align-items: center; justify-content: center; gap: 4px; }
.wave-bar { width: 3px; height: 4px; border-radius: 10px; background: var(--ab-accent); opacity: .25; transition: height 90ms ease, opacity 90ms ease; }

.record-button {
  position: relative;
  width: 106px;
  height: 106px;
  border: 10px solid color-mix(in srgb, var(--rec) 14%, transparent);
  border-radius: 50%;
  background: var(--rec);
  background-clip: padding-box;
  cursor: pointer;
  box-shadow: 0 13px 28px color-mix(in srgb, var(--rec) 28%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}

.record-button:active { transform: scale(.97); }
.record-button:disabled { cursor: not-allowed; filter: saturate(.6); opacity: .6; }
.record-icon { display: block; width: 26px; height: 26px; margin: auto; border: 3px solid #fff; border-radius: 50%; transition: all .2s ease; }
.recording .record-icon { width: 25px; height: 25px; border: 0; border-radius: 5px; background: #fff; }
.recording { animation: mn-pulse 1.8s infinite; }
@keyframes mn-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rec) 28%, transparent); } 50% { box-shadow: 0 0 0 14px transparent; } }

.record-hint { min-height: 18px; margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }

/* A file drops anywhere on the page; the box lights up while one is dragged. */
.mn-open {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 272px;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1.5px dashed color-mix(in srgb, var(--ab-accent) 38%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  cursor: pointer;
  text-align: left;
}

.mn-open svg { width: 22px; height: 22px; flex: none; color: var(--ab-accent); }
.mn-open-copy { display: grid; gap: 2px; min-width: 0; }
.mn-open-label { overflow: hidden; font-size: .86rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mn-open-sub { color: var(--muted); font-size: .74rem; }
.mn-open:disabled { cursor: default; opacity: .5; }
.mn-open.is-dragover:not(:disabled) { border-style: solid; border-color: var(--ab-accent); background: color-mix(in srgb, var(--ab-accent) 10%, var(--surface)); }
.mn-open.is-armed { border-color: #bd482e; color: #bd482e; }
.mn-open.is-armed svg { color: currentColor; }

.mn-people {
  padding: 18px 20px 28px;
  border-top: 1px solid var(--border);
}

.mn-people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mn-people-head .qp-sec-title { margin: 0; }

.mn-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 600;
}

.mn-count .qp-select { height: 32px; }

.mn-people-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mn-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.mn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--who); }

.mn-person input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-strong);
  font-size: .88rem;
  font-weight: 650;
}

/* body.__accessbox-tool, to out-rank tool-theme's rules for every field. */
body.__accessbox-tool .mn-person input::placeholder { color: var(--who); opacity: .85; }
body.__accessbox-tool .mn-person input:focus { border-color: var(--who); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--who) 18%, transparent); }

.mn-play {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

.mn-play svg { width: 13px; height: 13px; }
.mn-play[aria-pressed="true"] { border-color: var(--who); color: #fff; background: var(--who); }

.mn-quote {
  grid-column: 2 / -1;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- The notes ---------- */

.qp-stage.mn-stage { padding: 28px 34px 48px; }
.mn-notes { max-width: 760px; }

.mn-turn { margin: 0 0 22px; }

.mn-turn-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 3px -8px;
}

body.__accessbox-tool .mn-who {
  /* As wide as the name shown, not as "New speaker"; ignored where unsupported. */
  field-sizing: content;
  max-width: 100%;
  height: 28px;
  padding: 0 22px 0 8px;
  border: 0;
  border-radius: 8px;
  color: var(--who);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23928f85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 4px center / 14px;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 750;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
}

.mn-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font: 500 .72rem "DM Mono", ui-monospace, monospace;
}

.mn-time svg { width: 9px; height: 9px; }
.mn-time[aria-pressed="true"] { color: var(--who); background: color-mix(in srgb, var(--who) 10%, transparent); }
.mn-time:disabled { cursor: default; }
.mn-time:disabled svg { display: none; }

.mn-text {
  margin: 0;
  padding: 2px 0;
  border-radius: 6px;
  color: var(--text);
  font: 400 1.04rem/1.66 "Inter", system-ui, sans-serif;
  white-space: pre-wrap;
  outline: none;
}

.mn-text:focus { background: color-mix(in srgb, var(--who) 6%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--who) 6%, transparent); }

.mn-empty {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.6;
}

.mn-live {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.mn-live::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ab-accent);
  animation: mn-blink 1.4s ease-in-out infinite;
  content: "";
}

@keyframes mn-blink { 50% { opacity: .25; } }

/* Clear asks twice: the first press turns it red. */
.qp-btn.confirm-clear { border-color: #bd482e; color: #fff; background: #bd482e; animation: mn-wiggle .25s ease; }
@keyframes mn-wiggle { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-7deg); } 70% { transform: rotate(7deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1001;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--text);
  font-size: .8rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) {
  .record-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 34px color-mix(in srgb, var(--rec) 34%, transparent); }
  .mn-open:hover:not(:disabled, .is-armed) { border-color: var(--ab-accent); background: color-mix(in srgb, var(--ab-accent) 6%, var(--surface)); }
  body.__accessbox-tool .mn-who:hover { background-color: color-mix(in srgb, var(--who) 10%, transparent); }
  .mn-time:hover:not(:disabled) { color: var(--who); background: color-mix(in srgb, var(--who) 10%, transparent); }
  .mn-play:hover { border-color: var(--who); }
}

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  .qp-work.mn-work {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--qp-bar-actual, 56px));
    height: calc(100dvh - var(--qp-bar-actual, 56px));
  }

  .qp-work.mn-work > .mn-stage {
    flex: 1;
    min-height: 0;
    order: 0;
    overflow: auto;
    padding: 14px 16px 16px;
  }

  /* Out-ranks the shell's side-left order, which would put it on top. */
  .qp-work.mn-work > aside.mn-side {
    flex: none;
    order: 1;
    overflow: visible;
    border-top: 1px solid var(--border);
  }

  .mn-recorder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copy button" "hint button" "open button";
    align-items: center;
    gap: 4px 16px;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .recorder-copy {
    grid-area: copy;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 12px;
    text-align: left;
  }

  .status-label { grid-column: 1 / -1; margin: 0; font-size: .8rem; }
  .timer { font-size: 1.8rem; }
  .waveform { height: 28px; margin: 0; justify-content: flex-start; gap: 3px; overflow: hidden; }
  .record-button { grid-area: button; width: 84px; height: 84px; border-width: 8px; }
  .record-hint { grid-area: hint; min-height: 16px; font-size: .74rem; text-align: left; }
  /* No dragging on a phone, so the box is a small button in the dock. */
  .mn-open {
    grid-area: open;
    justify-self: start;
    width: auto;
    max-width: 100%;
    margin: 4px 0 0;
    padding: 6px 12px 6px 9px;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
  }

  .mn-open svg { width: 16px; height: 16px; }
  .mn-open-label { font-size: .78rem; }
  .mn-open-sub { display: none; }

  /* Moved above the notes by the page script. */
  .mn-stage > .mn-people {
    margin: 0 0 18px;
    padding: 0 0 16px;
    border-top: 0;
    border-bottom: 1px solid var(--border);
  }

  .mn-text { font-size: 1rem; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .mn-work *, .mn-work *::before, .mn-work *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
