/* Gift Registry UI refresh — mobile-first overlay on Bootstrap 2 */

:root {
	--bg: #f3eee4;
	--bg-card: #fffdf8;
	--ink: #1c2421;
	--ink-muted: #5c6561;
	--line: #e3d8c6;
	--teal: #0f6b63;
	--teal-dark: #0b524c;
	--teal-soft: #e5f3f1;
	--gold: #b8842a;
	--danger: #9b3a2e;
	--shadow: 0 1px 2px rgba(28, 36, 33, 0.05), 0 10px 28px rgba(28, 36, 33, 0.06);
	--radius: 14px;
	--pad: 16px;
	--max: 1180px;
	--nav-h: 48px;
	--tap: 44px;
}

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

body {
	background: var(--bg);
	color: var(--ink);
	font-family: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	margin: 0;
}

a {
	color: var(--teal);
}

a:hover,
a:focus {
	color: var(--teal-dark);
}

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

.page-wrap {
	max-width: var(--max);
	margin: 0 auto;
	padding: calc(var(--nav-h) + 8px) var(--pad) 32px;
}

body.auth-page .page-wrap {
	padding-top: 32px;
	max-width: 520px;
}

/* Bootstrap container used by older markup still in some pages */
.container {
	width: auto !important;
	max-width: var(--max);
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: var(--pad) !important;
	padding-right: var(--pad) !important;
}

/* -------------------------------------------------------------------------- */
/* Navbar                                                                      */
/* -------------------------------------------------------------------------- */

.navbar-fixed-top {
	position: fixed !important;
	right: 0;
	left: 0;
	margin: 0 !important;
}

.navbar-fixed-top .navbar-inner,
.navbar-inner {
	background: var(--teal) !important;
	background-image: none !important;
	filter: none !important;
	border: 0 !important;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08) !important;
	min-height: var(--nav-h);
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.navbar .container {
	padding-top: 0 !important;
}

.navbar .brand {
	color: #fff !important;
	text-shadow: none !important;
	font-weight: 700;
	font-size: 17px;
	padding: 12px 10px 12px 0;
	letter-spacing: 0.01em;
}

.navbar .nav > li > a {
	color: rgba(255, 255, 255, 0.92) !important;
	text-shadow: none !important;
	padding: 14px 10px;
	font-weight: 600;
}

.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus,
.navbar .nav > .active > a,
.navbar .nav > .open > a {
	background: rgba(0, 0, 0, 0.12) !important;
	color: #fff !important;
}

.navbar .btn-navbar {
	display: none;
	background: transparent !important;
	background-image: none !important;
	filter: none !important;
	border: 1px solid rgba(255, 255, 255, 0.45) !important;
	box-shadow: none !important;
	float: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 3px;
	width: 36px;
	height: 32px;
	padding: 0;
	margin: 0;
	line-height: 0;
	font-size: 0;
	box-sizing: border-box;
}

.navbar .btn-navbar .icon-bar,
.btn-navbar .icon-bar + .icon-bar {
	background-color: #fff;
	box-shadow: none;
	width: 16px;
	height: 2px;
	margin: 0 !important;
	display: block;
}

.navbar .dropdown-menu {
	border-radius: 10px;
	border-color: var(--line);
	box-shadow: var(--shadow);
}

@media (max-width: 979px) {
	.navbar-fixed-top .navbar-inner,
	.navbar-inner {
		position: relative;
		height: var(--nav-h);
		min-height: var(--nav-h);
		padding: 0 var(--pad) !important;
		overflow: visible;
	}

	.navbar .container {
		position: relative;
		height: var(--nav-h);
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}

	.navbar .brand {
		float: none;
		display: block;
		height: var(--nav-h);
		line-height: var(--nav-h);
		padding: 0 44px 0 0;
		margin: 0;
	}

	.navbar .btn-navbar,
	.navbar .btn.btn-navbar {
		display: flex;
		position: absolute;
		top: 50%;
		right: 0;
		margin: 0 !important;
		padding: 0;
		-webkit-transform: translateY(-50%);
		transform: translateY(-50%);
	}

	.navbar,
	.navbar-fixed-top,
	.navbar-inner,
	.navbar .container {
		overflow: visible !important;
	}

	.navbar .nav-collapse {
		display: none !important;
		height: 0 !important;
		overflow: hidden !important;
		clear: none;
		margin: 0;
		padding: 0;
	}

	.navbar .nav-collapse.in,
	.navbar .nav-collapse.collapse.in {
		display: block !important;
		position: fixed !important;
		top: var(--nav-h) !important;
		left: 0 !important;
		right: 0 !important;
		height: auto !important;
		max-height: calc(100vh - var(--nav-h));
		overflow-x: hidden !important;
		overflow-y: auto !important;
		z-index: 2000 !important;
		padding: 8px !important;
		margin: 0 !important;
		background: var(--teal-dark);
	}

	.nav-collapse .nav {
		margin: 0 !important;
	}

	.navbar .nav-collapse .nav > li > a {
		color: #fff !important;
		border-radius: 8px;
	}

	.navbar .nav-collapse .dropdown-menu a {
		color: #fff;
	}

	/* Always show Admin links in the drawer. Bootstrap 2's
	   touchstart+click dropdown handlers open then immediately close. */
	.navbar .nav-collapse .dropdown > .dropdown-toggle {
		pointer-events: none;
		cursor: default;
		font-size: 0.75rem;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		opacity: 0.75;
		padding-top: 10px;
		padding-bottom: 4px;
	}

	.navbar .nav-collapse .dropdown > .dropdown-toggle .caret {
		display: none;
	}

	.navbar .nav-collapse .dropdown-menu,
	.navbar .nav-collapse .open > .dropdown-menu {
		display: block !important;
		position: static !important;
		float: none !important;
		top: auto !important;
		left: auto !important;
		width: auto !important;
		max-width: none !important;
		margin: 0 0 8px !important;
		padding: 0 0 0 8px !important;
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		border-radius: 0 !important;
	}

	.navbar .nav-collapse .dropdown-menu > li > a {
		display: block;
		color: #fff !important;
		padding: 10px 12px;
		border-radius: 8px;
	}

	.navbar .pull-right {
		float: none;
	}
}

/* -------------------------------------------------------------------------- */
/* Page chrome                                                                 */
/* -------------------------------------------------------------------------- */

.page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin: 0 0 16px;
}

.page-head h1,
.page-head h2 {
	margin: 0;
	font-size: 1.6rem;
	line-height: 1.2;
	font-weight: 700;
}

.page-head .muted,
.list-summary {
	color: var(--ink-muted);
	font-size: 0.95rem;
	margin: 0;
}

.panel,
.well {
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px;
}

.well {
	min-height: 0;
}

.panel + .panel,
.well + .well,
.stack > * + * {
	margin-top: 16px;
}

.section-title {
	margin: 0 0 12px;
	font-size: 1.15rem;
}

.help-disclose {
	background: var(--teal-soft);
	border: 1px solid #c7e4df;
	border-radius: 12px;
	padding: 10px 14px;
	margin: 0 0 16px;
	color: var(--ink);
}

.help-disclose summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--teal-dark);
	list-style: none;
}

.help-disclose summary::-webkit-details-marker {
	display: none;
}

.help-disclose summary::after {
	content: " +";
	font-weight: 700;
}

.help-disclose[open] summary::after {
	content: " –";
}

.help-disclose .help-body {
	margin-top: 8px;
}

.help-disclose ul {
	margin: 0 0 0 1.1em;
}

.alert {
	border-radius: 12px;
	border-color: var(--line);
}

.alert-info {
	background: var(--teal-soft);
	border-color: #c7e4df;
	color: var(--ink);
	text-shadow: none;
}

.alert-error,
.alert-block {
	text-shadow: none;
}

.legend-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	font-size: 0.9rem;
	color: var(--ink-muted);
	margin: 0 0 16px;
}

.legend-row img {
	width: 16px;
	height: 16px;
}

/* -------------------------------------------------------------------------- */
/* Sort + empty                                                                */
/* -------------------------------------------------------------------------- */

.sort-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-weight: 600;
}

.sort-bar select {
	flex: 1;
	min-height: var(--tap);
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	padding: 0 10px;
}

.empty-state {
	text-align: center;
	padding: 28px 12px;
	color: var(--ink-muted);
}

.empty-state a {
	font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Cards (phones / tablets)                                                    */
/* -------------------------------------------------------------------------- */

.item-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.item-card {
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 14px;
}

.item-card-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.item-card-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
}

.item-card-title a,
.item-desc-text a,
.cell-wrap > a {
	text-decoration: none;
}

.item-card-title a:hover,
.item-card-title a:focus,
.item-desc-text a:hover,
.item-desc-text a:focus,
.cell-wrap > a:hover,
.cell-wrap > a:focus {
	text-decoration: underline;
}

.item-desc-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
	flex: 1 1 auto;
}

.item-desc-row .item-card-title,
.item-desc-row .item-desc-text {
	flex: 1 1 auto;
	min-width: 0;
}

.photo-chip {
	flex: 0 0 auto;
	margin-left: auto;
	align-self: flex-start;
}

.item-card-kicker {
	margin: 0 0 4px;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--teal-dark);
	text-transform: none;
}

.item-card-price {
	flex: 0 1 auto;
	font-weight: 700;
	white-space: normal;
	text-align: right;
	max-width: 46%;
	color: var(--ink);
}

.item-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin-top: 8px;
	color: var(--ink-muted);
	font-size: 0.92rem;
}

.item-card-meta .rank {
	color: var(--gold);
}

.rank img,
.rank-col img {
	width: 14px;
	height: 14px;
	max-width: none !important;
	display: inline;
	vertical-align: middle;
}

.item-card-extras {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.note-disclose {
	flex: 1 1 100%;
}

.note-disclose summary {
	list-style: none;
}

.note-disclose summary::-webkit-details-marker,
.note-disclose summary::marker {
	display: none;
	content: "";
}

.item-note,
.item-note em {
	display: block;
	flex: 1 1 100%;
	margin-top: 6px;
	font-size: 0.88em;
	font-style: italic !important;
	font-family: Georgia, "Times New Roman", serif;
	color: var(--ink-muted);
	white-space: normal;
	line-height: 1.35;
}

button.meta-chip {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	cursor: pointer;
}

.popover {
	max-width: calc(100vw - 24px);
}

.item-card-status {
	margin-top: 10px;
}

.item-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.meta-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--teal-dark);
	font-weight: 600;
	font-size: 0.88rem;
	text-decoration: none;
}

.meta-chip:hover {
	background: var(--teal-soft);
	text-decoration: none;
}

.status-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 700;
	background: #ece7dc;
	color: var(--ink);
}

.status-pill.available {
	background: #d8efe4;
	color: #1b5c3d;
}

.status-pill.mine {
	background: #dcecf7;
	color: #1a4d73;
}

.status-pill.taken {
	background: #f3e2c8;
	color: #7a4b10;
}

.status-lines {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.92rem;
}

/* -------------------------------------------------------------------------- */
/* Action buttons                                                              */
/* -------------------------------------------------------------------------- */

.action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: var(--tap);
	padding: 0 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none;
	line-height: 1;
}

.action-btn img {
	width: 16px;
	height: 16px;
}

.action-btn:hover,
.action-btn:focus {
	background: var(--teal-soft);
	color: var(--teal-dark);
	text-decoration: none;
}

.action-btn.primary {
	background: var(--teal);
	border-color: var(--teal);
	color: #fff;
}

.action-btn.primary:hover,
.action-btn.primary:focus {
	background: var(--teal-dark);
	color: #fff;
}

.action-btn.danger:hover,
.action-btn.danger:focus {
	background: #f8e7e4;
	color: var(--danger);
}

.row-actions {
	white-space: nowrap;
	text-align: right;
}

td.row-actions {
	display: table-cell;
}

.row-actions a {
	display: inline-block;
	vertical-align: middle;
	min-width: 28px;
	min-height: 28px;
	padding: 4px;
	border-radius: 8px;
	border: 1px solid transparent;
	text-align: center;
	line-height: 20px;
}

.row-actions img,
.action-btn img,
.item-card-meta img,
.legend-row img {
	width: 16px;
	height: 16px;
	max-width: none;
}

.row-actions a:hover {
	background: var(--teal-soft);
	border-color: #c7e4df;
}

/* -------------------------------------------------------------------------- */
/* Tables (desktop)                                                            */
/* -------------------------------------------------------------------------- */

.item-table-wrap {
	display: none;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.item-table-wrap .table {
	width: 100%;
	max-width: 100%;
	table-layout: auto;
}

.item-table-wrap th,
.item-table-wrap td {
	width: 1%;
	white-space: nowrap;
}

.item-table-wrap .cell-wrap {
	width: 99%;
	white-space: normal;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
}

.item-table-wrap .rank-col {
	width: 1%;
	white-space: nowrap;
}

.item-table-wrap td.row-actions,
.item-table-wrap td:last-child,
.item-table-wrap th:last-child {
	width: 1%;
	white-space: nowrap;
}

.item-table-wrap .meta-chip {
	min-height: 28px;
	padding: 2px 8px;
}

.item-table-wrap .photo-chip {
	min-height: 28px;
}

.item-table-wrap .table,
.panel .table,
.well .table {
	margin-bottom: 0;
	background: transparent;
}

.table th,
.table td {
	border-color: var(--line) !important;
	vertical-align: top;
}

.table thead th {
	background: #f7f1e6;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.table thead th a {
	color: var(--ink);
}

.table-bordered {
	border-color: var(--line);
	border-radius: 10px;
}

.table-striped tbody tr:nth-child(odd) td {
	background: #fbf7ef;
}

.num,
.price-col {
	text-align: right;
	white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                       */
/* -------------------------------------------------------------------------- */

.form-horizontal .control-label {
	font-weight: 600;
}

.form-actions {
	background: transparent;
	border-top: 1px solid var(--line);
}

.btn {
	min-height: 40px;
	padding: 8px 16px;
	border-radius: 10px;
	font-weight: 600;
	background-image: none !important;
	filter: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.btn-primary {
	background: var(--teal) !important;
	border-color: var(--teal-dark) !important;
}

.btn-primary:hover,
.btn-primary:focus {
	background: var(--teal-dark) !important;
}

.form-horizontal input[type="text"],
.form-horizontal input[type="password"],
.form-horizontal input[type="email"],
.form-horizontal select,
.form-horizontal textarea,
input.input-xlarge,
select.input-xlarge,
textarea.input-xlarge {
	border-radius: 10px;
	border-color: var(--line);
	min-height: 40px;
	box-sizing: border-box;
}

.auth-brand {
	margin: 0 0 8px;
	color: var(--teal-dark);
	font-size: 1.8rem;
}

.auth-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.auth-links a {
	flex: 1 1 140px;
	display: block;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px;
	text-align: center;
	font-weight: 600;
	box-shadow: var(--shadow);
}

.version-note {
	margin-top: 20px;
	text-align: right;
	font-size: 0.8rem;
	color: var(--ink-muted);
}

.page-actions {
	margin-top: 16px;
}

.flag-list label {
	display: block;
	margin: 6px 0;
}

/* -------------------------------------------------------------------------- */
/* Home dashboard                                                              */
/* -------------------------------------------------------------------------- */

.dash-grid {
	display: grid;
	gap: 16px;
}

.dash-grid > .panel {
	min-width: 0;
	overflow: hidden;
}

.pagination ul > li > a {
	min-width: 36px;
	min-height: 36px;
	line-height: 22px;
}

.add-link {
	display: inline-flex;
	align-items: center;
	min-height: var(--tap);
	font-weight: 700;
}

/* Compact My Items rows so more of the list fits on one page. */
#myitems .item-card {
	padding: 10px 12px;
}

#myitems .item-card-meta {
	margin-top: 4px;
}

#myitems .item-card-extras {
	margin-top: 4px;
	gap: 6px;
}

#myitems .item-note,
#myitems .item-note em {
	margin-top: 2px;
}

#myitems .item-card-actions {
	margin-top: 8px;
	gap: 6px;
}

#myitems .action-btn {
	min-height: 36px;
	padding: 0 10px;
	font-size: 0.85rem;
}

#myitems .table th,
#myitems .table td {
	padding: 5px 8px;
	vertical-align: middle;
}

#myitems .item-table-wrap .item-card-extras {
	margin-top: 2px;
}

#myitems .item-table-wrap .item-note,
#myitems .item-table-wrap .item-note em {
	margin-top: 0;
}

/* -------------------------------------------------------------------------- */
/* Breakpoints                                                                 */
/* -------------------------------------------------------------------------- */

/* On phones, keep the photo on the description line as a tap-sized icon
   so it does not crowd the price. Tablets still show the Photo label. */
@media (max-width: 520px) {
	.photo-chip {
		min-width: var(--tap);
		min-height: var(--tap);
		padding: 0;
		justify-content: center;
	}

	.photo-chip .chip-label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		border: 0;
	}
}

@media (max-width: 767px) {
	body {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.form-horizontal .control-label {
		float: none;
		width: auto;
		text-align: left;
		padding-top: 0;
	}

	.form-horizontal .controls {
		margin-left: 0;
	}

	.form-horizontal .form-actions {
		padding-left: 0;
		padding-right: 0;
	}

	.form-horizontal input[type="text"],
	.form-horizontal input[type="password"],
	.form-horizontal input[type="email"],
	.form-horizontal select,
	.form-horizontal textarea,
	input.input-xlarge,
	select.input-xlarge,
	textarea.input-xlarge {
		width: 100%;
		max-width: 100%;
		height: auto;
	}

	.form-horizontal textarea,
	textarea.input-xlarge {
		min-height: 96px;
	}

	.row [class*="span"] {
		margin-left: 0;
	}
}

@media (min-width: 768px) {
	.dash-grid.two {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.page-head h1 {
		font-size: 1.9rem;
	}
}

@media (min-width: 900px) {
	.item-cards {
		display: none;
	}

	.sort-bar {
		max-width: 280px;
	}

	.item-table-wrap {
		display: block;
	}

	.page-wrap {
		padding-top: calc(var(--nav-h) + 24px);
	}
}

/* -------------------------------------------------------------------------- */
/* Print                                                                       */
/* -------------------------------------------------------------------------- */

@media print {
	body {
		background: #fff;
		color: #000;
	}

	.navbar,
	.btn-navbar,
	.sort-bar,
	.help-disclose,
	.page-actions,
	.no-print,
	.item-card-actions,
	.row-actions {
		display: none !important;
	}

	.page-wrap {
		padding: 0;
		max-width: none;
	}

	.item-cards {
		display: none !important;
	}

	.item-table-wrap {
		display: block !important;
	}

	.panel,
	.well,
	.item-card {
		box-shadow: none;
		border-color: #ccc;
	}
}
