dialog.share-entry {
  width: min(354px,calc(100vw - 28px));
  max-width:calc(100vw - 28px);
  max-height:calc(100dvh - 32px);
  overflow:auto;
  overscroll-behavior:contain;
  padding: 23px;
  border: 1px solid #a9b88e;
  border-radius: 14px;
  color: #2d5036;
  background: #fff8e9;
  box-shadow: 0 3px 0 #6a80574a;
}
dialog.share-entry::backdrop { background:#19392c66; }
dialog.share-entry .share-heading { display:flex; align-items:center; gap:8px; }
dialog.share-entry .share-heading h2 { margin:0; flex:1; font:400 27px/1.25 var(--kv-writing,serif); }
dialog.share-entry .share-close { flex:0 0 46px; width:46px; height:46px; min-height:46px; padding:0; border:0; border-radius:8px; background:transparent; color:#3d5841; font:26px/1 sans-serif; }
dialog.share-entry .share-guidance { margin:12px 0 17px; font:400 15px/1.6 var(--kv-label,sans-serif); }
dialog.share-entry .share-link-label { margin:0; font:600 14px/1.6 var(--kv-label,sans-serif); }
dialog.share-entry .invite-link { display:block; margin:6px 0 19px; width:100%; padding:10px 12px; resize:none; font:400 16px/1.45 var(--kv-label,sans-serif); color:#274a31; background:#f4f3dc!important; border:1px solid #afbc90; border-radius:8px; }
dialog.share-entry .share-copy { min-height:48px; border-radius:8px; margin:0; font-size:16px; background:var(--kv-action,#3d6243); color:#fff9e9; }
dialog.share-entry .share-result { min-height:22px; margin:12px 0 0; font:400 14px/1.5 var(--kv-label,sans-serif); }
dialog.share-entry.account-card {
  inset:50% auto auto 50%;
  margin:0;
  transform:translate(-50%,-50%) scale(var(--stage-scale,1));
  width:354px;
  max-width:calc((100vw - 24px) / var(--stage-scale,1));
  max-height:calc((100dvh - 24px) / var(--stage-scale,1));
  padding:18px 20px;
}
.account-card .share-guidance { margin:8px 0 12px; }
.account-card .share-link-label { display:block; margin:10px 0; }
.account-card input { margin-top:5px; padding:10px 12px; background:#f4f3dc; border:1px solid #afbc90; border-radius:8px; color:#244830; font:400 16px/1.35 var(--kv-label,sans-serif); }
.account-card .account-card-secret { display:flex; align-items:center; gap:5px; }
.account-card .account-card-password { min-width:0; flex:1; }
.account-card .account-card-reveal { width:44px; height:44px; padding:0; border-radius:8px; background:transparent; color:#294b32; font-size:14px; font-weight:600; }
.account-card .account-card-manual { min-height:88px; margin:6px 0 8px; padding:8px 10px; font:400 16px/1.4 var(--kv-label,sans-serif); }
.account-card .account-card-copy { margin-top:10px; border-radius:8px; min-height:46px; padding:9px; font-size:15px; }
.account-card .account-card-done { margin-top:10px; border-radius:8px; min-height:46px; padding:9px; font-size:16px; }
.account-card textarea[hidden] { display:none; }
dialog.share-entry {--share-touch:max(46px,calc(44.25px / var(--stage-scale,1)))}
#app dialog.share-entry button {min-height:var(--share-touch)}
dialog.share-entry .share-close {flex-basis:var(--share-touch);width:var(--share-touch);height:var(--share-touch);min-height:var(--share-touch)}
dialog.share-entry .account-card-reveal {flex:0 0 var(--share-touch);width:var(--share-touch);height:var(--share-touch)}
#app dialog.share-entry :is(.share-copy,.account-card-copy,.account-card-done) {min-height:var(--share-touch)}

#app dialog.share-entry :is(.share-copy,.account-card-done),
dialog.share-entry :is(.share-copy,.account-card-done) {
  border:1px solid var(--kv-action,#3d6243);
  border-radius:8px;
  background:var(--kv-action,#3d6243);
  color:#fff9e9;
  box-shadow:none;
  font-weight:600;
}
#app dialog.share-entry :is(.share-copy,.account-card-done):active:not(:disabled):not([aria-disabled="true"]),
dialog.share-entry :is(.share-copy,.account-card-done):active:not(:disabled):not([aria-disabled="true"]) {
  background:var(--kv-action-active,#315236);
}
#app dialog.share-entry .account-card-copy,
dialog.share-entry .account-card-copy {
  border:1px solid #a7b68b;
  border-radius:8px;
  background:#eef2de;
  color:#294b32;
  box-shadow:none;
  font-weight:600;
}
#app dialog.share-entry .account-card-copy:active:not(:disabled):not([aria-disabled="true"]),
dialog.share-entry .account-card-copy:active:not(:disabled):not([aria-disabled="true"]) {
  background:#e2ebd0;
}
#app dialog.share-entry :is(button,a,input,textarea):focus-visible,
dialog.share-entry :is(button,a,input,textarea):focus-visible {
  outline:2px solid var(--kv-focus,#2c5135);
  outline-offset:2px;
}
#app dialog.share-entry :is(input,textarea):focus,
dialog.share-entry :is(input,textarea):focus {
  border-color:var(--kv-focus,#2c5135);
  box-shadow:0 0 0 2px #2c513524;
}
#app dialog.share-entry .share-close:focus-visible,
dialog.share-entry .share-close:focus-visible {
  outline-offset:-2px;
}

dialog.share-invitation {
  /* Center the top-layer box before stage scaling; auto margins collapse when
     its unscaled 358px width is wider than a narrow physical viewport. */
  inset:50% auto auto 50%;
  margin:0;
  transform:translate(-50%,-50%) scale(var(--stage-scale,1));
  width:358px;
  max-width:calc((100vw - 24px) / var(--stage-scale,1));
  max-height:calc((100dvh - 24px) / var(--stage-scale,1));
  padding:18px;
  scroll-padding-block-start:72px;
}
dialog.share-invitation .share-guidance {
  margin:4px 0 12px;
  padding:9px 11px;
  border-left:3px solid #9cac76;
  background:#edf1d5;
  font-size:15px;
}
dialog.share-invitation .share-heading {
  position:sticky;
  top:-18px;
  z-index:2;
  margin:-18px -18px 10px;
  padding:12px 18px 8px;
  border-bottom:1px dashed #d5dac0;
  background:#fff8e9;
}
dialog.share-invitation .share-guidance p {margin:3px 0 0}
dialog.share-invitation .share-link-label,
dialog.share-invitation .share-manual {display:block;scroll-margin-top:72px}
dialog.share-invitation .share-manual[hidden],
dialog.share-invitation .share-card[hidden] {display:none}
dialog.share-invitation :is(.invite-link,.share-message,.share-manual textarea) {
  display:block;
  width:100%;
  margin:4px 0 9px;
  padding:7px 9px;
  border:1px solid #c0c59e;
  border-radius:8px;
  color:#274a31;
  background:#f9f3e4;
  font:400 16px/1.45 var(--kv-label,sans-serif);
  resize:none;
  scroll-margin-top:72px;
}
dialog.share-invitation .share-message {
  height:72px;
  font-weight:550;
  color:#274a31;
}
dialog.share-invitation .invite-link {font-size:16px}
dialog.share-invitation .share-manual {font:600 14px/1.45 var(--kv-label)}
dialog.share-invitation .share-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
dialog.share-invitation .share-actions .share-copy {grid-column:1/-1}
dialog.share-invitation .share-actions button:not(.share-copy) {
  padding:5px;
  border:1px solid #a7b68b;
  border-radius:8px;
  color:#294b32;
  background:#eef2de;
  font:600 14px/1.3 var(--kv-label);
}
#app dialog.share-invitation .share-actions button:not(.share-copy):is(:disabled,[aria-disabled="true"]),
dialog.share-invitation .share-actions button:not(.share-copy):is(:disabled,[aria-disabled="true"]) {
  background:#f2efe1;
  border-color:#c4cdb2;
  color:#4f664f;
  opacity:.82;
  cursor:not-allowed;
  transform:none;
}
#app dialog.share-invitation .share-actions button:not(.share-copy)[aria-disabled="true"][aria-busy="true"],
dialog.share-invitation .share-actions button:not(.share-copy)[aria-disabled="true"][aria-busy="true"] {
  opacity:.88;
  cursor:wait;
}
#app dialog.share-invitation .share-actions button:not(.share-copy):is(:disabled,[aria-disabled="true"]):focus-visible,
dialog.share-invitation .share-actions button:not(.share-copy):is(:disabled,[aria-disabled="true"]):focus-visible {
  opacity:1;
}
dialog.share-invitation .share-result {margin-top:7px;min-height:0}
dialog.share-invitation .share-result:empty {display:none}
dialog.share-invitation .share-card {
  width:min(260px,100%);
  margin:12px auto 0;
  text-align:center;
  scroll-margin-top:72px;
}
dialog.share-invitation .share-card img {
  display:block;
  width:100%;
  height:auto;
  border-radius:8px;
}
dialog.share-invitation .share-card a {
  display:grid;
  min-height:var(--share-touch);
  margin-top:7px;
  place-items:center;
  color:#294b32;
  border:1px solid #a7b68b;
  border-radius:8px;
  background:#eef2de;
  font:600 15px/1.3 var(--kv-label);
  text-decoration:none;
}
dialog.share-invitation .share-expressions {margin:10px auto 12px;max-width:300px;text-align:left;color:#496247;font:600 13px/1.4 var(--kv-label)}
dialog.share-invitation .share-expressions[hidden] {display:none}
dialog.share-invitation .share-expressions>div {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-top:5px}
#app dialog.share-invitation .share-expressions button {padding:2px;border:1px solid #b9cba5;border-radius:8px;background:#f9f5e7;color:#38563a;font:500 13px/1.2 var(--kv-label)}
#app dialog.share-invitation .share-expressions button[aria-pressed="true"] {background:#dcebc9;border-color:#719365;color:#244830}
#app dialog.share-invitation .share-expressions button:is(:disabled,[aria-disabled="true"]) {background:#f2efe2;border-color:#cdd6be;color:#546953;opacity:.72;cursor:not-allowed}
#app dialog.share-invitation .share-expressions button[aria-pressed="true"]:is(:disabled,[aria-disabled="true"]) {background:#e6eed9;border-color:#9cb38f;color:#3a573f;opacity:.84;cursor:not-allowed}
#app dialog.share-invitation .share-expressions button[aria-disabled="true"][aria-busy="true"] {background:#eaeed9;border-color:#88a17a;color:#2d4e35;opacity:1;cursor:wait}
#app dialog.share-invitation .share-expressions button:is(:disabled,[aria-disabled="true"]):focus-visible {opacity:1}
dialog.share-invitation .share-expression-status {margin:7px 0 0;color:#496247;font:400 13px/1.4 var(--kv-label)}
dialog.share-invitation .share-expression-status:empty {display:none}
dialog.share-invitation .invite-link {
  min-height:0;
  height:68px;
  word-break:break-all;
}
