/* The host's form, from the canvas prototype's Bygg boards. */

.bygg {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nudge0 {
  animation: nudge0 .4s ease-out;
}

.nudge1 {
  animation: nudge1 .4s ease-out;
}

/* Two names for one shake, so that a second nudge starts it again. */
@keyframes nudge0 {
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
  to { transform: none; }
}

@keyframes nudge1 {
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
  to { transform: none; }
}

/* A section's rows in a column, on the front page, /tavler, the guest parts and the host page. */
.sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sec.front {
  margin-bottom: 10px;
}

.brow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 10px 8px 14px;
  box-sizing: border-box;
  color: var(--text);
  text-decoration: none;
}

.brow:hover {
  color: var(--text);
}

.brow > svg:not(.box) {
  position: relative;
  flex: none;
  color: var(--soft);
}

a.brow:hover .line {
  stroke: var(--hover);
}

.btext {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.btitle {
  font-size: var(--size-fact);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.bsaid {
  color: var(--muted);
  font-size: var(--size-fine);
  font-weight: 700;
}

.brow.gone .btitle {
  color: var(--muted);
}

.sub.all {
  text-decoration: none;
}

/* The page of all the boards: each with its bin, and under it what the bin asks, while the row
   keeps the bin's dashed outline. */
.boards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.bline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bline .brow {
  flex: 1;
  min-width: 0;
}

.boards .sure {
  margin: 12px 0 8px;
}

.asked > .bline,
.bline:has(.rm:not(.adm):focus-visible) {
  outline: 2px dashed var(--hover);
  outline-offset: 4px;
}

@media (hover: hover) {
  .bline:has(.rm:not(.adm):hover) {
    outline: 2px dashed var(--hover);
    outline-offset: 4px;
  }
}

/* The fields, each in its chalk box. */
.tbox,
.field,
.area,
.optin {
  position: relative;
  display: block;
}

.tbox input,
.field input,
.optin input,
.area textarea {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  outline: 0;
}

.bygg input::placeholder,
.bygg textarea::placeholder {
  color: var(--muted);
}

.tbox:hover .line,
.field:hover .line,
.area:hover .line,
.optin:hover .line,
.tfield:hover .line,
.qin:hover .line {
  stroke: var(--hover);
}

.tbox:focus-within .line,
.field:focus-within .line,
.area:focus-within .line,
.optin:focus-within .line,
.tfield:focus-within .line,
.qin:focus-within .line {
  stroke: var(--edge);
  stroke-width: 1.8;
}

.tbox {
  height: 62px;
}

.tbox input {
  padding: 0 12px;
  --field: 36px;
  font-weight: 800;
}

.desc {
  margin-top: -10px;
}

.desc textarea {
  display: block;
  min-height: 56px;
  padding: 16px 14px;
  --field: var(--size-fact);
  line-height: 1.35;
  resize: none;
  field-sizing: content;
}

.addnote {
  align-self: flex-start;
  margin: -14px 0 -6px;
}

.trow {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The button under the polls that adds one. */
.adds {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* A part, open or folded. */
.part {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.part:has(.rm:not(.edit):hover),
.part:has(.rm:not(.edit):focus-visible) {
  outline: 2px dashed var(--hover);
  outline-offset: 6px;
}

/* The tabs over the open part. The active one joins the box under it, and one with a part in it has a tick. */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1.5px solid var(--line);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 68px;
  margin-bottom: -1.5px;
  padding: 0;
  border: 1.5px solid transparent;
  border-bottom: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--size-small);
  font-weight: 800;
  cursor: pointer;
}

.tab.used {
  color: var(--soft);
}

.tab.on {
  border-color: var(--line);
  background: var(--board);
  color: var(--text);
}

.tl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

@media (hover: hover) {
  .tab:not(.on):hover {
    border-color: var(--edge);
    background: var(--fill);
    box-shadow: inset 0 0 0 3px var(--board);
    color: var(--ink);
  }
}

.tabbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px;
  border: 1.5px solid var(--line);
  border-top: 0;
}

.folds {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 18px;
}

/* A folded part: its icon, its state line, the pen and the bin. */
.fold {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fold > svg {
  flex: none;
  color: var(--soft);
}

.fline {
  flex: 1;
  min-width: 0;
  font-size: var(--size-fact);
  font-weight: 700;
  cursor: pointer;
}

.fline .sline {
  font-size: inherit;
  font-weight: inherit;
}

.fold:has(.fline:hover) .edit {
  color: var(--text);
}

/* An open part: the head with the state, the body, and the foot with the padlock and Ferdig. */
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--rule);
}

.phead > svg {
  flex: none;
  margin-top: 2px;
  color: var(--soft);
}

.phead .rm {
  margin-block: -10px;
}

.state {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sline {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.sline > span {
  display: block;
}

.snote {
  color: var(--soft);
  font-size: var(--size-small);
  font-weight: 700;
}

.pfoot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pfoot .done {
  margin-left: auto;
}

/* The button that folds a calendar out and in. */
.dbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.dbox:hover,
.dbox.lit {
  color: var(--text);
}

.body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.done {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 112px;
  height: 40px;
  padding: 0 0 0 18px;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--size-small);
  font-weight: 800;
  cursor: pointer;
}

.done > svg:not(.box),
.done span {
  position: relative;
}

.done > svg:not(.box) {
  color: var(--edge);
}

.done:hover .line {
  stroke: var(--hover);
}

.rm {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.rm:hover,
.rm:focus-visible {
  color: var(--text);
}

a.rm {
  text-decoration: none;
}

/* .rm's -11px is for the bin at the edge, and would slide the admin button's box under the bin's. */
.rm.adm {
  margin-right: 0;
}

.acts {
  flex: none;
  display: flex;
}

/* .rm's -11px is for the bin at the edge, and would slide the pen's box under the bin's. */
.acts .edit {
  margin-right: 0;
}

/* The lines of a part, folded or open: an icon beside what it says. */
.facts {
  display: flex;
  flex-direction: column;
}

.facts.form {
  gap: 6px;
}

.fact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: var(--size-fact);
  font-weight: 700;
}

.fact > svg {
  flex: none;
  margin-top: 7px;
  color: var(--soft);
}

.form .fact > svg {
  margin-top: 9px;
}

.lines {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lines > * {
  display: block;
  padding: 6px 0;
  line-height: 24px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.wline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 40px;
}

.wline.days {
  align-items: flex-start;
  min-height: 50px;
  padding-top: 8px;
}

.hint {
  color: var(--muted);
  font-size: var(--size-small);
}

.ispace {
  flex: none;
  width: 22px;
}

/* Klokkeslett's rows. */
.tgroup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tfield {
  position: relative;
  display: inline-block;
  width: 118px;
  height: 40px;
}

.tfield input {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0 30px 0 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  --field: var(--size-fact);
  font-weight: 700;
  outline: 0;
}

.spin {
  position: absolute;
  top: 1px;
  right: 2px;
  bottom: 1px;
  display: flex;
  flex-direction: column;
}

.spin button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.spin button:hover {
  color: var(--text);
}

.spin button:focus-visible {
  outline-offset: -2px;
}

.x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.x:hover {
  color: var(--edge);
}

/* Sted's lines. */
.plist {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pline {
  position: relative;
  display: flex;
  align-items: center;
}

.place {
  flex: 1;
  height: 40px;
}

.place input {
  padding: 0 11px;
  --field: var(--size-fact);
}

/* A poll: its title over a line, and the options in boxes. */
.qin {
  display: block;
}

.uline {
  display: block;
  width: 100%;
  height: 6px;
}

.qin input {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  --field: var(--size-head);
  font-weight: 800;
  outline: 0;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.optin {
  height: 52px;
}

.optin input {
  padding: 0 52px 0 14px;
  --field: var(--size-head);
  font-weight: 800;
}

.optin input::placeholder {
  font-weight: 700;
}

.drop {
  position: absolute;
  right: 4px;
  top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.drop:hover {
  color: var(--edge);
}

.qtext {
  font-size: var(--size-head);
  font-weight: 800;
}

/* Finn sted: the pin in each place's box. */
.optin .pin {
  position: absolute;
  left: 14px;
  top: 15px;
  color: var(--muted);
  pointer-events: none;
}

.optin.pinned input {
  padding-left: 44px;
}

/* A row under a poll's options of the switches that say a setting and flip it: the padlock, and one choice only. */
.lockrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 18px;
  min-height: 44px;
}

.lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  margin-left: -7px;
  padding: 0 6px 0 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: var(--size-small);
  font-weight: 800;
  cursor: pointer;
}

.lock span {
  color: var(--muted);
}

/* Ulåst and Låst take the same width, so a press on the padlock moves the switch beside it. */
.lock:first-child span {
  min-width: 5.2ch;
}

.lock:hover {
  color: var(--edge);
}

.lock:hover span {
  color: var(--text);
}

/* Lag tavle, the step that the page is for, filled. */
.go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--size-head);
  font-weight: 800;
  cursor: pointer;
}

.go span {
  position: relative;
}

.go .line {
  stroke: var(--edge);
  stroke-width: 1.8;
}

.go:hover .fill {
  fill: var(--edge);
}

.go:disabled {
  cursor: progress;
  opacity: .7;
}

/* What the list under one of Finn sted's places is placed by (steder.js). */
.optbox {
  position: relative;
}

/* The front page: the boxes that ask what to arrange, and the steps for a first visit. */
.start {
  display: flex;
  flex-direction: column;
}

.start .pick {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.start .ask {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.picks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.seg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 84px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.seg.wide {
  grid-column: 1 / -1;
}

.seg > span,
.seg > svg:not(.box) {
  position: relative;
}

.seg > svg:not(.box) {
  color: var(--soft);
}

.icrow {
  display: inline-flex;
  gap: 6px;
}

.seg .fill {
  fill: none;
}

/* Alve's trial: a mouse over a box fills it as Lag tavle is filled. */
@media (hover: hover) {
  .seg:hover {
    color: var(--ink);
  }

  .seg:hover > svg:not(.box),
  .seg:hover .icrow svg {
    color: var(--ink);
  }

  .seg:hover .line {
    stroke: var(--edge);
    stroke-width: 1.8;
  }

  .seg:hover .fill {
    fill: var(--fill);
  }
}

.intro,
.start .sec.front {
  padding-top: 36px;
}

.itit {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.start .sec.front {
  margin-bottom: 0;
}

.start .sec.front .itit {
  margin-bottom: 0;
}

.journey {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 52px;
}

.journey .s2,
.journey .s4 {
  flex-direction: row-reverse;
  align-self: flex-end;
  margin-left: 0;
  margin-right: 52px;
}

.s2 .stext,
.s4 .stext {
  text-align: right;
}

.num {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  color: var(--soft);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.stext {
  color: var(--soft);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.vis {
  flex: none;
  color: var(--line);
}

.vis.ans {
  color: var(--soft);
}

.journey .chalk {
  stroke: var(--line);
  stroke-width: 2;
  overflow: visible;
}

.journey .dash {
  stroke-dasharray: 6 7;
}

.journey > li:not(.step) {
  line-height: 0;
}
