/* $web/styles.css */
:root {
  --pad: 14px;
  --gap: 10px;
  --radius: 10px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f7f7f8;
  color: #111;
}
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #e8e8ea;
  padding: var(--pad);
}
h1 {
  margin: 0;
  font-size: 18px;
}
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--pad);
}
.crumbs {
  font-size: 14px;
  color: #555;
  overflow-x: auto;
  white-space: nowrap;
}
.crumbs a {
  color: #0b5fca;
  text-decoration: none;
}
.toolbar {
  display: flex;
  gap: var(--gap);
  align-items: center;
  margin-top: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  text-decoration: none;
  color: #111;
  font-size: 16px;
  touch-action: manipulation;
}
.btn:active {
  transform: translateY(1px);
}
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.list {
  margin-top: 12px;
}
.row {
  background: #fff;
  border: 1px solid #e8e8ea;
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}
.row-main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.name a {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kind {
  width: 28px;
  text-align: center;
}

.meta {
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preview-inline {
  margin-top: 10px;
  border-top: 1px dashed #eee;
  padding-top: 10px;
}
img,
video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.error {
  color: #b00020;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  margin-top: 10px;
}

@media (hover: hover) {
  .row:hover {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  }
}

/* ----- Calendar (top-right) ----- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #e8e8ea;
  padding: var(--pad);
  position: sticky;
}
header {
  position: sticky;
} /* ensure header is positioned for absolute child */
.calendar {
  position: absolute;
  right: var(--pad);
  top: var(--pad);
  width: 280px;
  background: #fff;
  border: 1px solid #e8e8ea;
  border-radius: var(--radius);
  padding: 10px;
  font-size: 12px;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 6px;
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-btn {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}
.cal-month {
  font-weight: 600;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dow {
  text-align: center;
  color: #777;
  font-size: 11px;
}
.day {
  text-align: center;
  padding: 6px 0;
  border-radius: 6px;
  user-select: none;
}
.day.existing {
  background: #799EFF;
  color: #fff;
  cursor: pointer;
}
.day.missing {
  background: #f0f0f2;
  color: #aaa;
}
.day.today {
  outline: 2px solid #799EFF;
  outline-offset: 1px;
}
.day.disabled {
  visibility: hidden;
} /* leading/trailing blanks for grid alignment */

@media (max-width: 800px) {
  /* On narrow screens, stack the calendar under the header instead of overlapping */
  .calendar {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
}
.calendar-toggle {
  background: #5EABD6;
  color: #5EABD6;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
}
.calendar.collapsed {
  display: none;
}
