.wr-dialog {
  --wr-ink: #17253f;
  --wr-muted: #5d677c;
  --wr-accent: #5045c7;
  --wr-line: #dbe0eb;
  box-sizing: border-box;
  width: min(27rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(90vh, 52rem);
  max-height: min(90dvh, 52rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d5dbea;
  border-radius: 18px;
  background: white;
  color: var(--wr-ink);
  box-shadow: 0 24px 96px #17253f35;
  font: 1rem/1.55 "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  text-align: left;
}
.wr-dialog::backdrop {
  background: #17233a70;
  backdrop-filter: blur(3px);
}
.wr-dialog.wr-wide { width: min(45rem, calc(100% - 2rem)); }
.wr-dialog *, .wr-dialog *::before, .wr-dialog *::after { box-sizing: border-box; }
.wr-dialog [hidden] { display: none !important; }
.wr-dialog button, .wr-dialog input, .wr-dialog select { font: inherit; }
.wr-dialog button { cursor: pointer; }
.wr-dialog button:disabled, .wr-dialog fieldset:disabled button { cursor: default; opacity: .58; }
.wr-dialog :focus-visible { outline: 3px solid #9189ec; outline-offset: 3px; }
.wr-dialog .wr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.6rem 1.15rem;
  border-bottom: 1px solid var(--wr-line);
  background: #fff;
}
.wr-head h2 {
  margin: 0;
  color: var(--wr-ink);
  font-size: 1.35rem;
  font-weight: 720;
  line-height: 1.35;
}
.wr-dialog .wr-close {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f3f8;
  color: #57617a;
}
.wr-close::before, .wr-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.7px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}
.wr-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.wr-dialog .wr-close:hover { background: #e8e9f2; color: var(--wr-ink); }
.wr-body { padding: 1.4rem 1.6rem 1.6rem; }
.wr-intro, .wr-count, .wr-sharing, .wr-retry p { margin: 0; color: var(--wr-muted); }
.wr-intro { margin-bottom: 1.25rem; }
.wr-login, .wr-field, .wr-entry { display: grid; }
.wr-login { gap: 1.05rem; }
.wr-field { min-width: 0; gap: .42rem; }
.wr-dialog label, .wr-dialog legend { color: var(--wr-ink); font-size: .92rem; font-weight: 620; }
.wr-dialog input:not([type="radio"]), .wr-dialog select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .6rem .78rem;
  border: 1px solid #cbd2e1;
  border-radius: 8px;
  background-color: #fff;
  color: var(--wr-ink);
  font-size: 1rem;
  font-weight: 440;
  line-height: 1.4;
}
.wr-dialog input::placeholder { color: #788198; }
.wr-dialog select {
  padding-right: 2rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #626d82 50%), linear-gradient(135deg, #626d82 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.wr-dialog input:focus, .wr-dialog select:focus { border-color: var(--wr-accent); }
.wr-dialog select:disabled, .wr-fields:disabled input, .wr-fields:disabled select { background-color: #f4f5f9; color: #737d91; }
.wr-dialog .wr-primary, .wr-dialog .wr-secondary {
  min-height: 42px;
  padding: .6rem 1.12rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.4;
}
.wr-dialog .wr-primary { background: var(--wr-accent); color: #fff; }
.wr-dialog .wr-primary:hover:enabled { background: #3c32a8; }
.wr-dialog .wr-secondary { border-color: #cbd2e1; background: white; color: var(--wr-ink); }
.wr-dialog .wr-secondary:hover:enabled { background: #f4f5fa; }
.wr-login .wr-primary { margin-top: .25rem; }
.wr-dialog .wr-link {
  min-height: 34px;
  padding: .22rem .15rem;
  border: 0;
  background: transparent;
  color: var(--wr-accent);
  font-size: .9rem;
  font-weight: 620;
}
.wr-dialog .wr-link:hover { text-decoration: underline; text-underline-offset: .16em; }
.wr-message {
  margin: 0;
  padding: .65rem .85rem;
  border-radius: 7px;
  background: #ecf5f1;
  color: #225c47;
  font-size: .91rem;
}
.wr-message.wr-error { background: #fff0ee; color: #932e24; }
.wr-retry { display: grid; justify-items: start; gap: 1rem; }
.wr-tools, .wr-project-head, .wr-actions, .wr-account, .wr-switch { display: flex; align-items: center; }
.wr-tools, .wr-project-head { justify-content: space-between; gap: .6rem; }
.wr-tools { flex-wrap: wrap; margin-bottom: 1.15rem; }
.wr-switch { gap: .15rem; padding: .2rem; border-radius: 9px; background: #f0f1f8; }
.wr-dialog .wr-switch button {
  min-height: 35px;
  padding: .35rem .85rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--wr-muted);
  font-size: .9rem;
  font-weight: 620;
}
.wr-dialog .wr-switch button[aria-pressed="true"] { background: white; color: var(--wr-accent); box-shadow: 0 1px 4px #17253f1c; }
.wr-account { min-width: 0; gap: .65rem; }
.wr-account span { max-width: 12rem; overflow: hidden; color: var(--wr-muted); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.wr-workspace > .wr-message { margin-bottom: 1rem; }
.wr-project-head { margin-bottom: .2rem; }
.wr-create {
  display: grid;
  gap: .7rem;
  margin-bottom: .9rem;
  padding: .85rem 1rem;
  border: 1px solid #daddf4;
  border-radius: 10px;
  background: #f6f6fd;
}
.wr-entry { gap: 1rem; }
.wr-fields, .wr-types { min-width: 0; margin: 0; padding: 0; border: 0; }
.wr-types { display: flex; gap: .55rem; margin-bottom: 1rem; }
.wr-types legend { margin-bottom: .45rem; padding: 0; }
.wr-types label { position: relative; cursor: pointer; }
.wr-types input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wr-types span {
  display: block;
  padding: .43rem 1.2rem;
  border: 1px solid var(--wr-line);
  border-radius: 7px;
  color: var(--wr-muted);
}
.wr-types input:checked + span { border-color: #9d96e5; background: #f0efff; color: #443aac; }
.wr-types input:focus-visible + span { outline: 3px solid #9189ec; outline-offset: 2px; }
.wr-grid, .wr-history-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.wr-sharing { margin: 1rem 0 .95rem; font-size: .875rem; }
.wr-actions { flex-wrap: wrap; gap: .8rem; }
.wr-entry .wr-actions { justify-content: end; }
.wr-history-tools { padding-bottom: 1.05rem; }
.wr-count { margin-bottom: .38rem; font-size: .9rem; }
.wr-records { margin: 0; padding: 0; list-style: none; }
.wr-records li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  padding: .82rem 0;
  border-top: 1px solid #e7eaf2;
}
.wr-records li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.wr-records strong, .wr-records b { display: block; color: var(--wr-ink); font-size: 1rem; font-weight: 650; }
.wr-meta, .wr-value span { display: block; color: var(--wr-muted); font-size: .84rem; }
.wr-value { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.wr-income .wr-value b { color: #207258; }
@media (max-width: 520px) {
  .wr-dialog, .wr-dialog.wr-wide { width: calc(100% - 1.2rem); border-radius: 14px; }
  .wr-dialog .wr-head, .wr-body { padding: 1rem 1.1rem; }
  .wr-tools { align-items: flex-start; }
  .wr-grid { grid-template-columns: 1fr; gap: .85rem; }
  .wr-history-tools { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .6rem; }
  .wr-entry .wr-primary { width: 100%; }
}
