/* Signed-in pages: what the shared shell does not already draw. */

/* Keep the everyday send/request controls in view, without clipping overflow. */
.app.compact:has(.transfer-form) { width: min(480px, calc(100% - 16px)); margin-block: 8px; }
.compact:has(.transfer-form) .topbar { min-height: 50px; padding-block: 8px; }
.compact:has(.transfer-form) .back-home { display: none; }
.compact:has(.transfer-form) .content { padding: 8px 12px 12px; gap: 8px; }
.compact:has(.transfer-form) .page-head { display: none; }
.compact:has(.transfer-form) .page-head p { display: none; }
.compact:has(.transfer-form) .card-body { padding: 0; }
.transfer-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px 12px; }
.transfer-form > * { min-width: 0; }
.transfer-form label { margin-bottom: 0; }
.transfer-form label .hint { font-size: 11px; line-height: 1.3; }
.transfer-form input, .transfer-form select { padding: 6px 8px; min-height: 34px; }
.transfer-form textarea { min-height: 44px; height: 44px; resize: vertical; }
.transfer-form input, .transfer-form select, .transfer-form textarea { font-size: 13px; }
.credential-password { display: flex; align-items: center; position: relative; margin: 0; }
.credential-password input { padding-right: 34px; }
.credential-password .icon-btn { position: absolute; right: 2px; padding: 6px; }
.transfer-form .delivery-fields .hint { display: none; }
.transfer-form .delivery-fields { display: grid; gap: 8px 12px; }
.transfer-form .delivery-fields > label { min-width: 0; }
.transfer-form .limit-controls { margin: 0; gap: 8px; }
.transfer-form .limit-controls select { min-height: 34px; }
.primary-security { display: grid; gap: 5px 12px; margin-top: 6px; }
.primary-security > label { min-width: 0; }
.transfer-form > button[type="submit"] { justify-self: stretch; min-height: 36px; }
.transfer-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.transfer-tabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 4px; min-height: 36px; color: var(--text-2); text-decoration: none;
  font-size: 12px; border-radius: 5px; }
.transfer-tabs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 650; }
.transfer-tabs a:hover { background: var(--panel-2); }
.transfer-tabs .i { width: 15px; height: 15px; }
.quick-card .version-badge, .quick-card .version-badge.has-news,
.quick-card .version-badge:hover { color: var(--text-2); background: var(--panel-2); }
.transfer-form label > span:first-child { font-size: 12px; }
.transfer-form > label:has(input[name="purpose"]) input { min-height: 30px; }
@media (pointer: coarse) {
  .transfer-tabs a, .transfer-form input, .transfer-form select,
  .transfer-form > button[type="submit"] { min-height: 44px; }
}
@media (min-width: 360px) {
  .primary-security { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-form .delivery-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .transfer-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-form > * { grid-column: 1 / -1; }
  .transfer-form > label:has(input[name="login"]),
  .transfer-form > label:has(input[name="password"]) { grid-column: auto; }
}

.limit-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.limit-controls label { flex: 1 1 105px; min-width: 0; }
.limit-controls select { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); color: var(--text); }
/* A bounded overlay keeps recent recipients from stretching the form. */
.recent-recipients { position: relative; margin: 0; min-width: 0; }
.recent-toggle { width: fit-content; list-style: none; cursor: pointer; }
.recent-toggle::-webkit-details-marker { display: none; }
.recent-toggle > span { font-size: 18px; line-height: 1; }
.recent-panel {
  position: absolute; z-index: 5; inset: calc(100% + 4px) 0 auto;
  display: grid; gap: 3px; padding: 6px;
  max-height: min(280px, 45dvh); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
}
.recent-recipients:not([open]) > .recent-panel { display: none; }
.recent-panel .recent-chip {
  display: block; width: 100%; min-width: 0; text-align: left;
  white-space: normal; overflow-wrap: anywhere;
  font-size: 12px; font-weight: 400; padding: 7px 9px;
}
.recent-status:empty { display: none; }
.recent-status:not(:empty) { color: var(--bad); font-size: 12px; }

/* One Send card; the shared Request/recipient controls keep their layout. */
.compact-send [hidden] { display: none !important; }
.compact-send { gap: 10px 12px; }
.compact-send input, .compact-send select, .compact-send textarea { font-size: 14px; min-height: 40px; }
.compact-send label > span:first-child { font-size: 13px; }
.compact-send label .hint, .compact-send .hint { font-size: 12px; line-height: 1.35; }
.compact-send > label:has(input[name="purpose"]) input { min-height: 40px; }
.compact-send .send-recipient .hint { display: none; }
.compact-send .send-email-hint { margin: 0; }
.send-delivery { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; position: relative; }
.send-delivery > label { flex: 1; }
.channel-segments { display: flex; flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.channel-segments .btn { flex: 1; min-width: 0; padding: 8px 6px; border: 0; border-radius: 0; background: transparent; font-size: 13px; }
.channel-segments .btn + .btn { border-left: 1px solid var(--line-strong); }
.channel-segments .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.channel-segments .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.channel-segments .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.channel-segments .btn:disabled { opacity: .5; }
.compact-send .recent-recipients { position: static; }
.compact-send .recent-panel { inset-inline: 0; }
.compact-send .btn, .compact-send .recent-toggle { min-height: 44px; }
.compact-send .recent-panel .recent-chip { min-height: 44px; }
.compact-send .recent-toggle { padding-inline: 9px; }
.compact-send .credential-password input { padding-right: 44px; }
.compact-send .credential-password .icon-btn { width: 40px; height: 40px; }
.compact-send .send-optional { grid-column: auto; }
.compact-send .send-optional:has(> div:not([hidden])) { grid-column: 1 / -1; }
.compact-send .optional-toggle { gap: 6px; }
.compact-send .optional-toggle:disabled { opacity: 1; color: var(--text-2); cursor: default; }
.compact-send .send-optional > div { margin-top: 6px; }
.compact-send .send-optional p { margin: 4px 0 0; }
.compact-send .file-selection { margin-bottom: 0; }
.compact-send .limit-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-send .limit-controls select { min-height: 40px; }
.compact-send .primary-security { margin-top: 10px; }
.compact-send > button[type="submit"] { min-height: 44px; }
@media (max-width: 359px) {
  .compact-send .channel-segments { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .compact-send input, .compact-send select, .compact-send textarea,
  .compact-send .limit-controls select,
  .compact-send > label:has(input[name="purpose"]) input { min-height: 44px; font-size: 16px; }
  .compact-send .credential-password .icon-btn { width: 44px; height: 44px; }
}
@media (pointer: coarse) {
  .recent-toggle, .recent-panel .recent-chip { min-height: 44px; }
}

/* Revealed secret: masked until the eye is pressed (details/summary, no JS). */
.secret-reveal summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-ink);
  font-weight: 700;
  user-select: none;
}
.secret-reveal summary::-webkit-details-marker { display: none; }
.secret-reveal .mask {
  font-family: var(--mono);
  letter-spacing: 0.15em;
  color: inherit;
  opacity: 0.7;
}
.secret-reveal .when-open, .secret-reveal[open] .when-closed, .secret-reveal[open] .mask { display: none; }
.secret-reveal[open] .when-open { display: inline; }
.secret-reveal .eye {
  position: relative;
  width: 1.5rem;
  height: 0.9rem;
  margin-left: auto;
  border: 2px solid currentColor;
  border-radius: 100% 0;
  transform: rotate(45deg);
  box-sizing: border-box;
}
.secret-reveal .eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  margin: -0.2rem 0 0 -0.2rem;
  border-radius: 50%;
  background: currentColor;
}
.secret-reveal[open] .eye::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  top: 50%;
  width: 1.9rem;
  height: 2px;
  margin-top: -1px;
  background: currentColor;
  transform: rotate(-45deg);
}
.secret-reveal[open] textarea { margin-top: 0.75rem; }
.card-body > .secret-reveal + .btn { margin-top: 12px; }

/* The one-time link and code stand out and wrap. */
#one-time-pin {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 13px;
  user-select: all;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.result-card .result-hint { margin: 0; color: var(--text-2); }
.result-card .one-time { margin: 0; }
.result-card .delivery-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
}
.pin-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px 12px;
  padding: 12px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-soft);
}
.pin-card span { grid-column: 1 / -1; color: var(--text-2); font-size: 13px; }
.pin-card code { font-size: 18px; letter-spacing: 0.12em; }

@media (max-width: 640px) {
  .result-card { padding: 14px; }
  .result-card .one-time { flex-direction: column; align-items: stretch; }
  /* In a column the row's flex-basis would become the field's height. */
  .result-card .one-time input { width: 100%; flex: none; }
}

.shared-verification label { display:flex; align-items:center; gap:.5rem; }
.shared-verification input[type="checkbox"] { width:auto; margin:0; }
.shared-verification .hint { margin:.25rem 0 0; }
