/* Image-A-Day v2 — Design Tokens & Base Styles
   Extracted from v1 SASS (Susy grid, Compass mixins)
   Design: dark theme with green accent (#52AD4B)
   Grid: 12 columns, 4em col + 1em gutter = 59em max width (~944px)
   v1 CSS reference from saved production pages
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  /* Colors */
  --color-base:       #222222;
  --color-splash:     #52AD4B;
  --color-border:     #1a1a1a;
  --color-highlight:  #2e2e2e;
  --color-font:       #CCCCCC;
  --color-link:       #607890;
  --color-error:      #B81212;
  --color-selected-bg: #ff5e99;
  --color-selected-font: white;

  /* Typography */
  --font-serif:       Cambria, Georgia, serif;
  --font-sans:        "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:        "Andale Mono", "Lucida Console", Monaco, Courier, monospace;
  --font-size-base:   1rem;
  --line-height:      1.5;

  /* Grid (Susy: 12 cols, 4em col, 1em gutter) */
  --grid-cols:        12;
  --col-width:        4em;
  --gutter-width:     1em;
  --content-cols:     8;
  --comments-cols:    4;
  --max-width:        75em;
  --content-width:    calc(8 * 4em + 7 * 1em);     /* 39em ≈ 624px */
  --sidebar-width:    calc(4 * 4em + 3 * 1em);     /* 19em ≈ 304px */

  /* Sizing */
  --icon-size:        32px;
  --thumb-size:       64px;
  --border-radius:    0.33em;
  --border-radius-sm: 0.2em;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-font);
  background-color: var(--color-border);
}

a {
  color: var(--color-link);
  text-decoration: none;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
}
a:hover, a:focus, a:active {
  color: #907860;
  text-shadow: 0 0 2px #bcab9a;
}

img { max-width: 100%; height: auto; }

h1, h2, caption {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
h1 {
  font-size: 1.313em;
  line-height: 1.143em;
  margin-bottom: 1.143em;
}
h2, h3, h4, h5, h6 {
  margin-bottom: 1.5em;
}

dt {
  margin-top: 1.5em;
  font-style: italic;
  color: rgba(204,204,204,0.6);
}
dd {
  padding-left: 1.5em;
}

::selection {
  background: #607890;
  color: white;
  text-shadow: none;
}

/* ============================================================
   CONTAINER & LAYOUT
   ============================================================ */

.container {
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
  margin: 0 auto;
  background-color: var(--color-base);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75em var(--gutter-width);
  background-color: var(--color-border);
  position: relative;
  z-index: 100;
  min-height: calc(2 * var(--line-height) * var(--font-size-base));
  background: linear-gradient(to bottom, var(--color-base), var(--color-highlight));
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

#title {
  font-size: 2em;
  line-height: 1.5em;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#title a {
  color: var(--color-link);
}

#main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  min-height: 650px;
  overflow: visible;
  position: relative;
}

#flash {
  width: 100%;
  position: absolute;
  z-index: 90;
}
#flash > div {
  border-radius: var(--border-radius);
  padding: 0.5em var(--gutter-width);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  background-color: var(--color-highlight);
  color: var(--color-font);
  text-align: center;
  margin: 0;
}
#flash .notice { background-color: var(--color-font); color: var(--color-base); }
#flash .error, #flash .warning { background-color: var(--color-error); color: var(--color-base); }
#flash .success { background-color: var(--color-splash); color: var(--color-base); }

#content {
  flex: 1;
  min-width: 0;
  padding: 0 var(--gutter-width);
}
#content.with-comments {
  max-width: none;
  flex: 1 1 0;
}
#content.full {
  max-width: var(--max-width);
}

#wall {
  width: var(--sidebar-width);
  padding: 0 var(--gutter-width);
  padding-top: 1.5em;
}

#wall .notices {
  margin-bottom: 1.5em;
}
#wall .new_comment {
  margin-bottom: 1.5em;
}

#footer {
  margin-left: 1.639%;
  padding-top: 1.5em;
  color: rgba(204,204,204,0.4);
  clear: both;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

#nav ul, #secondary-nav ul {
  list-style: none;
  display: flex;
  gap: 1em;
  margin: 0;
  padding: 0 2em;
}
#nav {
  display: flex;
}
#nav li, #secondary-nav li {
  min-width: var(--col-width);
  text-align: center;
}
#nav li.wide, #secondary-nav li.wide { text-align: left; min-width: calc(2 * var(--col-width)); }
#nav #user, #secondary-nav #user {
  margin-left: auto;
  text-align: right;
  padding-left: 3em;
}
#nav #user .control-link, #secondary-nav #user .control-link {
  margin-left: var(--gutter-width);
}

/* ============================================================
   CONTROL LINKS (buttons)
   ============================================================ */

.control-link, .ad-slideshow-start, .ad-slideshow-stop {
  display: inline-block;
  padding: 0 0.5em;
  background-color: var(--color-border);
  border: 1px solid var(--color-link);
  border-radius: var(--border-radius-sm);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  color: var(--color-link);
  cursor: pointer;
  font-size: 0.75em;
  line-height: 2em;
  position: relative;
  top: -0.1em;
  font-family: var(--font-sans);
}
.control-link:hover, .control-link:focus, .control-link:active,
.ad-slideshow-start:hover, .ad-slideshow-stop:hover {
  background-color: #353535;
  border-color: #907860;
  box-shadow: 0 0 8px #907860;
  color: #907860;
}

.control-link-inactive, .ad-slideshow-running .ad-slideshow-start {
  background-color: var(--color-base);
  border-color: var(--color-border);
  color: rgba(204,204,204,0.4);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  cursor: default;
  font-size: 0.75em;
  line-height: 2em;
  position: relative;
  top: -0.1em;
}

.previous_page, .next_page {
  display: inline-block;
  padding: 0 0.5em;
  background-color: var(--color-border);
  border: 1px solid var(--color-link);
  border-radius: var(--border-radius-sm);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  color: var(--color-link);
  font-size: 0.75em;
  line-height: 2em;
  position: relative;
  top: -0.1em;
}
.previous_page.disabled, .next_page.disabled {
  background-color: var(--color-base);
  border-color: var(--color-border);
  color: rgba(204,204,204,0.4);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  font-size: 0.75em;
  line-height: 2em;
  position: relative;
  top: -0.1em;
}

.control-link[data-method="delete"]:hover {
  background-color: var(--color-error);
  color: var(--color-font);
}

/* ============================================================
   TIME CONTROLS (prev/next navigation)
   ============================================================ */

.time.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 7.692%;
  padding-right: 7.692%;
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}
.time.controls #prev { flex: 0 0 auto; }
.time.controls #next { flex: 0 0 auto; text-align: right; }
.time.controls .date {
  flex: 1;
  text-align: center;
  color: rgba(204,204,204,0.4);
}
.time.controls .date h3 { margin: 0; }

/* ============================================================
   WEEK STRIPS
   ============================================================ */

.week {
  position: relative;
}
.week .label {
  display: block;
  font-size: 1.875rem;
  line-height: 1.6em;
  position: absolute;
  top: -0.8em;
  z-index: -1;
  color: rgba(204,204,204,0.6);
  text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
}

.image-list {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  min-height: calc(3 * var(--line-height) * var(--font-size-base));
  overflow: visible;
  padding: 0;
}
.image-list li { white-space: normal; }

.image.thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  margin-top: 0;
}
.image.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: var(--color-border);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
}

.image.icon img {
  width: var(--icon-size);
  height: var(--icon-size);
}

.image.absent {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border: 1px solid var(--color-highlight);
  border-radius: var(--border-radius-sm);
  background-color: var(--color-border);
  font-weight: bold;
  font-size: 0.875rem;
  line-height: 1.3;
  font-family: var(--font-sans);
}
.image.absent a { display: none; }

.user.current .image-list .image.absent {
  background-color: var(--color-error) !important;
}
.user.current .image-list .image.absent a {
  display: block;
  color: var(--color-font);
  text-align: center;
}

/* ============================================================
   WEEK VIEW PAGE
   ============================================================ */

body.home .user.week { opacity: 0.6; }
body.home .user.week:hover { opacity: 1; }
body.home .weeklist .week { opacity: 1; }

/* ============================================================
   MONTH VIEW
   ============================================================ */

body.home .month .week { margin-top: 0.75em; }
body.home .month .image img { opacity: 0.5; }
body.home .month .image.tmonth img,
body.home .month .image:hover img { opacity: 1; }
body.home .month .image.absent {
  opacity: 0.5;
  transform: scale(0.8);
}
body.home .month .image.absent.tmonth { opacity: 0.75; transform: scale(1); }
.user.current .image.absent.tday {
  opacity: 1;
}
.user.current .image.absent:hover,
.user.current .image.absent:focus {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 8px var(--color-splash);
}

/* ============================================================
   POP-UP (image details on hover)
   ============================================================ */

.pop-up {
  position: absolute;
  margin-left: -20000px;  /* hidden by default */
  z-index: 50;
  min-width: 12em;
  max-width: 23em;
  max-height: 23em;
  padding: calc(var(--line-height) / 2 * var(--font-size-base) - 1px);
  border: 1px solid rgba(46,46,46,0.5);
  border-radius: 1em;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  background-color: var(--color-base);
}
.image.thumb:hover > .pop-up { margin-left: 0; }
.pop-up:hover { margin-left: -30px; }

/* ============================================================
   COMMENTS
   ============================================================ */

.comment {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5em;
  margin-bottom: 0.5em;
}
.comment .info {
  font-size: 0.75em;
  line-height: 2em;
  display: flex;
  gap: 1em;
  align-items: baseline;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(204,204,204,0.6);
}
.comment .info li {
  list-style: none;
  white-space: nowrap;
}
.comment .info li:first-child { padding-left: 0; }
.comment .user { font-weight: bold; color: var(--color-font); }
.comment .date { font-style: italic; }
.comment .delete { margin-left: auto; }
.comment .edit { margin-left: 0.5em; }
.comment p {
  padding-left: var(--gutter-width);
  margin-bottom: 1em;
}
.comment p:last-of-type {
  margin-bottom: 0;
}

.image-row {
  display: flex;
  gap: 1em;
  align-items: flex-start;
  padding: 0.75em 0;
  border-bottom: 1px solid var(--color-border);
}
.image-row .image-thumb {
  flex-shrink: 0;
  width: var(--thumb-size);
  height: var(--thumb-size);
}
.image-row .image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: var(--color-border);
}
.image-row .image-info {
  flex: 1;
  min-width: 0;
}
.image-row .info {
  font-size: 0.75em;
  line-height: 2em;
  display: flex;
  gap: 1em;
  align-items: baseline;
  margin: 0 0 0.25em 0;
  padding: 0;
  list-style: none;
  color: rgba(204,204,204,0.6);
}
.image-row .info li {
  list-style: none;
  white-space: nowrap;
}
.image-row .user { font-weight: bold; color: var(--color-font); }
.image-row .date { font-style: italic; }
.image-row .edit { margin-left: auto; }
.image-row .image-desc {
  margin: 0 0 0.5em 0;
}

.user-profile {
  display: flex;
  gap: 2em;
  margin-bottom: 1.5em;
}
.user-profile-left {
  flex: 1;
}
.user-profile-right {
  flex: 1;
}
.user-profile-left .control-link {
  display: inline-block;
  margin-top: 1em;
}

.new_comment {
  overflow: hidden;
}
.new_comment textarea {
  width: 100%;
  box-sizing: border-box;
  background-color: var(--color-highlight);
  border: 1px solid var(--color-border);
  color: var(--color-font);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 0.25em;
}
.new_comment button {
  float: right;
  margin-top: 0.5em;
}
.new_comment textarea:focus {
  border-color: #988a60;
  outline: none;
}

/* ============================================================
   IMAGE DETAIL PAGE
   ============================================================ */

.images h2, .images h3, .users h2, .users h3,
#content > h1, #content > h2, #content > h3 {
  color: rgba(204,204,204,0.4);
  margin-bottom: 0;
}

.image > div, .image > details {
  width: 100%;
  margin-bottom: 1.5em;
}

.image.thumb > a, .image.icon > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.image details a[data-method="delete"] {
  float: right;
}

/* ============================================================
   GALLERY (Today view)
   ============================================================ */

.ad-gallery {
  width: 100%;
  margin: 0;
}
.ad-gallery .ad-image-wrapper {
  width: 100%;
  height: 27em;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 0 10px var(--color-border);
}
.ad-gallery .ad-image-wrapper .ad-image {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}
.ad-gallery .ad-image-wrapper .ad-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.ad-gallery .ad-image-wrapper .ad-image a img { border: 0; }

.ad-gallery .ad-image-wrapper .ad-next,
.ad-gallery .ad-image-wrapper .ad-prev {
  position: absolute;
  top: 0;
  width: 25%;
  height: 100%;
  cursor: pointer;
  display: block;
  z-index: 10;
}
.ad-gallery .ad-image-wrapper .ad-next { right: 0; }
.ad-gallery .ad-image-wrapper .ad-prev { left: 0; }

.ad-gallery .ad-image-wrapper .ad-next .ad-next-image,
.ad-gallery .ad-image-wrapper .ad-prev .ad-prev-image {
  width: 0;
  height: 0;
  border-style: solid;
  position: absolute;
  top: 47%;
  opacity: 0;
  transition: opacity 0.3s ease 2s;
}
.ad-gallery .ad-image-wrapper .ad-prev .ad-prev-image {
  border-width: 15px 18px 15px 0;
  border-color: transparent rgba(255,255,255,0.5) transparent transparent;
  left: 10px;
}
.ad-gallery .ad-image-wrapper .ad-next .ad-next-image {
  border-width: 15px 0 15px 18px;
  border-color: transparent transparent transparent rgba(255,255,255,0.5);
  right: 10px;
}
.ad-gallery .ad-image-wrapper:hover .ad-next .ad-next-image,
.ad-gallery .ad-image-wrapper:hover .ad-prev .ad-prev-image {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.ad-gallery .ad-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25em 0;
  color: rgba(204,204,204,0.4);
}
.ad-gallery .ad-info { font-size: 0.75rem; }
.ad-gallery .ad-slideshow-countdown {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.ad-gallery .ad-nav {
  position: relative;
  display: flex;
  justify-content: center;
}
.ad-gallery .ad-description-title:after {
  content: ": ";
}
.ad-gallery .ad-back,
.ad-gallery .ad-forward {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  cursor: pointer;
  z-index: 1;
}
.ad-gallery .ad-back {
  left: 4px;
  border-width: 10px 10px 10px 0;
  border-color: transparent rgba(255,255,255,0.3) transparent transparent;
}
.ad-gallery .ad-forward {
  right: 4px;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent rgba(255,255,255,0.3);
}
.ad-gallery .ad-forward:hover,
.ad-gallery .ad-back:hover {
  opacity: 0.9;
}
.ad-gallery .ad-nav .ad-thumbs {
  overflow: hidden;
  height: calc(2 * var(--line-height) * var(--font-size-base));
}
.ad-gallery .ad-thumbs .ad-thumb-list {
  display: flex;
  gap: var(--gutter-width);
  list-style: none;
  padding: 0;
  margin: 9px 0 0 var(--gutter-width);
}
.ad-gallery .ad-thumbs li a img {
  width: var(--icon-size);
  height: var(--icon-size);
  display: block;
  border-radius: var(--border-radius);
  padding: 0;
}
.ad-gallery .ad-thumbs .ad-active img {
  border: 2px solid var(--color-splash) !important;
  box-shadow: 0 0 8px var(--color-splash);
}

.ad-gallery .description {
  width: 100%;
  margin: 1.5em 0 1em;
}
.ad-gallery .comments {
  width: 100%;
  margin-bottom: 1.5em;
}
.ad-gallery .comments .new_comment {
  margin-bottom: 1.5em;
}
.ad-gallery .comments .allcomments {
  margin-top: 1.5em;
}

/* ============================================================
   FORMS
   ============================================================ */

select, input, textarea {
  color: var(--color-font);
  border: 1px solid var(--color-border);
  background-color: var(--color-highlight);
  font-family: var(--font-sans);
}

/* ============================================================
   LOGIN / SIGN UP PAGES
   ============================================================ */

#main.login-layout {
  display: flex;
  gap: 2em;
  align-items: flex-start;
  padding-top: 1.5em;
}

#about {
  flex: 1;
  max-width: calc(7 * var(--col-width) + 6 * var(--gutter-width));
  padding: 1em;
}
#about h2 {
  font-size: 1.313em;
  font-weight: bold;
  margin-bottom: 0.75em;
}
#about p {
  margin-bottom: 1em;
  line-height: 1.5;
}

#login, #signup {
  width: calc(5 * var(--col-width) + 4 * var(--gutter-width));
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  box-shadow: 0 0 10px var(--color-border);
  padding: 1em;
}
#login { margin-left: 0; }

.auth-form .field {
  margin-bottom: 1em;
}
.auth-form label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(204,204,204,0.6);
  margin-bottom: 0.25em;
}
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.5em;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-highlight);
  color: var(--color-font);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-serif);
}
.auth-form input:focus {
  outline: none;
  border-color: #907860;
  box-shadow: 0 0 6px #907860;
}
.auth-form .control-link {
  margin-top: 0.5em;
}
.login-link {
  display: inline-block;
  margin-top: 0.75em;
  font-size: 0.75em;
  font-family: var(--font-sans);
}

/* ============================================================
   UPLOAD FORM
   ============================================================ */

.upload-form {
  max-width: calc(6 * var(--col-width) + 5 * var(--gutter-width));
  margin-top: 1.5em;
}
.upload-form .field {
  margin-bottom: 1em;
}
.upload-form label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(204,204,204,0.6);
  margin-bottom: 0.25em;
}
.upload-form .field.file-field label {
  display: inline;
  margin-right: 0.5em;
}
.upload-form input[type="file"] {
  display: inline;
  font-family: var(--font-sans);
  font-size: 0.85em;
  color: var(--color-font);
}
.upload-form input[type="file"]::file-selector-button {
  padding: 0.25em 0.75em;
  background-color: var(--color-border);
  border: 1px solid var(--color-link);
  border-radius: var(--border-radius-sm);
  color: var(--color-link);
  cursor: pointer;
  font-size: 0.85em;
  font-family: var(--font-sans);
  margin-right: 0.5em;
}
.upload-form input[type="file"]::file-selector-button:hover {
  background-color: #353535;
  border-color: #907860;
  color: #907860;
}
.upload-form textarea {
  width: 100%;
  padding: 0.5em;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-highlight);
  color: var(--color-font);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-serif);
  resize: vertical;
}
.upload-form textarea:focus {
  outline: none;
  border-color: #907860;
  box-shadow: 0 0 6px #907860;
}
.upload-form .field label:first-child {
  font-size: 0.85em;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-font);
}
.upload-form .actions {
  margin-top: 0.5em;
}
.upload-form .actions button {
  display: inline-block;
  padding: 0 0.75em;
  background-color: var(--color-border);
  border: 1px solid var(--color-link);
  border-radius: var(--border-radius-sm);
  box-shadow: 1px 1px 5px rgba(0,0,0,0.6);
  color: var(--color-link);
  cursor: pointer;
  font-size: 0.85em;
  line-height: 2.2em;
  font-family: var(--font-sans);
}
.upload-form .actions button:hover {
  background-color: #353535;
  border-color: #907860;
  box-shadow: 0 0 8px #907860;
  color: #907860;
}
.upload-form .actions button:disabled {
  background-color: var(--color-base);
  border-color: var(--color-border);
  color: rgba(204,204,204,0.4);
  cursor: default;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */

.users table {
  width: 100%;
  border-collapse: collapse;
}
.users th, .users td {
  padding: 0.25em 0.5em;
  text-align: center;
}
.users th.short, .users td.short { width: 4em; }
.users th.long, .users td.long { width: auto; text-align: left; }
.users .create_user {
  border: 1px solid var(--color-border);
  background-color: var(--color-border);
  padding: 0.5em;
}
.admin-inline-input { width: 10em; }

/* ============================================================
   USER PROFILE STATS
   ============================================================ */

.stats dl {
  display: grid;
  grid-template-columns: 23.077% 1fr;
  gap: 0.25em 1em;
  margin-bottom: 1.5em;
}
.stats dt { text-align: right; color: rgba(204,204,204,0.6); margin-top: 0; }
.stats dd { padding: 0; }

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  text-align: center;
  font-family: var(--font-mono);
  margin: 1em 0;
}
.pagination em {
  font-style: normal;
  font-weight: bold;
  color: rgba(204,204,204,0.4);
}

/* ============================================================
   NOTICES
   ============================================================ */

.notices { text-align: center; }
.notices a.control-link {
  font-size: 1em;
  line-height: 3em;
  padding: 0.3em 1em;
}

/* ============================================================
   SIDE TITLE (rotated text on Today view)
   ============================================================ */

#side_title {
  position: absolute;
  top: 0;
  left: -80px;
  width: 80px;
  height: 100%;
  z-index: 1;
  color: var(--color-base);
  font-style: italic;
  pointer-events: none;
}
#side_title h3 {
  transform: rotate(-90deg);
  transform-origin: 300px 300px;
  font-size: 5em;
  line-height: 1em;
  margin: 0;
  width: 600px;
  text-align: right;
  position: relative;
  left: 0.15em;
}

/* ============================================================
   UTILITY
   ============================================================ */

.disabled { opacity: 0.5 !important; }
.caps { letter-spacing: 0.1em; }
.allcaps { letter-spacing: 0.1em; text-transform: uppercase; }
.smallcaps { letter-spacing: 0.1em; font-variant: small-caps; }
.sans { font-family: var(--font-sans); }
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

/* ============================================================
   ERROR PAGES
   ============================================================ */

.error-page {
  text-align: center;
  padding: 4em 1em;
}
.error-page h1 {
  font-size: 3rem;
  margin-bottom: 0.5em;
  color: rgba(204,204,204,0.4);
}
.error-page h1.not-found { color: var(--color-splash); }
.error-page h1.server-error { color: var(--color-error); }
.error-page p {
  font-size: 1.25rem;
  margin-bottom: 0.5em;
}
.error-home { margin-top: 1em; }

.admin-users { border-collapse: separate; border-spacing: 0 0.75em; }
.admin-users td, .admin-users th { padding: 0.25em 1em; text-align: left; }
.admin-users tbody tr { background: var(--color-border); border-radius: var(--border-radius-sm); }
.admin-users tbody tr td:first-child { border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm); }
.admin-users tbody tr td:last-child { border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0; }

.admin-form .field { margin-bottom: 0.5em; }
.admin-form .hint { font-size: 0.75em; color: rgba(204,204,204,0.6); margin-top: 0.5em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 970px) {
  .container { max-width: 100%; }
  #header { flex-wrap: wrap; padding: 0.5em; }
  #title { font-size: 1.5rem; }
  #nav ul { flex-wrap: wrap; gap: 0.25em 0.75em; padding: 0; justify-content: center; }
  #nav li { min-width: auto; }
  #nav #user { margin-left: 0; width: auto; text-align: center; padding-left: 0; }
  #nav #user .control-link { margin-left: 0.5em; }
  #main { flex-direction: column; }
  #content, #content.with-comments { max-width: 100%; }
  #wall { width: 100%; }
  #side_title { display: none; }
  .image-list { flex-wrap: wrap; margin-left: 0; }
  .ad-gallery .ad-nav { margin-left: 0; }
  .ad-gallery .ad-thumbs { overflow-x: auto; }
  .ad-gallery .ad-thumb-list { margin-left: 0; }
  .time.controls { flex-wrap: wrap; gap: 0.5em; justify-content: center; }
  .stats dl { grid-template-columns: 1fr; }
  .stats dt { text-align: left; }
  .users table { display: block; overflow-x: auto; white-space: nowrap; }
  #login, #signup { max-width: 100%; margin-left: 0; }
  #main.login-layout { flex-direction: column; }
  #about { max-width: 100%; }
}

@media (max-width: 480px) {
  body { font-size: 0.875rem; }
  #header { flex-direction: column; align-items: flex-start; gap: 0.5em; }
  #title { font-size: 1.25rem; bottom: 0; }
  #nav ul { flex-direction: column; gap: 0.25em; }
  #nav li { text-align: left; }
  #nav li.wide { text-align: left; min-width: auto; }
  .control-link, .ad-slideshow-start, .ad-slideshow-stop { padding: 0.2em 0.5em; font-size: 0.875rem; }
  .previous_page, .next_page { padding: 0.2em 0.5em; font-size: 0.875rem; }
  .ad-gallery .ad-image-wrapper { height: calc(12 * var(--line-height) * var(--font-size-base)); }
}
