@charset "utf-8";

/* =============================================================================
   skin-j — 2000年代初頭の個人ホームページ風スキン
   見た目はレトロ / コードはデザイントークン・アクセシビリティ対応
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------------- */
:root {
	/* Color — classic early-2000s personal site */
	--color-bg: #ffffff;
	--color-bg-muted: #f4f4f8;
	--color-bg-panel: #ffffff;
	--color-bg-title: #000080;
	--color-bg-nav: #e8e8f0;
	--color-bg-code: #f0f0f0;
	--color-bg-new: #ff0000;
	--color-bg-situation: #ffffcc;
	--color-bg-datebar: #000080;
	--color-bg-badge: #e8e8e8;

	--color-text: #000000;
	--color-text-muted: #444444;
	--color-text-inv: #ffffff;
	--color-text-title: #ffffff;

	--color-link: #0000ee;
	--color-link-visited: #551a8b;
	--color-link-hover: #cc0000;
	--color-link-active: #ff0000;

	--color-border: #999999;
	--color-border-strong: #000000;
	--color-border-panel: #808080;
	--color-accent: #000080;
	--color-accent-soft: #c0c0ff;
	--color-danger: #cc0000;
	--color-ok: #006600;
	--color-focus: #ff6600;

	/* Typography — Japanese personal-site era stacks */
	--font-sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic",
		"Meiryo", "MS PGothic", "MS UI Gothic", sans-serif;
	--font-mono: "MS Gothic", "Osaka-Mono", "Courier New", Consolas, monospace;

	--fs-xs: 0.75rem;
	--fs-sm: 0.8125rem;
	--fs-base: 0.9375rem;
	--fs-md: 1rem;
	--fs-lg: 1.25rem;
	--fs-xl: 1.75rem;

	--lh-tight: 1.35;
	--lh-base: 1.7;
	--lh-loose: 1.85;

	/* Space */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;

	/* Layout */
	--site-max: 1100px;
	--sidebar-w: 220px;
	--radius: 0;
	--border: 1px solid var(--color-border);
	--border-strong: 2px solid var(--color-border-strong);
	--tap-min: 2.75rem;

	/* Motion */
	--motion-fast: 120ms ease;
	--motion-blink: 1s steps(1, end) infinite;
}

html[data-theme="dark"] {
	/* Retro dark: CRT / old BBS night feel — still plain, not neon-modern */
	--color-bg: #0d1117;
	--color-bg-muted: #161b22;
	--color-bg-panel: #12161c;
	--color-bg-title: #1a3a6b;
	--color-bg-nav: #1a2230;
	--color-bg-code: #1e2430;
	--color-bg-situation: #3a3010;
	--color-bg-datebar: #1a3a6b;
	--color-bg-badge: #2a3340;

	--color-text: #e6e6e6;
	--color-text-muted: #b0b0b0;
	--color-text-inv: #ffffff;
	--color-text-title: #ffffff;

	--color-link: #6cb6ff;
	--color-link-visited: #c49bff;
	--color-link-hover: #ff8a8a;
	--color-link-active: #ffb4b4;

	--color-border: #4a5568;
	--color-border-strong: #8a9bb0;
	--color-border-panel: #5a6a7a;
	--color-accent: #6cb6ff;
	--color-accent-soft: #243048;
	--color-focus: #ffaa44;
}

html[data-theme="dark"] body {
	background-image:
		linear-gradient(rgba(108, 182, 255, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(108, 182, 255, 0.05) 1px, transparent 1px);
}

html[data-theme="dark"] .site {
	box-shadow: 0 0 0 8px rgba(13, 17, 23, 0.8);
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--motion-fast: 0ms;
		--motion-blink: 0ms;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------------------------------------------------------------------------
   2. Base / reset-ish
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--color-bg);
	background-image:
		linear-gradient(rgba(0, 0, 128, 0.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0, 0, 128, 0.03) 1px, transparent 1px);
	background-size: 12px 12px;
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	line-height: var(--lh-base);
}

img {
	max-width: 100%;
	height: auto;
	border: 0;
	vertical-align: middle;
}

svg {
	max-width: 100%;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

/* ---------------------------------------------------------------------------
   3. Links — classic blue + underline
   --------------------------------------------------------------------------- */
a:link {
	color: var(--color-link);
	text-decoration: underline;
}

a:visited {
	color: var(--color-link-visited);
	text-decoration: underline;
}

a:hover,
a:focus-visible {
	color: var(--color-link-hover);
}

a:active {
	color: var(--color-link-active);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: var(--space-2) var(--space-3);
	background: var(--color-bg-title);
	color: var(--color-text-title);
	text-decoration: none;
}

.skip-link:focus {
	left: var(--space-2);
	top: var(--space-2);
}

/* URL / card / media from tegalog body markup */
.url {
	overflow-wrap: anywhere;
	word-break: break-all;
}

.cardlink {
	display: inline-block;
	width: 100%;
	max-width: 28rem;
	margin: var(--space-2) 0;
	padding: 0;
	font-size: var(--fs-sm);
	text-decoration: none;
	vertical-align: middle;
	color: inherit;
}

.cardlink:link,
.cardlink:visited {
	color: inherit;
	text-decoration: none;
}

.cardlinkbox {
	display: flex;
	border: var(--border);
	background: var(--color-bg-panel);
}

.cardlinkbox:hover {
	border-color: var(--color-accent);
	background: var(--color-bg-muted);
}

.cardlinkimage {
	flex-shrink: 0;
	background: var(--color-bg-muted) center / cover no-repeat;
}

.cardlinktextbox {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	padding: var(--space-2) var(--space-3);
	min-width: 0;
}

.cardlinktitle,
.cardlinkdescription,
.cardlinkurl {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cardlinktitle {
	-webkit-line-clamp: 2;
	line-clamp: 2;
	font-weight: bold;
	color: var(--color-link);
	text-decoration: underline;
}

.cardlinkdescription {
	-webkit-line-clamp: 2;
	line-clamp: 2;
	color: var(--color-text-muted);
	line-height: var(--lh-tight);
}

.cardlinkurl {
	-webkit-line-clamp: 1;
	line-clamp: 1;
	color: var(--color-text-muted);
	font-size: var(--fs-xs);
}

.cardsize-S {
	flex-direction: row;
}

.cardsize-S .cardlinkimage {
	min-width: 5.5rem;
	min-height: 5.5rem;
}

.cardsize-L {
	flex-direction: column;
}

.cardsize-L .cardlinkimage {
	min-height: 7rem;
	width: 100%;
}

.embeddedimage {
	max-width: min(100%, 320px);
	height: auto;
	border: 1px solid var(--color-border);
	margin: var(--space-2) 0;
}

.embeddedvideo {
	max-width: 100%;
	margin: var(--space-2) 0;
}

.fallbackmessage {
	font-size: var(--fs-sm);
	color: var(--color-text-muted);
}

/* Search highlight */
.highlight,
mark.highlight {
	background: #ffff66;
	color: #000;
	padding: 0 0.1em;
}

html[data-theme="dark"] .highlight,
html[data-theme="dark"] mark.highlight {
	background: #8a7000;
	color: #fff;
}

/* Decoration from tegalog markup */
.decorationH,
.decorationO {
	margin: var(--space-2) 0;
}

.readmorebutton {
	display: inline-block;
	margin: var(--space-2) 0;
	padding: var(--space-1) var(--space-3);
	border: 1px solid var(--color-border-strong);
	background: var(--color-bg-muted);
	font-size: var(--fs-sm);
	text-decoration: none;
}

.readmorebutton:link,
.readmorebutton:visited {
	color: var(--color-text);
	text-decoration: none;
}

.readmorebutton:hover {
	background: var(--color-accent-soft);
}

.foldswitch {
	cursor: pointer;
}

.foldedarea {
	margin-top: var(--space-2);
	padding: var(--space-2);
	border-left: 3px solid var(--color-border);
}

/* ---------------------------------------------------------------------------
   4. Site shell — table-layout feel via CSS Grid
   --------------------------------------------------------------------------- */
.site {
	max-width: var(--site-max);
	margin: 0 auto;
	padding: var(--space-3);
	background: var(--color-bg);
	border-left: 1px solid var(--color-border);
	border-right: 1px solid var(--color-border);
	box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.65);
}

.site-header {
	margin-bottom: var(--space-4);
	border: var(--border-strong);
	background: var(--color-bg-panel);
}

.site-header__inner {
	display: grid;
	gap: var(--space-3);
	padding: var(--space-4);
	text-align: center;
}

.site-welcome {
	margin: 0;
}

.welcome-banner {
	display: inline-block;
	padding: var(--space-1) var(--space-3);
	border: 2px double var(--color-danger);
	color: var(--color-danger);
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	font-weight: bold;
	letter-spacing: 0.04em;
}

.site-brand__label {
	margin: 0 0 var(--space-2);
	font-size: var(--fs-sm);
	color: var(--color-text-muted);
}

.site-title {
	margin: 0;
	font-size: var(--fs-xl);
	font-weight: bold;
	line-height: var(--lh-tight);
	letter-spacing: 0.04em;
}

.site-title a:link,
.site-title a:visited {
	color: var(--color-accent);
	text-decoration: none;
}

.site-title a:hover,
.site-title a:focus-visible {
	color: var(--color-link-hover);
	text-decoration: underline;
}

.site-subtitle {
	margin: var(--space-1) 0 0;
	font-size: var(--fs-sm);
	color: var(--color-text-muted);
}

.site-subtitle:empty {
	display: none;
}

.site-desc {
	margin: var(--space-2) auto 0;
	max-width: 36em;
	font-size: var(--fs-sm);
	color: var(--color-text-muted);
}

.site-desc:empty {
	display: none;
}

.site-header__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-3) var(--space-5);
	font-size: var(--fs-sm);
}

.site-updated {
	margin: var(--space-2) 0 0;
	font-size: var(--fs-sm);
}

.site-updated .label {
	color: var(--color-text-muted);
}

.site-nav {
	border-top: 1px solid var(--color-border-strong);
	background: var(--color-bg-nav);
}

.site-nav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list li {
	border-right: 1px solid var(--color-border);
}

.site-nav__list li:last-child {
	border-right: 0;
}

.site-nav__list a {
	display: block;
	padding: var(--space-2) var(--space-3);
	font-size: var(--fs-sm);
	text-decoration: underline;
}

.site-nav__list a:hover {
	background: var(--color-accent-soft);
}

.theme-toggle-wrap {
	display: flex;
	align-items: stretch;
}

.theme-toggle {
	display: block;
	margin: 0;
	padding: var(--space-2) var(--space-3);
	border: 0;
	border-left: 1px solid var(--color-border);
	background: transparent;
	color: var(--color-link);
	font-family: var(--font-sans);
	font-size: var(--fs-sm);
	line-height: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
	background: var(--color-accent-soft);
	color: var(--color-link-hover);
}

.theme-toggle[aria-pressed="true"] {
	color: var(--color-link-visited);
}

/* Layout: 3-column table feel */
.layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
	align-items: start;
}

.main {
	order: 2;
	min-width: 0;
}

.sidebar--left {
	order: 1;
	min-width: 0;
}

.sidebar--right {
	order: 3;
	min-width: 0;
}

#main,
#profile,
#links {
	scroll-margin-top: 4.5rem;
}

.sidebar-fold {
	margin: 0;
	border: 0;
}

.sidebar-fold__summary {
	display: none;
	list-style: none;
	cursor: pointer;
}

.sidebar-fold__summary::-webkit-details-marker {
	display: none;
}

.sidebar-fold__body {
	display: block;
	min-width: 0;
}

@media (min-width: 720px) {
	.layout {
		grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	}

	.sidebar--left {
		order: 1;
	}

	.main {
		order: 2;
	}

	.sidebar--right {
		order: 3;
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
		gap: var(--space-4);
	}
}

@media (min-width: 980px) {
	.layout {
		grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--sidebar-w);
	}

	.sidebar--right {
		grid-column: auto;
		display: block;
	}
}

/* ---------------------------------------------------------------------------
   5. Panels — bordered “table cell” sections
   --------------------------------------------------------------------------- */
.panel {
	margin: 0 0 var(--space-4);
	border: 1px solid var(--color-border-panel);
	background: var(--color-bg-panel);
}

.panel:last-child {
	margin-bottom: 0;
}

.panel__title,
.panel__title-row {
	margin: 0;
	padding: var(--space-1) var(--space-3);
	background: var(--color-bg-title);
	color: var(--color-text-title);
	font-size: var(--fs-sm);
	font-weight: bold;
	line-height: var(--lh-tight);
}

.panel__title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2);
	min-width: 0;
}

.panel__title-row .panel__title {
	padding: 0;
	background: transparent;
	color: inherit;
	min-width: 0;
	overflow-wrap: anywhere;
}

.panel__meta {
	margin: 0;
	font-size: var(--fs-xs);
	font-weight: normal;
	opacity: 0.9;
	white-space: normal;
}

.panel__body {
	padding: var(--space-3);
	font-size: var(--fs-sm);
	overflow-wrap: anywhere;
	word-break: break-word;
	min-width: 0;
	max-width: 100%;
}

.panel__body > :first-child {
	margin-top: 0;
}

.panel__body > :last-child {
	margin-bottom: 0;
}

/* Profile — assumes tegalog user icon image(s) */
.profile {
	text-align: center;
}

.profile__face {
	margin: 0 auto var(--space-2);
}

.profile__face ul,
.profile__face .userlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Personal-site assumption: show the first user icon only */
.profile__face li + li {
	display: none;
}

.profile__face img,
.profile__face .usericon,
.profile__face .oneusericon,
.profile__face .oneusericon img,
.profile img.usericon,
.profile .usericon img {
	display: inline-block;
	width: 96px;
	height: 96px;
	object-fit: cover;
	border: 1px solid var(--color-border-strong);
	background: var(--color-bg-muted);
	vertical-align: middle;
}

.profile__face .oneuserlink {
	display: inline-block;
	line-height: 0;
	text-decoration: none;
}

.profile__content {
	margin: 0;
	font-size: var(--fs-xs);
	line-height: var(--lh-base);
	text-align: left;
	overflow-wrap: anywhere;
}

.profile__content > :first-child {
	margin-top: 0;
}

.profile__content > :last-child {
	margin-bottom: 0;
}

.menu-list,
.link-list {
	margin: 0;
	padding: 0 0 0 1.1em;
}

.menu-list li,
.link-list li {
	margin: 0.35em 0;
}

.banner-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin: var(--space-3) 0 0;
}

.badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 88px;
	height: 31px;
	border: 1px solid #000;
	font-family: var(--font-mono);
	font-size: 0.65rem;
	font-weight: bold;
	line-height: 1;
	text-decoration: none;
	text-align: center;
	box-sizing: border-box;
}

a.badge:link,
a.badge:visited {
	text-decoration: none;
}

.badge--home {
	background: #fff;
	color: #00f;
	box-shadow: inset 0 0 0 1px #00f;
}

.badge--rss {
	background: #f60;
	color: #fff;
}

.link-note,
.browser-note p {
	margin: var(--space-2) 0 0;
	font-size: var(--fs-xs);
	color: var(--color-text-muted);
	line-height: var(--lh-base);
}

.site-info__list {
	margin: 0;
	padding-left: 1.1em;
}

.site-info__list li {
	margin: 0.25em 0;
}

.browser-note__badge {
	display: inline-block;
	margin: 0;
	padding: var(--space-1) var(--space-2);
	border: 1px solid var(--color-border-strong);
	background: var(--color-bg-badge);
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--color-text);
}

.bbs-note {
	font-size: var(--fs-xs);
	line-height: var(--lh-loose);
}

.bbs-note p {
	margin: 0 0 var(--space-1);
}

.bbs-note__sign {
	text-align: right;
	color: var(--color-text-muted);
}

.freespace-edit {
	margin-top: var(--space-2);
	font-size: var(--fs-xs);
}

/* ---------------------------------------------------------------------------
   6. Quick post / search / CGI widgets
   --------------------------------------------------------------------------- */
.postform {
	margin: 0;
	padding: 0;
	background: transparent;
}

.postform p {
	margin: 0 0 var(--space-2);
}

textarea.tegalogpost {
	width: 100%;
	min-height: 5em;
	padding: var(--space-2);
	border: 2px inset var(--color-border);
	background: var(--color-bg);
	font-size: 16px; /* avoid iOS zoom */
	line-height: var(--lh-base);
	resize: vertical;
}

.line-control {
	margin: var(--space-2) 0 0;
}

.postbutton {
	display: inline-block;
	padding: var(--space-1) var(--space-3);
	border: 2px outset #ccc;
	background: #e8e8e8;
	color: #000;
	font-weight: bold;
	font-size: var(--fs-sm);
	text-decoration: none;
	cursor: pointer;
}

.postbutton:hover {
	background: #f5f5f5;
}

.decoBtns {
	display: inline-block;
	margin-top: var(--space-2);
}

.decoBtns input {
	min-width: 2rem;
	min-height: 1.75rem;
	margin: 1px;
	border: 1px solid var(--color-border);
	background: var(--color-bg-muted);
	cursor: pointer;
	vertical-align: middle;
}

.decoBtns input:hover {
	border-color: var(--color-accent);
	background: var(--color-accent-soft);
}

.decoBtnB {
	font-weight: bold;
}
.decoBtnD {
	text-decoration: line-through;
}
.decoBtnE {
	font-weight: bold;
	color: var(--color-link);
}
.decoBtnI {
	font-style: italic;
}

.search-area,
.searchbox,
.calendar-area,
.calendar-place {
	min-width: 0;
	max-width: 100%;
}

/*
  CGI output shape:
  <form class="searchbox">
    <span class="searchinputs">
      <input class="queryinput">
      <span class="submitcover"><input class="submitbutton"></span>
    </span>
    ...
  </form>
*/
.searchbox,
.search-area form {
	display: block;
	margin: 0;
	width: 100%;
	max-width: 100%;
}

.searchbox .searchinputs,
.search-area .searchinputs {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.35rem;
	width: 100%;
	min-width: 0;
}

.searchbox .queryinput,
.search-area .queryinput,
.searchbox input[type="text"],
.searchbox input[type="search"],
.search-area input[type="text"],
.search-area input[type="search"] {
	display: block;
	flex: 1 1 auto;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	box-sizing: border-box;
	padding: 0.35em 0.5em;
	border: 2px inset var(--color-border);
	background: var(--color-bg);
	font-size: 16px;
	line-height: 1.4;
}

.searchbox .submitcover,
.search-area .submitcover,
.date-list .submitcover,
.datelimitbox .submitcover {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	line-height: 1;
}

.searchbox .submitbutton,
.search-area .submitbutton,
.search-area input[type="submit"],
.searchbox input[type="submit"] {
	display: inline-block;
	width: auto;
	min-height: 2rem;
	margin: 0;
	padding: 0.35em 0.7em;
	border: 2px outset #ccc;
	background: #e8e8e8;
	color: #000;
	font-size: var(--fs-sm);
	line-height: 1.3;
	cursor: pointer;
	box-sizing: border-box;
	white-space: nowrap;
}

.searchtarget,
.search-area .searchtarget,
.searchbox .searchtarget {
	display: block;
	margin: 0.35rem 0 0;
	font-size: var(--fs-xs);
	line-height: var(--lh-tight);
}

/* Category / hashtag / date / latest lists from CGI */
.categoryTree,
.category-tree,
.hashtag-list,
.latest-list,
.date-list,
.freespace,
.about-body {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

/* Aboutページモード（mode=about）：フリースペース1を本文に表示し、日記欄は隠す */
body.mode-about .panel--post,
body.mode-about .situation-banner,
body.mode-about .panel--logs {
	display: none;
}

.panel--about .about-body {
	font-size: var(--fs-base);
	line-height: var(--lh-base);
}

.panel--about .about-body > *:first-child {
	margin-top: 0;
}

.panel--about .about-body > *:last-child {
	margin-bottom: 0;
}

.categoryTree ul,
.category-tree ul,
.hashtaglist,
.hashtag-list ul,
.latestlist,
.latest-list ul,
.datelist,
.date-list ul {
	margin: 0;
	padding-left: 1.1em;
	list-style: disc;
}

.categoryTree li,
.category-tree li,
.hashtaglist li,
.hashtag-list li,
.latestlist li,
.latest-list li {
	margin: 0.15em 0;
	line-height: var(--lh-tight);
}

.hashtaglist .num,
.category-tree .catcount,
.categoryTree .catcount {
	color: var(--color-text-muted);
	font-size: var(--fs-xs);
}

.caticon,
.categoryicon {
	max-width: 1.1em;
	max-height: 1.1em;
	vertical-align: middle;
}

.calendar-place {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.calendar,
table.calendar {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 0.65rem;
	text-align: center;
}

.calendar th,
.calendar td,
table.calendar th,
table.calendar td {
	border: 1px solid var(--color-border);
	padding: 0.15em 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.calendar caption,
table.calendar caption {
	caption-side: top;
	padding-bottom: var(--space-1);
	font-weight: bold;
	font-size: var(--fs-xs);
}

.calendar a,
table.calendar a {
	display: block;
	padding: 0.35em 0.1em;
	text-decoration: underline;
	min-height: 1.75rem;
}

.calendar-nav {
	margin: var(--space-2) 0 0;
	text-align: center;
	font-size: var(--fs-xs);
}

.date-list details,
.date-list .dateexpand,
.date-list details.datebox {
	margin: 0.2em 0;
}

.date-list summary {
	cursor: pointer;
	padding: 0.2em 0;
	font-weight: bold;
	list-style: none;
}

.date-list summary::-webkit-details-marker {
	display: none;
}

.date-list summary::before {
	content: "▶ ";
	font-size: 0.75em;
}

.date-list details[open] > summary::before {
	content: "▼ ";
}

.datelimitlist,
.datelist,
.date-list ul {
	margin: 0;
	padding-left: 1.1em;
	list-style: disc;
}

.date-list details ul {
	margin: 0.35em 0 0.5em;
	padding-left: 1.1em;
}

.datelimitlist .datelimitsublist {
	margin: 0.15em 0 0.35em;
	padding-left: 1em;
	list-style: circle;
}

.datelimitlist .year {
	font-weight: bold;
}

/* Date pull-down (DATEBOX:PULL): select + 表示 on one row */
.datelimitbox,
.date-list form,
.date-list .datelimitbox {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	max-width: 100%;
	min-width: 0;
}

.date-list select,
.datelimitbox select,
.date-list .datelimitbox select {
	display: block;
	order: 1;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.35em 0.4em;
	border: 2px inset var(--color-border);
	background: var(--color-bg);
	font-size: 16px;
	line-height: 1.4;
}

.date-list .submitcover,
.datelimitbox .submitcover {
	order: 2;
}

.date-list input[type="submit"],
.datelimitbox input[type="submit"],
.date-list .submitbutton,
.datelimitbox .submitbutton {
	display: inline-block;
	order: 2;
	flex: 0 0 auto;
	width: auto;
	min-height: 2rem;
	margin: 0;
	padding: 0.35em 0.7em;
	border: 2px outset #ccc;
	background: #e8e8e8;
	color: #000;
	font-size: var(--fs-sm);
	line-height: 1.3;
	cursor: pointer;
	white-space: nowrap;
}

.datelimitboxoptions {
	order: 3;
	flex: 1 1 100%;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	font-size: var(--fs-xs);
	line-height: var(--lh-tight);
}

.datelimitboxoptions label {
	display: inline-flex;
	align-items: center;
	gap: 0.25em;
	margin: 0;
}

/* ---------------------------------------------------------------------------
   7. Logs / posts
   --------------------------------------------------------------------------- */
.situation-banner {
	min-width: 0;
	max-width: 100%;
	margin: 0 0 var(--space-3);
}

/* CGI often outputs empty <p class="situation"></p> when not filtered */
.situation-banner:has(> .situation:only-child:empty) {
	display: none;
	margin: 0;
}

.situation,
.situation-banner .situation,
p.situation,
div.situation {
	display: block;
	margin: 0;
	padding: var(--space-2) var(--space-3);
	border: 1px dashed var(--color-border-strong);
	background: var(--color-bg-situation);
	font-size: var(--fs-sm);
	font-weight: bold;
	line-height: var(--lh-base);
	white-space: normal !important;
	overflow-wrap: anywhere;
	word-break: break-word;
	max-width: 100%;
	box-sizing: border-box;
}

.situation:empty {
	display: none;
	margin: 0;
	padding: 0;
	border: 0;
}

.situation span,
.situation a,
.situation-banner span,
.situation-banner a {
	white-space: normal !important;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.dateseparator {
	margin: var(--space-4) 0 var(--space-3);
	padding: var(--space-1) var(--space-3);
	background: var(--color-bg-datebar);
	color: var(--color-text-inv);
	font-size: var(--fs-sm);
	font-weight: bold;
}

.dateseparator::before {
	content: "▼ ";
}

.dateseparator a {
	margin-left: var(--space-3);
	color: #ffff99;
	font-size: var(--fs-xs);
	font-weight: normal;
}

.dateseparator a:hover {
	color: #ffffff;
}

.fixedseparator {
	background: #600060;
}

.onelog {
	margin: 0 0 var(--space-4);
	padding: 0 0 var(--space-3);
	border-bottom: 1px dashed var(--color-border);
}

.onelog:last-child {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

.onelog__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	margin-bottom: var(--space-2);
	padding: var(--space-1) var(--space-2);
	background: var(--color-bg-muted);
	border: 1px solid var(--color-border);
	font-size: var(--fs-xs);
}

.onelog__meta,
.onelog__author {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-1) var(--space-2);
}

.onelog__new:empty {
	display: none;
}

.onelog__new:not(:empty) {
	display: inline-block;
	padding: 0 0.35em;
	background: var(--color-bg-new);
	color: #fff;
	font-weight: bold;
	font-size: 0.7rem;
	line-height: 1.4;
	animation: new-blink var(--motion-blink);
}

@keyframes new-blink {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0.35;
	}
}

.onelog__id {
	font-family: var(--font-mono);
	font-weight: bold;
}

.onelog__rel {
	color: var(--color-text-muted);
}

.onelog__user {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	text-decoration: none;
}

.onelog__user:hover .onelog__name {
	text-decoration: underline;
}

.onelog__icon img,
.onelog__icon .usericon {
	width: 20px;
	height: 20px;
	border: 1px solid var(--color-border);
	object-fit: cover;
}

.onelog__name {
	font-weight: bold;
}

.onelog__userid {
	color: var(--color-text-muted);
}

.onelog__body {
	padding: var(--space-1) var(--space-1) var(--space-2);
	font-size: var(--fs-base);
	line-height: var(--lh-loose);
	overflow-wrap: anywhere;
}

.onelog__body > :first-child {
	margin-top: 0;
}

.onelog__body > :last-child {
	margin-bottom: 0;
}

.onelog__body .taglink {
	margin: 0 0.15em;
}

.onelog__foot {
	margin-top: var(--space-2);
}

.onelog__info {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1) var(--space-3);
	margin: 0;
	font-size: var(--fs-xs);
	color: var(--color-text-muted);
}

.onelog__categories:empty {
	display: none;
}

.onelog__permalink,
.onelog__edit,
.onelog__delete {
	white-space: nowrap;
}

/* Post status accents */
.logstatus-fixed {
	border-left: 4px solid #990099;
	padding-left: var(--space-2);
}

.logstatus-lock {
	border-left: 4px solid #886600;
	padding-left: var(--space-2);
}

.logstatus-rear {
	opacity: 0.85;
}

.logstatus-draft {
	border-left: 4px solid var(--color-border);
	padding-left: var(--space-2);
	background: repeating-linear-gradient(
		-45deg,
		transparent,
		transparent 6px,
		var(--color-bg-muted) 6px,
		var(--color-bg-muted) 12px
	);
}

/* Passkey form */
.passkeyform {
	display: inline-block;
	margin: var(--space-2) 0;
	padding: var(--space-3);
	border: 2px solid var(--color-border-strong);
	background: var(--color-bg-muted);
}

.passkeyerror {
	display: block;
	margin: 0 0 var(--space-2);
	padding: var(--space-1) var(--space-2);
	background: var(--color-danger);
	color: #fff;
	font-weight: bold;
}

.passkeybox {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
}

.passkeyinput {
	min-width: 8rem;
	padding: var(--space-1);
	border: 2px inset var(--color-border);
	background: var(--color-bg);
	font-size: 16px;
}

.passkeysubmit {
	padding: var(--space-1) var(--space-2);
	border: 2px outset #ccc;
	background: #e8e8e8;
	color: #000;
	cursor: pointer;
}

/* Utility links (single post) */
.utilitylinks {
	margin: var(--space-5) 0 var(--space-3);
	padding: var(--space-3);
	border: 1px solid var(--color-border-panel);
	background: var(--color-bg-muted);
	font-size: var(--fs-sm);
}

.utilitylinks ul {
	margin: 0;
	padding-left: 1.2em;
}

.utilitylinks li {
	margin: 0.25em 0;
}

/* Pagination */
.pagenavi {
	margin: var(--space-4) 0 0;
	padding: var(--space-3);
	border-top: 1px dotted var(--color-border);
	text-align: center;
	font-size: var(--fs-sm);
}

.pagelinks,
.pagenums,
.pagehome {
	margin: var(--space-1) 0;
}

.pagelinks:empty,
.pagenums:empty,
.pagehome:empty {
	display: none;
}

.pagenums a.pagenumlink,
.pagenums a {
	display: inline-block;
	margin: 0 0.15em;
	padding: 0.15em 0.45em;
	border: 1px solid var(--color-border);
	text-decoration: underline;
}

.pagenums a.current,
.pagenums .current {
	background: var(--color-bg-title);
	color: var(--color-text-title);
	border-color: var(--color-bg-title);
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   8. Footer
   --------------------------------------------------------------------------- */
.site-footer {
	margin-top: var(--space-5);
	padding: var(--space-4) var(--space-3);
	border-top: var(--border-strong);
	text-align: center;
	font-size: var(--fs-xs);
	color: var(--color-text-muted);
	line-height: var(--lh-loose);
}

.pagetop-link {
	margin: 0 0 var(--space-3);
	font-size: var(--fs-sm);
}

.pagetop-btn {
	position: fixed;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 28;
	padding: 0.35em 0.55em;
	border: 2px outset #c0c0c0;
	background: #e8e8e8;
	color: #000;
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	font-weight: bold;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: 1px 1px 0 #808080;
}

.pagetop-btn:link,
.pagetop-btn:visited {
	color: #000;
	text-decoration: none;
}

.pagetop-btn:hover,
.pagetop-btn:focus-visible {
	background: #f5f5f5;
	color: #000;
}

.pagetop-btn:active {
	border-style: inset;
}

.site-footer__nav {
	margin: 0 0 var(--space-2);
	font-size: var(--fs-sm);
}

.site-footer__home,
.site-footer__copy,
.poweredby {
	margin: var(--space-2) 0 0;
}

.best-view {
	font-family: var(--font-mono);
}

.poweredby {
	margin-top: var(--space-3);
}

.poweredby a {
	font-weight: bold;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
   9. Heatmap (if present) — keep subdued
   --------------------------------------------------------------------------- */
.chmCover,
.calendarheatmap {
	margin: var(--space-4) 0;
	overflow-x: auto;
	font-size: var(--fs-xs);
}

/* ---------------------------------------------------------------------------
   10. Login visibility (tegalog outputs loginYES / loginNO via SYS:ISLOGGEDIN)
   --------------------------------------------------------------------------- */
body.loginNO .Login-Required {
	display: none !important;
}

/* ---------------------------------------------------------------------------
   11. Small screens / mobile usability
   --------------------------------------------------------------------------- */
.mobile-dock {
	display: none;
}

@media (max-width: 719px) {
	.site {
		padding: var(--space-2);
		padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
	}

	.site-header__inner {
		padding: var(--space-3);
	}

	.site-title {
		font-size: 1.35rem;
	}

	/* Diary first on small screens */
	.main {
		order: 1;
	}

	.sidebar--left {
		order: 2;
	}

	.sidebar--right {
		order: 3;
	}

	.site-nav {
		position: sticky;
		top: 0;
		z-index: 20;
		border-bottom: 1px solid var(--color-border);
	}

	.site-nav__list {
		display: flex;
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	.site-nav__list li {
		flex: 0 0 auto;
		border-right: 1px solid var(--color-border);
		border-bottom: 0;
	}

	.site-nav__list a {
		min-height: var(--tap-min);
		padding: 0.85rem 1rem;
		display: flex;
		align-items: center;
		white-space: nowrap;
	}

	.theme-toggle {
		min-height: var(--tap-min);
		padding: 0.85rem 1rem;
	}

	.sidebar-fold {
		border: 1px solid var(--color-border-panel);
		background: var(--color-bg-panel);
	}

	.sidebar-fold + .sidebar-fold,
	.sidebar .sidebar-fold {
		margin-bottom: var(--space-3);
	}

	.sidebar-fold__summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: var(--tap-min);
		padding: 0.75rem 1rem;
		background: var(--color-bg-title);
		color: var(--color-text-title);
		font-size: var(--fs-sm);
		font-weight: bold;
	}

	.sidebar-fold__summary::after {
		content: "＋";
		font-weight: bold;
	}

	.sidebar-fold[open] > .sidebar-fold__summary::after {
		content: "−";
	}

	.sidebar-fold__body {
		padding: var(--space-3);
	}

	.sidebar-fold__body .panel:last-child {
		margin-bottom: 0;
	}

	.menu-list a,
	.link-list a,
	.pagenums a,
	.pagelinks a,
	.calendar-nav a {
		display: inline-block;
		padding: 0.35em 0.15em;
		min-height: 2rem;
		line-height: 2rem;
	}

	.onelog__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.onelog__permalink,
	.onelog__edit,
	.onelog__delete {
		padding: 0.35em 0.5em;
		min-height: var(--tap-min);
		display: inline-flex;
		align-items: center;
	}

	.mobile-dock {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 30;
		margin: 0;
		padding: 0 env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
		border-top: 2px solid var(--color-border-strong);
		background: var(--color-bg-nav);
	}

	.mobile-dock a {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: var(--tap-min);
		padding: 0.65rem 0.25rem;
		border-right: 1px solid var(--color-border);
		font-size: var(--fs-xs);
		font-weight: bold;
		text-decoration: none;
		text-align: center;
	}

	.mobile-dock a:last-child {
		border-right: 0;
	}

	.mobile-dock a:link,
	.mobile-dock a:visited {
		color: var(--color-accent);
		text-decoration: none;
	}

	.mobile-dock a:hover,
	.mobile-dock a:focus-visible {
		background: var(--color-accent-soft);
	}

	.pagetop-btn {
		right: 0.5rem;
		bottom: calc(var(--tap-min) + 0.65rem + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------------------------------------------------------------------------
   12. Print
   --------------------------------------------------------------------------- */
@media print {
	.skip-link,
	.site-nav,
	.panel--post,
	.sidebar,
	.pagenavi,
	.mobile-dock,
	.pagetop-btn {
		display: none !important;
	}

	.layout {
		display: block;
	}

	.site,
	.panel,
	.onelog {
		border-color: #000;
	}

	a:link,
	a:visited {
		color: #000;
	}
}
