:root {
  color-scheme: light;
  --ink: #182b2a;
  --teal: #185d54;
  --line: #cbd8d4;
  --mute: #4d615e;
  --paper: #fff;
  --wash: #f3f6f4;
  font: 100%/1.55 "Source Sans 3", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  overflow-wrap: anywhere;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button, summary {
  cursor: pointer;
}

button {
  border: 1px solid transparent;
  border-radius: .55rem;
  min-height: 44px;
  padding: .45rem .9rem;
  font-weight: 600;
  background: transparent;
}

button:disabled, input:disabled, fieldset:disabled {
  opacity: .65;
  cursor: default;
}

button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #e3a538;
  outline-offset: 3px;
}

.masthead {
  background: #183c39;
  color: white;
  padding: env(safe-area-inset-top) 0 0;
}

.topline, main {
  max-width: 43rem;
  margin: 0 auto;
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-left: max(1rem, env(safe-area-inset-left));
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  letter-spacing: .01em;
  font-size: 1.12rem;
  font-weight: 650;
}

.header-action {
  color: white;
  padding-right: 0;
}

main {
  padding-top: 1rem;
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

nav {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .68rem;
  padding: .2rem;
  margin-bottom: 1.5rem;
}

nav button {
  flex: 1;
  padding: .4rem .3rem;
  font-size: .95rem;
}

nav [aria-current=page] {
  background: #dfede8;
  color: #154c43;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 1.65rem;
  line-height: 1.3;
  letter-spacing: -.025em;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.45;
}

h3 {
  font-size: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hint, .empty, .optional, .metadata, .feedback-status {
  color: var(--mute);
}

.hint, .empty, .metadata, .feedback-status {
  font-size: .92rem;
}

.hint, .empty, .card-text, .metadata, .feedback-status:not(:empty) {
  margin: .5rem 0;
}

.empty {
  padding: 1.2rem 0;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: 1rem;
  margin-top: .85rem;
}

.login-box {
  max-width: 28rem;
  margin: 2rem auto;
}

.panel label {
  display: block;
  font-weight: 600;
  margin: .85rem 0 .35rem;
}

input, textarea, select {
  display: block;
  width: 100%;
  border: 1px solid #a3b7b2;
  border-radius: .45rem;
  background: white;
  min-height: 44px;
  padding: .55rem .65rem;
}

textarea {
  resize: vertical;
}

.photo-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--teal);
  font-weight: 600;
}

.photo-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.photo-picker:focus-within {
  outline: 3px solid #e3a538;
  outline-offset: 3px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.optional {
  font-weight: 400;
  font-size: .86rem;
}

.primary {
  background: var(--teal);
  color: white;
  margin-top: 1rem;
}

.secondary {
  background: white;
  color: var(--teal);
  border-color: var(--line);
}

.card-button {
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  padding: .8rem .95rem;
  margin: .35rem 0;
  display: grid;
  gap: .15rem;
}

.card-button[aria-expanded=true] {
  border-color: var(--teal);
  box-shadow: inset 3px 0 var(--teal);
}

.card-button .metadata {
  font-weight: 400;
  margin: 0;
}

.card-text {
  white-space: pre-wrap;
}

.state {
  font-size: .85rem;
  font-weight: 650;
  color: #1b5a4d;
}

.state.inactive {
  color: #835320;
}

.push-settings {
  margin: 1.5rem 0;
  border-top: 1px solid var(--line);
  padding-top: .5rem;
}

summary {
  color: var(--teal);
  font-weight: 600;
  padding: .65rem 0;
  min-height: 44px;
}

#connection {
  background: #fff0cb;
  color: #654516;
  border: 1px solid #ddc180;
  border-radius: .6rem;
  padding: .7rem .85rem;
  margin-bottom: 1rem;
}

#previews {
  list-style: none;
  padding: 0;
  margin: 0;
}

.photo {
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}

.photo-top {
  display: flex;
  gap: .65rem;
  align-items: center;
}

.photo img {
  object-fit: cover;
  width: 3.8rem;
  height: 3.8rem;
  border-radius: .4rem;
}

.photo-name {
  flex: 1;
  min-width: 0;
}

.photo button {
  color: var(--teal);
  border-color: var(--line);
  font-weight: 500;
}

.photo label {
  font-size: .85rem;
  margin: .4rem 0;
}

.receipt-photo {
  display: block;
  max-width: 100%;
  height: auto;
  margin: .5rem 0;
}

.status-error {
  color: #913923;
}

@media (min-width:40rem) {
  main {
    padding-top: 1.5rem;
  }
  .panel {
    padding: 1.35rem;
  }
}
